069551c0a4fe52e387e678a27df747c30a003f97
[platform/framework/web/crosswalk-tizen.git] /
1 // Copyright 2013 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ewk_text_style_private_h
6 #define ewk_text_style_private_h
7
8 #include <string>
9 #include <vector>
10
11 #include <Eina.h>
12 #include <Evas.h>
13
14 #include <ui/gfx/geometry/point.h>
15
16 struct SelectionColor {
17   int r;
18   int g;
19   int b;
20   int a;
21 };
22
23 struct SelectionStylePrams {
24   int underline_state;
25   int italic_state;
26   int bold_state;
27   SelectionColor bg_color;
28   SelectionColor color;
29   std::string font_size;
30   int order_list_state;
31   int un_order_list_state;
32   int text_align_center_state;
33   int text_align_left_state;
34   int text_align_right_state;
35   int text_align_full_state;
36   int has_composition;
37 };
38
39 struct _Ewk_Text_Style {
40   _Ewk_Text_Style(const SelectionStylePrams& params, const gfx::Point& start_point, const gfx::Point& end_point) {
41     selectionParams = params;
42
43     position.startPoint.x = start_point.x();
44     position.startPoint.y = start_point.y();
45     position.endPoint.x = end_point.x();
46     position.endPoint.y = end_point.y();
47
48     bgColor = params.bg_color;
49     color = params.color;
50     fontSize = eina_stringshare_add(params.font_size.c_str());
51     hasComposition = params.has_composition;
52   }
53
54   ~_Ewk_Text_Style() {
55     eina_stringshare_del(fontSize);
56   }
57
58   SelectionStylePrams selectionParams;
59   Eina_Stringshare* fontSize;
60   Eina_Bool hasComposition;
61
62   struct {
63     Evas_Point startPoint;
64     Evas_Point endPoint;
65   } position;
66
67   SelectionColor bgColor;
68   SelectionColor color;
69 };
70
71 #endif