Merge "Fix bug[N_SE-37282]" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiIInputConnectionProvider.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-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                FUiIInputConnectionProvider.h
20  * @brief       This is the header file for the %IInputConnectionProvider interface.
21  *
22  * This header file contains the declarations of the %IInputConnectionProvider interface.
23  *
24  *
25  */
26
27 #ifndef _FUI_IINPUT_CONNECTION_PROVIDER_H_
28 #define _FUI_IINPUT_CONNECTION_PROVIDER_H_
29
30 #include <FOspConfig.h>
31
32 namespace Tizen { namespace Base {
33         class String;
34 }} // Tizen::Base
35
36 namespace Tizen { namespace Ui {
37
38 class InputConnection;
39
40 /**
41  * @interface   IInputConnectionProvider
42  * @brief       This interface defines methods for processing between the InputConnection and the input method.
43  *
44  * @since 2.0
45  *
46  * The %IInputConnectionProvider interface defines methods for processing between the InputConnection and the input method. It is possible to not work the callback depending on the current active Input Method.
47  */
48 class _OSP_EXPORT_ IInputConnectionProvider
49 {
50 public:
51         /**
52          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
53          *
54          * @since 2.0
55          */
56         virtual ~IInputConnectionProvider(void) {}
57
58         /**
59          * Called when the text needs to be deleted.
60          *
61          * @since 2.0
62          * @param[in]       source                  The source of the event
63          * @param[in]       offset                   The position to delete before the current cursor position
64          * @param[in]       charCount             The number of characters to delete
65          */
66         virtual void DeleteSurroundingText(Tizen::Ui::InputConnection& source, int offset, int charCount) = 0;
67
68         /**
69          * Called when the input method requests the previous text.
70          *
71          * @since 2.0
72          * @param[in]   source          The source of the event
73          * @param[out]  text                    The text to send to the Input Method
74          * @param[out]  cursorPosition  The current cursor position to send to the Input Method
75          * @remarks      The text will be used for processing the auto-capitalization/auto-period. At least three letters in front of the cursor are required.
76          */
77         virtual void GetPreviousText(Tizen::Ui::InputConnection& source, Tizen::Base::String& text, int& cursorPosition) = 0;
78
79 protected:
80         //
81         // This method is for internal use only. Using this method can cause behavioral, security-related,
82         // and consistency-related issues in the application.
83         //
84         // This method is reserved and may change its name at any time without
85         // prior notice.
86         //
87         virtual void IInputConnectionProvider_Reserved1(void) {}
88
89         //
90         // This method is for internal use only. Using this method can cause behavioral, security-related,
91         // and consistency-related issues in the application.
92         //
93         // This method is reserved and may change its name at any time without
94         // prior notice.
95         //
96         virtual void IInputConnectionProvider_Reserved2(void) {}
97
98         //
99         // This method is for internal use only. Using this method can cause behavioral, security-related,
100         // and consistency-related issues in the application.
101         //
102         // This method is reserved and may change its name at any time without
103         // prior notice.
104         //
105         virtual void IInputConnectionProvider_Reserved3(void) {}
106 }; // IInputConnectionProvider
107
108 }} // Tizen::Ui
109 #endif // _FUI_IINPUT_CONNECTION_PROVIDER_H_
110