|
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 * view id changer |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CXSPVIEWIDCHANGER_H__ |
|
21 #define __CXSPVIEWIDCHANGER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MxSPViewMapper.h" |
|
26 #include "TNewViewIdInfo.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MxSPFactory; |
|
30 class CxSPViewInfo; |
|
31 |
|
32 |
|
33 /** |
|
34 * View id changer |
|
35 */ |
|
36 class CxSPViewIdChanger : public CBase, |
|
37 public MxSPViewMapper |
|
38 { |
|
39 #ifdef T_CXSPVIEWIDCHANGER_H |
|
40 friend class T_CxSPViewIdChannger; |
|
41 #endif// T_CXSPVIEWIDCHANGER_H |
|
42 |
|
43 public: |
|
44 /** |
|
45 * Static factory function that performs the 2-phased construction. |
|
46 * |
|
47 * @return New instance of this class |
|
48 */ |
|
49 static CxSPViewIdChanger* NewL(); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CxSPViewIdChanger(); |
|
55 |
|
56 public: // from MxSPViewMapper |
|
57 |
|
58 TInt GetOldView( TUint32 aId, TInt aNewView, TInt& aOldView ) const; |
|
59 TInt GetNewView( TUint32 aId, TInt aOldView, TInt& aNewView ) const; |
|
60 |
|
61 public: |
|
62 |
|
63 /** |
|
64 * Performs the view ID change operation for given extensions |
|
65 * |
|
66 * @param aFactories Array of extension factories |
|
67 */ |
|
68 void ChangeViewIdsL( CArrayPtrFlat<MxSPFactory>& aFactories ); |
|
69 |
|
70 /** |
|
71 * Gets the total number of views |
|
72 * |
|
73 * @param aTabs Number of tab views |
|
74 * @param aOthres Number of other views |
|
75 */ |
|
76 void GetViewCount( TInt &aTabs, TInt &aOthers ) const; |
|
77 |
|
78 /** |
|
79 * Gets a tab view's info |
|
80 * |
|
81 * @param aId ID related to the wanted tab view |
|
82 * @param aInfoArray View info |
|
83 */ |
|
84 void GetTabViewInfoL( TUint32 aId, RPointerArray<CxSPViewInfo>& aInfoArray ) const; |
|
85 |
|
86 /** |
|
87 * Gets all extensions tab view's info |
|
88 * |
|
89 * @param aInfoArray View info |
|
90 */ |
|
91 void GetTabViewInfoL( RPointerArray<CxSPViewInfo>& aInfoArray ) const; |
|
92 |
|
93 /** |
|
94 * Map Extension Manager's view IDs |
|
95 */ |
|
96 void ChangeManagerViewIdsL(); |
|
97 /** |
|
98 * write tab view names to Central Repository. |
|
99 */ |
|
100 void WriteTabViewNamesToRepositoryL(); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Constructor. |
|
106 */ |
|
107 CxSPViewIdChanger(); |
|
108 |
|
109 /** |
|
110 * 2nd phase constructor. |
|
111 */ |
|
112 void ConstructL(); |
|
113 |
|
114 private: // Data |
|
115 |
|
116 /// array of tab view ids |
|
117 RArray<TNewViewIdInfo> iTabViewNewIds; |
|
118 /// array of non-tab view ids |
|
119 RArray<TNewViewIdInfo> iNonTabViewNewIds; |
|
120 |
|
121 /// Array of view infos |
|
122 RPointerArray<CxSPViewInfo> iViewIdMap; |
|
123 }; |
|
124 |
|
125 |
|
126 |
|
127 #endif // __CXSPVIEWIDCHANGER_H__ |
|
128 |
|
129 // End of File |