|
1 // screenmngr.h |
|
2 // |
|
3 // Copyright (c) 2009 - 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 #ifndef SCREENMNGR_H_ |
|
13 #define SCREENMNGR_H_ |
|
14 |
|
15 #include "common.h" |
|
16 |
|
17 class MViewController; |
|
18 |
|
19 /* |
|
20 Class responsible for arranging windows on the screen. For now it handles only one main window and one command window. |
|
21 New windows can be added by calling AddViewL. The class should rearrange visible windows and resize appropriate views. |
|
22 Many views can be shown in the same window - switching between visible views is done by calling AttachViewL. The class |
|
23 automatically disables old views and activates new views. If more than one window is supported then there may be |
|
24 another function necessary which attaches a provided view to a particular window, not just the default one. |
|
25 */ |
|
26 class CScreenManager : public CBase |
|
27 { |
|
28 public: |
|
29 //Returns the TWindow occupied by the command window |
|
30 const TWindow& GetCommandWindow() {return iCmdWnd;} |
|
31 //Sets new coordinates of the screen available to this screen manager |
|
32 void ResizeScreenL(const TWindow& aWindow); |
|
33 //Resizes all Views to make space (if possible) for the new size of the command window. |
|
34 //Returns the new size of the command window. |
|
35 const TWindow& ResizeCommandWindowL(TInt aHeight); |
|
36 //Opens a new window and attaches the view provided to it. The new view becomes active. |
|
37 void AddViewL(MViewController& aView); |
|
38 //Attaches the provided view to the currently active window. The attached view becomes active. |
|
39 void AttachViewL(MViewController& aView); |
|
40 |
|
41 void RefreshScreenL(); |
|
42 |
|
43 void UnsetCurrentView(); |
|
44 |
|
45 private: |
|
46 TWindow iScreenWnd; |
|
47 TWindow iCmdWnd; |
|
48 TWindow iMainWnd; |
|
49 MViewController* iCurrentView; |
|
50 }; |
|
51 |
|
52 #endif /*SCREENMNGR_H_*/ |