00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "Minimal.h"
00018
00019 const TUid KUidMinimal = { 0xE800008B };
00020
00021
00022
00023 TUid CExampleApplication::AppDllUid() const
00024 {
00025 return KUidMinimal;
00026 }
00027
00028
00029
00030 CApaDocument* CExampleApplication::CreateDocumentL()
00031 {
00032 return new (ELeave) CExampleDocument(*this);
00033 }
00034
00035
00036
00037 TFileName CExampleApplication::ResourceFileName() const
00038 {
00039 return TFileName();
00040 }
00041
00042 CExampleDocument::CExampleDocument(CEikApplication& aApp)
00043 : CEikDocument(aApp)
00044 {}
00045
00046
00047
00048
00049 CEikAppUi* CExampleDocument::CreateAppUiL()
00050 {
00051 return new(ELeave) CExampleAppUi;
00052 }
00053
00054
00055
00056 void CExampleAppUi::ConstructL()
00057 {
00058 BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
00059 iAppView = CExampleAppView::NewL(ClientRect());
00060 }
00061
00062
00063
00064 CExampleAppUi::~CExampleAppUi()
00065 {
00066 delete iAppView;
00067 }
00068
00069
00070
00071 void CExampleAppUi::HandleCommandL(TInt aCommand)
00072 {
00073 switch (aCommand)
00074 {
00075
00076 case EEikCmdExit:
00077 Exit();
00078 break;
00079 }
00080 }
00081
00082 CExampleAppView::CExampleAppView()
00083 {
00084 }
00085
00086
00087 CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
00088 {
00089 CExampleAppView* self = new(ELeave) CExampleAppView();
00090 CleanupStack::PushL(self);
00091 self->ConstructL(aRect);
00092 CleanupStack::Pop();
00093 return self;
00094 }
00095
00096 CExampleAppView::~CExampleAppView()
00097 {
00098 }
00099
00100
00101 void CExampleAppView::ConstructL(const TRect& aRect)
00102 {
00103
00104 CreateWindowL();
00105
00106 SetRect(aRect);
00107
00108 ActivateL();
00109 }
00110
00111
00112
00113 void CExampleAppView::Draw(const TRect& ) const
00114 {
00115
00116 CWindowGc& gc = SystemGc();
00117 TRect drawRect = Rect();
00118 const CFont* fontUsed;
00119 gc.Clear();
00120 drawRect.Shrink(10,10);
00121 gc.DrawRect(drawRect);
00122 fontUsed = iEikonEnv->TitleFont();
00123 gc.UseFont(fontUsed);
00124 TInt baselineOffset=(drawRect.Height())/2;
00125 _LIT(KText,"Welcome to the minimal application example");
00126 gc.DrawText(KText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
00127 gc.DiscardFont();
00128 }
00129