|
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 group popup. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPGUGROUPPOPUP_H |
|
20 #define CPGUGROUPPOPUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <eikcmobs.h> |
|
25 #include <MVPbkContactViewObserver.h> |
|
26 #include <MVPbkContactSelector.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CEikColumnListBox; |
|
30 class CPbk2InputAbsorber; |
|
31 class MVPbkContactLink; |
|
32 class MVPbkContactLinkArray; |
|
33 class MVPbkContactViewBase; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Phonebook 2 group popup. |
|
39 * Responsible for displaying a popup dialog which displays groups. |
|
40 */ |
|
41 class CPguGroupPopup : public CBase, |
|
42 private MVPbkContactViewObserver, |
|
43 private MVPbkContactSelector, |
|
44 private MEikCommandObserver |
|
45 { |
|
46 public: // Construction and destruction |
|
47 |
|
48 /** |
|
49 * Creates a new instance of this class. |
|
50 * |
|
51 * @param aGroupsJoined List of groups to which |
|
52 * contact belongs to. |
|
53 * @param aTitleResId Title's resource id. |
|
54 * @param aEmptyTextResId Empty text resource id. |
|
55 * @param aSoftKeyResId Softkey resource id. |
|
56 * @param aListBoxFlags Listbox flags. |
|
57 * @param aAllGroupsView All groups view. |
|
58 * @return A new instance of this class. |
|
59 */ |
|
60 static CPguGroupPopup* NewL( |
|
61 MVPbkContactLinkArray* aGroupsJoined, |
|
62 TInt32 aTitleResId, |
|
63 TInt32 aEmptyTextResId, |
|
64 TInt32 aSoftKeyResId, |
|
65 TInt32 aListBoxFlags, |
|
66 MVPbkContactViewBase& aAllGroupsView ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 ~CPguGroupPopup(); |
|
72 |
|
73 public: // Interface |
|
74 |
|
75 /** |
|
76 * Executes the group selection dialog. |
|
77 * Returns a link to the selected group, or NULL if user cancelled |
|
78 * the dialog. Ownership is transferred to caller. |
|
79 * |
|
80 * @return Link to the selected group. |
|
81 */ |
|
82 MVPbkContactLink* ExecuteLD(); |
|
83 |
|
84 private: // From MVPbkContactViewObserver |
|
85 void ContactViewReady( |
|
86 MVPbkContactViewBase& aView ); |
|
87 void ContactViewUnavailable( |
|
88 MVPbkContactViewBase& aView ); |
|
89 void ContactAddedToView( |
|
90 MVPbkContactViewBase& aView, |
|
91 TInt aIndex, |
|
92 const MVPbkContactLink& aContactLink ); |
|
93 void ContactRemovedFromView( |
|
94 MVPbkContactViewBase& aView, |
|
95 TInt aIndex, |
|
96 const MVPbkContactLink& aContactLink ); |
|
97 void ContactViewError( |
|
98 MVPbkContactViewBase& aView, |
|
99 TInt aError, |
|
100 TBool aErrorNotified ); |
|
101 |
|
102 private: // From MEikCommandObserver |
|
103 void ProcessCommandL( |
|
104 TInt aCommandId ); |
|
105 |
|
106 private: // From MVPbkContactSelector |
|
107 TBool IsContactIncluded( |
|
108 const MVPbkBaseContact& aContact ); |
|
109 |
|
110 private: // Implementation |
|
111 CPguGroupPopup( |
|
112 MVPbkContactLinkArray* aGroupsJoined, |
|
113 TInt32 aTitleResId, |
|
114 TInt32 aEmptyTextResId, |
|
115 TInt32 aSoftKeyResId, |
|
116 TInt32 aListBoxFlags ); |
|
117 void ConstructL( |
|
118 MVPbkContactViewBase& aAllGroupsView ); |
|
119 void Close(); |
|
120 void RunPopupL(); |
|
121 |
|
122 private: // Data |
|
123 /// Own: View for the groups that the iStore contact belongs to |
|
124 MVPbkContactViewBase* iGroupView; |
|
125 /// Own: Title's resource id |
|
126 TInt32 iTitleResId; |
|
127 /// Own: ListBox's empty text resource id |
|
128 TInt32 iEmptyTextResId; |
|
129 /// Own: Softkeys resource id |
|
130 TInt32 iSoftKeyResId; |
|
131 /// Own: ListBox flags |
|
132 TInt32 iListBoxFlags; |
|
133 /// Own: Selected links |
|
134 MVPbkContactLink* iSelectedGroup; |
|
135 /// Own: Popup's result |
|
136 TInt iResult; |
|
137 /// Own: Input absorber |
|
138 CPbk2InputAbsorber* iInputAbsorber; |
|
139 /// Ref: Groups that the iStoreContact belongs to |
|
140 MVPbkContactLinkArray* iGroupsJoined; |
|
141 }; |
|
142 |
|
143 #endif // CPGUGROUPPOPUP_H |
|
144 |
|
145 // End of File |