author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:17:03 +0300 | |
branch | RCL_3 |
changeset 31 | 97232defd20e |
parent 30 | bd7edf625bdd |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
30 | 14 |
* Description: Controller class for editing related UI behavior |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
30 | 20 |
#ifndef __EDITUI_H__ |
21 |
#define __EDITUI_H__ |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
// INCLUDES |
30 | 24 |
#include <calentry.h> |
25 |
#include <e32base.h> |
|
26 |
#include <AknWaitDialog.h> |
|
27 |
#include <MAgnEntryUi.h> |
|
28 |
#include <calcommon.h> |
|
29 |
#include <cmrmailboxutils.h> // CMRMailboxUtils::TMailboxInfo |
|
30 |
#include <calencommandhandler.h> |
|
31 |
#include <calennotificationhandler.h> // MCalenNotificationHandler |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// FORWARD DECLARATIONS |
30 | 34 |
class CCalenEditorsPlugin; |
35 |
class CCalenView; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
class CCalInstance; |
30 | 37 |
class CCalenGlobalData; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
class CCalenController; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// CLASS DECLARATION |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
* CCalenEditUi encapsulates editing related behavior in Calendar application. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
*/ |
30 | 47 |
NONSHARABLE_CLASS( CCalenEditUi ) : public CBase, |
48 |
public MAgnEntryUiCallback, |
|
49 |
public MCalenNotificationHandler, |
|
50 |
public MCalenCommandHandler, |
|
51 |
public MProgressDialogCallback |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
public: // public API |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
* Symbian 1st phase construction |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
* @param aController Reference of the controller that owns the editui |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
static CCalenEditUi* NewL( CCalenController& aController ); |
30 | 60 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
* Destructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
virtual ~CCalenEditUi(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
30 | 66 |
public: // From MCalenCommandHandler |
67 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
/** |
30 | 69 |
* Handles key presses. |
70 |
* |
|
71 |
* @param aCommand The command Id of the key. |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
TBool HandleCommandL( const TCalenCommand& aCommand ); |
30 | 74 |
|
75 |
/** |
|
76 |
* Allows extending this API without breaking BC. |
|
77 |
* |
|
78 |
* @param aExtensionUid specifies |
|
79 |
* @return extension of the requested type |
|
80 |
*/ |
|
81 |
TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid ); |
|
82 |
||
83 |
protected: // From MProgressDialogCallback |
|
84 |
||
85 |
/** |
|
86 |
* From MProgressDialogCallback |
|
87 |
* Callback method |
|
88 |
* called when a dialog is dismissed |
|
89 |
*/ |
|
90 |
void DialogDismissedL( const TInt aButtonId ); |
|
91 |
||
92 |
public: // New functions |
|
93 |
||
94 |
/** |
|
95 |
* Creates a new entry of type aType and launches the editor |
|
96 |
* @param aType type of new entry |
|
97 |
*/ |
|
98 |
void EditNewEntryL( CCalEntry::TType aEntryType = CCalEntry::EAppt ); |
|
99 |
||
100 |
/** |
|
101 |
* Creates a new meeting request and launches the editor |
|
102 |
*/ |
|
103 |
void EditNewMeetingRequestL(); |
|
104 |
||
105 |
/** |
|
106 |
* Launches editor for aEntry |
|
107 |
* @param aEntry entry to be edited |
|
108 |
* @param aInstancetime Instance time of the entry |
|
109 |
* @param aEditorMode Edit mode, EViewEntry/EEditEntry |
|
110 |
*/ |
|
111 |
void EditEntryL( CCalEntry* aEntry, |
|
112 |
const TTime& aInstanceTime, |
|
113 |
MAgnEntryUi::TAgnEntryUiEditorMode aEditorMode = MAgnEntryUi::EViewEntry ); |
|
114 |
||
115 |
/** |
|
116 |
* Function to tell whether editor is active or not |
|
117 |
* @return ETrue if editor is active else EFalse |
|
118 |
*/ |
|
119 |
TBool IsEditorActive(); |
|
120 |
||
121 |
public: // From MCalenNotificationHandler |
|
122 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
* Handle notifications |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
* @param aNotification Nofication to be handled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
void HandleNotification(const TCalenNotification aNotification ); |
30 | 128 |
|
129 |
protected: // From MAgnEntryUiCallback |
|
130 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
/** |
30 | 132 |
* Pure virtual function from MAgnEntryUiCallback |
133 |
* Not used |
|
134 |
* @param aCommandId Command id to be processed |
|
135 |
*/ |
|
136 |
TInt ProcessCommandWithResultL( TInt aCommandId ); |
|
137 |
||
138 |
/** |
|
139 |
* Handle Command |
|
140 |
* @param aCommandId Command id to be handled |
|
141 |
*/ |
|
142 |
void ProcessCommandL( TInt aCommandId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
private: // own methods |
30 | 145 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
* C++ constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
* @param aController Reference to the controller that owns the caleneditui |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
*/ |
30 | 150 |
CCalenEditUi( CCalenController& aController ); |
151 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
* Symbian 2nd phase constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
void ConstructL(); |
30 | 156 |
|
157 |
/** |
|
158 |
* Attempts to load the editors plugin into iEditorsPlugin. If failure occurs |
|
159 |
* (for example, if the user is prompted to select a default mailbox and hits |
|
160 |
* cancel), iEditorsPlugin is set to NULL. |
|
161 |
*/ |
|
162 |
void LoadEditorsPluginL(); |
|
163 |
||
164 |
/** |
|
165 |
* If aComplete is ETrue, sets the todo as complete. |
|
166 |
* Otherwise sets the todo as incomplete. |
|
167 |
* @param aComplete Complete status to be set |
|
168 |
*/ |
|
169 |
void SetTodoCompleteL( TBool aComplete ); |
|
170 |
||
171 |
/** |
|
172 |
* If aComplete is ETrue, sets the todo as complete. |
|
173 |
* Otherwise sets the todo as incomplete. |
|
174 |
* @param aComplete Complete status to be set |
|
175 |
*/ |
|
176 |
void SetTodoEntryCompleteL( TBool aComplete, TCalLocalUid aEntryUid,TCalCollectionId colId); |
|
177 |
||
178 |
/** |
|
179 |
* If aComplete is ETrue, sets the todo as complete. |
|
180 |
* Otherwise sets the todo as incomplete. |
|
181 |
* @param aComplete Complete status to be set |
|
182 |
*/ |
|
183 |
TBool SetMultipleTodoCompleteL(TBool aComplete); |
|
184 |
||
185 |
/** |
|
186 |
* Sends the current entry. |
|
187 |
*/ |
|
188 |
void SendEntryL(); |
|
189 |
||
190 |
/** |
|
191 |
* Register for view created notification |
|
192 |
* @param aCommand Command that is going to be handled when view is created |
|
193 |
*/ |
|
194 |
void WaitForEntryViewNotificationL( const TCalenCommand& aCommand ); |
|
195 |
||
196 |
/** |
|
197 |
* Leaving function that handles ECalenNotifyViewCreated |
|
198 |
*/ |
|
199 |
void HandleECalenNotifyViewCreatedL(); |
|
200 |
||
201 |
void DisplayWaitDialogL(); |
|
202 |
||
203 |
void MarkedEntriesCompletedL(); |
|
204 |
||
205 |
/** |
|
206 |
* Calculate active time from context |
|
207 |
* |
|
208 |
* @TTime returns the ttime |
|
209 |
*/ |
|
210 |
TTime CalculateActiveTimeFromContextL(); |
|
211 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
private: // data |
30 | 213 |
MAgnEntryUi* iEditorsPlugin; |
214 |
CCalenGlobalData* iGlobalData; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
CCalenController& iController; |
30 | 216 |
CDesCArrayFlat* iListItems; |
217 |
CArrayFix<TInt>* iListItemCommands; |
|
218 |
CAknWaitDialog* iWaitDialog; |
|
219 |
||
220 |
// Stored command if the entry view |
|
221 |
// needs to constructed asyncronously |
|
222 |
TCalenCommand iStoredCommand; |
|
223 |
||
224 |
TInt iMutlipleContextIdsCount; |
|
225 |
TInt iEntriesToComplete; |
|
226 |
TBool iMoreEntriesToComplete; |
|
227 |
TBool isEditorActive; // to inform framework if editor is active |
|
228 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
}; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
|
30 | 231 |
#endif // __EDITUI_H__ |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
// End of File |