NXWidgets  1.19
cfullscreenwindow.hxx
Go to the documentation of this file.
1 /****************************************************************************
2  * NxWidgets/nxwm/include/cfullscreenwindow.hxx
3  *
4  * Copyright (C) 2012 Gregory Nutt. All rights reserved.
5  * Author: Gregory Nutt <gnutt@nuttx.org>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
18  * me be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ****************************************************************************/
35 
36 #ifndef __INCLUDE_CFULLSCREENWINDOW_NXX
37 #define __INCLUDE_CFULLSCREENWINDOW_NXX
38 
39 /****************************************************************************
40  * Included Files
41  ****************************************************************************/
42 
43 #include <nuttx/config.h>
44 
45 #include "cnxwindow.hxx"
46 #include "cwidgetcontrol.hxx"
47 
48 #include "iapplicationwindow.hxx"
49 
50 /****************************************************************************
51  * Pre-Processor Definitions
52  ****************************************************************************/
53 
54 /****************************************************************************
55  * Implementation Classes
56  ****************************************************************************/
57 
58 #if defined(__cplusplus)
59 
60 namespace NxWM
61 {
62  /**
63  * This class represents a generic window. This bland window is used,
64  * for example, to support full screen displays.
65  */
66 
68  {
69  protected:
70  NXWidgets::CNxWindow *m_window; /**< The generic window used by the application */
71 
72  public:
73 
74  /**
75  * CFullScreenWindow Constructor
76  *
77  * @param window. The raw window to be used by this full screen application.
78  */
79 
81 
82  /**
83  * CFullScreenWindow Destructor
84  */
85 
86  ~CFullScreenWindow(void);
87 
88  /**
89  * Initialize window. Window initialization is separate from
90  * object instantiation so that failures can be reported.
91  *
92  * @return True if the window was successfully initialized.
93  */
94 
95  bool open(void);
96 
97  /**
98  * Re-draw the application window
99  */
100 
101  void redraw(void);
102 
103  /**
104  * The application window is hidden (either it is minimized or it is
105  * maximized, but not at the top of the hierarchy)
106  */
107 
108  void hide(void);
109 
110  /**
111  * Recover the contained NXTK window instance
112  *
113  * @return. The window used by this application
114  */
115 
116  NXWidgets::INxWindow *getWindow(void) const;
117 
118  /**
119  * Recover the contained widget control
120  *
121  * @return. The widget control used by this application
122  */
123 
125 
126  /**
127  * Block further activity on this window in preparation for window
128  * shutdown.
129  *
130  * @param app. The application to be blocked
131  */
132 
133  void block(IApplication *app);
134 
135  /**
136  * Set the window label
137  *
138  * @param appname. The name of the application to place on the window
139  */
140 
141  void setWindowLabel(NXWidgets::CNxString &appname);
142 
143  /**
144  * Report of this is a "normal" window or a full screen window. The
145  * primary purpose of this method is so that window manager will know
146  * whether or not it show draw the task bar.
147  *
148  * @return True if this is a full screen window.
149  */
150 
151  bool isFullScreen(void) const;
152 
153  /**
154  * Register to receive callbacks when toolbar icons are selected
155  */
156 
157  void registerCallbacks(IApplicationCallback *callback);
158 
159  /**
160  * Simulate a mouse click or release on the minimize icon. This method
161  * is only available for automated testing of NxWM.
162  *
163  * @param click. True to click; false to release;
164  */
165 
166 #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
167  void clickMinimizePosition(bool click);
168 #endif
169 
170  /**
171  * Simulate a mouse click or release on the stop icon. This method
172  * is only available for automated testing of NxWM.
173  *
174  * @param click. True to click; false to release;
175  */
176 
177 #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
178  void clickStopIcon(bool click);
179 #endif
180  };
181 }
182 
183 #endif // __cplusplus
184 
185 #endif // __INCLUDE_CFULLSCREENWINDOW_NXX
void block(IApplication *app)
void registerCallbacks(IApplicationCallback *callback)
NXWidgets::CWidgetControl * getWidgetControl(void) const
void setWindowLabel(NXWidgets::CNxString &appname)
void clickStopIcon(bool click)
NXWidgets::INxWindow * getWindow(void) const
CFullScreenWindow(NXWidgets::CNxWindow *window)
NXWidgets::CNxWindow * m_window
void clickMinimizePosition(bool click)