|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Phonebook fetch dialog page: Groups List. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPbkGroupsListFetchDlgPage_H__ |
|
21 #define __CPbkGroupsListFetchDlgPage_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> // CBase |
|
25 #include "MPbkFetchDlgPage.h" |
|
26 #include <MPbkContactViewListControlObserver.h> |
|
27 #include <cntviewbase.h> // MContactViewObserver |
|
28 #include <MPbkContactSelector.h> |
|
29 #include "MPbkFetchDlgSelection.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPbkContactViewListControl; |
|
33 class CPbkContactSubView; |
|
34 class CPbkContactIdSet; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Phonebook fetch dialog page: Groups List. |
|
40 */ |
|
41 NONSHARABLE_CLASS(CPbkGroupsListFetchDlgPage) : |
|
42 public CBase, |
|
43 public MPbkFetchDlgPage, |
|
44 public MPbkFetchDlgSelection, |
|
45 private MPbkContactViewListControlObserver, |
|
46 private MContactViewObserver, |
|
47 private MPbkContactSelector |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 /** |
|
51 * Creates a new instance of this class. |
|
52 * @param aParentDlg parent dialog |
|
53 */ |
|
54 static CPbkGroupsListFetchDlgPage* NewL(MPbkFetchDlg& aParentDlg); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CPbkGroupsListFetchDlgPage(); |
|
60 |
|
61 public: // from MPbkFetchDlgPage |
|
62 TInt FetchDlgPageId() const; |
|
63 TBool DlgPageReady() const; |
|
64 void ActivateFetchDlgPageL(); |
|
65 void DeactivateFetchDlgPage(); |
|
66 TContactItemId FocusedContactIdL() const; |
|
67 TBool IsFetchDlgPageEmpty() const; |
|
68 void SetMPbkFetchDlgSelection(MPbkFetchDlgSelection* aAccepter); |
|
69 TBool ItemsMarked() const; |
|
70 void LayoutContents(); |
|
71 const CContactIdArray& MarkedItemsL() const; |
|
72 TBool ProcessSoftkeyMarkCommandL(TInt aCommandId); |
|
73 CPbkContactViewListControl& Control(); |
|
74 |
|
75 public: // from MPbkFetchDlgSelection |
|
76 TBool ContactSelectionAcceptedL |
|
77 (TContactItemId aGroupId, TInt aCurrentSelectedCount) const; |
|
78 |
|
79 private: // from MPbkContactViewListControlObserver |
|
80 void HandleContactViewListControlEventL |
|
81 (CPbkContactViewListControl& aControl, |
|
82 const TPbkContactViewListControlEvent& aEvent); |
|
83 |
|
84 private: // from MContactViewObserver |
|
85 void HandleContactViewEvent |
|
86 (const CContactViewBase& aView, const TContactViewEvent& aEvent); |
|
87 |
|
88 private: // from MPbkContactSelector |
|
89 TBool IsContactIncluded(TContactItemId aId); |
|
90 |
|
91 private: // Implementation |
|
92 CPbkGroupsListFetchDlgPage(MPbkFetchDlg& aFetchDlg); |
|
93 void ConstructL(); |
|
94 void SetupControlL(); |
|
95 void HandleGroupSelectionL(TContactItemId aGroupId, TBool aSelected); |
|
96 void HandleContactViewEventL |
|
97 (const CContactViewBase& aView, const TContactViewEvent& aEvent); |
|
98 void HandleContactViewEventL(const TContactViewEvent& aEvent); |
|
99 void HandleGroupsViewEventL(const TContactViewEvent& aEvent); |
|
100 |
|
101 private: // Data |
|
102 /// Ref: Owner dialog of this page |
|
103 MPbkFetchDlg& iParentDlg; |
|
104 /// Ref: groups list control owned by iParentDlg |
|
105 CPbkContactViewListControl* iControl; |
|
106 /// Ref: names list contact view |
|
107 CContactViewBase& iContactView; |
|
108 /// Ref: all groups contact view |
|
109 CContactViewBase* iAllGroupsView; |
|
110 /// Ref: filtered groups view |
|
111 CPbkContactSubView* iGroupSubView; |
|
112 /// Own: initialisation state flags |
|
113 TUint iStateFlags; |
|
114 /// Own: set of included groups |
|
115 CPbkContactIdSet* iGroupsToInclude; |
|
116 /// Ref: selection accepter |
|
117 MPbkFetchDlgSelection* iFetchSelection; |
|
118 /// Own: id array of contacts from selected groups |
|
119 CContactIdArray* iGroupItemsArray; |
|
120 }; |
|
121 |
|
122 #endif // __CPbkGroupsListFetchDlgPage_H__ |
|
123 |
|
124 // End of File |