|
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 USIM contact info view base class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPSU2INFOVIEWBASE_H |
|
20 #define CPSU2INFOVIEWBASE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2UIExtensionView.h> |
|
25 #include <MPbk2ControlObserver.h> |
|
26 #include <MVPbkSingleContactOperationObserver.h> |
|
27 #include <MPbk2MemoryEntryView.h> |
|
28 #include <vwsdef.h> |
|
29 #include <MPbk2NavigationObserver.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPsu2ViewManager; |
|
33 class CPbk2UIExtensionView; |
|
34 template<class Control> class CPbk2ControlContainer; |
|
35 class CPbk2ContactInfoControl; |
|
36 class MPbk2ContactUiControl; |
|
37 class MVPbkStoreContact; |
|
38 class CPbk2MemoryEntryContactLoader; |
|
39 class MPbk2ViewActivationTransaction; |
|
40 class MVPbkContactStore; |
|
41 class MPbk2ContactNavigation; |
|
42 class CAknNavigationDecorator; |
|
43 class MVPbkContactLink; |
|
44 class MPbk2PointerEventInspector; |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 /** |
|
49 * Phonebook 2 USIM contact info view base class. |
|
50 * Responsible for providing common functionality for USIM info views. |
|
51 */ |
|
52 class CPsu2InfoViewBase : public CBase, |
|
53 public MPbk2UIExtensionView, |
|
54 public MPbk2ControlObserver, |
|
55 public MPbk2MemoryEntryView, |
|
56 public MPbk2NavigationObserver |
|
57 { |
|
58 public: // Construction and destruction |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 ~CPsu2InfoViewBase(); |
|
64 |
|
65 public: // From MPbk2UIExtensionView |
|
66 void HandleStatusPaneSizeChange(); |
|
67 CPbk2ViewState* ViewStateLC() const; |
|
68 TBool HandleCommandKeyL( |
|
69 const TKeyEvent& aKeyEvent, |
|
70 TEventCode aType ); |
|
71 void HandlePointerEventL( |
|
72 const TPointerEvent& aPointerEvent ); |
|
73 TInt GetViewSpecificMenuFilteringFlagsL() const; |
|
74 void DoActivateL( |
|
75 const TVwsViewId& aPrevViewId, |
|
76 TUid aCustomMessageId, |
|
77 const TDesC8& aCustomMessage ); |
|
78 void DoDeactivate(); |
|
79 void HandleCommandL( |
|
80 TInt aCommand ); |
|
81 void DynInitMenuPaneL( |
|
82 TInt aResourceId, |
|
83 CEikMenuPane* aMenuPane ); |
|
84 void HandleLongTapEventL( |
|
85 const TPoint& aPenEventLocation, |
|
86 const TPoint& aPenEventScreenLocation ); |
|
87 |
|
88 public: // From MPbk2ControlObserver |
|
89 void HandleControlEventL( |
|
90 MPbk2ContactUiControl& aControl, |
|
91 const TPbk2ControlEvent& aEvent ); |
|
92 |
|
93 private: // From MPbk2MemoryEntryView |
|
94 void PrepareForContactChangeL(); |
|
95 void ContactChangedL( |
|
96 MVPbkStoreContact* aContact ); |
|
97 void ContactChangeFailed(); |
|
98 const MVPbkStoreContact* Contact() const; |
|
99 |
|
100 protected: // From MPbk2NavigationObserver |
|
101 void HandleNavigationEvent( |
|
102 const TEventType& aEventType ); |
|
103 |
|
104 protected: // Implementation |
|
105 CPsu2InfoViewBase( |
|
106 CPbk2UIExtensionView& aExtensionView, |
|
107 CPsu2ViewManager& aViewManager ); |
|
108 void BaseConstructL(); |
|
109 |
|
110 private: // Base class implementation interface |
|
111 virtual TInt NameListControlResourceId() const = 0; |
|
112 virtual HBufC* NaviPaneLabelL() const = 0; |
|
113 virtual void UpdateCbasL() = 0; |
|
114 |
|
115 private: // Implementation |
|
116 void CreateControlsL(); |
|
117 void UpdateViewStateL( |
|
118 const TDesC8& aCustomMessage ); |
|
119 void StoreStateL(); |
|
120 void RestoreStateL(); |
|
121 MVPbkContactLink* CurrentContactInNavigatorLC(); |
|
122 void ReturnToPreviousViewL( MVPbkContactLink* aFocusedContact ) const; |
|
123 |
|
124 |
|
125 protected: // Data |
|
126 /// This view's control container type |
|
127 typedef CPbk2ControlContainer<CPbk2ContactInfoControl> CContainer; |
|
128 /// Own: this view's control container |
|
129 CContainer* iContainer; |
|
130 /// Ref: The extension view instance |
|
131 CPbk2UIExtensionView& iExtensionView; |
|
132 /// Ref: The view manager of the extension |
|
133 CPsu2ViewManager& iViewManager; |
|
134 /// Ref: This view's control |
|
135 MPbk2ContactUiControl* iControl; |
|
136 /// Own: Contact loader |
|
137 CPbk2MemoryEntryContactLoader* iContactLoader; |
|
138 /// Own: View activation transaction object |
|
139 MPbk2ViewActivationTransaction* iViewActivationTransaction; |
|
140 /// Ref: Pointer event inspector |
|
141 MPbk2PointerEventInspector* iPointerEventInspector; |
|
142 |
|
143 private: // Data |
|
144 /// Own: Stored control state |
|
145 CPbk2ViewState* iControlState; |
|
146 /// Ref: Register for events |
|
147 MVPbkContactStore* iStore; |
|
148 /// Own: The view which this view was activated from |
|
149 TVwsViewId iPreviousViewId; |
|
150 /// Own: Navigation strategy |
|
151 MPbk2ContactNavigation* iNavigation; |
|
152 /// Own: Store list |
|
153 RPointerArray<MVPbkContactStore> iStoreList; |
|
154 /// Own: Decorator for the navipane |
|
155 CAknNavigationDecorator* iNaviDecorator; |
|
156 }; |
|
157 |
|
158 #endif // CPSU2INFOVIEWBASE_H |
|
159 |
|
160 // End of File |