|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Phonebook application UI class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPbkAppUi_H__ |
|
21 #define __CPbkAppUi_H__ |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <CPbkAppUiBase.h> |
|
26 #include <coemain.h> |
|
27 #include "RPbkViewResourceFile.h" |
|
28 #include <MPbkAppUiExtension.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CAknNavigationControlContainer; |
|
33 class CPbkDocument; |
|
34 class CPbkApplication; |
|
35 class CPbkCompressUiImpl; |
|
36 class CEikImage; |
|
37 class MPbkCommandHandler; |
|
38 class CPbkFFSCheck; |
|
39 class CPbkAppGlobals; |
|
40 class CBCardEngine; |
|
41 class CPbkViewNavigator; |
|
42 class MPbkAppUiExtension; |
|
43 class MPbkCommand; |
|
44 |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 /** |
|
49 * Phonebook application UI class. |
|
50 * An object of this class is created by the Symbian OS |
|
51 * framework by a call to CPbkDocument::CreateAppUiL(). |
|
52 * The application UI object creates and owns the application's |
|
53 * views and handles system commands selected from the menu. |
|
54 */ |
|
55 class CPbkAppUi : |
|
56 public CPbkAppUiBase, |
|
57 public MCoeForegroundObserver |
|
58 { |
|
59 public: // Constants and types |
|
60 static const TUid KPbkNamesListViewUid; |
|
61 static const TUid KPbkGroupsListViewUid; |
|
62 static const TUid KPbkGroupMembersListViewUid; |
|
63 static const TUid KPbkContactInfoViewUid; |
|
64 static const TUid KPbkBusinessCardViewUid; |
|
65 static const TUid KPbkPhotoViewUid; |
|
66 static const TUid KPbkPersonalInfoViewUid; |
|
67 |
|
68 public: // Constructors and destructor |
|
69 /** |
|
70 * Constructor. |
|
71 */ |
|
72 CPbkAppUi(); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 */ |
|
77 ~CPbkAppUi(); |
|
78 |
|
79 public: // New functions |
|
80 /** |
|
81 * Returns the Phonebook document object. |
|
82 */ |
|
83 CPbkDocument* PbkDocument() const; |
|
84 |
|
85 /** |
|
86 * Returns the Phonebook application object. |
|
87 */ |
|
88 CPbkApplication* PbkApplication() const; |
|
89 |
|
90 /** |
|
91 * Gets reference to this app's default navi pane control. |
|
92 */ |
|
93 CAknNavigationControlContainer* NaviPane(); |
|
94 |
|
95 /** |
|
96 * Call to exit Phonebook in correct way. |
|
97 */ |
|
98 void ExitL(); |
|
99 |
|
100 /** |
|
101 * Call to force exit in Phonebook. |
|
102 */ |
|
103 void Exit(); |
|
104 |
|
105 /** |
|
106 * Returns ETrue if this application is running on foreground, EFalse otherwise. |
|
107 * Running on foreground means that the user has not pressed exit. |
|
108 */ |
|
109 TBool IsRunningForeground() const; |
|
110 |
|
111 /** |
|
112 * Sends application to the background |
|
113 */ |
|
114 void SendAppToBackgroundL(); |
|
115 |
|
116 public: // from CPbkAppUiBase |
|
117 void ActivatePhonebookViewL |
|
118 (TUid aViewId, const CPbkViewState* aViewState=NULL); |
|
119 void ActivatePreviousViewL(const CPbkViewState* aViewState = NULL); |
|
120 CViewActivationTransaction* HandleViewActivationLC |
|
121 (const TUid& aViewId, const TVwsViewId& aPrevViewId, |
|
122 const TDesC* aTitlePaneText, |
|
123 const CEikImage* aContextPanePicture, |
|
124 TUint aFlags=EUpdateAll); |
|
125 CPbkAppGlobalsBase* AppGlobalsL(); |
|
126 void FFSClCheckL(const MPbkCommandHandler& aCommandHandler, |
|
127 TInt aBytesToWrite = 0); |
|
128 |
|
129 private: // from CAknViewAppUi |
|
130 void HandleCommandL(TInt aCommand); |
|
131 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
132 void ConstructL(); |
|
133 TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
134 void HandleForegroundEventL(TBool aForeground); |
|
135 void HandleResourceChangeL(TInt aType); |
|
136 void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination); |
|
137 |
|
138 private: // from MPbkKeyEventHandler |
|
139 TBool PbkProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
140 |
|
141 private: // from MCoeForegroundObserver |
|
142 void HandleGainingForeground(); |
|
143 void HandleLosingForeground(); |
|
144 |
|
145 private: // Command handlers (use "Cmd" prefix) |
|
146 void CmdExitL(); |
|
147 |
|
148 private: // Implementation |
|
149 void CreateEngineL(); |
|
150 void ReadViewGraphL(); |
|
151 void CreateViewsL(); |
|
152 TBool IsPhonebookView(const TVwsViewId& aViewId) const; |
|
153 class CViewActivationTransactionImpl; |
|
154 friend class CViewActivationTransactionImpl; |
|
155 |
|
156 private: // data |
|
157 /// Ref: this app's default navi pane |
|
158 CAknNavigationControlContainer* iNaviPane; |
|
159 /// Own: Phonebook view dll resource file |
|
160 RPbkViewResourceFile iViewResourceFile; |
|
161 /// Own: View navigation graph |
|
162 CDigViewGraph* iViewGraph; |
|
163 /// Own: view navigator |
|
164 CPbkViewNavigator* iViewNavigator; |
|
165 /// Own: Phonebook compress UI |
|
166 CPbkCompressUiImpl* iCompressUi; |
|
167 /// Own: FFS space checker |
|
168 CPbkFFSCheck* iFFSCheck; |
|
169 /// Own: this is the only instance of this class |
|
170 CPbkAppGlobals* iAppGlobals; |
|
171 /// Own: appui extension |
|
172 MPbkAppUiExtension* iAppUiExtension; |
|
173 /// Own: Application running on foreground indicator |
|
174 TBool iIsRunningForeground; |
|
175 /// Own: End key exit flag |
|
176 TBool iEndKeyExit; |
|
177 |
|
178 }; |
|
179 |
|
180 |
|
181 #endif // __CPbkAppUi_H__ |
|
182 |
|
183 |
|
184 // End of File |