03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TInt iCursorX;<br />

TInt iCursorY;<br />

TUid iViewUid; // UID of view<br />

};<br />

The main point is that the class now implements the abstract interface MCoeView. This is<br />

what turns the class from being an ordinary control into being usable by the view<br />

architecture.<br />

Also, note the following:<br />

� The constructor and ConstructL() functions are now protectedrather than<br />

public. This indicates that CFleetView is now a base class rather than a concrete<br />

class. I found that the 'my fleet' and 'opposition fleet' views behaved differently enough<br />

to be their own classes. They still have most functionality in common, though, and this is<br />

provided by CFleetView.<br />

� It has far fewer data members than the original CFleetView, but it has a new data<br />

member iData.<br />

� It has three public functions for generating sound effects.<br />

Implementing MCoeView<br />

MCoeView's documentation in some SDKs omits some functions, and as the class is quite<br />

cryptic, it's worth looking at its entire declaration:<br />

class MCoeView<br />

{<br />

public:<br />

virtual TVwsViewId ViewId() const=0;<br />

private:<br />

virtual void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid<br />

aCustomMessageId,const<br />

TDesC8& aCustomMessage)=0;<br />

virtual void ViewDeactivated()=0;<br />

protected:<br />

IMPORT_C virtual TVwsViewIdAndMessage<br />

ViewScreenDeviceChangedL();<br />

private:<br />

IMPORT_C virtual void ViewConstructL();<br />

protected:<br />

IMPORT_C virtual TBool ViewScreenModeCompatible(TInt<br />

aScreenMode);<br />

private:<br />

friend class CCoeViewManager;<br />

IMPORT_C virtual void MCoeView_Reserved_2();<br />

};

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!