Move enum types to hb-common.h
[profile/ivi/org.tizen.video-player.git] / src / hb-unicode.h
1 /*
2  * Copyright (C) 2009  Red Hat, Inc.
3  *
4  *  This is part of HarfBuzz, a text shaping library.
5  *
6  * Permission is hereby granted, without written agreement and without
7  * license or royalty fees, to use, copy, modify, and distribute this
8  * software and its documentation for any purpose, provided that the
9  * above copyright notice and the following two paragraphs appear in
10  * all copies of this software.
11  *
12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16  * DAMAGE.
17  *
18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23  *
24  * Red Hat Author(s): Behdad Esfahbod
25  */
26
27 #ifndef HB_UNICODE_H
28 #define HB_UNICODE_H
29
30 #include "hb-common.h"
31
32 HB_BEGIN_DECLS
33
34
35 /*
36  * hb_unicode_funcs_t
37  */
38
39 typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t;
40
41 hb_unicode_funcs_t *
42 hb_unicode_funcs_create (void);
43
44 hb_unicode_funcs_t *
45 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
46
47 unsigned int
48 hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs);
49
50 void
51 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);
52
53 hb_unicode_funcs_t *
54 hb_unicode_funcs_copy (hb_unicode_funcs_t *ufuncs);
55
56 void
57 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
58
59 hb_bool_t
60 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs);
61
62 /*
63  * funcs
64  */
65
66
67 /* typedefs */
68
69 typedef hb_codepoint_t (*hb_unicode_get_mirroring_func_t) (hb_codepoint_t unicode);
70 typedef hb_unicode_general_category_t (*hb_unicode_get_general_category_func_t) (hb_codepoint_t unicode);
71 typedef hb_script_t (*hb_unicode_get_script_func_t) (hb_codepoint_t unicode);
72 typedef unsigned int (*hb_unicode_get_combining_class_func_t) (hb_codepoint_t unicode);
73 typedef unsigned int (*hb_unicode_get_eastasian_width_func_t) (hb_codepoint_t unicode);
74
75
76 /* setters */
77
78 void
79 hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
80                                      hb_unicode_get_mirroring_func_t mirroring_func);
81
82 void
83 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
84                                             hb_unicode_get_general_category_func_t general_category_func);
85
86 void
87 hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
88                                   hb_unicode_get_script_func_t script_func);
89
90 void
91 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
92                                            hb_unicode_get_combining_class_func_t combining_class_func);
93
94 void
95 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
96                                            hb_unicode_get_eastasian_width_func_t eastasian_width_func);
97
98
99 /* getters */
100
101 /* These never return NULL.  Return fallback defaults instead. */
102
103 hb_unicode_get_mirroring_func_t
104 hb_unicode_funcs_get_mirroring_func (hb_unicode_funcs_t *ufuncs);
105
106 hb_unicode_get_general_category_func_t
107 hb_unicode_funcs_get_general_category_func (hb_unicode_funcs_t *ufuncs);
108
109 hb_unicode_get_script_func_t
110 hb_unicode_funcs_get_script_func (hb_unicode_funcs_t *ufuncs);
111
112 hb_unicode_get_combining_class_func_t
113 hb_unicode_funcs_get_combining_class_func (hb_unicode_funcs_t *ufuncs);
114
115 hb_unicode_get_eastasian_width_func_t
116 hb_unicode_funcs_get_eastasian_width_func (hb_unicode_funcs_t *ufuncs);
117
118
119 /* accessors */
120
121 hb_codepoint_t
122 hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
123                           hb_codepoint_t unicode);
124
125 hb_unicode_general_category_t
126 hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs,
127                                  hb_codepoint_t unicode);
128
129 hb_script_t
130 hb_unicode_get_script (hb_unicode_funcs_t *ufuncs,
131                        hb_codepoint_t unicode);
132
133 unsigned int
134 hb_unicode_get_combining_class (hb_unicode_funcs_t *ufuncs,
135                                 hb_codepoint_t unicode);
136
137 unsigned int
138 hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
139                                 hb_codepoint_t unicode);
140
141
142 HB_END_DECLS
143
144 #endif /* HB_UNICODE_H */