build: get doxygen generating selective
[platform/core/uifw/aurum.git] / libaurum / inc / Accessibility / AccessibleUtils.h
1 #pragma once
2 //#include <atspi/atspi.h>
3 #include <gio/gio.h>
4
5 #include <string.h>
6 #include <memory>
7
8 #include "config.h"
9
10 /**
11  * @brief TBD
12  * @since_tizen 5.5
13  */
14 struct GobjDeletor {
15     void operator()(gpointer ptr) const
16     {
17         if (ptr) g_object_unref(ptr);
18     }
19 };
20
21 /**
22  * @brief TBD
23  * @since_tizen 5.5
24  */
25 struct GarrayDeletor {
26     void operator()(GArray *ptr) const
27     {
28         if (ptr) g_array_free(ptr, 1);
29     }
30 };
31
32 /**
33  * @brief TBD
34  * @since_tizen 5.5
35  */
36 template <class T>
37 using unique_ptr_gobj = std::unique_ptr<T, GobjDeletor>;
38
39 /**
40  * @brief TBD
41  * @since_tizen 5.5
42  */
43 template <class T>
44 using unique_ptr_garray = std::unique_ptr<T, GarrayDeletor>;
45
46 /**
47  * @brief TBD
48  * @since_tizen 5.5
49  */
50 template <class T>
51 unique_ptr_gobj<T> make_gobj_unique(T *ptr)
52 {
53     return unique_ptr_gobj<T>(ptr);
54 }
55
56 /**
57  * @brief TBD
58  * @since_tizen 5.5
59  */
60 template <class T>
61 unique_ptr_garray<T> make_garray_unique(T *ptr)
62 {
63     return unique_ptr_garray<T>(ptr);
64 }
65
66 /**
67  * @brief TBD
68  * @since_tizen 5.5
69  */
70 template <class T>
71 unique_ptr_gobj<T> make_gobj_ref_unique(T *ptr)
72 {
73     g_object_ref(ptr);
74     return unique_ptr_gobj<T>(ptr);
75 }
76
77 /**
78  * @brief TBD
79  * @since_tizen 5.5
80  */
81 template <class T>
82 std::shared_ptr<T> make_gobj_shared(T *ptr)
83 {
84     return std::shared_ptr<T>(ptr, [](T *ptr){ if(ptr) g_object_unref(ptr); });
85 }
86
87 /**
88  * @brief TBD
89  * @since_tizen 5.5
90  */
91 template <class T>
92 std::shared_ptr<T> make_garray_shared(T *ptr)
93 {
94     return std::shared_ptr<T>(ptr,  [](T *ptr){ if(ptr) g_array_free(ptr, 1); });
95 }
96
97 /**
98  * @brief TBD
99  * @since_tizen 5.5
100  */
101 template <class T>
102 std::shared_ptr<T> make_gobj_ref_shared(T *ptr)
103 {
104     g_object_ref(ptr);
105     return std::shared_ptr<T>(ptr,  [](T *ptr){ if(ptr) g_object_unref(ptr); });
106 }
107
108 /**
109  * @brief TBD
110  * @since_tizen 5.5
111  */
112 //char *state_to_char(AtspiStateType state);