|
1 /* |
|
2 * Copyright (c) 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: Handling status pane. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CCAAPPSTATUSPANEHANDLER_H__ |
|
20 #define __CCAAPPSTATUSPANEHANDLER_H__ |
|
21 |
|
22 //INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 //FORWARD DECLARATIONS |
|
26 class CCCAAppAppUi; |
|
27 class CAknTabGroup; |
|
28 class CAknNavigationDecorator; |
|
29 |
|
30 //CONSTS |
|
31 const TInt KCCAppMinPluginCountForTabs = 2; |
|
32 const TInt KCCAppMinPluginCountForMaxTabs = 3; |
|
33 |
|
34 /** |
|
35 * CCCAppStatusPaneHandler |
|
36 * Class for handling status pane. |
|
37 * |
|
38 * @code |
|
39 * |
|
40 * @endcode |
|
41 * |
|
42 * @lib ccaapp |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 class CCCAppStatusPaneHandler : |
|
46 public CBase, |
|
47 public MAknTabObserver |
|
48 { |
|
49 #ifdef __CCAPPUNITTESTMODE |
|
50 friend class UT_CCAappStatusPaneHandler; |
|
51 #endif// __CCAPPUNITTESTMODE |
|
52 |
|
53 public: |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CCCAppStatusPaneHandler* NewL( CCCAppView& aView ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CCCAppStatusPaneHandler(); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * Constructor. |
|
67 */ |
|
68 CCCAppStatusPaneHandler( CCCAppView& aView ); |
|
69 void ConstructL(); |
|
70 |
|
71 private:// from MAknTabObserver |
|
72 |
|
73 /** |
|
74 * from MAknTabObserver |
|
75 */ |
|
76 void TabChangedL( TInt aIndex ); |
|
77 |
|
78 public: // Implementation |
|
79 |
|
80 /** |
|
81 * Creates tabs if there are KCCAppMinPluginCountForTabs (or more) plugins |
|
82 * |
|
83 * @since S60 v5.0 |
|
84 */ |
|
85 void CreateTabsL(); |
|
86 |
|
87 /** |
|
88 * Set given tab active if iTabGroup available |
|
89 * |
|
90 * @since S60 v5.0 |
|
91 * @param aTabIndex: Activates given tab. |
|
92 */ |
|
93 void ActivateTab( TInt aTabIndex ); |
|
94 |
|
95 /** |
|
96 * Set next/previous tab active if iTabGroup available |
|
97 * |
|
98 * @since S60 v5.0 |
|
99 * @param aForward next/previous |
|
100 */ |
|
101 void ActivateTabL( TBool aForward ); |
|
102 |
|
103 /** |
|
104 * Returns current tab index. If no iTabGroup available |
|
105 * returns KErrNotFound. |
|
106 * |
|
107 * @since S60 v5.0 |
|
108 * @return current tab index. |
|
109 */ |
|
110 TInt ActiveTabIndex(); |
|
111 |
|
112 /** |
|
113 * Counts tabs. If no iTabGroup available |
|
114 * returns KErrNotFound. |
|
115 * |
|
116 * @since S60 v5.0 |
|
117 * @return count of tab items. |
|
118 */ |
|
119 TInt TabCount(); |
|
120 |
|
121 /** |
|
122 * Helper Function to identify whether a Tab has been |
|
123 * Created or not. If there is only 1 plugin, then the tab |
|
124 * will not be created. If there is more than 1Plugin interested |
|
125 * in the CCAParam then Tabs will be created and made visible |
|
126 * Use this function to check the availability of the tab |
|
127 * and pass the tab related functionalities like |
|
128 * switching between tabs |
|
129 * |
|
130 * @since S60 v5.0 |
|
131 * @return ETrue - If Tab Created and Visible |
|
132 * EFalse - Otherwise |
|
133 */ |
|
134 TBool IsTabAvailable(); |
|
135 |
|
136 private: //Implementation |
|
137 |
|
138 /** |
|
139 * Helper function for adding bitmaps. |
|
140 * |
|
141 * @since S60 v5.0 |
|
142 * @param index of plugin |
|
143 */ |
|
144 void AddBitmapsL(TInt aPlugin); |
|
145 |
|
146 /** |
|
147 * Creates navipane |
|
148 * |
|
149 * @since S60 v5.0 |
|
150 */ |
|
151 void CreateNavipaneL(); |
|
152 |
|
153 /** |
|
154 * Adds a plugin into navipane. |
|
155 * |
|
156 * @since S60 v5.0 |
|
157 * @param index of plugin |
|
158 */ |
|
159 void AddTabL( TInt aPlugin ); |
|
160 |
|
161 private: //Data |
|
162 |
|
163 /** |
|
164 * Decorated tab-group. |
|
165 * Own. |
|
166 */ |
|
167 CAknNavigationDecorator* iDecoratedTabGroup; |
|
168 |
|
169 /** |
|
170 * Tab-group. |
|
171 * Not own. Ownership transferred to NavigationDecoration |
|
172 */ |
|
173 CAknTabGroup* iTabGroupRef; |
|
174 |
|
175 /** |
|
176 * Reference to view -class |
|
177 * Not own. |
|
178 */ |
|
179 CCCAppView& iView; |
|
180 |
|
181 //Tab is available or not ETrue/EFalse |
|
182 TBool iTabAvailability; |
|
183 }; |
|
184 |
|
185 #endif // __CCAAPPSTATUSPANEHANDLER_H__ |
|
186 |