2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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
9 // http://floralicense.org/license/
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.
19 * @file FUiSystemUtil.h
20 * @brief This is the header file for the SystemUtil
22 * This header file contains the declarations of the SystemUtil class.
26 #ifndef _FUI_SYSTEM_UTIL_H_
27 #define _FUI_SYSTEM_UTIL_H_
29 #include <FUiIKeyEventListener.h>
31 namespace Tizen { namespace Graphics
37 namespace Tizen { namespace Ui
43 * Defines key event types.
49 KEY_EVENT_TYPE_PRESSED, /**< Key pressed event type */
50 KEY_EVENT_TYPE_RELEASED, /**< Key released event type */
54 * @enum TouchEventType
56 * Defines touch event types.
62 TOUCH_EVENT_TYPE_PRESSED, /**< Touch pressed event type */
63 TOUCH_EVENT_TYPE_RELEASED, /**< Touch released event type */
64 TOUCH_EVENT_TYPE_MOVED /**< Touch moved event type */
68 * @if VISPARTNER-MANUFACTURER
70 * @brief This is a class for system utililty such as touch, key, and capturing screen. It provides
71 * functionalities to simulate user inputs.
73 * @final This class is not intended for extension.
74 * @visibility partner-manufacturer
76 * This class provides methods to generate user's input events such as
77 * touch and key events for helping test application and to capture current screen.
80 class _OSP_EXPORT_ SystemUtil
84 * @if VISPARTNER-MANUFACTURER
85 * Generates a key event
88 * @visibility partner-manufacturer
89 * @privilege %http://tizen.org/privilege/inputmanager
91 * @return An error code
92 * @param[in] keyEvent The event type of the key to be generated
93 * @param[in] keyCode The code of the key
94 * @exception E_SUCCESS The method was successful.
95 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
96 * @exception E_OPERATION_FAILED An error occurred in the underlying system.
97 * @exception E_INVALID_ARG The specified @c keyEvent or @c keyCode is not supported.
100 static result GenerateKeyEvent(KeyEventType keyEvent, KeyCode keyCode);
103 * @if VISPARTNER-MANUFACTURER
104 * Generates a touch event
107 * @visibility partner-manufacturer
108 * @privilege %http://tizen.org/privilege/inputmanager
110 * @return An error code
111 * @param[in] touchEvent The event type of the touch to be generated
112 * @param[in] point The point on which the touch occurs
113 * @exception E_SUCCESS The method was successful.
114 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
115 * @exception E_OPERATION_FAILED An error occurred in the underlying system.
116 * @exception E_INVALID_ARG The specified @c touchEvent is not supported.
119 static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point);
122 * @if VISPARTNER-MANUFACTURER
126 * @visibility partner-manufacturer
127 * @privilege %http://tizen.org/privilege/inputmanager
129 * @return A pointer to the captured screen bitmap, @n
130 * else @c null if it fails to capture screen
131 * @exception E_SUCCESS The method was successful.
132 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
133 * @exception E_OPERATION_FAILED An error occurred in the underlying system.
134 * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
135 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
136 * The returned bitmap should be deleted by the application after use.
139 static Tizen::Graphics::Bitmap* CaptureScreenN(void);
143 // This default constructor is intentionally declared as private because this class cannot be constructed.
148 // This destructor is intentionally declared as private because this class cannot be constructed.
150 SystemUtil(const SystemUtil& rhs);
153 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
155 SystemUtil& operator =(const SystemUtil& rhs);
158 // This is a destructor for this class.
159 // This destructor is intentionally declared as private because this class cannot be constructed.