Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiAccessibilityContainer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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         FUiAccessibilityContainer.h
20  * @brief         This is the header file for the AccessibilityContainer class.
21  *
22  * This header file contains the declarations of the AccessibilityContainer class.
23  */
24
25 #ifndef _FUI_ACCESSIBILITY_CONTAINER_H_
26 #define _FUI_ACCESSIBILITY_CONTAINER_H_
27
28 #include <FOspConfig.h>
29 #include <FBaseObject.h>
30 #include <FUiAccessibilityTypes.h>
31
32 namespace Tizen { namespace Base
33 {
34 class String;
35 }} // Tizen::Base
36
37 namespace Tizen { namespace Base { namespace Collection
38 {
39 class IList;
40 }}} //Tizen::Base::Collection
41
42
43 namespace Tizen { namespace Ui
44 {
45
46 class Control;
47 class AccessibilityElement;
48 class IAccessibilityListener;
49 class _AccessibilityContainerImpl;
50
51 /**
52 * @class                AccessibilityContainer
53 * @brief                This class represents a container for accessibility element.
54 * @since                2.0
55 *
56 *
57 * @final                This class is not intended for extension.
58 * This class represents a container for accessibility element.
59  * The following example demonstrates how to use the %AccessibilityContainer class.
60 .*
61  * @code
62 // Sample code for AccessibilitySample.h
63 #include <FGraphics.h>
64 #include <FUi.h>
65
66 class AccessibilitySample 
67         : public Tizen::Ui::Controls::Form
68 {
69 public:
70         AccessibilitySample(void);
71         virtual ~AccessibilitySample(void);
72
73         result Initialize(void);
74
75         virtual result OnInitializing(void);
76
77
78 private:
79         static const int ID_FOOTER_ITEM1 = 101;
80         static const int ID_FOOTER_ITEM2 = 102;
81
82         Tizen::Graphics::Bitmap *__pTizenBitmap;
83 };
84
85  *      @endcode
86  *
87  * @final               This class is not intended for extension.
88  * This class represents a container for accessibility element.
89  */
90 class _OSP_EXPORT_ AccessibilityContainer
91         : public Tizen::Base::Object
92 {
93 public:
94         /**
95          * Gets the owner of the accessibility container
96          *
97          * @since               2.0
98          * @return      The control which owns this %AccessibilityContainer
99          * @see         Control::GetAccessibilityContainer()
100          */
101         const Control* GetOwner(void) const;
102
103         /**
104          * Gets the owner of the accessibility container
105          *
106          * @since               2.0
107          * @return      The control which owns this %AccessibilityContainer
108          * @see         Control::GetAccessibilityContainer()
109          */
110         Control* GetOwner(void);
111
112         /**
113          * Adds the IAccessibilityListener instance to the %AccessibilityContainer. @n
114          * The added listener gets notified when the accessibility status is changed.
115          *
116          * @since               2.0
117          * @return An error code
118          * @param[in] listener  The event listener to add
119          * @exception E_SUCCESS The method is successful.
120          * @exception E_OBJ_ALREADY_EXIST       The instance of IAccessibilityListener is already registered.
121          * @see         RemoveAccessibilityListener()
122          */
123         result AddAccessibilityListener(IAccessibilityListener& listener);
124
125         /**
126          * Removes the IAccessibilityListener listener instance. @n
127          * The removed listener is not notified even when the accessibility status is changed.
128          *
129          *
130          * @since               2.0
131          * @return An error code
132          * @param[in] listener  The listener to remove
133          * @exception E_SUCCESS The method is successful.
134          * @exception E_OBJ_NOT_FOUND   The instance of listener is not found.
135          * @see         AddAccessibilityListener()
136          */
137         result RemoveAccessibilityListener(IAccessibilityListener& listener);
138
139         /**
140          * Adds the accessibility element to the %AccessibilityContainer.
141          *
142          * @since               2.0
143          * @return An error code
144          * @param[in] element   The instance of AccessibilityElement
145          * @exception E_SUCCESS The method is successful.
146          * @exception E_OBJ_ALREADY_EXIST       The instance of AccessibilityElement is already registered.
147          * @see         RemoveElement(), RemoveAllElements()
148          *
149          */
150         result AddElement(AccessibilityElement& element);
151
152         /**
153          * Removes the accessibility element in the %AccessibilityContainer.
154          *
155          * @since               2.0
156          *
157          * @return An error code
158          *
159          * @param[in] element   The instance of AccessibilityElement
160          *
161          * @exception E_SUCCESS The method is successful.
162          * @exception E_OBJ_NOT_FOUND   The instance of AccessibilityElement is already registered.
163          * @see         AddElement(), InsertElement()
164          *
165          */
166         result RemoveElement(AccessibilityElement& element);
167
168         /**
169          * Removes all of the accessibility elements in the %AccessibilityContainer.
170          *
171          * @since               2.0
172          *
173          * @see         AddElement, InsertElement
174          *
175          */
176         void RemoveAllElements(void);
177
178         /**
179          * Gets the instance of accessibility element which is the child of the %AccessibilityContainer by the name.
180          *
181          * @since               2.0
182          *
183          * @return      The instance of child element, if there exists an element which has the given name @n
184          *                      else @c null
185          *
186          * @param[in] name The name of AccessibilityElement
187          *
188          */
189         AccessibilityElement* GetElement(const Tizen::Base::String& name) const;
190
191         /**
192          * Gets the list of accessibility elements that are the child of the %AccessibilityContainer.
193          *
194          * @since               2.0
195          *
196          * @return      The list of child element, if there exists some elements in the container. @n
197          *                      else @c null.
198          *
199          */
200         Tizen::Base::Collection::IList* GetElementsN(void) const;
201
202 private:
203         //
204         // This default constructor is intentionally declared as private so that only the platform can create an instance
205         //
206         AccessibilityContainer(void);
207
208         //
209         // This destructor is intentionally declared as private so that only the platform can delete an instance.
210         //
211         virtual ~AccessibilityContainer(void);
212
213         //
214         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
215         //
216         AccessibilityContainer(const AccessibilityContainer& rhs);
217
218         //
219         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
220         //
221         AccessibilityContainer& operator =(const AccessibilityContainer& rhs);
222
223 private:
224         _AccessibilityContainerImpl* __pAccessibilityContainerImpl;
225         friend class _AccessibilityContainerImpl;
226 }; // AccessibilityContainer
227
228 }} // Tizen::Ui
229 #endif //_FUI_ACCESSIBILITY_CONTAINER_H_