author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:32:31 +0100 | |
branch | RCL_3 |
changeset 66 | bd7edf625bdd |
parent 65 | 12af337248b1 |
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) 2007-2008 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 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Calendar action ui |
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 |
// INCLUDES |
66 | 20 |
#include <aknViewAppUi.h> |
21 |
#include <avkon.hrh> |
|
22 |
#include <aknnavi.h> |
|
23 |
#include <akntitle.h> |
|
24 |
#include <eikspane.h> |
|
25 |
#include <Calendar.rsg> |
|
26 |
#include <calencommonui.rsg> |
|
27 |
#include <calenservices.h> |
|
28 |
#include <calentoolbar.h> |
|
29 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include "calendarui_debug.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
#include "calenactionui.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "calencontroller.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#include "calendeleteui.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
#include "caleneditui.h" |
66 | 35 |
#include "calenlocationui.h" |
36 |
#include "calensettingsui.h" |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
#include "calennotifier.h" |
66 | 38 |
#include "calenmultipledbui.h" |
39 |
#include "calenattachmentui.h" |
|
40 |
#include "CalenUid.h" |
|
27
55d60436f00b
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
41 |
#include "calenviewmanager.h" |
0
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 |
// CCalenActionUi::NewL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// 1st phase of construction |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
CCalenActionUi* CCalenActionUi::NewL( CCalenController& aController ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
{ |
66 | 51 |
TRACE_ENTRY_POINT; |
52 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
CCalenActionUi* self = new( ELeave ) CCalenActionUi( aController ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
CleanupStack::PushL( self ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
self->ConstructL(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
CleanupStack::Pop( self ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
|
66 | 58 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
return self; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
} |
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 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
// CCalenActionUi::CCalenActionUi |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
// C++ default constructor. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
CCalenActionUi::CCalenActionUi( CCalenController& aController ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
: iController( aController ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
{ |
66 | 71 |
TRACE_ENTRY_POINT; |
72 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// CCalenActionUi::ConstructL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
// 2nd phase of construction. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
void CCalenActionUi::ConstructL() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
66 | 83 |
TRACE_ENTRY_POINT; |
84 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
// CCalenActionUi::~CCalenActionUi |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
// Destructor. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
CCalenActionUi::~CCalenActionUi() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
{ |
66 | 95 |
TRACE_ENTRY_POINT; |
96 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
delete iDeleteUi; |
66 | 98 |
delete iEditUi; |
99 |
delete iLocationUi; |
|
100 |
delete iAttachmentUi; |
|
101 |
||
102 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
// CCalenActionUi::GetCommandHandlerL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
// Gets a command handler |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
MCalenCommandHandler* CCalenActionUi::GetCommandHandlerL( TInt aCommand ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
MCalenCommandHandler* handler = NULL; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
|
66 | 114 |
if( aCommand >= ECalenEditCommandBase && |
115 |
aCommand < ECalenDeleteCommandBase ) |
|
116 |
{ |
|
117 |
if(!iEditUi) |
|
118 |
{ |
|
119 |
iEditUi = CCalenEditUi::NewL(iController); |
|
120 |
} |
|
121 |
handler = iEditUi; |
|
122 |
} |
|
123 |
else if( aCommand >= ECalenDeleteCommandBase && |
|
124 |
aCommand < ECalenSettingsCommandBase ) |
|
125 |
{ |
|
126 |
if(!iDeleteUi) |
|
127 |
{ |
|
128 |
iDeleteUi = CCalenDeleteUi::NewL( iController ); |
|
129 |
} |
|
130 |
handler = iDeleteUi; |
|
131 |
} |
|
132 |
else if( aCommand >= ECalenSettingsCommandBase && |
|
133 |
aCommand < ECalenMapCommandBase ) |
|
134 |
{ |
|
135 |
handler = this; |
|
136 |
} |
|
137 |
else if( aCommand >= ECalenMapCommandBase && |
|
138 |
aCommand < ECalenAttachmentCommandBase ) |
|
139 |
{ |
|
140 |
if(!iLocationUi) |
|
141 |
{ |
|
142 |
iLocationUi = CCalenLocationUi::NewL( iController ); |
|
143 |
} |
|
144 |
handler = iLocationUi; |
|
145 |
} |
|
146 |
else if( aCommand >= ECalenAttachmentCommandBase && |
|
147 |
aCommand < ECalenLastCommand ) |
|
148 |
{ |
|
149 |
if(!iAttachmentUi) |
|
150 |
{ |
|
151 |
iAttachmentUi = CCalenAttachmentUi::NewL(iController); |
|
152 |
} |
|
153 |
handler = iAttachmentUi; |
|
154 |
} |
|
155 |
||
156 |
TRACE_EXIT_POINT; |
|
157 |
return handler; |
|
158 |
} |
|
159 |
||
160 |
// ---------------------------------------------------------------------------- |
|
161 |
// CCalenActionUi::HandleCommmandL |
|
162 |
// Handles Calendar commands. Delegates to appropriate action ui. |
|
163 |
// (other items were commented in a header). |
|
164 |
// ---------------------------------------------------------------------------- |
|
165 |
// |
|
166 |
/*TBool CCalenActionUi::HandleActionUiCommandL( TInt aCommand ) |
|
167 |
{ |
|
168 |
TRACE_ENTRY_POINT; |
|
169 |
||
170 |
// Lazy initialisation for action uis. |
|
171 |
TBool handled( EFalse ); |
|
172 |
||
173 |
if( aCommand >= ECalenEditCommandBase && aCommand < ECalenLastCommand ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
if( !iEditUi ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
iEditUi = CCalenEditUi::NewL( iController ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
} |
66 | 179 |
handled = iEditUi->HandleActionUiCommandL( aCommand ); |
180 |
||
181 |
if( !handled ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
{ |
66 | 183 |
if( !iDeleteUi ) |
184 |
{ |
|
185 |
iDeleteUi = CCalenDeleteUi::NewL( iController ); |
|
186 |
} |
|
187 |
handled = iDeleteUi->HandleActionUiCommandL( aCommand ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
} |
66 | 189 |
|
190 |
if( !handled && aCommand == ECalenShowSettings ) |
|
191 |
{ |
|
192 |
handled = ETrue; |
|
193 |
||
194 |
ShowSettingsL(); |
|
195 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
27
diff
changeset
|
196 |
} |
66 | 197 |
|
198 |
TRACE_EXIT_POINT; |
|
199 |
return handled; |
|
200 |
}*/ |
|
201 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
// CCalenActionUi::HandleCommandL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
205 |
// Handles key presses. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
TBool CCalenActionUi::HandleCommandL( const TCalenCommand& aCommand ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
{ |
66 | 211 |
TRACE_ENTRY_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
TBool continueCommand(EFalse); |
66 | 213 |
|
214 |
switch(aCommand.Command()) |
|
215 |
{ |
|
216 |
case ECalenShowSettings: |
|
217 |
{ |
|
218 |
ShowSettingsL(); |
|
219 |
} |
|
220 |
break; |
|
221 |
case ECalenShowCalendars: |
|
222 |
{ |
|
223 |
ShowCalendarsL(); |
|
224 |
} |
|
225 |
break; |
|
226 |
default: |
|
227 |
break; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
} |
66 | 229 |
|
230 |
TRACE_EXIT_POINT; |
|
231 |
return continueCommand; |
|
232 |
} |
|
233 |
||
234 |
// ---------------------------------------------------------------------------- |
|
235 |
// CCalenActionUi::CalenCommandHandlerExtensionL |
|
236 |
// Dummy implementation. |
|
237 |
// (other items were commented in a header). |
|
238 |
// ---------------------------------------------------------------------------- |
|
239 |
// |
|
240 |
TAny* CCalenActionUi::CalenCommandHandlerExtensionL( TUid /*aExtensionUid*/ ) |
|
241 |
{ |
|
242 |
TRACE_ENTRY_POINT; |
|
243 |
TRACE_EXIT_POINT; |
|
244 |
return NULL; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
// ---------------------------------------------------------------------------- |
66 | 248 |
// CCalenActionUi::ShowCalendarsL |
249 |
// Shows the multiple db calendar's dialog |
|
250 |
// (other items were commented in a header). |
|
251 |
// ---------------------------------------------------------------------------- |
|
252 |
// |
|
253 |
void CCalenActionUi::ShowCalendarsL() |
|
254 |
{ |
|
255 |
TRACE_ENTRY_POINT; |
|
256 |
// Create settings own titlepane and navipane, and swap with existing ones |
|
257 |
CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
258 |
||
259 |
// Titlepane |
|
260 |
CAknTitlePane* newtp = new( ELeave ) CAknTitlePane(); |
|
261 |
CleanupStack::PushL( newtp ); |
|
262 |
CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp ); |
|
263 |
CleanupStack::Pop( newtp ); // ownership is passed to statuspane |
|
264 |
TRect oldRect( 0, 0, 0, 0 ); |
|
265 |
if( oldtp ) |
|
266 |
{ |
|
267 |
CleanupStack::PushL( oldtp ); |
|
268 |
oldRect = oldtp->Rect(); |
|
269 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle )); |
|
270 |
newtp->SetContainerWindowL( *ctrl ); |
|
271 |
newtp->ConstructL(); |
|
272 |
newtp->SetRect(oldRect); |
|
273 |
newtp->ActivateL(); |
|
274 |
} |
|
275 |
// NaviPane |
|
276 |
CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer(); |
|
277 |
CleanupStack::PushL( newnp ); |
|
278 |
CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp ); |
|
279 |
CleanupStack::Pop( newnp ); // ownership is passed to statuspane |
|
280 |
if( oldnp ) |
|
281 |
{ |
|
282 |
CleanupStack::PushL( oldnp ); |
|
283 |
oldRect = oldnp->Rect(); |
|
284 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
285 |
newnp->SetContainerWindowL( *ctrl ); |
|
286 |
newnp->ConstructL(); |
|
287 |
newnp->SetRect( oldRect ); |
|
288 |
newnp->PushDefaultL(); |
|
289 |
newnp->ActivateL(); |
|
290 |
} |
|
291 |
||
292 |
// Hide the toolbar before we display settings menu |
|
293 |
MCalenToolbar* toolbar = iController.Services().ToolbarOrNull(); |
|
294 |
if(toolbar) |
|
295 |
{ |
|
296 |
toolbar->SetToolbarVisibilityL(EFalse); |
|
297 |
} |
|
298 |
||
299 |
// defer settings notifications before launching the settings |
|
300 |
CCalenNotifier& notifier = iController.Notifier(); |
|
301 |
notifier.DeferSettingsNotifications(); |
|
302 |
||
303 |
CCalenMultipleDbUi* dlg = CCalenMultipleDbUi::NewL(iController); |
|
304 |
TInt retValue = KErrNone; |
|
305 |
// Trap showing settings so settings watcher is always resumed. |
|
306 |
PIM_TRAPD_HANDLE( retValue = dlg->ExecuteLD( R_CALEN_MULTIPLEDB_DIALOG ) ); |
|
307 |
notifier.ResumeSettingsNotifications(); |
|
308 |
||
309 |
// Unhide the toolbar when manage calendar view is closed |
|
310 |
TUid activeViewUid = iController.ViewManager().CurrentView(); |
|
311 |
if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) ) |
|
312 |
{ |
|
313 |
toolbar->SetToolbarVisibilityL(ETrue); |
|
314 |
} |
|
315 |
||
316 |
// When setting is closed, swap back old titlepane and navipane |
|
317 |
if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) ) |
|
318 |
{ |
|
319 |
CleanupStack::Pop( oldnp ); |
|
320 |
delete newnp; |
|
321 |
oldnp->ActivateL(); |
|
322 |
} |
|
323 |
if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) ) |
|
324 |
{ |
|
325 |
CleanupStack::Pop( oldtp ); |
|
326 |
delete newtp; |
|
327 |
oldtp->ActivateL(); |
|
328 |
} |
|
329 |
||
330 |
iController.BroadcastNotification( ECalenNotifyCalendarFieldChanged ); |
|
331 |
||
332 |
if( retValue == EAknCmdExit || |
|
333 |
retValue == EKeyEscape ) |
|
334 |
{ |
|
335 |
// iController.IssueCommandL( EAknCmdExit ); |
|
336 |
// FIX ME :: |
|
337 |
// Issuing the command from here will not exit the application properly |
|
338 |
// because aknviewappui is not exited |
|
339 |
// Calling ProcessCommandL of aknviewappui will exits the application |
|
340 |
iController.AppUi().ProcessCommandL(EAknCmdExit); |
|
341 |
} |
|
342 |
else if(retValue == EAknSoftkeyExit) |
|
343 |
{ |
|
344 |
// iController.IssueCommandL( EAknCmdExit ); |
|
345 |
// FIX ME :: |
|
346 |
// Issuing the command from here will not exit the application properly |
|
347 |
// because aknviewappui is not exited |
|
348 |
// Calling ProcessCommandL of aknviewappui will exits the application |
|
349 |
iController.AppUi().ProcessCommandL(EAknSoftkeyExit); |
|
350 |
} |
|
351 |
||
352 |
TRACE_EXIT_POINT; |
|
353 |
} |
|
354 |
||
355 |
// ---------------------------------------------------------------------------- |
|
356 |
// CCalenActionUi::ShowSettingsL |
|
357 |
// Shows the settings dialog |
|
358 |
// (other items were commented in a header). |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
359 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
// |
66 | 361 |
void CCalenActionUi::ShowSettingsL() |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
{ |
66 | 363 |
TRACE_ENTRY_POINT; |
364 |
||
365 |
// Create settings own titlepane and navipane, and swap with existing ones |
|
366 |
CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
367 |
||
368 |
// Titlepane |
|
369 |
CAknTitlePane* newtp = new( ELeave ) CAknTitlePane(); |
|
370 |
CleanupStack::PushL( newtp ); |
|
371 |
CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp ); |
|
372 |
CleanupStack::Pop( newtp ); // ownership is passed to statuspane |
|
373 |
TRect oldRect( 0, 0, 0, 0 ); |
|
374 |
if( oldtp ) |
|
375 |
{ |
|
376 |
CleanupStack::PushL( oldtp ); |
|
377 |
oldRect = oldtp->Rect(); |
|
378 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle )); |
|
379 |
newtp->SetContainerWindowL( *ctrl ); |
|
380 |
newtp->ConstructL(); |
|
381 |
newtp->SetRect(oldRect); |
|
382 |
newtp->ActivateL(); |
|
383 |
} |
|
384 |
||
385 |
// NaviPane |
|
386 |
CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer(); |
|
387 |
CleanupStack::PushL( newnp ); |
|
388 |
CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp ); |
|
389 |
CleanupStack::Pop( newnp ); // ownership is passed to statuspane |
|
390 |
if( oldnp ) |
|
391 |
{ |
|
392 |
CleanupStack::PushL( oldnp ); |
|
393 |
oldRect = oldnp->Rect(); |
|
394 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
395 |
newnp->SetContainerWindowL( *ctrl ); |
|
396 |
newnp->ConstructL(); |
|
397 |
newnp->SetRect( oldRect ); |
|
398 |
newnp->PushDefaultL(); |
|
399 |
newnp->ActivateL(); |
|
400 |
} |
|
401 |
||
402 |
// Hide the toolbar before we display settings menu |
|
403 |
MCalenToolbar* toolbar = iController.Services().ToolbarOrNull(); |
|
404 |
if(toolbar) |
|
405 |
{ |
|
406 |
toolbar->SetToolbarVisibilityL(EFalse); |
|
407 |
} |
|
408 |
||
409 |
// defer settings notifications before launching the settings |
|
410 |
CCalenNotifier& notifier = iController.Notifier(); |
|
411 |
notifier.DeferSettingsNotifications(); |
|
412 |
||
413 |
CCalenSettingsUi* dlg = CCalenSettingsUi::NewL(iController.CustomisationManager()); |
|
414 |
TInt retValue = KErrNone; |
|
415 |
// Trap showing settings so settings watcher is always resumed. |
|
416 |
PIM_TRAPD_HANDLE( retValue = dlg->ExecuteLD( R_CALEN_SETTING_DIALOG ) ); |
|
417 |
notifier.ResumeSettingsNotifications(); |
|
418 |
||
419 |
// Unhide the toolbar when settings is closed |
|
420 |
TUid activeViewUid = iController.ViewManager().CurrentView(); |
|
421 |
if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) ) |
|
422 |
{ |
|
423 |
toolbar->SetToolbarVisibilityL(ETrue); |
|
424 |
} |
|
425 |
||
426 |
// When setting is closed, swap back old titlepane and navipane |
|
427 |
if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) ) |
|
428 |
{ |
|
429 |
CleanupStack::Pop( oldnp ); |
|
430 |
delete newnp; |
|
431 |
oldnp->ActivateL(); |
|
432 |
} |
|
433 |
if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) ) |
|
434 |
{ |
|
435 |
CleanupStack::Pop( oldtp ); |
|
436 |
delete newtp; |
|
437 |
oldtp->ActivateL(); |
|
438 |
} |
|
439 |
||
440 |
iController.BroadcastNotification( ECalenNotifySettingsClosed ); |
|
441 |
||
442 |
if( retValue == EAknCmdExit || |
|
443 |
retValue == EKeyEscape ) |
|
444 |
{ |
|
445 |
// iController.IssueCommandL( EAknCmdExit ); |
|
446 |
// FIX ME :: |
|
447 |
// Issuing the command from here will not exit the application properly |
|
448 |
// because aknviewappui is not exited |
|
449 |
// Calling ProcessCommandL of aknviewappui will exits the application |
|
450 |
iController.AppUi().ProcessCommandL(EAknCmdExit); |
|
451 |
} |
|
452 |
else if(retValue == EAknSoftkeyExit) |
|
453 |
{ |
|
454 |
// iController.IssueCommandL( EAknCmdExit ); |
|
455 |
// FIX ME :: |
|
456 |
// Issuing the command from here will not exit the application properly |
|
457 |
// because aknviewappui is not exited |
|
458 |
// Calling ProcessCommandL of aknviewappui will exits the application |
|
459 |
iController.AppUi().ProcessCommandL(EAknSoftkeyExit); |
|
460 |
} |
|
461 |
||
462 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
} |
66 | 464 |
|
465 |
// ----------------------------------------------------------------------------- |
|
466 |
// CCalenActionUi::IsEditorActive |
|
467 |
// Tells framework whether editor is active or not |
|
468 |
// ----------------------------------------------------------------------------- |
|
469 |
// |
|
470 |
TBool CCalenActionUi::IsEditorActive() |
|
471 |
{ |
|
472 |
if(iEditUi) |
|
473 |
{ |
|
474 |
return(iEditUi->IsEditorActive()); |
|
475 |
} |
|
476 |
else |
|
477 |
return EFalse; |
|
478 |
} |
|
479 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
// End of file |