LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BannerWindow.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 BANNERWINDOW_H
23 #define BANNERWINDOW_H
24 
25 #include "Common.h"
26 
27 #include <string>
28 
29 #include <QGraphicsObject>
30 
31 #include "BannerMessageHandler.h"
32 #include "Window.h"
33 
35 class ActiveCallBanner;
36 
38  public BannerMessageView
39 {
40 public:
41 
42  BannerWindow(DashboardWindowManager* wm, int width, int height);
43  virtual ~BannerWindow();
44 
45  virtual QRectF boundingRect() const;
46  virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
47 
48  void contentUpdated();
49  inline void resetIgnoreGestureUpEvent() {
50  m_ignoreGestureUpEvent = !m_ignoreGestureUpEvent;
51  }
52 
53  void resize(int width, int height);
54 
55 private:
56 
57  bool sceneEvent(QEvent* event);
58  bool handleTap(const QPointF &tapHotspot);
59 
60  virtual int bmViewGetWidth() const;
61  virtual void bmViewUpdated();
62  virtual void bmViewMessageCountUpdated(int count);
63 
64  virtual void bmViewAddActiveCallBanner(const std::string& msg, const std::string& icon, uint32_t time);
65  virtual void bmViewRemoveActiveCallBanner();
66  virtual void bmViewUpdateActiveCallBanner(const std::string& msg, const std::string& icon, uint32_t time);
67  virtual void bmViewShowingNonSuppressibleMessage(bool val);
68 
69  void sendClickToActiveBannerWindow(Window* win, int x, int y);
70 
72  ActiveCallBanner* m_activeCallBanner;
73  BannerMessageHandler* m_bmHandler;
74  int m_width;
75  int m_height;
76  int m_msgCount;
77  bool m_ignoreGestureUpEvent;
78 };
79 
80 #endif /* BANNERWINDOW_H */