|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Layout file resource header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef XNLAYOUTENGINE_HRH |
|
20 #define XNLAYOUTENGINE_HRH |
|
21 |
|
22 // Data types |
|
23 |
|
24 STRUCT LAYOUT |
|
25 { |
|
26 STRUCT nodes[]; |
|
27 } |
|
28 |
|
29 STRUCT MAPPINGS |
|
30 { |
|
31 STRUCT mappings[]; |
|
32 } |
|
33 |
|
34 /** node type - bitmap,skinbitmap,control */ |
|
35 STRUCT NODE |
|
36 { |
|
37 LONG type; |
|
38 |
|
39 // node identification |
|
40 /** area id */ |
|
41 LTEXT nodeid; |
|
42 /** parent area id */ |
|
43 LTEXT parentnodeid = ""; |
|
44 /** branch id, used for identifying optional branches */ |
|
45 LTEXT branchid = ""; |
|
46 /** 1 or 0, tells whether a branch is enabled */ |
|
47 LONG enabled = 1; |
|
48 /** horizontal alignment of the area: 0-100000, 50000 is center */ |
|
49 LONG horizontalalignment = 0; |
|
50 /** vertical alignment of the area: 0-100000, 50000 is center */ |
|
51 LONG verticalalignment = 0; |
|
52 |
|
53 /** |
|
54 * area priority, 0 is "must", consequent values are so that higher |
|
55 * numbers |
|
56 * mean higher priority |
|
57 */ |
|
58 LONG priority = 0; |
|
59 |
|
60 /** |
|
61 * 1 or 0, tells whether area aspect ratio should be preserved when |
|
62 * resizing |
|
63 */ |
|
64 LONG lockaspectratio = 0; |
|
65 |
|
66 // we assume that minimum dimensions are always absolute and always |
|
67 // in pixels |
|
68 |
|
69 /** minimum width in pixels */ |
|
70 LONG pixelminimumwidth; |
|
71 /** minimum width in pixels */ |
|
72 LONG pixelminimumheight; |
|
73 /** maximum size */ |
|
74 STRUCT maximumsize; |
|
75 /** preferred size */ |
|
76 STRUCT preferredsize; |
|
77 /** area margins */ |
|
78 STRUCT margins; |
|
79 /** include data for included layout file */ |
|
80 STRUCT include; |
|
81 /** orientation of child areas */ |
|
82 STRUCT childorientation; |
|
83 /** node-specific data, depending on the node type */ |
|
84 STRUCT nodedata; |
|
85 } |
|
86 |
|
87 /** child area layout is defined as rows x columns */ |
|
88 STRUCT CHILD_ORIENTATION |
|
89 { |
|
90 LONG rows = 0; |
|
91 LONG columns = 0; |
|
92 } |
|
93 |
|
94 /** margins are assumed absolute and in pixels */ |
|
95 STRUCT MARGIN |
|
96 { |
|
97 LONG left = 0; |
|
98 LONG right = 0; |
|
99 LONG top = 0; |
|
100 LONG bottom = 0; |
|
101 } |
|
102 |
|
103 /** maximum size can be pixels, twips or percentage of parent area */ |
|
104 STRUCT MAXIMUMSIZE |
|
105 { |
|
106 LONG pixelmaximumwidth = 0; |
|
107 LONG pixelmaximumheight = 0; |
|
108 |
|
109 LONG twipmaximumwidth = 0; |
|
110 LONG twipmaximumheight = 0; |
|
111 |
|
112 /** percentage, 0-1000000, 1000000 is 100% */ |
|
113 LONG relativemaximumwidth = 0; |
|
114 /** percentage, 0-1000000, 1000000 is 100% */ |
|
115 LONG relativemaximumheight = 0; |
|
116 } |
|
117 |
|
118 /** preferred size can be pixels, twips or percentage of parent area */ |
|
119 STRUCT PREFERREDSIZE |
|
120 { |
|
121 LONG pixelpreferredwidth = 0; |
|
122 LONG pixelpreferredheight = 0; |
|
123 |
|
124 LONG twippreferredwidth = 0; |
|
125 LONG twippreferredheight = 0; |
|
126 |
|
127 /** percentage, 0-1000000, 1000000 is 100% */ |
|
128 LONG relativepreferredwidth = 0; |
|
129 /** percentage, 0-1000000, 1000000 is 100% */ |
|
130 LONG relativepreferredheight = 0; |
|
131 } |
|
132 |
|
133 /** sub-areas are included from external files by filename */ |
|
134 STRUCT INCLUDE |
|
135 { |
|
136 LTEXT file = ""; |
|
137 } |
|
138 |
|
139 /** bitmap area defines a file name and a bitmap id */ |
|
140 STRUCT BITMAPAREA |
|
141 { |
|
142 /** file name */ |
|
143 LTEXT file; |
|
144 |
|
145 /** |
|
146 * id is string in order to allow different representations for image data |
|
147 */ |
|
148 LTEXT bitmapid; |
|
149 /** mask file name is optional */ |
|
150 LTEXT maskfile = ""; |
|
151 |
|
152 /** |
|
153 * mask id is optional. id is string in order to allow different |
|
154 * representations for image data |
|
155 */ |
|
156 LTEXT maskbitmapid = ""; |
|
157 /** is mask inverted */ |
|
158 LONG invertmask = 0; |
|
159 /** is mask enabled */ |
|
160 LONG enablemask = 0; |
|
161 } |
|
162 |
|
163 /** skin area defines a skin id and a bitmap id */ |
|
164 STRUCT SKINBITMAPAREA |
|
165 { |
|
166 /** skin file id */ |
|
167 LONG skinfileid; |
|
168 /** skin bitmap id */ |
|
169 LONG bitmapid; |
|
170 /** mask file id */ |
|
171 LONG maskfileid = 0; |
|
172 /** mask bitmap id */ |
|
173 LONG maskbitmapid = 0; |
|
174 /** is mask inverted */ |
|
175 LONG invertmask = 0; |
|
176 /** is mask enabled */ |
|
177 LONG enablemask = 0; |
|
178 } |
|
179 |
|
180 STRUCT CONTROLAREA |
|
181 { |
|
182 /** node UI type, an UID */ |
|
183 LONG uitype; |
|
184 /** construction data file name */ |
|
185 LTEXT resourcefile = ""; |
|
186 |
|
187 /** |
|
188 * construction data id in the file - string in order to allow different |
|
189 * data representations |
|
190 */ |
|
191 LTEXT resourceid = ""; |
|
192 } |
|
193 |
|
194 /** mapping defines a name that maps a hierarchical name */ |
|
195 STRUCT MAPPING |
|
196 { |
|
197 /** mapping name (for example, "button1") */ |
|
198 LTEXT key; |
|
199 |
|
200 /** |
|
201 * mapping path, a blank-separated path |
|
202 * (for example, "rootnode statusnode left_area") |
|
203 */ |
|
204 LTEXT path; |
|
205 } |
|
206 |
|
207 STRUCT FILEVERSION |
|
208 { |
|
209 /** version string */ |
|
210 LTEXT version; |
|
211 } |
|
212 |
|
213 #endif // XNLAYOUTENGINE_HRH |