LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HostWindow.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2010-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 HOSTWINDOW_H
23 #define HOSTWINDOW_H
24 
25 #include "Common.h"
26 
27 #include "Window.h"
28 #include "HostWindow.h"
29 #include "HostWindowData.h"
30 #include "InputClient.h"
31 #include <PIpcBuffer.h>
32 #include <PIpcChannelListener.h>
33 
34 class PIpcChannel;
35 class IpcClientHost;
36 class QGraphicsSceneWheelEvent;
37 
38 class HostWindow : public Window
39  , public PIpcChannelListener
40  , public InputClient
41 {
42  Q_OBJECT
43 
44 public:
45 
46  // for non-IPC windows
47  HostWindow(WindowType::Type type, int width, int height, bool hasAlpha);
48  HostWindow(WindowType::Type type, HostWindowData* data, IpcClientHost* clientHost=0);
49  virtual ~HostWindow();
50 
51  int routingId() const;
52 
53  bool isIpcWindow() const { return m_isIpcWindow; }
54  void channelRemoved();
55  void setClientHost(IpcClientHost* clientHost);
56 
57  virtual void close();
58 
59  virtual void setVisibleDimensions(int width, int height) { }
60  virtual void resizeEventSync(int w, int h, bool forceSync=false);
61  virtual void flipEventSync(bool fromQueue = false);
62  virtual void flipEventAsync(QRect windowScreenBounds, bool fromQueue = false);
63  virtual void asynchFlipCompleted(int newWidth, int newHeight, int newScreenWidth, int newScreenHeight);
64  virtual void queuedFlipCanceled(QRect windowScreenBounds);
65  virtual void onMessageReceived(const PIpcMessage& msg);
66  virtual void onDisconnected();
67 
68  virtual void onUpdateWindowRegion(int x, int y, int w, int h);
69  virtual void onUpdateFullWindow();
70  virtual void onUpdateWindowRequest();
71  void onAsynchFlipCompleted(int newWidth, int newHeight, int newScreenWidth, int newScreenHeight);
72 
73  virtual const QPixmap* acquireScreenPixmap();
74 
75  virtual void setComposingText(const std::string& text);
76  virtual void commitComposingText();
77 
78  virtual void commitText(const std::string& text);
79 
80  virtual void performEditorAction(PalmIME::FieldAction action);
81 
82  virtual void removeInputFocus();
83 
84  virtual const HostWindowData* hostWindowData() const { return m_data; }
85 
86 private Q_SLOTS:
87 
88  void slotAboutToSendSyncMessage();
89 
90 protected:
91 
92  virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
93  virtual void onEditorFocusChanged(bool focus, const PalmIME::EditorState& state);
94  void onAutoCapChanged(bool enabled);
95  virtual void onEnableTouchEvents(bool) {}
96 
97 protected:
98 
102 };
103 
104 #endif /* HOSTWINDOW_H */