|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // TRgb |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 inline TRgb::TRgb(): |
|
20 iValue(0xffffffff) |
|
21 /** Constructs a TRgb initialised to KRgbWhite.*/ |
|
22 {} |
|
23 |
|
24 |
|
25 inline TRgb::TRgb(TUint32 aValue): |
|
26 iValue(((aValue & 0xff0000) >> 16) | (aValue & 0x00ff00) | ((aValue & 0x0000ff) << 16) | (0xff000000 - (aValue & 0xff000000))) |
|
27 /** Constructs a TRgb directly from a single 32-bit integer. |
|
28 |
|
29 The integer is of the form 0xaabbggrr, where bb is the hex number for blue, |
|
30 gg is the hex number for green, rr is the hex number for red, and aa is the hex number for |
|
31 "transparency" alpha (0 means opaque, 255 means transparent). |
|
32 |
|
33 This constructor is deprecated. The byte order of Red ,Green and Blue |
|
34 does not match other constructors and methods in this class, |
|
35 and the meaning of alpha is reversed compared to current convention. |
|
36 |
|
37 For example, TRgb(0x00080402) using this constructor |
|
38 can be replaced with the 3 colour constructor TRgb(2,4,8). |
|
39 The equivalent explicit alpha constructors are TRgb(0x020408,0xff) and TRgb(2,4,8,255). |
|
40 The equivalent call to SetInternal is SetInternal(0xff020408). |
|
41 |
|
42 This constructor is deprecated. Use other constructors or SetInternal() instead. |
|
43 |
|
44 @param aValue Integer representing colour value. Takes form 0x00bbggrr. |
|
45 @deprecated */ |
|
46 {} |
|
47 |
|
48 inline TRgb::TRgb(TUint32 aInternalValue, TInt aAlpha) : |
|
49 iValue((aInternalValue & 0x00ffffff) | (aAlpha << 24)) |
|
50 /** Constructs a TRgb from a 32-bit integer (which corresponds to a colour) and from an alpha value. |
|
51 |
|
52 The first parameter is of the form 0x00rrggbb, where rr is the hex number for red, |
|
53 gg is the hex number for green, and bb is the hex number for blue. |
|
54 |
|
55 The second parameter corresponds to an alpha channel (0 means transparent, 255 means opaque). |
|
56 |
|
57 For example, TRgb(2,4,8,255) using the 3 colour+alpha constructor is equal to TRgb(0x00020408, 255) using |
|
58 this constructor. |
|
59 |
|
60 This constructor, which implements alpha in the conventional way, |
|
61 replaces TRgb( TUint32 aValue ) which is deprecated. |
|
62 |
|
63 @param aInternalValue Integer representing a colour value, which takes the form 0x00rrggbb. |
|
64 @param aAlpha Alpha component of the colour (0 - 255).*/ |
|
65 { |
|
66 } |
|
67 |
|
68 inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue): |
|
69 iValue(aRed<<16|aGreen<<8|aBlue|0xff000000) |
|
70 /** Constructs a TRgb from its three component colours. |
|
71 |
|
72 Each colour has a value between 0 and 255. |
|
73 The alpha component is always set to opaque (255) |
|
74 |
|
75 @param aRed Red component of the colour (0 - 255). |
|
76 @param aGreen Green component of the colour (0 - 255). |
|
77 @param aBlue Blue component of the colour (0 - 255). */ |
|
78 {} |
|
79 |
|
80 /** Constructs a TRgb from its three colour components and alpha component. |
|
81 |
|
82 Each component has a value between 0 and 255. |
|
83 The fourth parameter corresponds to an alpha channel (0 means transparent, 255 means opaque). |
|
84 |
|
85 This constructor, which implements alpha in the conventional way, |
|
86 replaces TRgb( TUint32 aValue ) which is deprecated. |
|
87 |
|
88 @param aRed Red component of the colour (0 - 255). |
|
89 @param aGreen Green component of the colour (0 - 255). |
|
90 @param aBlue Blue component of the colour (0 - 255). |
|
91 @param aAlpha Alpha component of the colour (0 - 255).*/ |
|
92 inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue, TInt aAlpha): |
|
93 iValue(aRed<<16|aGreen<<8|aBlue|aAlpha<<24) |
|
94 {} |
|
95 |
|
96 |
|
97 inline TInt TRgb::Red() const |
|
98 /** Gets the red component. |
|
99 |
|
100 @return The red component (0 - 255). */ |
|
101 {return((iValue&0xff0000)>>16);} |
|
102 |
|
103 |
|
104 inline TInt TRgb::Green() const |
|
105 /** Gets the green component. |
|
106 |
|
107 @return The green component (0 - 255). */ |
|
108 {return((iValue&0xff00)>>8);} |
|
109 |
|
110 |
|
111 inline TInt TRgb::Blue() const |
|
112 /** Gets the blue component. |
|
113 |
|
114 @return The blue component (0 - 255). */ |
|
115 {return(iValue&0xff);} |
|
116 |
|
117 |
|
118 inline TBool TRgb::operator==(const TRgb& aColor) const |
|
119 /** Compares this colour with the specified colour for equality. |
|
120 |
|
121 For two colours to be equal, their red, green and blue components must all |
|
122 be equal. |
|
123 |
|
124 @param aColor Colour to be compared. |
|
125 @return ETrue. if the colours are equal; EFalse, otherwise. */ |
|
126 |
|
127 {return(iValue==aColor.iValue);} |
|
128 |
|
129 |
|
130 inline TBool TRgb::operator!=(const TRgb& aColor) const |
|
131 /** Compares this colour with the specified colour for inequality. |
|
132 |
|
133 Two colours are unequal if one at least one of their red, green and blue components |
|
134 are unequal. |
|
135 |
|
136 @param aColor Colour to be compared. |
|
137 @return ETrue, if the colours are not equal; EFalse, otherwise. |
|
138 */ |
|
139 {return(!(*this==aColor));} |
|
140 |
|
141 inline TRgb& TRgb::operator&=(const TRgb& aColor) |
|
142 /** Logical AND assignment operator. |
|
143 |
|
144 The operator ANDs the first operand with the second and then assigns the result |
|
145 back to the first operand. |
|
146 |
|
147 Note: |
|
148 |
|
149 This operates in the TRgb domain. Graphics defines logical operations for |
|
150 drawing primitives which operate in the device colour domain. |
|
151 |
|
152 @param aColor Colour to be compared. |
|
153 @return First operand-contains result of logical AND. */ |
|
154 {iValue&=aColor.iValue;return(*this);} |
|
155 |
|
156 inline TRgb& TRgb::operator|=(const TRgb& aColor) |
|
157 /** Logical OR assignment operator. |
|
158 |
|
159 The operator ORs the first operand with the second and then assigns the result |
|
160 back to the first operand. |
|
161 |
|
162 Note: |
|
163 |
|
164 This operates in the TRgb domain. Graphics defines logical operations for |
|
165 drawing primitives which operate in the device colour domain. |
|
166 |
|
167 @param aColor Colour to be compared. |
|
168 @return First operand- contains result of logical OR. */ |
|
169 {iValue|=aColor.iValue;return(*this);} |
|
170 |
|
171 |
|
172 inline TRgb& TRgb::operator^=(const TRgb& aColor) |
|
173 /** Logical EXCLUSIVE OR assignment operator. |
|
174 |
|
175 The operator Exclusive ORs the first operand with the second and then assigns |
|
176 the result back to the first operand. |
|
177 |
|
178 Note: |
|
179 |
|
180 This operates in the TRgb domain. Graphics defines logical operations for |
|
181 drawing primitives which operate in the device colour domain. |
|
182 |
|
183 @param aColor Colour to be compared. |
|
184 @return First operand contains result of logical Exclusive OR. */ |
|
185 {iValue^=aColor.iValue;iValue^=0xff000000; return(*this);} |
|
186 |
|
187 |
|
188 inline TUint32 TRgb::Value() const |
|
189 /** Gets the 32-bit value of the TRgb as an integer. |
|
190 This function is deprecated. Use Internal() instead. |
|
191 Note: the order of Red, Green and Blue components returned by this method |
|
192 is reversed compared to all other methods. The alpha value is also reversed in meaning |
|
193 compared to current convention, such that 0 represents opaque and 0xff represents transparent. |
|
194 |
|
195 @return The 32 bit value of the TRgb. Has the form 0xaabbggrr, where bb is the hex number for blue, |
|
196 gg is the hex number for green, rr is the hex number for red, and aa is the hex number for |
|
197 "transparency" alpha (0 means opaque, 255 means transparent). |
|
198 @deprecated */ |
|
199 // rr gg bb aa |
|
200 {return (((iValue & 0xff0000) >> 16) | (iValue & 0x00ff00) | ((iValue & 0x0000ff) << 16) | (0xff000000 - (iValue & 0xff000000)));} |
|
201 |
|
202 inline TUint32 TRgb::Internal() const |
|
203 /** Gets the 32-bit value of the TRgb as an integer. |
|
204 |
|
205 @return The 32 bit value of the TRgb. Has the form 0xaarrggbb. */ |
|
206 {return (iValue);} |
|
207 |
|
208 inline void TRgb::SetInternal(TUint32 aInternal) |
|
209 /** Sets the 32-bit value of the TRgb as a 32-bit integer. |
|
210 @param aInternal Colour internal representation. Has the form 0xaarrggbb. |
|
211 */ |
|
212 {iValue = aInternal;} |
|
213 |
|
214 inline TRgb TRgb::operator~() const |
|
215 /** Bitwise logical inversion operator. |
|
216 |
|
217 @return Contains results of logical inversion. */ |
|
218 {TRgb rgb; rgb.SetInternal(iValue^0x00ffffff); return rgb;} |
|
219 |
|
220 |
|
221 inline TRgb TRgb::operator&(const TRgb& aColor) |
|
222 /** Bitwise logical AND operator. |
|
223 |
|
224 @param aColor Colour to be compared. |
|
225 @return Contains results of logical AND. */ |
|
226 {TRgb rgb; rgb.SetInternal(iValue&aColor.iValue); return rgb;} |
|
227 |
|
228 |
|
229 inline TRgb TRgb::operator|(const TRgb& aColor) |
|
230 /** Bitwise logical OR operator. |
|
231 |
|
232 @param aColor Colour to be compared. |
|
233 @return Contains results of logical OR. */ |
|
234 {TRgb rgb; rgb.SetInternal(iValue|aColor.iValue); return rgb;} |
|
235 |
|
236 |
|
237 inline TRgb TRgb::operator^(const TRgb& aColor) |
|
238 /** Bitwise EXCLUSIVE OR operator |
|
239 |
|
240 @param aColor Colour to be compared. |
|
241 @return Contains results of logical EXCLUSIVE OR. */ |
|
242 {TRgb rgb; rgb.SetInternal(iValue^aColor.iValue); return rgb;} |
|
243 |
|
244 |
|
245 /** Gets TRgb from 2 level grayscale. |
|
246 |
|
247 The function takes a grayscale argument and return a TRgb whose red, green |
|
248 and blue values are set to an appropriate level. |
|
249 |
|
250 @param aGray2 Grayscale value to be converted. |
|
251 @return Equivalent 24 bit colour. Gray2 has only 2 levels (black and white), |
|
252 the function returns r=g=b=0 or r=g=b=255. */ |
|
253 inline TRgb TRgb::_Gray2(TInt aGray2) |
|
254 { |
|
255 if(aGray2) return(TRgb(0xffffff, 0xff)); |
|
256 return(TRgb(0, 0xff)); |
|
257 } |
|
258 |
|
259 /** Gets TRgb from 4 level grayscale. |
|
260 |
|
261 The function takes a grayscale argument and return a TRgb whose red, green |
|
262 and blue values are set to an appropriate level. |
|
263 |
|
264 @param aGray4 Grayscale value to be converted. |
|
265 @return Equivalent 24 bit colour. Gray4 has 4 levels- the function returns |
|
266 r=g=b=85*c, where c=0,1,2, or 3. */ |
|
267 inline TRgb TRgb::_Gray4(TInt aGray4) |
|
268 { |
|
269 aGray4&=3; |
|
270 aGray4|=aGray4<<2; |
|
271 aGray4|=aGray4<<4; |
|
272 return(TRgb(aGray4,aGray4,aGray4)); |
|
273 } |
|
274 |
|
275 /** Gets TRgb from 16 level grayscale. |
|
276 |
|
277 The function takes a grayscale argument and return a TRgb whose red, green |
|
278 and blue values are set to an appropriate level. |
|
279 |
|
280 @param aGray16 Grayscale value to be converted. |
|
281 @return Equivalent 24 bit colour. Gray16 has 16 levels - the function returns |
|
282 r=g=b=17*c, where c=0, 1, ... 15. */ |
|
283 inline TRgb TRgb::_Gray16(TInt aGray16) |
|
284 { |
|
285 aGray16&=0xf; |
|
286 aGray16|=aGray16<<4; |
|
287 return(TRgb(aGray16,aGray16,aGray16)); |
|
288 } |
|
289 |
|
290 /** Gets TRgb from 256 level grayscale. |
|
291 |
|
292 The function takes a grayscale argument and return a TRgb whose red, green |
|
293 and blue values are set to an appropriate level. |
|
294 |
|
295 @param aGray256 Grayscale value to be converted. |
|
296 @return Equivalent 24 bit colour. Gray256 has 256 levels- the function |
|
297 returns r=g=b=c, where c=0, 1, ... 255. */ |
|
298 inline TRgb TRgb::_Gray256(TInt aGray256) |
|
299 { |
|
300 aGray256&=0xff; |
|
301 return(TRgb(aGray256,aGray256,aGray256)); |
|
302 } |
|
303 |
|
304 /** Gets TRgb from 4K colour index. |
|
305 |
|
306 The function takes a 12 bit index into a colour palette and returns a TRgb |
|
307 whose red, green and blue values are set to an appropriate level. |
|
308 |
|
309 @param aColor4K 12 bit index into a colour palette |
|
310 @return Equivalent 24 bit colour. */ |
|
311 inline TRgb TRgb::_Color4K(TInt aColor4K) |
|
312 { |
|
313 TUint32 value = (aColor4K & 0xf00) << 8; |
|
314 value |= (aColor4K & 0x0f0) << 4; |
|
315 value |= (aColor4K & 0x00f); |
|
316 return TRgb(value | (value << 4), 0xff); |
|
317 } |
|
318 |
|
319 /** Gets TRgb from 64K colour index. |
|
320 |
|
321 The function takes a 16 bit index into a colour palette and returns a TRgb |
|
322 whose red, green and blue values are set to an appropriate level. |
|
323 |
|
324 @param aColor64K 16 bit index into a colour palette |
|
325 @return Equivalent 24 bit colour. */ |
|
326 inline TRgb TRgb::_Color64K(TInt aColor64K) |
|
327 { |
|
328 TInt red = (aColor64K&0xF800)>>8; |
|
329 red += red>>5; |
|
330 TInt green = (aColor64K&0x07E0)>>3; |
|
331 green += green>>6; |
|
332 TInt blue = (aColor64K&0x001F)<<3; |
|
333 blue += blue>>5; |
|
334 return TRgb(red,green,blue); |
|
335 } |
|
336 |
|
337 /** Gets TRgb from 16M colour index. |
|
338 |
|
339 The function takes a 24 bit index into a colour palette and returns the TRgb |
|
340 whose red, green and blue values represent it exactly. |
|
341 |
|
342 @param a0RGB 24 bit index into a colour palette |
|
343 @return The TRgb which represents the index exactly. */ |
|
344 inline TRgb TRgb::_Color16M(TInt a0RGB) |
|
345 { |
|
346 return TRgb(a0RGB, 0xff); |
|
347 } |
|
348 |
|
349 /** Gets TRgb from 16MU colour index. |
|
350 The function takes a 24 bit colour value with eight bits for each |
|
351 component, blue in the low byte, and returns the TRgb |
|
352 whose red, green and blue values represent it exactly. |
|
353 @param a0RGB The color - 0, R, G, B bytes. / BGR0 - little endian format / |
|
354 @return The TRgb which represents the index exactly. */ |
|
355 inline TRgb TRgb::_Color16MU(TInt a0RGB) |
|
356 { |
|
357 return TRgb(a0RGB, 0xff); |
|
358 } |
|
359 |
|
360 /** Gets the index of the closest TRgb value to this, |
|
361 based on the matching display mode. |
|
362 |
|
363 @return The index (0 - 1) representing the nearest TRgb. */ |
|
364 inline TInt TRgb::_Gray2() const |
|
365 { |
|
366 return(Gray256()>>7); |
|
367 } |
|
368 |
|
369 /**Gets the index of the closest TRgb value to this, |
|
370 based on the matching display mode. |
|
371 |
|
372 @return The index (0 - 3) representing the nearest TRgb. */ |
|
373 inline TInt TRgb::_Gray4() const |
|
374 { |
|
375 return(Gray256()>>6); |
|
376 } |
|
377 |
|
378 /** Gets the index of the closest TRgb value to this, |
|
379 based on the matching display mode. |
|
380 |
|
381 @return The index (0 - 15) representing the nearest TRgb.*/ |
|
382 inline TInt TRgb::_Gray16() const |
|
383 { |
|
384 return(Gray256()>>4); |
|
385 } |
|
386 |
|
387 /** Gets the index of the closest TRgb value to this, |
|
388 based on the matching display mode. |
|
389 |
|
390 @return The index (0 - 255) representing the nearest TRgb.*/ |
|
391 inline TInt TRgb::_Gray256() const |
|
392 { |
|
393 return(((Red()<<1)+Green()+(Green()<<2)+Blue())>>3); |
|
394 } |
|
395 |
|
396 /** Gets the index of the closest TRgb value to this, |
|
397 based on the matching display mode. |
|
398 |
|
399 @return The index (0 - 4095) representing the nearest TRgb. */ |
|
400 inline TInt TRgb::_Color4K() const |
|
401 { |
|
402 TInt color4K = (iValue & 0x0000f0) >> 4; |
|
403 color4K |= (iValue & 0x00f000) >> 8; |
|
404 color4K |= (iValue & 0xf00000) >> 12; |
|
405 return color4K; |
|
406 } //0RGB |
|
407 |
|
408 /** Gets the index of the closest TRgb value to this, |
|
409 based on the matching display mode. |
|
410 |
|
411 @return The index (0 - 65535) representing the nearest TRgb.*/ |
|
412 inline TInt TRgb::_Color64K() const |
|
413 { |
|
414 TInt color64K = (iValue & 0x0000f8) >> 3; |
|
415 color64K |= (iValue & 0x00fc00) >> 5; |
|
416 color64K |= (iValue & 0xf80000) >> 8; |
|
417 return color64K; |
|
418 } |
|
419 |
|
420 /** Gets the index of the closest TRgb value to this, |
|
421 based on the matching display mode. |
|
422 |
|
423 @return The index (0 - 16777215) representing the nearest TRgb.*/ |
|
424 inline TInt TRgb::_Color16M() const |
|
425 { |
|
426 return (iValue & 0xffffff); |
|
427 // 0RGB |
|
428 } |
|
429 |
|
430 /** Gets the index of the closest TRgb value to this, based on the matching display mode. |
|
431 @return The index (0 - 16777215) representing the nearest TRgb. */ |
|
432 inline TInt TRgb::_Color16MU() const |
|
433 { |
|
434 return (iValue & 0xffffff); |
|
435 // 0RGB |
|
436 } |
|
437 |
|
438 |
|
439 /** Gets the alpha component. |
|
440 @return The alpha component (0 - 255). */ |
|
441 inline TInt TRgb::Alpha() const |
|
442 {return (iValue >> 24);} |
|
443 |
|
444 |
|
445 /** Gets TRgb from 16MA colour index. |
|
446 The function takes a 32 bit colour value with eight bits for each |
|
447 component, blue in the low byte, and returns the TRgb |
|
448 whose red, green, blue and alpha values represent it exactly. |
|
449 @param aARGB The color - A, R, G, B bytes. / BGR0 - little endian format / |
|
450 @return The TRgb which represents the index exactly. */ |
|
451 inline TRgb TRgb::_Color16MA(TUint aARGB) |
|
452 { |
|
453 TRgb col; col.SetInternal(aARGB); |
|
454 return col; |
|
455 } |
|
456 |
|
457 /** Gets the index of the closest TRgb value to this, based on the matching display mode. |
|
458 @return The index (0 - 16777215) representing the nearest TRgb. */ |
|
459 inline TUint TRgb::_Color16MA() const |
|
460 { |
|
461 return (iValue); |
|
462 // ARGB |
|
463 } |
|
464 // |
|
465 // CPalette |
|
466 // |
|
467 |
|
468 |
|
469 inline TInt CPalette::Entries() const |
|
470 /** Gets the number of entries in the palette |
|
471 |
|
472 @return The number of entries in the palette. */ |
|
473 {return(iNumEntries);} |
|
474 |
|
475 // |
|
476 // TColor256Utils |
|
477 // |
|
478 |
|
479 |
|
480 inline TRgb TColor256Util::Color256(TInt aColor256) const |
|
481 /** Gets the TRgb value of the entry at the specified index in the colour lookup |
|
482 table. |
|
483 |
|
484 @param aColor256 The index into the colour lookup table. |
|
485 @return The TRgb value of the entry at the specified index. */ |
|
486 { return TRgb(iColorTable[aColor256]); } |
|
487 |
|
488 // |
|
489 // TFontStyle |
|
490 // |
|
491 inline TGlyphBitmapType TFontStyle::BitmapType() const |
|
492 /** Gets the anti-aliasing setting for the font, as set by SetBitmapType(). |
|
493 |
|
494 @return Indicates whether or not this font should be drawn using anti-aliasing. */ |
|
495 { |
|
496 return (TGlyphBitmapType)(iFlags >> 16); |
|
497 } |
|
498 |
|
499 |
|
500 inline void TFontStyle::SetBitmapType(TGlyphBitmapType aBitmapType) |
|
501 /** Sets whether the font should be drawn using anti-aliasing. If set, this value |
|
502 overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType()) |
|
503 for this font. |
|
504 |
|
505 Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing |
|
506 support for bitmapped fonts. |
|
507 |
|
508 @param aBitmapType Indicates whether or not this font should be drawn using |
|
509 anti-aliasing. */ |
|
510 { |
|
511 iFlags &= 0xFFFF; |
|
512 iFlags |= (aBitmapType << 16); |
|
513 } |
|
514 |
|
515 // |
|
516 // CBitmapDevice |
|
517 // |
|
518 |
|
519 |
|
520 inline TInt CBitmapDevice::CreateBitmapContext(CBitmapContext*& aGC) |
|
521 /** Creates a bitmap context for this bitmap device. |
|
522 |
|
523 @param aGC On return, holds a pointer to the created bitmap context. |
|
524 @return KErrNone, if successful; otherwise, another of the system-wide error |
|
525 codes. */ |
|
526 {return(CreateContext((CGraphicsContext*&)aGC));} // relies on CBitmapContext deriving _only_ from CGraphicsContext |
|
527 |
|
528 // |
|
529 // TPictureCapability |
|
530 // |
|
531 |
|
532 inline TPictureCapability::TPictureCapability(TScalingType aScalingType,TBool aCroppable): |
|
533 iScalingType(aScalingType),iIsCroppable(aCroppable) |
|
534 /** Constructs the object setting the scaling-type and croppability properties. |
|
535 |
|
536 @param aScalingType Whether or not the picture is scalable. |
|
537 @param aCroppable Whether or not the picture is croppable. */ |
|
538 {} |
|
539 |
|
540 // |
|
541 // TZoomFactor |
|
542 // |
|
543 |
|
544 |
|
545 inline TZoomFactor::TZoomFactor(const MGraphicsDeviceMap* aDevice): |
|
546 iZoomFactor(TZoomFactor::EZoomOneToOne), |
|
547 iDevice(aDevice) |
|
548 /** Constructs a zoom factor object for a specific graphics device map. |
|
549 |
|
550 The graphics map is either directly associated with a particular graphics |
|
551 device itself, or is associated with a hierarchy of device maps whose root |
|
552 map is associated with a particular graphics device. |
|
553 |
|
554 @param aDevice The graphics device map with which the zoom factor is associated. */ |
|
555 {} |
|
556 |
|
557 inline TZoomFactor::TZoomFactor(const TZoomFactor* aDevice): |
|
558 iDevice(aDevice) |
|
559 { |
|
560 iZoomFactor=aDevice->iZoomFactor; |
|
561 } |
|
562 |
|
563 |
|
564 inline void TZoomFactor::SetGraphicsDeviceMap(const MGraphicsDeviceMap* aDevice) |
|
565 /** Sets the graphics device map for this zoom factor object. |
|
566 |
|
567 @param aDevice The graphics device map for this TZoomFactor. */ |
|
568 {iDevice=aDevice;} |
|
569 |
|
570 |
|
571 inline const MGraphicsDeviceMap* TZoomFactor::GraphicsDeviceMap() const |
|
572 /** Gets the graphics device map of this zoom factor object. |
|
573 |
|
574 @return The graphics device map of the TZoomFactor. */ |
|
575 {return(iDevice);} |
|
576 |
|
577 |
|
578 |
|
579 /** Gets the ascent of an ANSI capital letter in the font whether or not |
|
580 there are any ANSI capitals in the font. |
|
581 @return The positive distance from the font baseline to the top of a |
|
582 standard ANSI capital letter |
|
583 @publishedAll |
|
584 @released |
|
585 */ |
|
586 inline TInt CFont::FontCapitalAscent() const |
|
587 { |
|
588 return ExtendedFunction(KFontCapitalAscent); |
|
589 } |
|
590 |
|
591 /** Gets the max ascent of any pre-composed glyph in the font. This will |
|
592 include accents or diacritics that form part of pre-composed glyphs. It is |
|
593 not guaranteed to cover the max ascent of composite glyphs that have to be |
|
594 created by a layout engine. This is also the recommended distance between |
|
595 the top of a text box and the baseline of the first line of text. |
|
596 @return The positive distance from the font baseline to the top of the |
|
597 highest pre-composed glyph (including accents) above the baseline |
|
598 @publishedAll |
|
599 @released |
|
600 */ |
|
601 inline TInt CFont::FontMaxAscent() const |
|
602 { |
|
603 return ExtendedFunction(KFontMaxAscent); |
|
604 } |
|
605 |
|
606 /** Gets the descent of an ANSI descending character in the font. |
|
607 Whether or not there are any ANSI descenders in the font. |
|
608 @return The positive distance from the font baseline to the bottom of the |
|
609 lowest ANSI descender |
|
610 @publishedAll |
|
611 @released |
|
612 */ |
|
613 inline TInt CFont::FontStandardDescent() const |
|
614 { |
|
615 return ExtendedFunction(KFontStandardDescent); |
|
616 } |
|
617 |
|
618 /** Gets the max descent of any pre-composed glyph in the font. This will |
|
619 include accents or diacritics that form part of pre-composed glyphs. It is |
|
620 not guaranteed to cover the max descent of composite glyphs that have to be |
|
621 created by a layout engine. |
|
622 @return The positive distance from the font baseline to the bottom of the |
|
623 lowest pre-composed glyph (including accents) below the baseline |
|
624 @publishedAll |
|
625 @released |
|
626 */ |
|
627 inline TInt CFont::FontMaxDescent() const |
|
628 { |
|
629 return ExtendedFunction(KFontMaxDescent); |
|
630 } |
|
631 |
|
632 /** Gets the suggested line gap for the font. This is the recommended |
|
633 baseline to baseline distance between successive lines of text in the font. |
|
634 @return The positive recommended gap between successive lines |
|
635 @publishedAll |
|
636 @released |
|
637 */ |
|
638 inline TInt CFont::FontLineGap() const |
|
639 { |
|
640 return ExtendedFunction(KFontLineGap); |
|
641 } |
|
642 |
|
643 /** |
|
644 Gets the (positive) maximum height in pixels of the font. |
|
645 This may differ from the design height. |
|
646 |
|
647 @return The maximum height of the font. |
|
648 @publishedAll |
|
649 @released |
|
650 */ |
|
651 inline TInt CFont::FontMaxHeight() const |
|
652 { |
|
653 return FontMaxAscent() + FontMaxDescent(); |
|
654 } |
|
655 |