00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __DIRECT_H
00018 #define __DIRECT_H
00019
00020 #include <coecntrl.h>
00021 #include <coeccntx.h>
00022 #include <coemain.h>
00023
00024 #include <eikappui.h>
00025 #include <eikapp.h>
00026 #include <eikdoc.h>
00027 #include <uikon.hrh>
00028
00029 #include <direct.rsg>
00030 #include "Direct.hrh"
00031
00032 const TUid KUidExample = { 0xE8000054 };
00033
00034 class CDirectDisplayLife;
00035 class CLifeEngine;
00036
00037
00038 class CExampleAppView : public CCoeControl
00039 {
00040 public:
00041
00042 enum {
00043 EDirectNotStarted=0,
00044 EDirectStarted,
00045 EDirectPaused
00046 };
00047
00048 public:
00049
00050 CExampleAppView(CLifeEngine& aLifeEngine);
00051 ~CExampleAppView();
00052 void ConstructL(const TRect& aRect);
00053
00054
00055 void StartDirectL();
00056
00057 void PauseDirect();
00058
00059 void RestartDirect();
00060
00061
00062 TInt State() const;
00063
00064 private:
00065
00066 void Draw(const TRect&) const;
00067
00068 private:
00069
00070 CDirectDisplayLife* iDirectDisplayLife;
00071
00072 CLifeEngine& iLifeEngine;
00073
00074 TInt iState;
00075 };
00076
00077
00078 class CExampleAppUi : public CEikAppUi
00079 {
00080 public:
00081
00082 void ConstructL();
00083 ~CExampleAppUi();
00084
00085 private:
00086
00087 void HandleCommandL(TInt aCommand);
00088
00089 private:
00090 class COverlayDialog: public CActive
00091 {
00092 public:
00093 COverlayDialog();
00094 ~COverlayDialog();
00095 void ShowDialog();
00096
00097 private:
00098 void RunL();
00099 void DoCancel();
00100
00101 private:
00102 RNotifier iNotifier;
00103 TInt iR;
00104 };
00105
00106 private:
00107
00108 CExampleAppView* iAppView;
00109 COverlayDialog* iOverlayDialog;
00110 };
00111
00112
00113 class CExampleDocument : public CEikDocument
00114 {
00115 public:
00116
00117 CExampleDocument(CEikApplication& aApp);
00118 ~CExampleDocument();
00119
00120
00121 CLifeEngine& LifeEngine() const;
00122
00123 private:
00124
00125 CEikAppUi* CreateAppUiL();
00126
00127 private:
00128
00129 CLifeEngine* iLifeEngine;
00130 };
00131
00132
00133 class CExampleApplication : public CEikApplication
00134 {
00135 private:
00136 CApaDocument* CreateDocumentL();
00137 TUid AppDllUid() const;
00138 };
00139
00140 #endif