LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WindowManagerMinimal.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef WINDOWMANAGERMINIMAL_H
23 #define WINDOWMANAGERMINIMAL_H
24 
25 #include "Common.h"
26 
27 #include <QList>
28 
29 #include "WindowManagerBase.h"
30 #include "GraphicsItemContainer.h"
31 #include "StatusBar.h"
32 
33 class CardWindow;
34 
36 {
37  Q_OBJECT
38 
39 public:
40 
41  WindowManagerMinimal(int maxWidth, int maxHeight);
42  virtual ~WindowManagerMinimal();
43 
44  virtual void init();
45 
46  virtual void prepareAddWindow(Window* win);
47  virtual void addWindow(Window* win);
48  virtual void removeWindow(Window* win);
49  virtual void focusWindow(Window* win);
50 
51  virtual const char* name() const { return "Minimal"; }
52 
53  virtual void resize (int width, int height);
54  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
55 
56 private Q_SLOTS:
57 
58  void slotPositiveSpaceChanged(const QRect& r);
59  void slotUiRotationAboutToStart();
60  void slotUiRotationCompleted();
61 
62 private:
63 
64  void addCardWindow(Window* win);
65  void addAlertWindow(Window* win);
66 
67  void removeCardWindow(Window* win);
68  void removeAlertWindow(Window* win);
69 
70  void focusCardWindow(Window* win);
71  void focusAlertWindow(Window* win);
72  void resizeCardWindow(CardWindow* win, int width, int height);
73 
74 private:
75 
76  Window* m_activeWin;
77  QRect m_positiveSpace;
78 
79  StatusBar* m_statusBar;
80 
81  GraphicsItemContainer* m_cardContainer;
82  QList<Window*> m_cardArray;
83 
84  GraphicsItemContainer* m_alertContainer;
85  QList<Window*> m_alertArray;
86 };
87 
88 #endif /* WINDOWMANAGERMINIMAL_H */