|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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 * Declaration of class CBrowserWindowSelectionView. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef BROWSERWINDOWSELECTIONVIEW_H |
|
22 #define BROWSERWINDOWSELECTIONVIEW_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <aknview.h> |
|
26 #include "BrowserAppViewBase.h" |
|
27 #include "WindowInfoProvider.h" |
|
28 #include "WindowObserver.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CBrowserWindowSelectionContainer; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CBrowserWindowSelectionView view class. |
|
37 * |
|
38 */ |
|
39 class CBrowserWindowSelectionView : public CBrowserViewBase, |
|
40 MWindowInfoProvider, |
|
41 MWindowObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. Leaves on failure. Places the instance |
|
47 * on the cleanup stack. |
|
48 * @param aApiProvider The API provider. |
|
49 * @return The constructed view. |
|
50 */ |
|
51 static CBrowserWindowSelectionView* NewLC( MApiProvider& aApiProvider ); |
|
52 |
|
53 /** |
|
54 * Constructor |
|
55 */ |
|
56 CBrowserWindowSelectionView( MApiProvider& aApiProvider ); |
|
57 |
|
58 /** |
|
59 * default constructor. |
|
60 */ |
|
61 void ConstructL(); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CBrowserWindowSelectionView(); |
|
67 |
|
68 public: // Functions from base classes |
|
69 |
|
70 /** |
|
71 * From CAknView returns Uid of View |
|
72 * @return TUid uid of the view |
|
73 */ |
|
74 TUid Id() const; |
|
75 |
|
76 /** |
|
77 * Return command set id, to be displayed. |
|
78 * @since 1.2 |
|
79 * @return The command set's resource id. |
|
80 */ |
|
81 virtual TInt CommandSetResourceIdL(); |
|
82 |
|
83 /** |
|
84 * Set command set lsk,rsk,msk dynamically via pointers. |
|
85 * Derived classes should implement, though it can be empty. |
|
86 * If it does nothing, empty softkeys will be assigned |
|
87 * @since 5.0 |
|
88 */ |
|
89 void CommandSetResourceDynL(TSKPair& /*lsk*/, TSKPair& /*rsk*/, TSKPair& /*msk*/) {}; |
|
90 |
|
91 /** |
|
92 * From MEikMenuObserver delegate commands from the menu |
|
93 * @param aCommand a command emitted by the menu |
|
94 * @return void |
|
95 */ |
|
96 void HandleCommandL(TInt aCommand); |
|
97 |
|
98 /** |
|
99 * From CAknView reaction if size change |
|
100 * @return void |
|
101 */ |
|
102 void HandleClientRectChange(); |
|
103 |
|
104 /** |
|
105 * Changes the tabs according to available windows, by |
|
106 * recreating all tabs based on WindowManager. |
|
107 */ |
|
108 void UpdateTabsL(); |
|
109 |
|
110 /** |
|
111 * |
|
112 */ |
|
113 void UpdateTumbnailL(); |
|
114 |
|
115 /** |
|
116 * Updates the title of the view according to the highlighted tab. |
|
117 */ |
|
118 void UpdateTitleL(); |
|
119 |
|
120 /** |
|
121 * From MWindowObserver |
|
122 */ |
|
123 void WindowEventHandlerL( TWindowEvent aEvent, TInt aWindowId ); |
|
124 |
|
125 /** |
|
126 * @return Id of the window to activate. |
|
127 */ |
|
128 TInt GetWindowIdFromTabIndex( TInt aActiveTabIndex ); |
|
129 |
|
130 private: |
|
131 |
|
132 /** |
|
133 * From CAknView activate the view |
|
134 * @param aPrevViewId |
|
135 * @param aCustomMessageId |
|
136 * @param aCustomMessage |
|
137 * @return void |
|
138 */ |
|
139 void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, |
|
140 const TDesC8& aCustomMessage); |
|
141 |
|
142 /** |
|
143 * From CAknView deactivate the view (free resources) |
|
144 * @return void |
|
145 */ |
|
146 void DoDeactivate(); |
|
147 |
|
148 /** |
|
149 * From MWindowInfoProvider |
|
150 */ |
|
151 HBufC* CreateWindowInfoLC( const CBrowserWindow& aWindow ); |
|
152 |
|
153 /** |
|
154 * @return Pointer to the window`s title text. |
|
155 */ |
|
156 HBufC* GetWindowTitleFromTabIndex( TInt aActiveTabIndex ); |
|
157 |
|
158 private: // Data |
|
159 CBrowserWindowSelectionContainer* iContainer; |
|
160 CArrayFixFlat<CWindowInfo*>* iWindowInfo; // Array of all available windows |
|
161 CArrayFixFlat<TInt>* iWindowIds; // Array of window id`s |
|
162 CArrayFixFlat<HBufC*>* iTitles; // Array of window titles |
|
163 TVwsViewId iLastViewId; |
|
164 TBool iWindowEventsDisabled; // False if the object not handles events. |
|
165 }; |
|
166 |
|
167 #endif |
|
168 |
|
169 // End of File |