LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DockModeMenuManager.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-2013 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 DOCKMODEMENUMANAGER_H
23 #define DOCKMODEMENUMANAGER_H
24 
25 #include "Common.h"
26 
27 #include "WindowManagerBase.h"
28 
29 #include "GraphicsItemContainer.h"
30 #include <QGraphicsPixmapItem>
31 #include <QGraphicsSceneMouseEvent>
32 #include <QVector>
33 #include "SystemMenu.h"
34 
35 class Window;
36 class QGestureEvent;
37 class StatusBar;
41 
43 {
44  Q_OBJECT
45 
46 public:
47 
48  DockModeMenuManager(int maxWidth, int maxHeight);
49  virtual ~DockModeMenuManager();
50 
51  virtual void init();
52 
53  void resize(int width, int height);
54 
56  QGraphicsObject* getAppMenu() const { return m_menuObject; }
57  StatusBar* statusBar() const { return m_statusBar; }
58  bool isAppMenuOpen() const { return m_appMenuOpened; }
59 
60 public Q_SLOTS:
61 
62  void activateAppMenu(bool open);
63  void activateSystemMenu (bool open);
64  void closeAllMenus();
65  void slotCloseSystemMenu();
68  void slotDockModeStatusChanged (bool enabled);
69 
70 protected:
71 
72  virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
73  virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
74  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
75  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
76  void flickGestureEvent(QGestureEvent* event);
77 
78  virtual bool sceneEvent(QEvent* event);
79 
80 private Q_SLOTS:
81 
82  void slotPositiveSpaceChanged(const QRect& r);
83  // void slotSystemMenuStateChanged(bool opened);
84 
85 private:
86 
87  void handleMousePress(QGraphicsSceneMouseEvent* event, int clickCount);
88 
89 private:
90 
91  enum PenDownState {
92  PenDownInvalid,
93  PenDownInMenu,
94  };
95 
96  StatusBar* m_statusBar;
97  bool m_appMenuOpened;
98 
99  SystemMenu* m_sysMenu;
100  bool m_systemMenuOpened;
101 
102  DockModeAppMenuContainer* m_appMenuContainer;
103  QDeclarativeComponent* m_qmlNotifMenu;
104  QGraphicsObject* m_menuObject;
105 
106  std::string m_currentApp;
107 };
108 
109 #endif /* MENUWINDOWMANAGER_H */