|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : IMOpenAPIExampleDocument.cpp 00004 * Part of : IMOpenAPIExample 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2005-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 // INCLUDE FILES 00017 #include "IMOpenAPIExampleDocument.h" 00018 #include "IMOpenAPIExampleAppUi.h" 00019 #include "IMOpenAPIExamplemodel.h" 00020 00021 // ================= MEMBER FUNCTIONS ======================= 00022 00023 // ---------------------------------------------------- 00024 // CIMOpenAPIExampleDocument::CIMOpenAPIExampleDocument 00025 // C++ Constructor 00026 // ---------------------------------------------------- 00027 // 00028 CIMOpenAPIExampleDocument::CIMOpenAPIExampleDocument(CEikApplication& aApp) 00029 : CAknDocument(aApp) 00030 { 00031 } 00032 00033 // ---------------------------------------------------- 00034 // CIMOpenAPIExampleDocument::~CIMOpenAPIExampleDocument 00035 // Destructor 00036 // ---------------------------------------------------- 00037 // 00038 CIMOpenAPIExampleDocument::~CIMOpenAPIExampleDocument() 00039 { 00040 if(iModel) 00041 delete iModel; 00042 iModel = NULL; 00043 } 00044 00045 // ---------------------------------------------------- 00046 // CIMOpenAPIExamplemodel& CIMOpenAPIExampleDocument::Model() 00047 // ---------------------------------------------------- 00048 // 00049 CIMOpenAPIExamplemodel& CIMOpenAPIExampleDocument::Model() 00050 { 00051 return *iModel; 00052 } 00053 00054 // ---------------------------------------------------- 00055 // CIMOpenAPIExampleDocument::ConstructL() 00056 // Epoc constructor, can leave 00057 // ---------------------------------------------------- 00058 // 00059 void CIMOpenAPIExampleDocument::ConstructL() 00060 { 00061 iModel = CIMOpenAPIExamplemodel::NewL(this); 00062 } 00063 00064 // ---------------------------------------------------- 00065 // CIMOpenAPIExampleDocument* CIMOpenAPIExampleDocument::NewL 00066 // Two phase constructor 00067 // ---------------------------------------------------- 00068 // 00069 CIMOpenAPIExampleDocument* CIMOpenAPIExampleDocument::NewL( 00070 CEikApplication& aApp) 00071 { 00072 CIMOpenAPIExampleDocument* self = new (ELeave) CIMOpenAPIExampleDocument( aApp ); 00073 CleanupStack::PushL( self ); 00074 self->ConstructL(); 00075 CleanupStack::Pop(); 00076 00077 return self; 00078 } 00079 00080 // ---------------------------------------------------- 00081 // CIMOpenAPIExampleDocument::CreateAppUiL() 00082 // constructs CIMOpenAPIExampleAppUi 00083 // ---------------------------------------------------- 00084 // 00085 CEikAppUi* CIMOpenAPIExampleDocument::CreateAppUiL() 00086 { 00087 return new (ELeave) CIMOpenAPIExampleAppUi; 00088 } 00089 00090 // ---------------------------------------------------- 00091 // CIMOpenAPIExampleDocument::UI() 00092 // return pointer to UI 00093 // ---------------------------------------------------- 00094 // 00095 CIMOpenAPIExampleAppUi* CIMOpenAPIExampleDocument::UI() 00096 { 00097 return iUI; 00098 } 00099 00100 // ---------------------------------------------------- 00101 // CIMOpenAPIExampleDocument::Document() 00102 // return pointer to document for use in model 00103 // ---------------------------------------------------- 00104 // 00105 CIMOpenAPIExampleDocument& CIMOpenAPIExampleDocument::Document() 00106 { 00107 return *this; 00108 } 00109 00110 // ---------------------------------------------------- 00111 // CIMOpenAPIExampleDocument::SetPointerToUI() 00112 // sets the pointer to app ui, called by appui 00113 // ---------------------------------------------------- 00114 // 00115 void CIMOpenAPIExampleDocument::SetPointerToUI(CIMOpenAPIExampleAppUi* aUIPointer) 00116 { 00117 iUI = aUIPointer; 00118 } 00119 00120 // End of File 00121
|
© Nokia 2006 |