|
1 /* |
|
2 * Copyright (c) 2002-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 own numbers control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPSU2OWNNUMBERCONTROL_H |
|
20 #define CPSU2OWNNUMBERCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <MVPbkContactViewObserver.h> |
|
25 #include <MPbk2ContactUiControl.h> |
|
26 #include <MPbk2ContactUiControl2.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CPsu2OwnNumberListBox; |
|
30 class MVPbkContactViewBase; |
|
31 class MPbk2ContactNameFormatter; |
|
32 class CAknDoubleGraphicStyleListBox; |
|
33 class CCoeControl; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Phonebook 2 own numbers control. |
|
39 */ |
|
40 class CPsu2OwnNumberControl : public CCoeControl, |
|
41 public MPbk2ContactUiControl, |
|
42 public MPbk2ContactUiControl2 |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aView The view from the extension framework. |
|
50 * @param aContainer Container that owns the window. |
|
51 * @return A new instance of this class. |
|
52 */ |
|
53 static CPsu2OwnNumberControl* NewL( |
|
54 MVPbkContactViewBase& aView, |
|
55 CCoeControl* aContainer ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CPsu2OwnNumberControl(); |
|
61 |
|
62 public: // From CCoeControl |
|
63 TKeyResponse OfferKeyEventL( |
|
64 const TKeyEvent& aKeyEvent, |
|
65 TEventCode aType ); |
|
66 void SizeChanged(); |
|
67 TInt CountComponentControls() const; |
|
68 CCoeControl* ComponentControl( |
|
69 TInt aIndex ) const; |
|
70 void FocusChanged( |
|
71 TDrawNow aDrawNow ); |
|
72 |
|
73 public: // From MPbk2ContactUiControl |
|
74 MPbk2ContactUiControl* ParentControl() const; |
|
75 TInt NumberOfContacts() const; |
|
76 const MVPbkBaseContact* FocusedContactL() const; |
|
77 const MVPbkViewContact* FocusedViewContactL() const; |
|
78 const MVPbkStoreContact* FocusedStoreContact() const; |
|
79 void SetFocusedContactL( |
|
80 const MVPbkBaseContact& aContact ); |
|
81 void SetFocusedContactL( |
|
82 const MVPbkContactBookmark& aContactBookmark ); |
|
83 void SetFocusedContactL( |
|
84 const MVPbkContactLink& aContactLink ); |
|
85 TInt FocusedContactIndex() const; |
|
86 void SetFocusedContactIndexL( |
|
87 TInt aIndex ); |
|
88 TInt NumberOfContactFields() const; |
|
89 const MVPbkBaseContactField* FocusedField() const; |
|
90 TInt FocusedFieldIndex() const; |
|
91 void SetFocusedFieldIndex( |
|
92 TInt aIndex ); |
|
93 TBool ContactsMarked() const; |
|
94 MVPbkContactLinkArray* SelectedContactsL() const; |
|
95 MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const; |
|
96 MPbk2ContactLinkIterator* SelectedContactsIteratorL() const; |
|
97 CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const; |
|
98 void ClearMarks(); |
|
99 void SetSelectedContactL( |
|
100 TInt aIndex, |
|
101 TBool aSelected ); |
|
102 void SetSelectedContactL( |
|
103 const MVPbkContactBookmark& aContactBookmark, |
|
104 TBool aSelected ); |
|
105 void SetSelectedContactL( |
|
106 const MVPbkContactLink& aContactLink, |
|
107 TBool aSelected ); |
|
108 |
|
109 void DynInitMenuPaneL( |
|
110 TInt aResourceId, |
|
111 CEikMenuPane* aMenuPane ) const; |
|
112 void ProcessCommandL ( |
|
113 TInt aCommandId ) const; |
|
114 void UpdateAfterCommandExecution(); |
|
115 TInt GetMenuFilteringFlagsL() const; |
|
116 CPbk2ViewState* ControlStateL() const; |
|
117 void RestoreControlStateL( |
|
118 CPbk2ViewState* aState ); |
|
119 const TDesC& FindTextL(); |
|
120 void ResetFindL(); |
|
121 void ShowThumbnail(); |
|
122 void HideThumbnail(); |
|
123 void SetBlank( |
|
124 TBool aBlank ); |
|
125 void RegisterCommand( |
|
126 MPbk2Command* aCommand ); |
|
127 void SetTextL( |
|
128 const TDesC& aText ); |
|
129 TAny* ContactUiControlExtension(TUid aExtensionUid ); |
|
130 |
|
131 public: // From MPbk2ContactUiControl2 |
|
132 TInt CommandItemCount() const; |
|
133 const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const; |
|
134 const MPbk2UiControlCmdItem* FocusedCommandItem() const; |
|
135 void DeleteCommandItemL( TInt aIndex ); |
|
136 void AddCommandItemL(MPbk2UiControlCmdItem* aCommand, TInt aIndex); |
|
137 |
|
138 private: // Implementation |
|
139 CPsu2OwnNumberControl( |
|
140 MVPbkContactViewBase& aView ); |
|
141 void ConstructL( |
|
142 MVPbkContactViewBase& aView, |
|
143 CCoeControl* aContainer ); |
|
144 |
|
145 private: // Data |
|
146 /// Own: Listbox |
|
147 CAknDoubleGraphicStyleListBox* iListBox; |
|
148 /// Ref: All contacts view |
|
149 MVPbkContactViewBase* iBaseView; |
|
150 }; |
|
151 |
|
152 #endif // CPSU2OWNNUMBERCONTROL_H |
|
153 |
|
154 // End of File |