|
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 fetch dialog group page selection marker. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FETCHDLGGROUPMARKER_H |
|
20 #define CPBK2FETCHDLGGROUPMARKER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MVPbkSingleContactOperationObserver.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVPbkStoreContact; |
|
28 class MVPbkContactLinkArray; |
|
29 class CPbk2NamesListControl; |
|
30 class MVPbkContactViewBase; |
|
31 class CVPbkContactManager; |
|
32 class MVPbkContactOperationBase; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Phonebook 2 fetch dialog group page selection marker. |
|
38 * Responsible for checking which contact groups are selected. |
|
39 */ |
|
40 NONSHARABLE_CLASS(CPbk2FetchDlgGroupMarker) : public CActive, |
|
41 private MVPbkSingleContactOperationObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Creates a new instance of this class. |
|
47 * |
|
48 * @param aContactManager Virtual Phonebook contact manager. |
|
49 * @param aSelectedContacts Currently selected contacts. |
|
50 * @param aGroupsView Groups view. |
|
51 * @param aControl Control presenting the groups. |
|
52 * @return A new instance of this class. |
|
53 */ |
|
54 static CPbk2FetchDlgGroupMarker* NewL( |
|
55 CVPbkContactManager& aContactManager, |
|
56 MVPbkContactLinkArray& aSelectedContacts, |
|
57 MVPbkContactViewBase& aGroupsView, |
|
58 CPbk2NamesListControl& aControl ); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 ~CPbk2FetchDlgGroupMarker(); |
|
64 |
|
65 public: // Interface |
|
66 |
|
67 /** |
|
68 * Marks selected groups. |
|
69 */ |
|
70 void MarkSelectedGroupsL(); |
|
71 |
|
72 private: // From CActive |
|
73 void RunL(); |
|
74 void DoCancel(); |
|
75 TInt RunError( |
|
76 TInt aError ); |
|
77 |
|
78 private: // From MVPbkSingleContactOperationObserver |
|
79 void VPbkSingleContactOperationComplete( |
|
80 MVPbkContactOperationBase& aOperation, |
|
81 MVPbkStoreContact* aContact ); |
|
82 void VPbkSingleContactOperationFailed( |
|
83 MVPbkContactOperationBase& aOperation, |
|
84 TInt aError ); |
|
85 |
|
86 private: // Implementation |
|
87 CPbk2FetchDlgGroupMarker( |
|
88 CVPbkContactManager& aContactManager, |
|
89 MVPbkContactLinkArray& aSelectedContacts, |
|
90 MVPbkContactViewBase& aGroupsView, |
|
91 CPbk2NamesListControl& aControl ); |
|
92 void ConstructL(); |
|
93 void RetrieveNextGroupL(); |
|
94 void SelectGroupL(); |
|
95 TBool SelectionContainsAllMembersL( |
|
96 MVPbkContactLinkArray& aMembers ); |
|
97 void IssueRequest(); |
|
98 |
|
99 private: // Data structures |
|
100 /// Process states |
|
101 enum TProcessState |
|
102 { |
|
103 ERetrieving, |
|
104 EInspecting, |
|
105 EStopping |
|
106 }; |
|
107 |
|
108 private: // Data |
|
109 /// Ref: Virtual Phonebook contact manager |
|
110 CVPbkContactManager& iContactManager; |
|
111 /// Ref: Currently selected contacts |
|
112 MVPbkContactLinkArray& iSelectedContacts; |
|
113 /// Ref: Groups view |
|
114 MVPbkContactViewBase& iGroupsView; |
|
115 /// Ref: Control presenting the groups |
|
116 CPbk2NamesListControl& iControl; |
|
117 /// Own: Cursor to current group in groups view |
|
118 TInt iCursor; |
|
119 /// Own: Process state |
|
120 TProcessState iState; |
|
121 /// Own: Store contact |
|
122 MVPbkStoreContact* iStoreContact; |
|
123 /// Own: Retrieve operation |
|
124 MVPbkContactOperationBase* iRetrieveOperation; |
|
125 }; |
|
126 |
|
127 #endif // CPBK2FETCHDLGGROUPMARKER_H |
|
128 |
|
129 // End of File |