Add a callback for navigation policy in web engine.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / atspi-interfaces / hyperlink.h
1 #ifndef DALI_ADAPTOR_ATSPI_HYPERLINK_H
2 #define DALI_ADAPTOR_ATSPI_HYPERLINK_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 <cstdint>
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/atspi-interfaces/accessible.h>
26
27 namespace Dali::Accessibility
28 {
29 /**
30  * @brief Interface representing a hyperlink in hypertext .
31  */
32 class Hyperlink : public virtual Accessible
33 {
34 public:
35   /**
36    * @brief Gets the index of character in originating hypertext at which this hyperlink ends.
37    *
38    * @return The 0-based index of hyperlink's last character + 1, in its originating hypertext.
39    */
40   virtual int32_t GetEndIndex() const = 0;
41
42   /**
43    * @brief Gets the index of character in originating hypertext at which this hyperlink starts.
44    *
45    * @return The 0-based index of hyperlink's first character, in its originating hypertext.
46    */
47   virtual int32_t GetStartIndex() const = 0;
48
49   /**
50    * @brief Gets the total number of anchors which this hyperlink has. Though, typical hyperlinks will have only one anchor.
51    *
52    * @return The number of anchors.
53    */
54   virtual int32_t GetAnchorCount() const = 0;
55
56   /**
57    * @brief Gets the object associated with a particular hyperlink's anchor.
58    *
59    * @param[in] anchorIndex The 0-based index in anchor collection.
60    *
61    * @return The handle to accessible object.
62    */
63   virtual Accessible* GetAnchorAccessible(int32_t anchorIndex) const = 0;
64
65   /**
66    * @brief Gets the URI associated with a particular hyperlink's anchor.
67    *
68    * @param[in] anchorIndex The 0-based index in anchor collection.
69    *
70    * @return The string containing URI.
71    */
72   virtual std::string GetAnchorUri(int32_t anchorIndex) const = 0;
73
74   /**
75    * @brief Tells whether this hyperlink object is still valid with respect to its originating hypertext object.
76    *
77    * @return True if hyperlink object is valid, false otherwise
78    */
79   virtual bool IsValid() const = 0;
80 };
81
82 } // namespace Dali::Accessibility
83
84 #endif // DALI_ADAPTOR_ATSPI_HYPERLINK_H