1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Defines an interface to be implemented by components wishing to display
17 some object that may be dynamically resized."""
18
19
21 """Interface to be implemented by components wishing to display some
22 object that may be dynamically resized during runtime.
23
24 @author: Vaadin Ltd.
25 @author: Richard Lincoln
26 @version: 1.1.2
27 """
28
29
30 UNITS_PIXELS = 0
31
32
33 UNITS_POINTS = 1
34
35
36 UNITS_PICAS = 2
37
38
39 UNITS_EM = 3
40
41
42 UNITS_EX = 4
43
44
45 UNITS_MM = 5
46
47
48 UNITS_CM = 6
49
50
51 UNITS_INCH = 7
52
53
54
55 UNITS_PERCENTAGE = 8
56
57 SIZE_UNDEFINED = -1
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 UNIT_SYMBOLS = ['px', 'pt', 'pc', 'em', 'ex', 'mm', 'cm', 'in', '%']
74
75
77 """Gets the width of the object. Negative number implies unspecified
78 size (terminal is free to set the size).
79
80 @return: width of the object in units specified by widthUnits property.
81 """
82 raise NotImplementedError
83
84
86 """Sets the width of the object. Negative number implies unspecified
87 size (terminal is free to set the size).
88
89 @param args: tuple of the form
90 - (width)
91 1. the width of the object in units specified by widthUnits
92 propertyor in CSS style string representation, null or
93 empty string to reset
94 - (width, unit)
95 1. the width of the object.
96 2. the unit used for the width. Possible values include
97 L{UNITS_PIXELS}, L{UNITS_POINTS},
98 L{UNITS_PICAS}, L{UNITS_EM}, L{UNITS_EX},
99 L{UNITS_MM}, L{UNITS_CM}, L{UNITS_INCH},
100 L{UNITS_PERCENTAGE}.
101
102 See U{CSS specification
103 <http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length>} for
104 more details.
105 """
106 raise NotImplementedError
107
108
110 """Gets the height of the object. Negative number implies unspecified
111 size (terminal is free to set the size).
112
113 @return: height of the object in units specified by heightUnits
114 property.
115 """
116 raise NotImplementedError
117
118
120 """Sets the height of the object. Negative number implies unspecified
121 size (terminal is free to set the size).
122
123 @param args: tuple of the form
124 - (height)
125 1. the height of the object in units specified by
126 heightUnits property or the height of the component using
127 string presentation. String presentation is similar to
128 what is used in Cascading Style Sheets. Size can be
129 length or percentage of available size.
130 - (height, unit)
131 1. the height of the object.
132 2. the unit used for the width. Possible values include
133 L{UNITS_PIXELS}, L{UNITS_POINTS},
134 L{UNITS_PICAS}, L{UNITS_EM}, L{UNITS_EX},
135 L{UNITS_MM}, L{UNITS_CM}, L{UNITS_INCH},
136 L{UNITS_PERCENTAGE}.
137 """
138 raise NotImplementedError
139
140
142 """Gets the width property units.
143
144 @return: units used in width property.
145 """
146 raise NotImplementedError
147
148
150 """Sets the width property units.
151
152 @param units:
153 the units used in width property.
154 @deprecated: Consider setting width and unit simultaneously using
155 L{setWidth}, which is less error-prone.
156 """
157 raise NotImplementedError
158
159
161 """Gets the height property units.
162
163 @return: units used in height property.
164 """
165 raise NotImplementedError
166
167
169 """Sets the height property units.
170
171 @param units:
172 the units used in height property.
173 @deprecated: Consider setting height and unit simultaneously using
174 L{setHeight} or which is less error-prone.
175 """
176 raise NotImplementedError
177
178
180 """Sets the size to 100% x 100%."""
181 raise NotImplementedError
182
183
185 """Clears any size settings."""
186 raise NotImplementedError
187