63
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 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: Phonebook 2 names list application view.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPBK2NAMESLISTEXVIEW_H
|
|
20 |
#define CPBK2NAMESLISTEXVIEW_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <coecobs.h>
|
|
25 |
#include <MPbk2UIExtensionView.h>
|
|
26 |
#include <MPbk2ControlObserver.h>
|
|
27 |
#include <MPbk2StoreConfigurationObserver.h>
|
|
28 |
#include <MPbk2MenuCommandObserver.h>
|
|
29 |
#include <mpbk2uiextensionview2.h>
|
|
30 |
#include <akntoolbarobserver.h>
|
|
31 |
#include <eiklbo.h>
|
|
32 |
#include <coemain.h>
|
|
33 |
|
|
34 |
#include <Pbk2Commands.hrh>
|
|
35 |
#include <aknmarkingmodeobserver.h>
|
|
36 |
|
|
37 |
// FORWARD DECLARATIONS
|
|
38 |
template<class ControlType> class CPbk2ControlContainer;
|
|
39 |
class CPbk2UIExtensionView;
|
|
40 |
class MPbk2ContactUiControl;
|
|
41 |
class CPbk2NamesListControl;
|
|
42 |
class MVPbkContactViewBase;
|
|
43 |
class MPbk2ContactNameFormatter;
|
|
44 |
class MPbk2CommandHandler;
|
|
45 |
class CPbk2ViewState;
|
|
46 |
class MPbk2PointerEventInspector;
|
|
47 |
class CPbk2IconInfoContainer;
|
|
48 |
class CVPbkContactManager;
|
|
49 |
class CPbk2StoreConfiguration;
|
|
50 |
class MCCAParameter;
|
|
51 |
class MCCAConnection;
|
|
52 |
class CPbk2ContactUiControlProxy;
|
|
53 |
class CAknStylusPopUpMenu;
|
|
54 |
class CPbk2MyCard;
|
|
55 |
class CSpbContentProvider;
|
|
56 |
class CPbk2ContextLaunch;
|
|
57 |
|
|
58 |
// CLASS DECLARATION
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Phonebook 2 names list application view.
|
|
62 |
* Responsible for implementing Phonebook application view
|
|
63 |
* interface for names list view.
|
|
64 |
*/
|
|
65 |
class CPbk2NamesListExView : public CBase,
|
|
66 |
public MPbk2UIExtensionView,
|
|
67 |
public MPbk2ControlObserver,
|
|
68 |
public MPbk2StoreConfigurationObserver,
|
|
69 |
public MPbk2MenuCommandObserver,
|
|
70 |
public MAknToolbarObserver,
|
|
71 |
public MCoeControlObserver,
|
|
72 |
public MEikListBoxObserver,
|
|
73 |
private MCoeForegroundObserver,
|
|
74 |
public MPbk2UIExtensionView2,
|
|
75 |
public MAknMarkingModeObserver
|
|
76 |
{
|
|
77 |
public: // Construction and destruction
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Creates a new instance of this class.
|
|
81 |
*
|
|
82 |
* @param
|
|
83 |
* @return A new instance of this class.
|
|
84 |
*/
|
|
85 |
static CPbk2NamesListExView* NewL(
|
|
86 |
CPbk2UIExtensionView& aView,
|
|
87 |
CSpbContentProvider& aStatusProvider,
|
|
88 |
MCCAConnection*& aCCAConnection );
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Destructor.
|
|
92 |
*/
|
|
93 |
~CPbk2NamesListExView();
|
|
94 |
|
|
95 |
private: // From MPbk2UIExtensionView
|
|
96 |
void HandleCommandL(
|
|
97 |
TInt aCommand );
|
|
98 |
TUid Id() const;
|
|
99 |
void HandleStatusPaneSizeChange();
|
|
100 |
void DoActivateL(
|
|
101 |
const TVwsViewId& aPrevViewId,
|
|
102 |
TUid aCustomMessageId,
|
|
103 |
const TDesC8& aCustomMessage );
|
|
104 |
void DoDeactivate();
|
|
105 |
void DynInitMenuPaneL(
|
|
106 |
TInt aResourceId,
|
|
107 |
CEikMenuPane* aMenuPane );
|
|
108 |
void HandleForegroundEventL(
|
|
109 |
TBool aForeground );
|
|
110 |
CPbk2ViewState* ViewStateLC() const;
|
|
111 |
TBool HandleCommandKeyL(
|
|
112 |
const TKeyEvent& aKeyEvent,
|
|
113 |
TEventCode aType );
|
|
114 |
void HandlePointerEventL(
|
|
115 |
const TPointerEvent& aPointerEvent );
|
|
116 |
TInt GetViewSpecificMenuFilteringFlagsL() const;
|
|
117 |
void HandleLongTapEventL(
|
|
118 |
const TPoint& aPenEventLocation,
|
|
119 |
const TPoint& aPenEventScreenLocation);
|
|
120 |
TAny* UIExtensionViewExtension( TUid aExtensionUid );
|
|
121 |
|
|
122 |
protected:
|
|
123 |
// from MEikListBoxObserver
|
|
124 |
void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
private: // From MPbk2ControlObserver
|
|
130 |
void HandleControlEventL(
|
|
131 |
MPbk2ContactUiControl& aControl,
|
|
132 |
const TPbk2ControlEvent& aEvent );
|
|
133 |
|
|
134 |
public: // From MPbk2StoreConfigurationObserver
|
|
135 |
void ConfigurationChanged();
|
|
136 |
void ConfigurationChangedComplete();
|
|
137 |
|
|
138 |
public: // From MPbk2MenuCommandObserver
|
|
139 |
void PreCommandExecutionL(
|
|
140 |
const MPbk2Command& aCommand );
|
|
141 |
void PostCommandExecutionL(
|
|
142 |
const MPbk2Command& aCommand );
|
|
143 |
|
|
144 |
public:
|
|
145 |
TBool IsRclOnL();
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Getter for MyCard instance which can be NULL.
|
|
149 |
* Ownership NOT transferred to callee.
|
|
150 |
*
|
|
151 |
* @return Mycard object
|
|
152 |
*/
|
|
153 |
CPbk2MyCard* MyCard() const;
|
|
154 |
|
|
155 |
private: // From MAknToolbarObserver
|
|
156 |
void DynInitToolbarL(
|
|
157 |
TInt aResourceId,
|
|
158 |
CAknToolbar* aToolbar );
|
|
159 |
void OfferToolbarEventL(
|
|
160 |
TInt aCommand );
|
|
161 |
|
|
162 |
private: // From MCoeControlObserver
|
|
163 |
void HandleControlEventL(
|
|
164 |
CCoeControl* aControl,
|
|
165 |
TCoeEvent aEventType );
|
|
166 |
|
|
167 |
public: // From MAknMarkingModeObserver
|
|
168 |
|
|
169 |
/**
|
|
170 |
* This method is called when marking mode is activated or deactivated.
|
|
171 |
*
|
|
172 |
* @param aActivated @c ETrue if marking mode was activate, @c EFalse
|
|
173 |
* if marking mode was deactivated.
|
|
174 |
*/
|
|
175 |
void MarkingModeStatusChanged( TBool aActivated );
|
|
176 |
|
|
177 |
/**
|
|
178 |
* This method is called just before marking mode is closed. Client can
|
|
179 |
* either accept or decline closing.
|
|
180 |
*
|
|
181 |
* @return @c ETrue if marking mode should be closed, otherwise @c EFalse.
|
|
182 |
*/
|
|
183 |
TBool ExitMarkingMode() const;
|
|
184 |
|
|
185 |
private: // Implementation
|
|
186 |
CPbk2NamesListExView(
|
|
187 |
CPbk2UIExtensionView& aView,
|
|
188 |
CSpbContentProvider& aStatusProvider,
|
|
189 |
MCCAConnection*& aCCAConnection );
|
|
190 |
void ConstructL();
|
|
191 |
void ConstructToolbarL();
|
|
192 |
void CreateControlsL();
|
|
193 |
void StoreStateL();
|
|
194 |
void RestoreStateL();
|
|
195 |
void UpdateCbasL();
|
|
196 |
static TInt IdleSaveToolbarStateL(
|
|
197 |
TAny* aSelf );
|
|
198 |
void AttachAIWProvidersL();
|
|
199 |
void UpdateListEmptyTextL(
|
|
200 |
TInt aListState );
|
|
201 |
void Reset();
|
|
202 |
void ShowToolbarOnViewActivation(TBool aShown);
|
|
203 |
static TInt IdleSetEmptyTextL(
|
|
204 |
TAny* aSelf );
|
|
205 |
void DimItem( CEikMenuPane* aMenuPane, TInt aCmd );
|
|
206 |
void ShowContextMenuL();
|
|
207 |
// void ProcessEmptyAreaClickL();
|
|
208 |
void AddCommandItemsToContainerL();
|
|
209 |
TBool NeedToHideToolbar(TInt aCurrentCommand);
|
|
210 |
TBool IsPhoneMemoryUsedL() const;
|
|
211 |
|
|
212 |
private: // From MCoeForegroundObserver
|
|
213 |
void HandleGainingForeground();
|
|
214 |
void HandleLosingForeground();
|
|
215 |
|
|
216 |
private: // Data
|
|
217 |
CPbk2UIExtensionView& iView;
|
|
218 |
/// This view's control container type
|
|
219 |
typedef CPbk2ControlContainer<CPbk2NamesListControl> CContainer;
|
|
220 |
/// Own: This view's control container
|
|
221 |
CContainer* iContainer;
|
|
222 |
/// Ref: This view's control
|
|
223 |
CPbk2NamesListControl* iControl;
|
|
224 |
/// Ref: Pointer event inspector
|
|
225 |
MPbk2PointerEventInspector* iPointerEventInspector;
|
|
226 |
/// Ref: Virtual Phonebook contact manager
|
|
227 |
CVPbkContactManager* iContactManager;
|
|
228 |
/// Ref: Reference to the name formatter
|
|
229 |
MPbk2ContactNameFormatter* iNameFormatter;
|
|
230 |
/// Ref: Command handler
|
|
231 |
MPbk2CommandHandler* iCommandHandler;
|
|
232 |
/// Own: Stored control state
|
|
233 |
CPbk2ViewState* iControlState;
|
|
234 |
/// Own: Control state passed as parameter
|
|
235 |
CPbk2ViewState* iParamState;
|
|
236 |
/// Ref: Toolbar
|
|
237 |
CAknToolbar* iToolbar;
|
|
238 |
/// Own: Toolbar state indicator
|
|
239 |
TBool iToolbarVisible;
|
|
240 |
/// Own: Toolbar state is saved with the help of an idle object
|
|
241 |
CIdle* iIdleToolbarWarden;
|
|
242 |
/// Own: Stylus popup menu state indicator
|
|
243 |
TBool iStylusPopupMenuLaunched;
|
|
244 |
/// Own: Toolbar icon container
|
|
245 |
CPbk2IconInfoContainer* iToolbarIcons;
|
|
246 |
/// Own: ETrue, if any selection modifier key is depressed
|
|
247 |
TBool iSelectionModifierUsed;
|
|
248 |
/// Ref: Phonebook store configuration
|
|
249 |
CPbk2StoreConfiguration* iStoreConfiguration;
|
|
250 |
/// Own: Idle empty text setter
|
|
251 |
CIdle* iIdleTexter;
|
|
252 |
/// Own: List state
|
|
253 |
TInt iListState;
|
|
254 |
/// Own: Command state, indicates one command is alerady in execution.
|
|
255 |
TBool iCommandState;
|
|
256 |
/// Own: Proxy between commands and contact ui control
|
|
257 |
CPbk2ContactUiControlProxy* iControlProxy;
|
|
258 |
/// Own: contains current command id, if under execution.
|
|
259 |
/// Value is -1 if no command is executing
|
|
260 |
TInt iCurrentCommandId;
|
|
261 |
/// Own: control visible state, indicates if the control is visible before
|
|
262 |
/// hide in background.
|
|
263 |
TBool iCtrlVisibleStateBeforeLosingForground;
|
|
264 |
/// Own: indicates whether the names list view is first time activated
|
|
265 |
TBool iFirstTimeActivated;
|
|
266 |
/// Ref: Popup menu
|
|
267 |
CAknStylusPopUpMenu* iPopupMenu;
|
|
268 |
|
|
269 |
/// Own:
|
|
270 |
CPbk2MyCard* iMyCard;
|
|
271 |
// If the application is brought to the foreground too fast after being set to the
|
|
272 |
// backgroung the find box is not initialized properly by Avkon.
|
|
273 |
// In practise this means tapping the appshell icon for this application BEFORE
|
|
274 |
// the application has completed losing foreground actions. What happens in the
|
|
275 |
// background is that the find box setfocus is called when the phonebook appui is
|
|
276 |
// still in the background.
|
|
277 |
// This flag is used to force the find box focus to be re-initialized when the
|
|
278 |
// application is back in the foreground.
|
|
279 |
TBool iNeedSetFocus;
|
|
280 |
|
|
281 |
// REF: content provider
|
|
282 |
CSpbContentProvider& iContentProvider;
|
|
283 |
// Not own. CCA launcher connection
|
|
284 |
MCCAConnection*& iCCAConnection;
|
|
285 |
// Own: Context launcher
|
|
286 |
CPbk2ContextLaunch* iContextLauncher;
|
|
287 |
// Flag to indicate whether Marking mode is active
|
|
288 |
TBool iMarkingModeOn;
|
|
289 |
};
|
|
290 |
|
|
291 |
#endif // CPBK2NAMESLISTEXVIEW_H
|
|
292 |
|
|
293 |
// End of File
|