summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_text_format.eo
blob: 14d80a107c7e6e715c1a27e206acf3772b8911e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
enum @beta Efl.Text_Format_Wrap {
   [[Wrapping policy for the text.]]
   none, [[No wrapping.]]
   char, [[Wrap at character boundaries.]]
   word, [[Wrap at word boundaries.]]
   mixed, [[Wrap at word boundaries if possible, at any character if not.]]
   hyphenation [[Hyphenate if possible, otherwise try word boundaries or
                 at any character.]]
}

enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type {
   [[Automatic horizontal alignment setting for the text (Left-To-Right or Right-To-Left).]]
   none,   [[No auto-alignment rule: Horizontal Alignment is decided by @Efl.Text_Format.text_horizontal_align]]
   auto,   [[Respects LTR/RTL (bidirectional) characters found inside the text content.]]
   locale, [[Respects the system's language settings.]]
   opposite  [[Text is placed at opposite side of LTR/RTL (bidirectional) settings.]]
}

interface @beta Efl.Text_Format {
   [[The look and layout of the text.

     The text format can affect the geometry of the text object, as well as
     how characters are presented.
   ]]
   c_prefix: efl_text;
   methods {
      @property ellipsis {
         [[Controls automatic addition of ellipsis "..." to replace text which cannot be shown.
           The value must be a number indicating the position of the ellipsis inside the visible text.
           $[0.0] means the beginning of the text, $[1.0] means the end of the text, and values in between
           mean the proportional position inside the text.
           Any value smaller than 0 or greater than 1 disables ellipsis.
         ]]
         values
         {
            value: double; [[Position of the ellipsis inside the text, from $[0.0] to $[1.0].]]
         }
      }

      @property wrap {
         [[Wrapping policy for the text.

           When text does not fit the widget in a single line, it can be automatically wrapped at
           character or word boundaries, for example.

           Requires @.multiline to be $true.
         ]]
         values {
            wrap: Efl.Text_Format_Wrap; [[Wrapping policy.]]
         }
      }

      @property multiline {
         [[Enables text to span multiple lines.

           When $false, new-line characters are ignored and no text wrapping occurs.
         ]]
         values {
            enabled: bool; [[$true if multiple lines should be rendered.]]
         }
      }

      @property text_horizontal_align_auto_type {
         [[Specifies when the text's horizontal alignment should be set automatically.]]
         values {
            value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Automatic horizontal alignment type.]]
         }
      }

      @property text_horizontal_align {
         [[Manual horizontal alignment of text. $[0.0] means "left"
           and $[1.0] means "right".
           Setting this value also sets @.text_horizontal_align_auto_type to
           @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none.
           This value is ignored when @.text_horizontal_align_auto_type is set to anything other than
           @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none.
         ]]
         values {
            value: double; [[Alignment value between $[0.0] and $[1.0].]]
         }
      }

      @property text_vertical_align {
         [[Vertical alignment of text. $[0.0] means "top"
           and $[1.0] means "bottom"]]
         values {
            value: double; [[Alignment value between $[0.0] and $[1.0].]]
         }
      }

      @property line_gap {
         [[Minimal line gap (top and bottom) for each line in the text.

           $value is absolute size.
         ]]
         values
         {
            value: double; [[Line gap value, in pixels.]]
         }
      }

      @property line_rel_gap {
         [[Relative line gap (top and bottom) for each line in the text.

           The original line gap value is multiplied by $value.
         ]]
         values
         {
            value: double; [[Relative line gap value. $[1.0] means original size.]]
         }
      }

      @property tab_stops {
         [[Size (in pixels) of the tab character.]]
         values
         {
            value: int; [[Size in pixels, greater than 1.]]
         }
      }

      @property password {
         [[Enabling this causes all characters to be replaced by @.replacement_char.

           This is useful for password input boxes.
         ]]
         values
         {
            enabled: bool; [[$true if the text is a password.]]
         }
      }

      @property replacement_char {
         [[The character used to replace characters that can't be displayed.

           Only used to replace characters if @.password is enabled.
         ]]
         values {
            repch: string; [[Replacement character.]]
         }
      }
   }
}