|
1 /* |
|
2 * Copyright (c) 2006 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 * Composite view extension. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CXSPVIEWMANAGER_H__ |
|
21 #define __CXSPVIEWMANAGER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MxSPCommandMapper.h" |
|
26 |
|
27 // forward declarations |
|
28 class MxSPView; |
|
29 class CxSPCommandInfo; |
|
30 class CEikMenuPane; |
|
31 class MPbk2ContactUiControl; |
|
32 |
|
33 /** |
|
34 * Composite of view extensions. |
|
35 */ |
|
36 class CxSPViewManager : public CBase, |
|
37 public MxSPCommandMapper |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Creates new composite view extension object with empty |
|
42 * set of contained views. |
|
43 */ |
|
44 static CxSPViewManager* NewL(); |
|
45 |
|
46 /** |
|
47 * Appends an extension view to this composite view. |
|
48 * Ownership is transferred to this object. |
|
49 * |
|
50 * @param aView view to append. |
|
51 * @param aId xSP id |
|
52 */ |
|
53 void AppendL(MxSPView* aView, TUint32 aId); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CxSPViewManager(); |
|
59 |
|
60 public: |
|
61 /** |
|
62 * Filters the menu pane of the Phonebook view connect to this |
|
63 * extension. |
|
64 * |
|
65 * @param aResourceId menu resource id. |
|
66 * @param aMenuPane menu pane which will be filtered. |
|
67 */ |
|
68 void DynInitMenuPaneL |
|
69 (TInt aResourceId, CEikMenuPane* aMenuPane); |
|
70 |
|
71 /** |
|
72 * Handles phone book extension commands. |
|
73 * |
|
74 * @param aCommandId command id. |
|
75 * @return ETrue if command was handled. |
|
76 */ |
|
77 TBool HandleCommandL(TInt aCommandId, MPbk2ContactUiControl* aUiControl); |
|
78 |
|
79 public: // from MxSPCommandMapper |
|
80 |
|
81 TInt GetOldCommand( TUint32 aId, TInt aNewCommand, |
|
82 TInt& aOldCommand ) const; |
|
83 TInt GetNewCommand( TUint32 aId, TInt aOldCommand, |
|
84 TInt& aNewCommand ) const; |
|
85 |
|
86 private: // Implementation |
|
87 CxSPViewManager(); |
|
88 |
|
89 private: // Data |
|
90 /// Array of view extensions. |
|
91 CArrayPtrFlat<MxSPView> iViews; |
|
92 /// New commands pool |
|
93 TInt iNewCommands; |
|
94 /// Array of command id mappings |
|
95 RPointerArray<CxSPCommandInfo> iCommandIdMap; |
|
96 }; |
|
97 |
|
98 |
|
99 #endif // __CXSPVIEWMANAGER_H__ |
|
100 |
|
101 // End of File |