Merge "Add a callback for navigation policy in web engine." into devel/master
[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 #include <dali/devel-api/atspi-interfaces/text.h>
26
27 namespace Dali::Accessibility
28 {
29 /**
30  * @brief Interface representing objects which can store editable texts.
31  *
32  * @note Paste method is entirely implemented inside bridge
33  *
34  * @see Dali::Accessibility::EditableText
35  */
36 class DALI_ADAPTOR_API EditableText : public virtual Accessible, public virtual Text
37 {
38 public:
39   /**
40    * @brief Copies text in range to system clipboard.
41    *
42    * @param[in] startPosition The index of first character
43    * @param[in] endPosition The index of first character after the last one expected
44    *
45    * @return true on success, false otherwise
46    */
47   virtual bool CopyText(std::size_t startPosition, std::size_t endPosition) = 0;
48
49   /**
50    * @brief Cuts text in range to system clipboard.
51    *
52    * @param[in] startPosition The index of first character
53    * @param[in] endPosition The index of first character after the last one expected
54    *
55    * @return true on success, false otherwise
56    */
57   virtual bool CutText(std::size_t startPosition, std::size_t endPosition) = 0;
58
59   /**
60    * @brief Deletes text in range.
61    *
62    * @param[in] startPosition The index of first character
63    * @param[in] endPosition The index of first character after the last one expected
64    *
65    * @return true on success, false otherwise
66    */
67   virtual bool DeleteText(std::size_t startPosition, std::size_t endPosition) = 0;
68
69   /**
70    * @brief Inserts text at startPosition.
71    *
72    * @param[in] startPosition The index of first character
73    * @param[in] text The text content
74    *
75    * @return true on success, false otherwise
76    */
77   virtual bool InsertText(std::size_t startPosition, std::string text) = 0;
78
79   /**
80    * @brief Replaces text with content.
81    *
82    * @param[in] newContents The text content
83    *
84    * @return true on success, false otherwise
85    */
86   virtual bool SetTextContents(std::string newContents) = 0;
87 };
88
89 } // namespace Dali::Accessibility
90
91 #endif // DALI_ADAPTOR_ATSPI_EDITABLE_TEXT_H