Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiTouchEffect.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
18 /**
19  * @file        FUiTouchEffect.h
20  * @brief       This is the header file for the %TouchEffect class.
21  *
22  * This header file contains the declarations of the %TouchEffect class.
23  */
24
25 #ifndef _FUI_TOUCH_EFFECT_H_
26 #define _FUI_TOUCH_EFFECT_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseDataType.h>
30 #include <FUiTouchEffectTypes.h>
31
32 namespace Tizen { namespace Ui
33 {
34
35 class _TouchEffectImpl;
36
37 /**
38  * @class               TouchEffect
39  * @brief               This class is used for TouchEffect feature.
40  * @since               2.2
41  *
42  *
43  * The %TouchEffect class is used for accessing device's %TouchEffect feature.
44  * This class also provides features to play effects for input events
45  * such as touch the screen or the keypad.
46  *
47  * The following example demonstrates how to use the %TouchEffect class.
48  *
49  * @code
50  * #include <unique_ptr.h>
51  * #include <FBase.h>
52  * #include <FUi.h>
53  *
54  * using namespace Tizen::Base;
55  * using namespace Tizen::Ui;
56  *
57  * void TouchEffectExample::TouchEffectPlay(void)
58  * {
59  *       unique_ptr<TouchEffect> pTouchEffect(new (std::nothrow) TouchEffect());
60  *
61  *       result r = pTouchEffect->Construct();
62  *       if( IsFailed(r))
63  *       {
64  *           return;
65  *       }
66  *
67  *       r = pTouchEffect->Play(TOUCH_EFFECT_TAP);
68  *       if( IsFailed(r))
69  *       {
70  *           return;
71  *       }
72  *
73  *       r = pTouchEffect->Play(TOUCH_EFFECT_SIP);
74  *       if( IsFailed(r))
75  *       {
76  *           return;
77  *       }
78  *
79  *       r = pTouchEffect->Play(TOUCH_EFFECT_NO_SOUND);
80  *       if( IsFailed(r))
81  *       {
82  *           return;
83  *       }
84  *
85  * }
86  * @endcode
87  * @n
88  */
89
90 class _OSP_EXPORT_ TouchEffect
91         : public Tizen::Base::Object
92 {
93
94 public:
95         /**
96          * The object is not fully constructed after this constructor is called. For full construction, @n
97          * the Construct() method must be called right after calling this constructor.
98          *
99          * @since       2.2
100          */
101         TouchEffect(void);
102
103         /**
104          * This destructor overrides Tizen::Base::Object::~Object().
105          *
106          * @since       2.2
107          */
108         virtual ~TouchEffect(void);
109
110        /**
111         * Initializes this instance of %TouchEffect. @n
112         * Every application must call %Construct() before calling any other method of %TouchEffect.
113         *
114         * @return       An error code
115         * @exception    E_SUCCESS               The method is successful.
116         * @exception    E_OPERATION_FAILED      The operation has failed.
117         */
118         result Construct(void);
119
120        /**
121         * Plays a predefined effect.
122         *
123         * @since        2.2
124         *
125         * @return       An error code
126         * @param[in]    type    The type of touch for which effect is to be played e.g. SIP, TAP
127         * @exception    E_SUCCESS       The method is successful.
128         * @exception    E_SYSTEM        A system error has occurred.
129         * @exception    E_INVALID_ARG   The specified @c type is invalid.
130         */
131         result Play(TouchEffectType type);
132
133 private:
134         /**
135          * The implementation of this copy constructor is intentionally blank and declared as private @n
136          * to prohibit copying of objects.
137          *
138          * @since       2.2
139          */
140         TouchEffect(const TouchEffect& value);
141
142         /**
143          * The implementation of this copy assignment operator is intentionally blank and declared as private @n
144          * to prohibit copying of objects.
145          *
146          * @since       2.2
147          */
148         TouchEffect& operator =(const TouchEffect& value);
149
150 private:
151         _TouchEffectImpl* __pTouchEffectImpl;
152         friend class _TouchEffectImpl;
153
154 }; // TouchEffect
155
156 } }// Tizen::Ui
157
158 #endif // _FUI_TOUCH_EFFECT_H_