|
|
|
The application class defines the properties of the application, such
as its UID and caption, and creates a new document. To create an application
class, derive from
CQikApplication and overload its two pure virtual
functions:
CQikApplication::AppDllUid()
This function is called by the application architecture as a final check of the identity of the application. Implementations of the function must simply return the application's UID.
CQikApplication::CreateDocumentL()
This function is called by the application architecture to create
the document object associated with this application. Implementations of the
function must return a pointer to the application's CQikDocument
derived class as a pointer to a CApaDocument.
The definition of a minimal application class and the implementation of its functions are given in the example below.
class CExampleApplication : public CQikApplication
{
private:
//CreateDocumentL calls for NewL in CExampleDocument
CApaDocument* CreateDocumentL();
//Returns the UID of the application.
TUid AppDllUid() const;
};
// 1. Gets the application UID
TUid CExampleApplication::AppDllUid() const
{
return KUidApp; // The same UID as is declared in the mmp file.
}
// 2. Gets a new document object.
CApaDocument* CExampleApplication::CreateDocumentL()
{
return new (ELeave) CExampleDocument(*this);
}