|
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 contact info application view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CONTACTINFOAPPVIEW_H |
|
20 #define CPBK2CONTACTINFOAPPVIEW_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CPbk2AppView.h" |
|
24 #include <MPbk2MemoryEntryView.h> |
|
25 #include <MPbk2ControlObserver.h> |
|
26 #include <MPbk2StoreConfigurationObserver.h> |
|
27 #include <MPbk2MenuCommandObserver.h> |
|
28 #include <MPbk2NavigationObserver.h> |
|
29 #include "MPbk2ViewLoaderObserver.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPbk2ContactInfoControl; |
|
33 class CPbk2ViewState; |
|
34 class CPbk2MemoryEntryContactLoader; |
|
35 template<class ControlType> class CPbk2ControlContainer; |
|
36 class MPbk2ContactDetailsControl; |
|
37 class MPbk2CommandHandler; |
|
38 class MPbk2ViewActivationTransaction; |
|
39 class MPbk2ContactNavigation; |
|
40 class MPbk2PointerEventInspector; |
|
41 class CPbk2ViewLoader; |
|
42 class CVPbkContactManager; |
|
43 class MVPbkContactStore; |
|
44 class MVPbkContactLink; |
|
45 class CPbk2StoreConfiguration; |
|
46 |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * Phonebook 2 contact info application view. |
|
51 */ |
|
52 class CPbk2ContactInfoAppView : |
|
53 public CPbk2AppView, |
|
54 public MPbk2MemoryEntryView, |
|
55 public MPbk2ControlObserver, |
|
56 public MPbk2StoreConfigurationObserver, |
|
57 public MPbk2MenuCommandObserver, |
|
58 public MPbk2NavigationObserver, |
|
59 private MPbk2ViewLoaderObserver |
|
60 { |
|
61 public: // Construction and destruction |
|
62 |
|
63 /** |
|
64 * Creates and returns a new instance of this class. |
|
65 * |
|
66 * @param aContactManager Virtual Phonebook contact manager. |
|
67 * @return A new instance of this class. |
|
68 */ |
|
69 static CPbk2ContactInfoAppView* NewL( |
|
70 CVPbkContactManager& aContactManager ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 ~CPbk2ContactInfoAppView(); |
|
76 |
|
77 private: // From CPbk2AppView |
|
78 void HandleCommandL( |
|
79 TInt aCommand ); |
|
80 void DynInitMenuPaneL( |
|
81 TInt aResourceId, |
|
82 CEikMenuPane* aMenuPane ); |
|
83 TUid Id() const; |
|
84 void HandleStatusPaneSizeChange(); |
|
85 void DoActivateL( |
|
86 const TVwsViewId& aPrevViewId, |
|
87 TUid aCustomMessageId, |
|
88 const TDesC8& aCustomMessage ); |
|
89 void DoDeactivate(); |
|
90 void HandleForegroundEventL( |
|
91 TBool aForeground ); |
|
92 CPbk2ViewState* ViewStateLC() const; |
|
93 TBool HandleCommandKeyL( |
|
94 const TKeyEvent& aKeyEvent, |
|
95 TEventCode aType ); |
|
96 TInt GetViewSpecificMenuFilteringFlagsL() const; |
|
97 void HandleLongTapEventL( |
|
98 const TPoint& aPenEventLocation, |
|
99 const TPoint& aPenEventScreenLocation ); |
|
100 |
|
101 private: // From MPbk2MemoryEntryView |
|
102 void PrepareForContactChangeL(); |
|
103 void ContactChangedL( |
|
104 MVPbkStoreContact* aContact ); |
|
105 void ContactChangeFailed(); |
|
106 const MVPbkStoreContact* Contact() const; |
|
107 |
|
108 private: // From MPbk2ControlObserver |
|
109 void HandleControlEventL( |
|
110 MPbk2ContactUiControl& aControl, |
|
111 const TPbk2ControlEvent& aEvent ); |
|
112 |
|
113 private: // From MPbk2StoreConfigurationObserver |
|
114 void ConfigurationChanged(); |
|
115 void ConfigurationChangedComplete(); |
|
116 |
|
117 private: // From MPbk2MenuCommandObserver |
|
118 void PreCommandExecutionL( |
|
119 const MPbk2Command& aCommand ); |
|
120 void PostCommandExecutionL( |
|
121 const MPbk2Command& aCommand ); |
|
122 |
|
123 private: // From MPbk2NavigationObserver |
|
124 void HandleNavigationEvent( |
|
125 const TEventType& aEventType ); |
|
126 |
|
127 private: // From MPbk2ViewLoaderObserver |
|
128 void ViewLoaded( MVPbkContactViewBase& aView ); |
|
129 void ViewError( |
|
130 MVPbkContactViewBase& aView, |
|
131 TInt aError ); |
|
132 |
|
133 private: // Implementation |
|
134 CPbk2ContactInfoAppView( |
|
135 CVPbkContactManager& aContactManager ); |
|
136 void ConstructL(); |
|
137 void CreateControlsL(); |
|
138 void UpdateViewStateL( |
|
139 const TUid aCustomMessageId, |
|
140 const TDesC8& aCustomMessage ); |
|
141 void SetNavigatorViewL(); |
|
142 void StoreStateL(); |
|
143 TBool IsFocusedFieldTypeL( |
|
144 TInt aSelectorResId ); |
|
145 void UpdateCbasL(); |
|
146 void AttachAIWProvidersL(); |
|
147 MVPbkContactLink* CurrentContactInNavigatorLC(); |
|
148 void ReturnToPreviousViewL( |
|
149 MVPbkContactLink* aFocusedContact ) const; |
|
150 void LoadContactViewL( |
|
151 const TVwsViewId& aPrevViewId ); |
|
152 void HandleViewLoadedL(); |
|
153 void LoadContactL(); |
|
154 void ConstructNavigatorL(); |
|
155 void UpdateViewGraphL( |
|
156 const TVwsViewId& aPrevViewId ); |
|
157 void SetEmptyTextL( |
|
158 TInt aResourceId ); |
|
159 |
|
160 private: // Data |
|
161 /// This view's control container type |
|
162 typedef CPbk2ControlContainer<CPbk2ContactInfoControl> CContainer; |
|
163 /// Own: This view's control container |
|
164 CContainer* iContainer; |
|
165 /// Own: Control state |
|
166 CPbk2ViewState* iControlState; |
|
167 /// Ref: This view's control |
|
168 MPbk2ContactDetailsControl* iControl; |
|
169 /// Ref: Virtual Phonebook contact manager |
|
170 CVPbkContactManager& iContactManager; |
|
171 /// Ref: Command handler |
|
172 MPbk2CommandHandler* iCommandHandler; |
|
173 /// Own: View activation transaction |
|
174 MPbk2ViewActivationTransaction* iViewActivationTransaction; |
|
175 /// Own: Navigation strategy |
|
176 MPbk2ContactNavigation* iNavigation; |
|
177 /// Own: If of the view that activated this view |
|
178 TVwsViewId iPreviousViewId; |
|
179 /// Own: Memory entry contact loader |
|
180 CPbk2MemoryEntryContactLoader* iContactLoader; |
|
181 /// Own: list of stores used |
|
182 RPointerArray<MVPbkContactStore> iStoreList; |
|
183 /// Ref: Stylus event inspector |
|
184 MPbk2PointerEventInspector* iPointerInspector; |
|
185 /// Ref: Contact view base |
|
186 MVPbkContactViewBase* iContactView; |
|
187 /// Own: Contact view loader |
|
188 CPbk2ViewLoader* iViewLoader; |
|
189 /// Ref: Phonebook store configuration |
|
190 CPbk2StoreConfiguration* iStoreConfiguration; |
|
191 }; |
|
192 |
|
193 #endif // CPBK2CONTACTINFOAPPVIEW_H |
|
194 |
|
195 // End of File |