|
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 the License "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: Application Ui declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef PUSHVIEWERMSGEDAPPUI_H |
|
21 #define PUSHVIEWERMSGEDAPPUI_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include <MsgEditorAppUi.h> |
|
26 #include <bldvariant.hrh> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 class CMsgEditorView; |
|
31 class CPushMsgEntryBase; |
|
32 class CPushViewerDocument; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Push Viewer application's UI that creates a MsgEditor-based view. |
|
38 * This application uses a message server entry as a "model" or "context". |
|
39 */ |
|
40 class CPushViewerMsgEdAppUi : public CMsgEditorAppUi |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 */ |
|
47 CPushViewerMsgEdAppUi(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CPushViewerMsgEdAppUi(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Return the model of the application that is a push message entry. |
|
58 * @return The base class for all push entries. |
|
59 */ |
|
60 CPushMsgEntryBase& Model() const; |
|
61 |
|
62 private: // Constructors |
|
63 |
|
64 /** |
|
65 * Constructor. |
|
66 * @return None. |
|
67 */ |
|
68 void ConstructL(); |
|
69 |
|
70 private: // New functions |
|
71 |
|
72 /** |
|
73 * Return the document of the application. |
|
74 * @return The doc. |
|
75 */ |
|
76 CPushViewerDocument& PushDoc() const; |
|
77 |
|
78 /** |
|
79 * Call CMsgEditorAppUi::UpdateNaviPaneL() with the right images. |
|
80 * @return None. |
|
81 */ |
|
82 void UpdateNaviPaneL(); |
|
83 |
|
84 /** |
|
85 * Construct the view and make it visible. |
|
86 * @return None. |
|
87 */ |
|
88 void ConstructViewL(); |
|
89 |
|
90 /** |
|
91 * Chect the expiration state of the context. It is SI specific. |
|
92 * In case of other push messages it returns EFalse. |
|
93 * @return ETrue or EFalse. |
|
94 */ |
|
95 TBool IsExpired(); |
|
96 |
|
97 /** |
|
98 * Show information note and terminate the application. |
|
99 */ |
|
100 void NotifyAndExitL( TInt aResId ); |
|
101 |
|
102 /** |
|
103 * Construct the two body text: one holds the message, |
|
104 * the other holds the href. The order depends on the |
|
105 * length of the message text. |
|
106 * @param aBodyControl1 The first body control. |
|
107 * @param aBodyControl2 The second body control. |
|
108 * @return Index of the Href control or KErrNotFound if no href in the msg. |
|
109 */ |
|
110 TInt ConstructBodyTextL( CMsgBodyControl& aBodyControl1, |
|
111 CMsgBodyControl& aBodyControl2 ) const; |
|
112 |
|
113 private: // Functions from base classes |
|
114 |
|
115 /** |
|
116 * Terminate the application with this method. |
|
117 * @return None. |
|
118 */ |
|
119 void DoMsgSaveExitL(); |
|
120 |
|
121 /** |
|
122 * Construct the context, update the navi pane and construct the view. |
|
123 * @return None. |
|
124 */ |
|
125 void LaunchViewL(); |
|
126 |
|
127 /** |
|
128 * This method is called when the context is changed. |
|
129 * @return None. |
|
130 */ |
|
131 void HandleEntryChangeL(); |
|
132 |
|
133 /** |
|
134 * This method is called when the context is deleted. |
|
135 * @return None. |
|
136 */ |
|
137 void HandleEntryDeletedL(); |
|
138 |
|
139 /** |
|
140 * We handle the Left/Right arrow here. Other event keys are |
|
141 * handled by the view. |
|
142 * @return EKeyWasConsumed. |
|
143 */ |
|
144 TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
145 |
|
146 /** |
|
147 * Dynamically initialize the menu takin into consideration |
|
148 * the current context. |
|
149 * @return None. |
|
150 */ |
|
151 void DynInitMenuPaneL( TInt aMenuId, CEikMenuPane* aMenuPane ); |
|
152 |
|
153 /** |
|
154 * It's just an empty implementation. |
|
155 * @return None. |
|
156 */ |
|
157 void GetHelpContextForControl( TCoeHelpContext& aContext ) const; |
|
158 |
|
159 #ifdef __SERIES60_HELP |
|
160 /** |
|
161 * Get help context from the appui. |
|
162 * @return Context. |
|
163 */ |
|
164 CArrayFix<TCoeHelpContext>* HelpContextL() const; |
|
165 #endif // __SERIES60_HELP |
|
166 |
|
167 /** |
|
168 * Handle commands. |
|
169 * @return None. |
|
170 */ |
|
171 void HandleCommandL( TInt aCommand ); |
|
172 |
|
173 private: // Data members |
|
174 |
|
175 CPushMsgEntryBase* iContext; ///< Message wrapper. Owned. |
|
176 CMsgEditorView* iView; ///< MsgEditor style view. Owned. |
|
177 }; |
|
178 |
|
179 #endif // PUSHVIEWERMSGEDAPPUI_H |
|
180 |
|
181 // End of File |