Add a callback for navigation policy in web engine.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / atspi-interfaces / editable-text.h
1 #ifndef DALI_ADAPTOR_ATSPI_EDITABLE_TEXT_H
2 #define DALI_ADAPTOR_ATSPI_EDITABLE_TEXT_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // EXTERNAL INCLUDES
21 #include <string>
22
23 // INTERNAL INCLUDES
24 #include <dali/devel-api/atspi-interfaces/accessible.h>
25
26 namespace Dali::Accessibility
27 {
28 /**
29  * @brief Interface representing objects which can store editable texts.
30  *
31  * @note Paste method is entirely implemented inside bridge
32  *
33  * @see Dali::Accessibility::EditableText
34  */
35 class DALI_ADAPTOR_API EditableText : public virtual Accessible
36 {
37 public:
38   /**
39    * @brief Copies text in range to system clipboard.
40    *
41    * @param[in] startPosition The index of first character
42    * @param[in] endPosition The index of first character after the last one expected
43    *
44    * @return true on success, false otherwise
45    */
46   virtual bool CopyText(size_t startPosition, size_t endPosition) = 0;
47
48   /**
49    * @brief Cuts text in range to system clipboard.
50    *
51    * @param[in] startPosition The index of first character
52    * @param[in] endPosition The index of first character after the last one expected
53    *
54    * @return true on success, false otherwise
55    */
56   virtual bool CutText(size_t startPosition, size_t endPosition) = 0;
57
58   /**
59    * @brief Deletes text in range.
60    *
61    * @param[in] startPosition The index of first character
62    * @param[in] endPosition The index of first character after the last one expected
63    *
64    * @return true on success, false otherwise
65    */
66   virtual bool DeleteText(size_t startPosition, size_t endPosition) = 0;
67
68   /**
69    * @brief Inserts text at startPosition.
70    *
71    * @param[in] startPosition The index of first character
72    * @param[in] text The text content
73    *
74    * @return true on success, false otherwise
75    */
76   virtual bool InsertText(size_t startPosition, std::string text) = 0;
77
78   /**
79    * @brief Replaces text with content.
80    *
81    * @param[in] newContents The text content
82    *
83    * @return true on success, false otherwise
84    */
85   virtual bool SetTextContents(std::string newContents) = 0;
86 };
87
88 } // namespace Dali::Accessibility
89
90 #endif // DALI_ADAPTOR_ATSPI_EDITABLE_TEXT_H