|
1 /* |
|
2 * Copyright (c) 2007-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: Adapter between Pbk2 commands and command users. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TPBK2UICONTROLEVENTADAPTER_H |
|
20 #define TPBK2UICONTROLEVENTADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 #include <mpbk2contactuicontrol.h> |
|
26 #include <mpbk2uicontroladapterobserver.h> |
|
27 #include <mvpbkstorecontact.h> |
|
28 #include <mvpbkbasecontact.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MVPbkStoreContact; |
|
32 class MPbk2UiControlAdapterObserver; |
|
33 |
|
34 |
|
35 // CLASS DECLARATIONS |
|
36 /** |
|
37 * Phonebook 2 checks store state |
|
38 */ |
|
39 NONSHARABLE_CLASS( TPbk2UiControlEventAdapter ): |
|
40 public MPbk2ContactUiControl |
|
41 { |
|
42 public: // Interface |
|
43 |
|
44 |
|
45 void SetContact( MVPbkStoreContact& aStoreContact ); |
|
46 |
|
47 void SetObserver( MPbk2UiControlAdapterObserver& aObserver ); |
|
48 |
|
49 private: // From MPbk2ContactUiControl |
|
50 |
|
51 MPbk2ContactUiControl* ParentControl() const; |
|
52 |
|
53 TInt NumberOfContacts() const; |
|
54 |
|
55 const MVPbkBaseContact* FocusedContactL() const; |
|
56 |
|
57 const MVPbkViewContact* FocusedViewContactL() const; |
|
58 |
|
59 const MVPbkStoreContact* FocusedStoreContact() const; |
|
60 |
|
61 void SetFocusedContactL( |
|
62 const MVPbkBaseContact& aContact ); |
|
63 |
|
64 void SetFocusedContactL( |
|
65 const MVPbkContactBookmark& aContactBookmark ); |
|
66 |
|
67 void SetFocusedContactL( |
|
68 const MVPbkContactLink& aContactLink ); |
|
69 |
|
70 TInt FocusedContactIndex() const; |
|
71 |
|
72 void SetFocusedContactIndexL( |
|
73 TInt aIndex ); |
|
74 |
|
75 TInt NumberOfContactFields() const; |
|
76 |
|
77 const MVPbkBaseContactField* FocusedField() const; |
|
78 |
|
79 TInt FocusedFieldIndex() const; |
|
80 |
|
81 void SetFocusedFieldIndex( |
|
82 TInt aIndex ); |
|
83 |
|
84 TBool ContactsMarked() const; |
|
85 |
|
86 MVPbkContactLinkArray* SelectedContactsL() const; |
|
87 |
|
88 MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const; |
|
89 |
|
90 MPbk2ContactLinkIterator* SelectedContactsIteratorL() const; |
|
91 |
|
92 CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const; |
|
93 |
|
94 void ClearMarks(); |
|
95 |
|
96 void SetSelectedContactL( |
|
97 TInt aIndex, |
|
98 TBool aSelected ); |
|
99 |
|
100 TInt CommandItemCount() const; |
|
101 |
|
102 const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const; |
|
103 |
|
104 const MPbk2UiControlCmdItem* FocusedCommandItem() const; |
|
105 |
|
106 void DeleteCommandItemL( TInt aIndex ); |
|
107 |
|
108 void AddCommandItemL(MPbk2UiControlCmdItem* aCommand, TInt aIndex); |
|
109 |
|
110 void SetSelectedContactL( |
|
111 const MVPbkContactBookmark& aContactBookmark, |
|
112 TBool aSelected ); |
|
113 |
|
114 void SetSelectedContactL( |
|
115 const MVPbkContactLink& aContactLink, |
|
116 TBool aSelected ); |
|
117 |
|
118 void DynInitMenuPaneL( |
|
119 TInt aResourceId, |
|
120 CEikMenuPane* aMenuPane ) const; |
|
121 |
|
122 void ProcessCommandL( |
|
123 TInt aCommandId ) const; |
|
124 |
|
125 void UpdateAfterCommandExecution(); |
|
126 |
|
127 TInt GetMenuFilteringFlagsL() const; |
|
128 |
|
129 CPbk2ViewState* ControlStateL() const; |
|
130 |
|
131 void RestoreControlStateL( |
|
132 CPbk2ViewState* aState ); |
|
133 |
|
134 const TDesC& FindTextL(); |
|
135 |
|
136 void ResetFindL(); |
|
137 |
|
138 void HideThumbnail(); |
|
139 |
|
140 void ShowThumbnail(); |
|
141 |
|
142 void SetBlank( |
|
143 TBool aBlank ); |
|
144 |
|
145 void RegisterCommand( |
|
146 MPbk2Command* aCommand ); |
|
147 |
|
148 void SetTextL( |
|
149 const TDesC& aText ); |
|
150 |
|
151 private: // Data |
|
152 MVPbkStoreContact* iStoreContact; // Not owned |
|
153 MPbk2UiControlAdapterObserver* iObserver; // Not owned |
|
154 }; |
|
155 |
|
156 // INLINE IMPLEMENTATION |
|
157 #include "tpbk2uicontroleventadapter.inl" |
|
158 |
|
159 #endif // TPBK2UICONTROLEVENTADAPTER_H |
|
160 |
|
161 // End of File |