Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
gdi.h
Go to the documentation of this file.
1// Copyright (c) 1998-2010 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//
15
16#ifndef __GDI_H__
17#define __GDI_H__
18
19#include <e32base.h>
20#include <f32file.h>
21#include <s32std.h>
22#include <displaymode.h>
23
24#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
25#include <graphics/gdi/glyphsample.h>
26#include <graphics/gdi/gdiconsts.h>
27#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
28
29class TOpenFontCharMetrics;
30class RShapeInfo;
32class TTextParameters;
33
39const TInt KTwipsPerInch=1440;
40
46const TInt KTwipsPerPoint=20;
47
53const TInt KPointsPerInch=72;
54
60const TInt KTwipsPerCm=567;
61#if defined(__NO_CLASS_CONSTS__)
67#define KA4PaperSizeInTwips TSize(11906,16838)
73#define KLegalPaperSizeInTwips TSize(12240,20160)
74
80#define KExecutivePaperSizeInTwips TSize(10440,15120)
86#define KLetterPaperSizeInTwips TSize(12240,15840)
87
93#define KCom_10PaperSizeInTwips TSize(5940,13680)
94
100#define KMonarchPaperSizeInTwips TSize(5580,10800)
101
107#define KDLPaperSizeInTwips TSize(6236,12472)
108
114#define KC5PaperSizeInTwips TSize(9184,12983)
115#else
120const TSize KA4PaperSizeInTwips(11906,16838);
121const TSize KLegalPaperSizeInTwips(12240,20160);
122const TSize KExecutivePaperSizeInTwips(10440,15120);
123const TSize KLetterPaperSizeInTwips(12240,15840);
124const TSize KCom_10PaperSizeInTwips(5940,13680);
125const TSize KMonarchPaperSizeInTwips(5580,10800);
126const TSize KDLPaperSizeInTwips(6236,12472);
127const TSize KC5PaperSizeInTwips(9184,12983);
128#endif
129
130
134enum TGdiPanic
135 {
149 };
191class TRgb
192 {
193public:
194 inline TRgb();
195 inline TRgb(TUint32 aValue);
196 inline TRgb(TUint32 aInternalValue, TInt aAlpha);
197 inline TRgb(TInt aRed,TInt aGreen,TInt aBlue);
198 inline TRgb(TInt aRed, TInt aGreen, TInt aBlue, TInt aAlpha);
199 inline TInt Red() const;
200 inline TInt Green() const;
201 inline TInt Blue() const;
202 inline TInt Alpha() const;
203 IMPORT_C void SetRed(TInt aRed);
204 IMPORT_C void SetGreen(TInt aGreen);
205 IMPORT_C void SetBlue(TInt aBlue);
206 IMPORT_C void SetAlpha(TInt aAlpha);
207 IMPORT_C static TRgb Gray2(TInt aGray2);
208 IMPORT_C static TRgb Gray4(TInt aGray4);
209 IMPORT_C static TRgb Gray16(TInt aGray16);
210 IMPORT_C static TRgb Gray256(TInt aGray256);
211 IMPORT_C static TRgb Color16(TInt aColor16);
212 IMPORT_C static TRgb Color256(TInt aColor256);
213 IMPORT_C static TRgb Color4K(TInt aColor4K);
214 IMPORT_C static TRgb Color64K(TInt aColor64K);
215 IMPORT_C static TRgb Color16M(TInt aColor16M);
216 IMPORT_C TInt Gray2() const;
217 IMPORT_C TInt Gray4() const;
218 IMPORT_C TInt Gray16() const;
219 IMPORT_C TInt Gray256() const;
220 IMPORT_C TInt Color16() const;
221 IMPORT_C TInt Color256() const;
222 IMPORT_C TInt Color4K() const;
223 IMPORT_C TInt Color64K() const;
224 IMPORT_C TInt Color16M() const;
225 inline TBool operator==(const TRgb& aColor) const;
226 inline TBool operator!=(const TRgb& aColor) const;
227 inline TRgb operator~() const;
228 inline TRgb operator&(const TRgb& aColor);
229 inline TRgb operator|(const TRgb& aColor);
230 inline TRgb operator^(const TRgb& aColor);
231 inline TRgb& operator&=(const TRgb& aColor);
232 inline TRgb& operator|=(const TRgb& aColor);
233 inline TRgb& operator^=(const TRgb& aColor);
234 inline TUint32 Value() const;
235 inline TUint32 Internal() const;
236 inline void SetInternal(TUint32 aInternal);
237 IMPORT_C TInt Difference(const TRgb& aColor) const;
238 IMPORT_C void InternalizeL(RReadStream& aStream);
239 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
240 IMPORT_C static TRgb Color16MU(TInt a0RGB);
241 IMPORT_C TInt Color16MU() const;
242 IMPORT_C static TRgb Color16MA(TUint aARGB);
243 IMPORT_C TUint Color16MA() const;
244 IMPORT_C static TRgb Color16MAP(TUint aARGB);
245 IMPORT_C TUint Color16MAP() const;
246 IMPORT_C TUint _Color16MAP() const;
247 IMPORT_C static TRgb _Color16MAP(TUint aARGB);
248 inline TInt _Gray2() const;
249 inline TInt _Gray4() const;
250 inline TInt _Gray16() const;
251 inline TInt _Gray256() const;
252 inline TInt _Color4K() const;
253 inline TInt _Color64K() const;
254 inline TInt _Color16M() const;
255 inline TInt _Color16MU() const;
256 inline TUint _Color16MA() const;
257 inline static TRgb _Gray2(TInt aGray2);
258 inline static TRgb _Gray4(TInt aGray4);
259 inline static TRgb _Gray16(TInt aGray16);
260 inline static TRgb _Gray256(TInt aGray256);
261 inline static TRgb _Color4K(TInt aColor4K);
262 inline static TRgb _Color64K(TInt aColor64K);
263 inline static TRgb _Color16M(TInt aColor16M);
264 inline static TRgb _Color16MU(TInt a0RGB);
265 inline static TRgb _Color16MA(TUint aARGB);
266private:
267 TUint32 iValue;
268 };
275#define KRgbBlack TRgb(0x000000)
276#define KRgbDarkGray TRgb(0x555555)
277#define KRgbDarkRed TRgb(0x000080)
278#define KRgbDarkGreen TRgb(0x008000)
279#define KRgbDarkYellow TRgb(0x008080)
280#define KRgbDarkBlue TRgb(0x800000)
281#define KRgbDarkMagenta TRgb(0x800080)
282#define KRgbDarkCyan TRgb(0x808000)
283#define KRgbRed TRgb(0x0000ff)
284#define KRgbGreen TRgb(0x00ff00)
285#define KRgbYellow TRgb(0x00ffff)
286#define KRgbBlue TRgb(0xff0000)
287#define KRgbMagenta TRgb(0xff00ff)
288#define KRgbCyan TRgb(0xffff00)
289#define KRgbGray TRgb(0xaaaaaa)
290#define KRgbWhite TRgb(0xffffff)
291#define KRgbTransparent TRgb(0x000000,0x00)
298 {
299public:
300 IMPORT_C static TBool IsDisplayModeColor(TDisplayMode aDispMode);
301 IMPORT_C static TBool IsDisplayModeValid(TDisplayMode aDispMode);
302 IMPORT_C static TInt NumDisplayModeColors(TDisplayMode aDispMode);
303 IMPORT_C static TInt NumDisplayModeBitsPerPixel(TDisplayMode aDispMode);
304 };
305
329class CPalette : public CBase
331public:
332 IMPORT_C static CPalette* NewL(TInt aNumberOfEntries);
333 IMPORT_C static CPalette* NewDefaultL(TDisplayMode aDispMode);
334 IMPORT_C ~CPalette();
335 IMPORT_C void Clear();
336 inline TInt Entries() const;
337 IMPORT_C TRgb GetEntry(TInt aPaletteIndex) const;
338 IMPORT_C TRgb NearestEntry(const TRgb& aColor) const;
339 IMPORT_C TInt NearestIndex(const TRgb& aColor) const;
340 IMPORT_C void SetEntry(TInt aPaletteIndex,const TRgb& aPaletteEntry);
341 IMPORT_C void GetDataPtr(TInt aFirstColor,TInt aNumColors,TPtr8& aPtr);
342protected:
343 IMPORT_C CPalette();
344 void ConstructL(TInt aNumberOfEntries);
345protected:
346 TRgb* iArray;
347 TInt iNumEntries;
348 };
349
350
356class TColor256Util
357 {
358public:
359 IMPORT_C void Construct(const CPalette& aPalette);
360 IMPORT_C TInt Color256(TRgb aRgb) const;
361 IMPORT_C void Color256(TUint8* aDestination,const TRgb* aSource,TInt aNumPixels) const;
362 inline TRgb Color256(TInt aColor256) const;
363 IMPORT_C static const TColor256Util* Default();
364public:
371 TUint32 iColorTable[256];
382 TUint8 iInverseColorTable[0x1000];
383 };
384
385
399public:
401 enum TLineMode
402 {
404 ECenter,
407 ELeft
408 };
409public:
410 IMPORT_C TLinearDDA();
411 IMPORT_C TLinearDDA(const TLinearDDA& aLine);
412 IMPORT_C void Construct(const TPoint& aStart,const TPoint& aFinish,TLineMode aMode=ECenter);
413 IMPORT_C TBool SingleStep(TPoint& aPosition);
414 IMPORT_C TBool SingleScanline(TPoint& aStartPosition,TPoint& aEndPosition);
415 IMPORT_C TBool NextStep(TPoint& aPosition);
416 IMPORT_C void JumpToRect(const TRect& aRect);
417 IMPORT_C void JumpToXCoord(const TInt aXCoord,TInt& aYCoord);
418 IMPORT_C void JumpToYCoord(TInt& aXCoord,const TInt aYCoord);
419 IMPORT_C void JumpToXCoord2(TInt aXCoord,TInt& aYCoord);
420 IMPORT_C void JumpToYCoord2(TInt& aXCoord,TInt aYCoord);
421private:
422 void UpdatePosition();
423private:
424 enum TLineStatus
425 {
426 EInitialised,
427 ECurrent,
428 EComplete
429 };
430private:
431 TInt iCount;
432 TSize iDifference;
433 TPoint iFinish;
434 TInt iGradient;
435 TPoint iInc;
436 TPoint iPos;
437 TPoint iStart;
438 TRect iBoundingRect;
439 TBool iBoundingRectSet;
440 TInt16 iInsideX; // boolean, defined as TInt16 to maintain binary compatibility
441 TInt16 iInsideY; // boolean, defined as TInt16 to maintain binary compatibility
442 TLineStatus iStatus;
443 };
444
445
458 };
466 {
471 };
472
480 {
487 };
488
495 {
500 };
501
520const TInt KMaxTypefaceNameLength=0x18;
521
522
537class TTypeface
538 {
539public:
540 enum
550 ESymbol = 4,
551 };
552public:
553 IMPORT_C TTypeface();
554 IMPORT_C TBool operator==(const TTypeface& aTypeface) const;
555 IMPORT_C void InternalizeL(RReadStream& aStream);
556 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
557 IMPORT_C void SetAttributes(TInt aAttributes);
558 IMPORT_C void SetIsProportional(TBool aIsProportional);
559 IMPORT_C void SetIsSerif(TBool aIsSerif);
560 IMPORT_C void SetIsSymbol(TBool aIsSymbol);
561 IMPORT_C TInt Attributes() const;
562 IMPORT_C TBool IsProportional() const;
563 IMPORT_C TBool IsSerif() const;
564 IMPORT_C TBool IsSymbol() const;
565 IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
566 IMPORT_C void SetScriptTypeForMetrics(TInt aScript);
567 IMPORT_C TInt ScriptTypeForMetrics() const;
568 IMPORT_C void SetName(const TDesC& aName);
569 IMPORT_C const TDesC& Name() const;
570private:
571 void ResetAttributes();
572 void ResetScriptType();
573public:
576private:
577 TUint32 iFlags;
578 };
579
580
592 {
621 };
630NONSHARABLE_CLASS(FontEffect)
631 {
632public:
633 enum TEffect
634 {
635 ENone = 0x0, // No effects.
636 EAlgorithmicBold= 0x10, // Font is algorithmic bold (a.k.a pseudo bold.)
637 EDropShadow = 0x20, // Font has a drop shadow.
638 EOutline = 0x40, // Font is an outline font.
639 EEmbossed = 0x80, // Font is embossed.
640 EEngraved = 0x100, // Font is engraved.
641 ESoftEdge = 0x200, // Font is soft edged.
642 EReserved1 = 0x400, // Reserved for Symbian use.
643 EReserved2 = 0x800, // Reserved for Symbian use.
644 EReserved3 = 0x1000, // Reserved for Symbian use.
645 EReserved4 = 0x2000, // Reserved for Symbian use.
646 EReserved5 = 0x4000, // Reserved for Symbian use.
647 EReserved6 = 0x8000, // Reserved for Symbian use.
648 };
649public:
650 IMPORT_C static TBool IsEffectOn(TEffect aEffect, TUint32 aFontEffect);
651 IMPORT_C static void SetEffect(TEffect aEffect, TBool aOn, TUint32& aFontEffect);
652 };
653
672class TFontStyle
673 {
674public:
675 IMPORT_C TFontStyle();
676 IMPORT_C TFontStyle(TFontPosture aPost,TFontStrokeWeight aStrWgt,TFontPrintPosition aPrintPos);
677 IMPORT_C void InternalizeL(RReadStream& aStream);
678 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
679 IMPORT_C TFontPosture Posture() const;
680 IMPORT_C TFontStrokeWeight StrokeWeight() const;
681 IMPORT_C TFontPrintPosition PrintPosition() const;
682 IMPORT_C void SetPosture(TFontPosture aPosture);
683 IMPORT_C void SetStrokeWeight(TFontStrokeWeight aStrokeWeight);
684 IMPORT_C void SetPrintPosition(TFontPrintPosition aPrintPosition);
685 inline TGlyphBitmapType BitmapType() const;
686 inline void SetBitmapType(TGlyphBitmapType aBitmapType);
687 IMPORT_C TBool operator==(const TFontStyle& aFontStyle) const;
688 IMPORT_C TUint32 Effects() const;
689 IMPORT_C TBool IsEffectOn(FontEffect::TEffect aEffect) const;
690 IMPORT_C void SetEffects(TUint32 aEffects);
691 IMPORT_C void SetEffects(FontEffect::TEffect aEffect, TBool aOn);
692private:
693 enum
694 {
695 EItalic=0x1,
696 EBold=0x2,
697 ESuper=0x4,
698 ESub=0x8
699 };
700private:
701 TUint32 iFlags; // bitmap type - 16 bits (high), font effects - 12 bits (middle), style - 4 bits (low)
702 TAny* iReserved1;
703 TAny* iReserved2;
704 };
705
706
707
713class TFontSpec
714 {
715public:
716 IMPORT_C TFontSpec();
717 IMPORT_C TFontSpec(const TDesC& aTypefaceName,TInt aHeight);
718 IMPORT_C TBool operator==(const TFontSpec& aFontSpec) const;
719 IMPORT_C void InternalizeL(RReadStream& aStream);
720 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
721 IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
722 IMPORT_C TInt ScriptTypeForMetrics() const;
723public:
727 TInt iHeight;
730 };
732
733
745public:
756 TBool iIsScalable; // supports heights from min to max at fixed interval
757 };
758
765const TInt KSuperSubScalingPercentage=67;
766
773const TInt KSuperscriptOffsetPercentage=-28;
793class CTypefaceStore : public CBase
794 {
795public:
796 IMPORT_C ~CTypefaceStore();
797
816 virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec) = 0;
817
836 virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec) = 0;
837
858 virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight) = 0;
859
863 virtual TInt NumTypefaces() const=0;
876 virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const=0;
877
887 virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const=0;
888 IMPORT_C void ReleaseFont(CFont* aFont);
889 IMPORT_C static TInt BaselineOffset(TInt aHeight,TFontPrintPosition aPos);
890 IMPORT_C static TInt SuperSubHeight(TInt aHeight,TFontPrintPosition aPos);
891protected:
892 IMPORT_C CTypefaceStore();
893 IMPORT_C void ConstructL();
894 IMPORT_C void AddFontL(CFont* aFont);
895 IMPORT_C TBool IncrementFontCount(const CFont* aFont);
896private:
897 TBool FindFont(const CFont* aFont, TInt& aIdx) const;
898 NONSHARABLE_CLASS(TFontAccess)
903 {
904 public:
906 CFont* iFont;
908 TInt iAccessCount;
909 };
910protected:
920 };
921
925const TInt KMaxFontCacheEntries=32;
926
942class CFontCache : public CBase
943 {
944public:
945 IMPORT_C CFontCache();
946 IMPORT_C CFontCache(TInt aMaxEntries);
947 IMPORT_C ~CFontCache();
948 IMPORT_C CFont* Search(const TFontSpec& aFontSpec);
949 IMPORT_C CFont* AddEntryL(CFont* aFont,const TFontSpec& aFontSpec);
950 IMPORT_C CFont* RemoveFirstEntry();
951public:
954 TInt iNumHits;
957 TInt iNumMisses;
958private:
959 class CFontCacheEntry : public CBase
960 {
961 public:
962 CFontCacheEntry(CFont* aFont,const TFontSpec& aFontSpec,CFontCacheEntry* aNext);
963 public:
964 CFont* iFont;
966 CFontCacheEntry* iNext;
967 };
968private:
969 TInt iNumEntries;
970 TInt iMaxEntries;
971 CFontCacheEntry* iFirst;
972 };
973
984 {
985public:
986 IMPORT_C MGraphicsDeviceMap();
987 IMPORT_C virtual ~MGraphicsDeviceMap();
988 IMPORT_C TPoint TwipsToPixels(const TPoint& aTwipPoint) const;
989 IMPORT_C TRect TwipsToPixels(const TRect& aTwipRect) const;
990 IMPORT_C TPoint PixelsToTwips(const TPoint& aPixelPoint) const;
991 IMPORT_C TRect PixelsToTwips(const TRect& aPixelRect) const;
992
999 virtual TInt HorizontalTwipsToPixels(TInt aTwips) const=0;
1000
1007 virtual TInt VerticalTwipsToPixels(TInt aTwips) const=0;
1008
1015 virtual TInt HorizontalPixelsToTwips(TInt aPixels) const=0;
1016
1023 virtual TInt VerticalPixelsToTwips(TInt aPixels) const=0;
1043 virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec)=0;
1044
1064 CFont*& /*aFont*/, const TFontSpec& /*aFontSpec*/) { return KErrNotSupported; }
1065
1088 CFont*& /*aFont*/, const TFontSpec& /*aFontSpec*/, TInt /*aMaxHeight*/) { return KErrNotSupported; }
1089
1100 virtual void ReleaseFont(CFont* aFont)=0;
1101 };
1102
1103class CGraphicsContext;
1115class CGraphicsDevice : public CBase , public MGraphicsDeviceMap
1116 {
1117public:
1121 virtual TDisplayMode DisplayMode() const=0;
1122
1126 virtual TSize SizeInPixels() const=0;
1127
1131 virtual TSize SizeInTwips() const=0;
1132
1138 virtual TInt CreateContext(CGraphicsContext*& aGC)=0;
1139
1143 virtual TInt NumTypefaces() const=0;
1144
1161 virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const=0;
1162
1175 virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const=0;
1176
1183 virtual void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const=0;
1184
1191 virtual void SetPalette(CPalette* aPalette)=0;
1192
1201 virtual TInt GetPalette(CPalette*& aPalette) const=0;
1202 };
1203
1213class TCodeSection
1214 {
1215public:
1217 TInt iStart;
1219 TInt iEnd;
1221
1227const TUid KFontCapitalAscent = {0x1020498E};
1228const TUid KFontMaxAscent = {0x10204B10};
1229const TUid KFontStandardDescent = {0x10204B11};
1230const TUid KFontMaxDescent = {0x10205AFC};
1231const TUid KFontLineGap = {0x10204B12};
1232const TUid KFontGetFontTable = {0x102872C1};
1233const TUid KFontGetGlyphOutline = {0x102872C2};
1234const TUid KFontReleaseGlyphOutline = {0x2002A1FD};
1235const TUid KFontReleaseFontTable = {0x2002AC24};
1236
1237
1251class CFont : public CBase
1252 {
1253 friend class CTypefaceStore;
1254public:
1255
1263 enum TTextDirection
1269 EVertical
1270 };
1271
1284 class TPositionParam
1285 {
1286 public:
1291 iPosInText(0),
1292 iOutputGlyphs(0)
1293 {
1294 }
1295
1296 enum
1297 {
1298 EMaxInputChars = 18, // ligatures cannot be made from more than 18 components
1299 EMaxOutputGlyphs = 8 // output can consist of up to 8 characters (one base and 7 combining characters)
1300 };
1301
1303 enum TFlags
1306 EFLogicalOrder = 1
1307 };
1311 TInt16 iDirection;
1313 TUint16 iFlags;
1315 TPtrC iText;
1316
1319 TInt iPosInText;
1328 class TOutput
1329 {
1330 public:
1335 TUint iCode;
1337 const TUint8* iBitmap;
1342 TRect iBounds;
1343 };
1344
1349 };
1350
1351
1361 class TMeasureTextInput
1363 public:
1366 iEndInputChar(KMaxTInt),
1368 iFlags(0),
1369 iMaxAdvance(KMaxTInt),
1370 iMaxBounds(KMaxTInt),
1371 iCharJustNum(0),
1372 iCharJustExcess(0),
1373 iWordJustNum(0),
1375 {
1376 }
1377
1379 enum TFlags
1380 {
1382 EFVisualOrder = 1,
1396
1402 TInt iEndInputChar;
1403
1405 TUint16 iDirection;
1406
1408 TUint16 iFlags;
1409
1411 TInt iMaxAdvance;
1414 TInt iMaxBounds;
1415
1417 TInt iCharJustNum;
1420 TInt iCharJustExcess;
1421
1423 TInt iWordJustNum;
1424
1426 TInt iWordJustExcess;
1427 };
1438 class TMeasureTextOutput
1439 {
1440 public:
1445 TInt iChars;
1447 TInt iGlyphs;
1451 TInt iGroups;
1453 TInt iSpaces;
1455 TRect iBounds;
1458 };
1459
1472 {
1479 };
1480
1481private:
1482 // virtual functions have been made protected and public non-virtual ones
1483 // added to convert CFont to a handle-body pattern. SC is kept throught the
1484 // new functions and BC is kept by keeping the protected functions in the
1485 // same place in the class, and therefore in the same place in the vtable
1490 virtual TUid DoTypeUid() const=0;
1495 virtual TInt DoHeightInPixels() const=0;
1500 virtual TInt DoAscentInPixels() const=0;
1501 IMPORT_C virtual TInt DoDescentInPixels() const;
1506 virtual TInt DoCharWidthInPixels(TChar aChar) const=0;
1511 virtual TInt DoTextWidthInPixels(const TDesC& aText) const=0;
1516 virtual TInt DoBaselineOffsetInPixels() const=0;
1521 virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels) const=0;
1526 virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const=0;
1531 virtual TInt DoMaxCharWidthInPixels() const=0;
1536 virtual TInt DoMaxNormalCharWidthInPixels() const=0;
1541 virtual TFontSpec DoFontSpecInTwips() const=0;
1543protected:
1544 IMPORT_C virtual TCharacterDataAvailability DoGetCharacterData(TUint aCode, TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap,TSize& aBitmapSize) const;
1545 IMPORT_C virtual TBool DoGetCharacterPosition(TPositionParam& aParam) const;
1546 IMPORT_C virtual TInt DoExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
1547
1548protected:
1549 IMPORT_C virtual ~CFont();
1550
1551public:
1552 inline TInt FontCapitalAscent() const;
1553 inline TInt FontMaxAscent() const;
1554 inline TInt FontStandardDescent() const;
1555 inline TInt FontMaxDescent() const;
1556 inline TInt FontLineGap() const;
1557 inline TInt FontMaxHeight() const;
1558
1559public:
1568 IMPORT_C TUid TypeUid() const;
1569
1576 IMPORT_C TInt HeightInPixels() const;
1586 IMPORT_C TInt AscentInPixels() const;
1587
1596 IMPORT_C TInt DescentInPixels() const;
1597
1605 IMPORT_C TInt CharWidthInPixels(TChar aChar) const;
1606
1613 IMPORT_C TInt TextWidthInPixels(const TDesC& aText) const;
1614
1621 IMPORT_C TInt BaselineOffsetInPixels() const;
1622
1636 IMPORT_C TInt TextCount(const TDesC& aText,TInt aWidthInPixels) const;
1637
1652 IMPORT_C TInt TextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const;
1653
1657 IMPORT_C TInt MaxCharWidthInPixels() const;
1658
1665 IMPORT_C TInt MaxNormalCharWidthInPixels() const;
1666
1670 IMPORT_C TFontSpec FontSpecInTwips() const;
1671 IMPORT_C TCharacterDataAvailability GetCharacterData(TUint aCode, TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap,TSize& aBitmapSize) const;
1672 IMPORT_C TBool GetCharacterPosition(TPositionParam& aParam) const;
1673 IMPORT_C TInt WidthZeroInPixels() const;
1674 IMPORT_C TInt MeasureText(const TDesC& aText, const TMeasureTextInput* aInput = NULL, TMeasureTextOutput* aOutput = NULL) const;
1675 IMPORT_C static TBool CharactersJoin(TInt aLeftCharacter, TInt aRightCharacter);
1676 IMPORT_C TInt ExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
1677 IMPORT_C TBool GetCharacterPosition2(TPositionParam& aParam, RShapeInfo& aShapeInfo) const;
1678
1686 IMPORT_C TInt TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const;
1687 };
1688
1689class CFbsBitmap;
1690class CWsBitmap;
1720class CGraphicsContext : public CBase
1721 {
1722public:
1723
1729 enum TTextAlign
1730 {
1732 ELeft,
1734 ECenter,
1736 ERight
1737 };
1738
1747 {
1751 EXor=2,
1753 EOr=4,
1755 EAnd=8,
1757 ELogicalOp=14,
1759 EInvertPen=16,
1761 EPenmode=32,
1763 EWriteAlpha=64,
1765
1766
1840 };
1841
1849 enum TPenStyle
1852 ENullPen,
1854 ESolidPen,
1856 EDottedPen,
1858 EDashedPen,
1872 enum TBrushStyle
1873 {
1875 ENullBrush,
1902 };
1903
1918 enum TFillRule
1919 {
1921 EAlternate,
1923 EWinding
1924 };
1925
1927 struct TDrawTextParam
1928 {
1929 public:
1931 iDirection(CFont::EHorizontal),
1932 iCharJustNum(0),
1933 iCharJustExcess(0),
1934 iWordJustNum(0),
1937 {}
1938 public:
1942 TInt iCharJustNum;
1944 TInt iCharJustExcess;
1946 TInt iWordJustNum;
1948 TInt iWordJustExcess;
1949 };
1951
1957 public:
1960 iParRightToLeft(EFalse)
1961 {}
1962 public:
1966 };
1974 {
1975 public:
1977 iStart(0),
1978 iEnd(KMaxTInt),
1979 iFlags(0)
1980 {
1981 }
1982 TInt iStart;
1983 TInt iEnd;
1984 TUint16 iFlags;
1985 /* Reserved for future use */
1986 TAny* iReserved1;
1988 TAny* iReserved3;
1989 TAny* iReserved4;
1991public:
1995 virtual CGraphicsDevice* Device() const=0;
2003 virtual void SetOrigin(const TPoint& aPos=TPoint(0,0))=0;
2004
2055 virtual void SetDrawMode(TDrawMode aDrawingMode)=0;
2056
2072 virtual void SetClippingRect(const TRect& aRect)=0;
2073
2079 virtual void CancelClippingRect()=0;
2080
2093 virtual void Reset()=0;
2094
2116 virtual void UseFont(const CFont* aFont)=0;
2117
2123 virtual void DiscardFont()=0;
2130 virtual void SetUnderlineStyle(TFontUnderline aUnderlineStyle)=0;
2137 virtual void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)=0;
2138 IMPORT_C static TInt JustificationInPixels(TInt aExcessPixels,TInt aTotalUnits,TInt aFirstUnit,TInt aNumUnits);
2139 IMPORT_C static TInt JustificationInPixels(TInt& aExcessPixels,TInt& aTotalUnits);
2140
2185 virtual void SetWordJustification(TInt aExcessWidth,TInt aNumGaps)=0;
2186
2262 virtual void SetCharJustification(TInt aExcessWidth,TInt aNumChars)=0;
2263
2279 virtual void SetPenColor(const TRgb& aColor)=0;
2319 virtual void SetPenStyle(TPenStyle aPenStyle)=0;
2320
2358 virtual void SetPenSize(const TSize& aSize)=0;
2359
2376 virtual void SetBrushColor(const TRgb& aColor)=0;
2377
2397 virtual void SetBrushStyle(TBrushStyle aBrushStyle)=0;
2398
2425 virtual void SetBrushOrigin(const TPoint& aOrigin)=0;
2426
2450 virtual void UseBrushPattern(const CFbsBitmap* aBitmap)=0;
2451
2464 virtual void DiscardBrushPattern()=0;
2465
2466
2482 virtual void MoveTo(const TPoint& aPoint)=0;
2483
2499 virtual void MoveBy(const TPoint& aVector)=0;
2513 virtual void Plot(const TPoint& aPoint)=0;
2514
2552 virtual void DrawArc(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd)=0;
2553
2558 virtual void DrawLine(const TPoint& aPoint1,const TPoint& aPoint2)=0;
2559
2566 virtual void DrawLineTo(const TPoint& aPoint)=0;
2567
2579 virtual void DrawLineBy(const TPoint& aVector)=0;
2580
2587 virtual void DrawPolyLine(const CArrayFix<TPoint>* aPointList)=0;
2588
2596 virtual void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints)=0;
2597
2643 virtual void DrawPie(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd)=0;
2659 virtual void DrawEllipse(const TRect& aRect)=0;
2660
2664 virtual void DrawRect(const TRect& aRect)=0;
2665
2684 virtual void DrawRoundRect(const TRect& aRect,const TSize& aCornerSize)=0;
2685
2701 virtual TInt DrawPolygon(const CArrayFix<TPoint>* aPointList,TFillRule aFillRule=EAlternate)=0;
2702
2720 virtual TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate)=0;
2721
2743 virtual void DrawBitmap(const TPoint& aTopLeft,const CFbsBitmap* aSource)=0;
2744
2766 virtual void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource)=0;
2767
2789 virtual void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect)=0;
2790
2805 virtual void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask)=0;
2806
2832 virtual void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask)=0;
2833
2849 virtual void DrawText(const TDesC& aText,const TPoint& aPosition) = 0;
2850
2905 virtual void DrawText(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TTextAlign aAlignment = ELeft,
2906 TInt aLeftMargin = 0) = 0;
2907 IMPORT_C virtual void DrawText(const TDesC& aText,const TPoint& aPosition,const TDrawTextParam& aParam);
2908 IMPORT_C virtual void Reserved();
2909 IMPORT_C TInt DrawTextExtended(const TDesC& aText,const TPoint& aPosition,const TDrawTextExtendedParam& aParam);
2910
2921 virtual void MapColors(const TRect &aRect,const TRgb *aColors,TInt aNumPairs,TBool aMapForwards) = 0;
2922
2937 virtual TInt SetClippingRegion(const TRegion &aRegion) = 0;
2938
2941 virtual void CancelClippingRegion() = 0;
2942
2947 virtual void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp) = 0;
2948
2956 virtual void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0) = 0;
2957
2958 IMPORT_C TInt GetUnderlineMetrics(TInt& aTop,TInt& aBottom);
2959
2963 IMPORT_C TInt SetShadowColor(const TRgb& aShadowColor);
2964
2968 IMPORT_C TInt GetShadowColor(TRgb& aShadowColor);
2969
2975 IMPORT_C TBool IsFbsBitGc() const;
2976
2977 IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* iParam,const TPoint& aPosition);
2978 IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* iParam,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0);
2979 IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* iParam,const TPoint& aPosition,const TDrawTextParam& aParam);
2980
2981 IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* iParam,const TPoint& aPos,TBool aUp);
2982 IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* iParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
2983
2984 IMPORT_C TInt DrawTextExtended(const TDesC& aText,const TTextParameters* iParam,const TPoint& aPosition,const TDrawTextExtendedParam& aParam);
2985
2986protected:
2987
2997 IMPORT_C virtual TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
2998
3002 IMPORT_C virtual void Reserved_CGraphicsContext_2();
3003 };
3004
3005
3029class CBitmapContext : public CGraphicsContext
3030 {
3031public:
3037 virtual void Clear()=0;
3038
3046 virtual void Clear(const TRect& aRect)=0;
3047
3055 virtual void CopyRect(const TPoint& aOffset,const TRect& aRect)=0;
3056
3064 virtual void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap)=0;
3065
3079 virtual void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aRect)=0;
3080
3113 virtual void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask)=0;
3114
3118 virtual void SetFaded(TBool aFaded)=0;
3119
3139 virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap)=0;
3140
3159 virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt) = 0;
3160
3172 virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt) = 0;
3173
3174protected:
3175
3176 /*
3177 Implementations from CGraphicsContext
3178 @see CGraphicsContext::APIExtension(TUid, TAny*&, TAny*)
3179 */
3180 IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
3181 /*
3182 Implementations from CGraphicsContext
3183 @see CGraphicsContext::Reserved_CGraphicsContext_2()
3184 */
3185 IMPORT_C void Reserved_CGraphicsContext_2();
3186
3187 IMPORT_C virtual void Reserved_CBitmapContext_1();
3188 IMPORT_C virtual void Reserved_CBitmapContext_2();
3189 IMPORT_C virtual void Reserved_CBitmapContext_3();
3190 };
3191
3204class CBitmapDevice : public CGraphicsDevice
3205 {
3206public:
3215 virtual void GetPixel(TRgb& aColor,const TPoint& aPixel) const=0;
3216
3233 virtual void GetScanLine(TDes8& aBuf,const TPoint& aStartPixel,TInt aLength,TDisplayMode aDispMode) const=0;
3234
3245 virtual TInt AddFile(const TDesC& aName,TInt& aId)=0;
3246
3252 virtual void RemoveFile(TInt aId=0)=0;
3253
3272 virtual TInt GetNearestFontInPixels(CFont*& aFont, const TFontSpec& aFontSpec) = 0;
3273
3293 CFont*& /*aFont*/, const TFontSpec& /*aFontSpec*/) { return KErrNotSupported; }
3294
3317 CFont*& /*aFont*/, const TFontSpec& /*aFontSpec*/, TInt /*aMaxHeight*/) { return KErrNotSupported; }
3318
3340 virtual TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const=0;
3341 inline TInt CreateBitmapContext(CBitmapContext*& aGC);
3342 };
3343
3350class TMargins
3351 {
3352public:
3353 IMPORT_C void InternalizeL(RReadStream& aStream);
3354 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
3355 IMPORT_C TBool operator==(const TMargins& aMargins) const;
3356 IMPORT_C TBool operator!=(const TMargins& aMargins) const;
3357public:
3359 TInt iLeft;
3361 TInt iRight;
3363 TInt iTop;
3365 TInt iBottom;
3366 };
3367
3376 {
3377public:
3379 enum TScalingType
3380 {
3388 };
3389public:
3390 inline TPictureCapability(TScalingType aScalingType,TBool aCroppable);
3391public:
3395 TBool iIsCroppable;
3396 };
3397
3425class CPicture : public CBase
3426 {
3427public:
3429 enum TDetach
3430 {
3437 };
3438public:
3439 IMPORT_C virtual ~CPicture();
3452 virtual void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap) const=0;
3453 IMPORT_C virtual TStreamId StoreL(CStreamStore& aStore) const; // assumes no sub streams
3454 virtual void DetachFromStoreL(TDetach /*aDegree*/=EDetachFull) {}
3455
3464 virtual void ExternalizeL(RWriteStream& aStream) const =0;
3465
3469 virtual void GetOriginalSizeInTwips(TSize& aSize) const =0;
3470 IMPORT_C virtual void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); // does nothing
3471 IMPORT_C virtual void SetCropInTwips(const TMargins& aMargins); // does nothing
3472 IMPORT_C virtual TPictureCapability Capability() const; // no scale, no crop
3473 IMPORT_C virtual void GetCropInTwips(TMargins& aMargins) const; // returns no crop
3474 IMPORT_C virtual TInt ScaleFactorWidth() const; // returns no scaling
3475 IMPORT_C virtual TInt ScaleFactorHeight() const; // returns no scaling
3476 IMPORT_C virtual TBool LineBreakPossible(TUint aClass,TBool aBeforePicture,TBool aHaveSpaces) const;
3477 IMPORT_C virtual TBool NativePixelSize(TSize& aPixelSize);
3478
3479 IMPORT_C void GetSizeInPixels(MGraphicsDeviceMap* aMap, TSize& aSize) const;
3480 IMPORT_C void SetSizeInPixels(MGraphicsDeviceMap* aMap, const TSize& aSize);
3481 IMPORT_C void AddCropInPixels(MGraphicsDeviceMap* aMap, const TMargins& aMargins);
3482 IMPORT_C void GetSizeInTwips(TSize& aSize) const;
3483 IMPORT_C void SetSizeInTwips(const TSize& aSize);
3484 IMPORT_C void ResetToOriginal();
3485protected:
3486 IMPORT_C CPicture();
3487 };
3488
3489
3502class TPictureHeader
3503 {
3504public:
3505 IMPORT_C TPictureHeader();
3506 IMPORT_C void InternalizeL(RReadStream& aStream);
3507 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
3508 IMPORT_C void DeletePicture();
3509public:
3512 TSwizzle<CPicture> iPicture;
3518
3519
3529class MPictureFactory
3530 {
3531public:
3549 virtual void NewPictureL(TPictureHeader& aHeader,const CStreamStore& aDeferredPictureStore)const=0;
3550 };
3552// printing classes
3560const TInt KMaxPrinterModelNameLength=0x20;
3561
3570
3582class TPageSpec
3583 {
3584public:
3586 enum TPageOrientation
3587 {
3589 EPortrait,
3592 };
3593public:
3594 IMPORT_C TPageSpec();
3595 IMPORT_C TPageSpec(TPageOrientation aOrientation,const TSize& aSize);
3596 IMPORT_C void InternalizeL(RReadStream& aStream);
3597 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
3598 IMPORT_C TSize OrientedPageSize() const;
3599 IMPORT_C TBool operator==(const TPageSpec& aPageSpec) const;
3600 IMPORT_C TBool operator!=(const TPageSpec& aPageSpec) const;
3601public:
3610 };
3611
3612
3623class TBandAttributes
3624 {
3625public:
3627 TRect iRect;
3629 TBool iTextIsIgnored; // any text drawing to this band is ignored
3631 TBool iGraphicsIsIgnored; // any graphics drawing to this band is ignored
3633 TBool iFirstBandOnPage;
3648class CPrinterPort : public CBase
3650public:
3657 virtual void WriteRequest(const TDesC8& aBuf,TRequestStatus& aRequestStatus)=0;
3658
3660 virtual void Cancel()=0;
3661 };
3662
3663
3671 {
3672public:
3678 TUid iUid;
3679public:
3680 IMPORT_C void InternalizeL(RReadStream& aStream);
3681 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
3682 };
3684
3695 {
3696public:
3700 TStreamId iModelDataStreamId;
3701public:
3702 IMPORT_C void InternalizeL(RReadStream& aStream);
3703 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
3704 };
3705
3706
3721class CPrinterControl : public CBase
3722 {
3723public:
3725 enum TMoreOnPage
3726 {
3732public:
3733 IMPORT_C ~CPrinterControl();
3734
3738 virtual TInt BandsPerPage()=0;
3739
3753 virtual TMoreOnPage QueueGetBand(TRequestStatus& aStatus, TBandAttributes& aBand)=0; // returns affirmative if more to print on current page
3754
3764 virtual void QueueEndPrint(TRequestStatus& aStatus)=0;
3765
3769 virtual void AbortPrint()=0; // tidy up synchronously in a short time, return success code
3770protected:
3771 IMPORT_C CPrinterControl(CPrinterPort* aPrinterPort);
3772protected:
3777 ENotPrinting,
3779 EPrinting
3780 };
3785 };
3786
3787class CDictionaryStore;
3788class RFs;
3789
3815class CPrinterDevice : public CGraphicsDevice
3816 {
3817public:
3818 IMPORT_C ~CPrinterDevice();
3819
3824
3828 IMPORT_C virtual void SelectPageSpecInTwips(const TPageSpec& aPageSpec);
3829 IMPORT_C virtual TRect PrintablePageInPixels() const;
3830
3834 virtual TPrinterModelEntry Model()const =0;
3835
3842 virtual TInt SetModel(const TPrinterModelHeader& aModel,CStreamStore& aStore)=0;
3843
3852 virtual void CreateControlL(CPrinterPort* aPrinterPort)=0;
3853 IMPORT_C virtual void DeleteControl();
3854
3860 virtual void InternalizePropertiesL(RReadStream& /*aStream*/) {}
3867 virtual void ExternalizePropertiesL(RWriteStream& /*aStream*/) const {}
3868 IMPORT_C void RestorePropertiesL();
3869 IMPORT_C void StorePropertiesL() const;
3870protected:
3871 IMPORT_C CPrinterDevice();
3872public:
3894class CPrinterModelList : public CBase
3895 {
3896public:
3900 virtual TInt ModelCount() const=0;
3901
3911 virtual const TPrinterModelEntry operator[](TInt anIndex)=0;
3912
3917 virtual TInt UidToNum(TUid aModelUid) const=0;
3919
3920
3931 {
3932public:
3943 virtual void PrintBandL(CGraphicsDevice* aDevice,TInt aPageNo,const TBandAttributes& aBandInPixels)=0;
3944 };
3945
3951const TInt KPdrStoreFileUidVal=268435514;
3952
3953const TInt KPdlUidVal=268450588;
3954const TInt KUdlUidVal=268450589;
3955
3971class CPrinterDriverUI : public CBase
3972 {
3973protected:
3974 IMPORT_C CPrinterDriverUI();
3975public:
3976 IMPORT_C virtual TBool BeforePrintL();
3977 IMPORT_C virtual void AfterPrintL();
3978 IMPORT_C virtual void SetPropertiesL();
3979 IMPORT_C virtual TBool CanSetProperties();
3980
3984 virtual TInt SetPrinterDevice(CPrinterDevice* aPrinterDevice)=0;
3985 };
3986
3987class CFileStore;
3988
3989
4015class CPrinterDriver : public CBase
4017public:
4018 IMPORT_C static CPrinterDriver* NewL();
4019 IMPORT_C ~CPrinterDriver();
4020 IMPORT_C void OpenPdrL(const TDesC &aName);
4021 IMPORT_C void Close();
4022 IMPORT_C TInt NumModels() const;
4023 IMPORT_C TPrinterModelEntry Model(TInt aNum) const;
4024
4028 inline CPrinterDevice* PrinterDevice() {return iPrinterDevice;}
4031private:
4033 void DeletePrinterDevice();
4034 void DoOpenPdrL(const TDesC &aName);
4035 void DoCreatePrinterDeviceL(TUid aModelUid);
4036 void LoadLibraryL(RLibrary& aLibrary,const TDesC& aExt,TUid aUid2);
4037private:
4038 RFs iFs;
4039 CFileStore *iPdrStore;
4040 TInt iNumModels;
4041 TPrinterModelHeader* iModelList;
4042 TFileName iPdlName;
4043 TUid iPdlUid;
4044 RLibrary iPdlLibrary;
4045 CPrinterDevice* iPrinterDevice;
4046 RLibrary iUdlLibrary;
4048
4049class RResourceFile;
4050
4051
4057 {
4058public:
4059 IMPORT_C static CPdrModelList* NewL();
4060 IMPORT_C virtual ~CPdrModelList();
4061 IMPORT_C TInt ModelCount() const;
4062 IMPORT_C const TPrinterModelEntry operator [] (TInt anIndex);
4063 IMPORT_C TInt UidToNum(TUid aModelUid) const; // returns KErrNotFound the model uid is not matched
4064 IMPORT_C void AddDirectoryL(const TDesC& aDir);
4066 IMPORT_C CPrinterDriver* CreatePrinterDriverL(TInt anIndex);
4067private:
4068 CPdrModelList();
4069 void ConstructL();
4070private:
4071 class TFileEntry
4072 {
4073 public:
4074 TFileName iFileName;
4075 TDesC* iDirectory;
4076 };
4077 class TModelEntry
4078 {
4079 public:
4080 TPrinterModelEntry iEntry;
4081 TFileEntry* iFile;
4082 };
4083private:
4084 void ScanDirectoryL(TInt aDirIndex);
4085 void ListModelsL(TInt aFileIndex, TParse& aParser, TFileName& aNameOfLoadedResourceFile, TFileName& aTempFileName, RResourceFile& aResourceFile, HBufC8*& aResource);
4086 HBufC* NewPathBufL(const TFileEntry& aFileEntry);
4087private:
4088 CArrayFixSeg<TModelEntry>* iModelArray;
4090 CArrayFixFlat<HBufC*>* iDirectoryArray;
4091 RFs iFileServer;
4092 };
4093
4094
4107 {
4108public:
4109 IMPORT_C TZoomFactor();
4110 IMPORT_C ~TZoomFactor();
4111 inline TZoomFactor(const MGraphicsDeviceMap* aDevice);
4112 inline TZoomFactor(const TZoomFactor* aDevice);
4113 IMPORT_C TInt ZoomFactor() const;
4114 IMPORT_C void SetZoomFactor(TInt aZoomFactor);
4115 inline void SetGraphicsDeviceMap(const MGraphicsDeviceMap* aDevice);
4116 inline const MGraphicsDeviceMap* GraphicsDeviceMap() const;
4117 IMPORT_C void SetTwipToPixelMapping(const TSize& aSizeInPixels,const TSize& aSizeInTwips);
4118 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwipWidth) const;
4119 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwipHeight) const;
4120 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixelWidth) const;
4121 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixelHeight) const;
4122 IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
4123 IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
4124 IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
4125 IMPORT_C void ReleaseFont(CFont* aFont);
4126public:
4127
4129 enum {EZoomOneToOne=1000};
4130private:
4131 TInt iZoomFactor;
4132 const MGraphicsDeviceMap* iDevice;
4133 };
4135#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
4136#include <graphics/gdi/gdistructs.h>
4137#include <graphics/gdi/gdiinline.inl>
4138#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
4139
4140#include <gdi.inl>
4141
4142#endif // __GDI_H__
Array of fixed length objects contained within a flat dynamic buffer.
Definition e32base.h:488
Array of fixed length objects contained within a segmented buffer.
Definition e32base.h:589
A thin templated base class for arrays of fixed length objects.
Definition e32base.h:402
Container Base Class.
Definition e32base.h:60
An abstract, device-independent, interface to bitmapped graphics contexts.
Definition gdi.h:3181
IMPORT_C void Reserved_CGraphicsContext_2()
A reserved virtual function for future use.
virtual void Clear()=0
Clears the whole bitmap.
virtual IMPORT_C void Reserved_CBitmapContext_3()
virtual TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CFbsBitmap *aSrcBmp, const TRect &aSrcRect, const CFbsBitmap *aAlphaBmp, const TPoint &aAlphaPt)=0
Performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext, using the data from ...
virtual void SetFadingParameters(TUint8 aBlackMap, TUint8 aWhiteMap)=0
Sets the fading parameters.
virtual IMPORT_C void Reserved_CBitmapContext_2()
virtual void BitBltMasked(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask)=0
Performs a masked bitmap block transfer.
IMPORT_C TInt APIExtension(TUid aUid, TAny *&aOutput, TAny *aInput)
virtual void SetFaded(TBool aFaded)=0
Sets whether the graphics context is faded.
virtual IMPORT_C void Reserved_CBitmapContext_1()
virtual void BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap)=0
Performs a bitmap block transfer.
virtual void CopyRect(const TPoint &aOffset, const TRect &aRect)=0
Copies a rectangle.
Defines an abstract interface for the capabilities and attributes of a bitmapped graphics device.
Definition gdi.h:3358
virtual void GetPixel(TRgb &aColor, const TPoint &aPixel) const =0
Gets the RGB colour of an individual pixel on a bitmapped graphics device.
virtual void RemoveFile(TInt aId=0)=0
Removes a font file from the font store.
virtual TInt GetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt)
Definition gdi.h:3475
virtual TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec)=0
TInt CreateBitmapContext(CBitmapContext *&aGC)
Creates a bitmap context for this bitmap device.
virtual TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const =0
Gets the height, in pixels, of the specified typeface at one of its defined heights.
virtual void GetScanLine(TDes8 &aBuf, const TPoint &aStartPixel, TInt aLength, TDisplayMode aDispMode) const =0
Copies a scanline into a buffer.
virtual TInt GetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &)
Definition gdi.h:3449
virtual TInt AddFile(const TDesC &aName, TInt &aId)=0
Adds a font file to the device's typeface store.
Font cache.
Definition gdi.h:1022
IMPORT_C ~CFontCache()
Destructor.
TInt iNumMisses
The number of cache misses since the font cache was created i.e.
Definition gdi.h:1036
IMPORT_C CFont * AddEntryL(CFont *aFont, const TFontSpec &aFontSpec)
Adds a font entry to the cache.
IMPORT_C CFont * RemoveFirstEntry()
Removes the first entry from the font cache and returns it.
TInt iNumHits
The number of cache hits since the font cache was created i.e.
Definition gdi.h:1033
IMPORT_C CFontCache()
Default constructor.
IMPORT_C CFont * Search(const TFontSpec &aFontSpec)
Searches the cache for a specified font.
Input parameter block.
Definition gdi.h:1464
TUint16 iDirection
The direction in which to draw the text.
Definition gdi.h:1507
TInt iWordJustExcess
The amount of space to be used for word spacing.
Definition gdi.h:1528
TInt iCharJustExcess
The amount of space to be used for letter spacing.
Definition gdi.h:1522
TInt iMaxAdvance
The maximum advance.
Definition gdi.h:1513
TUint16 iFlags
Flags from TFlags.
Definition gdi.h:1510
TInt iEndInputChar
Index specifying the final input character.
Definition gdi.h:1504
TInt iStartInputChar
Starting index specifying first input character in iText.
Definition gdi.h:1497
TInt iMaxBounds
The maximum width (or height if drawing vertically) of bounds.
Definition gdi.h:1516
TInt iWordJustNum
The number of spaces to be used for word spacing.
Definition gdi.h:1525
TFlags
Flags for TMeasureTextInput::iFlags.
Definition gdi.h:1482
@ EFVisualOrder
Input text is visually ordered left-to-right.
Definition gdi.h:1484
@ EFIncludePenPositionInBoundsCheck
Flag to consider side bearings when checking bounds for line-break.
Definition gdi.h:1489
@ EFVisualOrderRightToLeft
Input text is visually ordered right-to-left.
Definition gdi.h:1487
TInt iCharJustNum
The number of glyph groups to be letter-spaced.
Definition gdi.h:1519
Output parameter block.
Definition gdi.h:1543
TInt iChars
The number of input characters that would be drawn.
Definition gdi.h:1549
TSize iMaxGlyphSize
The maximum width and height of any glyph.
Definition gdi.h:1561
TInt iGroups
The number of groups that would be drawn.
Definition gdi.h:1555
TInt iSpaces
The number of word spaces (U+0020) that would be drawn.
Definition gdi.h:1557
TInt iGlyphs
The number of glyphs that would be drawn.
Definition gdi.h:1551
TRect iBounds
The bounding box of all the glyphs that would be drawn.
Definition gdi.h:1559
const TUint8 * iBitmap
Bitmap data for the glyph, if available.
Definition gdi.h:1437
TOutput()
Standard constructor.
Definition gdi.h:1432
TRect iBounds
Bitmap bounds relative to the original pen position.
Definition gdi.h:1442
TUint iCode
Character or glyph code.
Definition gdi.h:1435
TSize iBitmapSize
Size of the bitmap before algorithmic bolding, size multiplication, etc.
Definition gdi.h:1440
Complicated parameter block used for contextual glyph selection, ligature creation and diacritic plac...
Definition gdi.h:1382
TOutput iOutput[EMaxOutputGlyphs]
Information about the glyphs that were output.
Definition gdi.h:1446
TUint16 iFlags
Input: Flags from TFlags.
Definition gdi.h:1410
TInt16 iDirection
Input: Orientation (EHorizontal or EVertical) in which to draw the text.
Definition gdi.h:1408
TFlags
Flags for TPositionParam::iFlags.
Definition gdi.h:1401
@ EFLogicalOrder
Input text is logically ordered not visually ordered.
Definition gdi.h:1403
TPositionParam()
Standard constructor.
Definition gdi.h:1385
TInt iPosInText
Input and output: Position within iText to shape.
Definition gdi.h:1416
TPtrC iText
Input: Text containing the characters to be positioned.
Definition gdi.h:1412
TPoint iPen
Input and output: Pen position.
Definition gdi.h:1418
TInt iOutputGlyphs
Number of glyphs actually output.
Definition gdi.h:1448
Abstract font interface.
Definition gdi.h:1347
TInt FontCapitalAscent() const
Gets the ascent of an ANSI capital letter in the font whether or not there are any ANSI capitals in t...
IMPORT_C TInt ExtendedFunction(TUid aFunctionId, TAny *aParam=NULL) const
Enables the caller to access a particular API extension function.
virtual IMPORT_C TBool DoGetCharacterPosition(TPositionParam &aParam) const
Overridable function innards of GetCharacterPosition and GetCharacterPosition2.
TInt FontLineGap() const
Gets the suggested line gap for the font.
TCharacterDataAvailability
Definition gdi.h:1578
@ ENoCharacterData
No font information available.
Definition gdi.h:1580
@ ECharacterWidthOnly
Width information only is available.
Definition gdi.h:1582
@ EAllCharacterData
All character data is available.
Definition gdi.h:1584
IMPORT_C TUid TypeUid() const
Gets run-time identity of the actual font type.
IMPORT_C TFontSpec FontSpecInTwips() const
Gets the font specification of this font in twips.
static IMPORT_C TBool CharactersJoin(TInt aLeftCharacter, TInt aRightCharacter)
Determines if aLeftCharacter and aRightCharacter affect each other's contextual glyph form if placed ...
IMPORT_C TInt HeightInPixels() const
Gets the font height in pixels.
IMPORT_C TInt MeasureText(const TDesC &aText, const TMeasureTextInput *aInput=NULL, TMeasureTextOutput *aOutput=NULL) const
Text measurement function.
IMPORT_C TInt TextWidthInPixels(const TDesC &aText) const
Gets the width in pixels of the specified descriptor when displayed in this font.
IMPORT_C TInt AscentInPixels() const
Gets the font ascent in pixels.
virtual IMPORT_C ~CFont()
Default destructor.
IMPORT_C TInt MaxNormalCharWidthInPixels() const
Gets the width in pixels of the widest normal character in this font.
TTextDirection
Text direction flags.
Definition gdi.h:1359
@ EHorizontal
Text is drawn horizontally.
Definition gdi.h:1362
@ EVertical
Text is drawn vertically.
Definition gdi.h:1364
TInt FontMaxAscent() const
Gets the max ascent of any pre-composed glyph in the font.
virtual IMPORT_C TCharacterDataAvailability DoGetCharacterData(TUint aCode, TOpenFontCharMetrics &aMetrics, const TUint8 *&aBitmap, TSize &aBitmapSize) const
Gets the character metrics for a character.
IMPORT_C TInt TextCount(const TDesC &aText, TInt aWidthInPixels) const
Gets how much of the specified descriptor can be displayed in this font without exceeding the specifi...
IMPORT_C TBool GetCharacterPosition2(TPositionParam &aParam, RShapeInfo &aShapeInfo) const
Takes Unicode text and produces the glyph cluster for the first character in that text plus any combi...
IMPORT_C TCharacterDataAvailability GetCharacterData(TUint aCode, TOpenFontCharMetrics &aMetrics, const TUint8 *&aBitmap, TSize &aBitmapSize) const
Gets the character metrics for a character.
IMPORT_C TInt CharWidthInPixels(TChar aChar) const
Gets the width in pixels in this font of the specified character.
TInt FontMaxDescent() const
Gets the max descent of any pre-composed glyph in the font.
TInt FontStandardDescent() const
Gets the descent of an ANSI descending character in the font.
IMPORT_C TInt DescentInPixels() const
Gets the font descent in pixels.
IMPORT_C TBool GetCharacterPosition(TPositionParam &aParam) const
Transforms one cluster of characters (base character plus combining marks, ligature or indic syllable...
virtual IMPORT_C TInt DoExtendedFunction(TUid aFunctionId, TAny *aParam=NULL) const
API extension system that enables the caller to access a particular API extension function.
IMPORT_C TInt MaxCharWidthInPixels() const
Gets the width in pixels of the widest character in this font.
IMPORT_C TInt WidthZeroInPixels() const
Gets the width of the zero character of this font in pixels.
IMPORT_C TInt BaselineOffsetInPixels() const
Gets the baseline offset in pixels.
TInt FontMaxHeight() const
Gets the (positive) maximum height in pixels of the font.
Parameters used in drawing text within supplied context.
Definition gdi.h:2116
Abstract base class for all graphics contexts.
Definition gdi.h:1851
virtual void SetPenStyle(TPenStyle aPenStyle)=0
Sets the line drawing style for the pen.
virtual void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)=0
Sets the strikethrough style.
virtual IMPORT_C void Reserved_CGraphicsContext_2()
A reserved virtual function for future use.
virtual void DrawArc(const TRect &aRect, const TPoint &aStart, const TPoint &aEnd)=0
Draws an arc.
@ EDrawModeOR
Bitwise ORs the pen and brush colours with the screen colour.
Definition gdi.h:1953
@ EDrawModeNOTPEN
Inverts the pen and brush colours.
Definition gdi.h:1967
@ EDrawModeANDNOT
Inverts the screen colour before ANDing.
Definition gdi.h:1947
@ EDrawModeNOTXOR
Inverts the pen and brush colours before XORing.
Definition gdi.h:1959
@ EDrawModeNOTAND
Inverts the pen and brush colours before ANDing.
Definition gdi.h:1943
@ EDrawModeNOTSCREEN
Inverts the colour of each pixel that is drawn over, (pen and brush attributes are ignored).
Definition gdi.h:1962
@ EDrawModeORNOT
Inverts the pen and brush colours before ORing.
Definition gdi.h:1970
@ EDrawModeNOTORNOT
Inverts the screen and pen and brush colours before ORing.
Definition gdi.h:1973
@ EDrawModeWriteAlpha
Writes alpha information in the source directly into the destination, rather than blending.
Definition gdi.h:1975
@ EDrawModeNOTOR
Inverts the screen colour before ORing.
Definition gdi.h:1965
@ EDrawModePEN
Uses both pen and brush colour as they are.
Definition gdi.h:1945
@ EDrawModeAND
Bitwise ANDs the pen and brush colours with the screen colour.
Definition gdi.h:1940
@ EDrawModeXOR
Bitwise XORs the pen and brush colours with the screen colour.
Definition gdi.h:1950
@ EDrawModeNOTANDNOT
Inverts the screen and pen and brush colours before ANDing.
Definition gdi.h:1956
@ EWriteAlpha
64
Definition gdi.h:1897
virtual void Plot(const TPoint &aPoint)=0
Draws a single point.
virtual void MoveBy(const TPoint &aVector)=0
Sets the drawing point relative to the current co-ordinates.
virtual void Reset()=0
Resets the graphics context to its default settings:
IMPORT_C TInt GetUnderlineMetrics(TInt &aTop, TInt &aBottom)
IMPORT_C TInt GetShadowColor(TRgb &aShadowColor)
Get the font's shadow colour.
virtual void DrawEllipse(const TRect &aRect)=0
Draws and fills an ellipse.
virtual void SetBrushColor(const TRgb &aColor)=0
Sets the brush colour.
IMPORT_C TInt SetShadowColor(const TRgb &aShadowColor)
Set the font's shadow colour.
@ ESolidBrush
The brush fills with a solid single colour, determined by SetBrushColor() and the drawing mode.
Definition gdi.h:2018
@ ERearwardDiagonalHatchBrush
The brush fills with rearward diagonal hatching lines going from top left to bottom right.
Definition gdi.h:2033
@ EDiamondCrossHatchBrush
The brush fills with forward diagonal and rearward diagonal hatching lines going from bottom left to ...
Definition gdi.h:2041
@ EHorizontalHatchBrush
The brush fills with horizontal hatching lines going from left to right.
Definition gdi.h:2030
@ ENullBrush
The brush fill has no effect (default).
Definition gdi.h:2015
@ EForwardDiagonalHatchBrush
The brush fills with diagonal hatching lines going from bottom left to top right.
Definition gdi.h:2027
@ ESquareCrossHatchBrush
The brush fills with horizontal and vertical hatching lines going from left to right plus lines going...
Definition gdi.h:2037
@ EVerticalHatchBrush
The brush fills with vertical hatching lines going from top to bottom.
Definition gdi.h:2024
@ EPatternedBrush
The brush fills with a selected bitmap pattern, set by UseBrushPattern().
Definition gdi.h:2021
virtual TInt SetClippingRegion(const TRegion &aRegion)=0
Sets the clipping region, any items that fall outside the extent of the clipping region will not be d...
virtual void MapColors(const TRect &aRect, const TRgb *aColors, TInt aNumPairs, TBool aMapForwards)=0
Maps pixels in the specified rectangle.
static IMPORT_C TInt JustificationInPixels(TInt aExcessPixels, TInt aTotalUnits, TInt aFirstUnit, TInt aNumUnits)
Gets the amount of space in pixels by which to adjust letter or word spacing, given the total number ...
virtual void UseFont(const CFont *aFont)=0
Sets the device font to be used for text drawing.
virtual void DrawLineBy(const TPoint &aVector)=0
Draws a straight line relative to the current drawing point, using a vector.
virtual TInt DrawPolygon(const CArrayFix< TPoint > *aPointList, TFillRule aFillRule=EAlternate)=0
Draws and fills a polygon defined using an array of points.
virtual CGraphicsDevice * Device() const =0
Gets a pointer to the graphics context's graphics device.
virtual void DrawText(const TDesC &aText, const TPoint &aPosition)=0
Draws text without a surrounding box.
virtual void MoveTo(const TPoint &aPoint)=0
Sets the drawing point relative to the co-ordinate origin.
virtual void DrawTextVertical(const TDesC &aText, const TPoint &aPos, TBool aUp)=0
Draws vertical text in the specified direction.
virtual void SetUnderlineStyle(TFontUnderline aUnderlineStyle)=0
Sets the underline style.
virtual void DrawPie(const TRect &aRect, const TPoint &aStart, const TPoint &aEnd)=0
Draws and fills a pie slice.
virtual void DrawPolyLine(const CArrayFix< TPoint > *aPointList)=0
Draws a polyline from a set of points in an array.
virtual void SetWordJustification(TInt aExcessWidth, TInt aNumGaps)=0
Adjusts the spaces between words to stretch or squeeze to a certain width.
virtual void SetClippingRect(const TRect &aRect)=0
Sets the clipping rectangle.
@ EWinding
Fill areas with winding numbers greater than zero.
Definition gdi.h:2065
@ EAlternate
Only fill areas with odd winding numbers.
Definition gdi.h:2063
virtual void SetCharJustification(TInt aExcessWidth, TInt aNumChars)=0
Sets character justification.
virtual void SetPenSize(const TSize &aSize)=0
Sets the line drawing size for the pen.
virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aSource)=0
Draws a bitmap at the specified point.
virtual void SetBrushStyle(TBrushStyle aBrushStyle)=0
Sets the brush style.
virtual void DiscardBrushPattern()=0
Discards a non-built-in brush pattern.
virtual void SetPenColor(const TRgb &aColor)=0
Sets the pen colour.
TTextAlign
Text alignment.
Definition gdi.h:1862
@ ERight
Text is right-aligned.
Definition gdi.h:1868
@ ELeft
Text is left-aligned.
Definition gdi.h:1864
@ ECenter
Text is centred.
Definition gdi.h:1866
@ EDotDashPen
A line of alternating dashes and dots.
Definition gdi.h:1999
@ EDashedPen
A dashed line.
Definition gdi.h:1996
@ EDottedPen
A dotted line.
Definition gdi.h:1994
@ EDotDotDashPen
A line of alternating single dashes and pairs of dots.
Definition gdi.h:2002
@ ESolidPen
A solid line (default).
Definition gdi.h:1992
@ ENullPen
The pen does not draw.
Definition gdi.h:1990
virtual void DrawRoundRect(const TRect &aRect, const TSize &aCornerSize)=0
Draws and fills a rectangle with rounded corners.
virtual void DrawLineTo(const TPoint &aPoint)=0
Draws a straight line from the current drawing point to a specified point.
virtual void DrawLine(const TPoint &aPoint1, const TPoint &aPoint2)=0
Draws a straight line between two points.
virtual void SetOrigin(const TPoint &aPos=TPoint(0, 0))=0
Sets the position of the co-ordinate origin.
virtual void DrawRect(const TRect &aRect)=0
Draws and fills a rectangle.
virtual void UseBrushPattern(const CFbsBitmap *aBitmap)=0
Sets the brush pattern to the specified bitmap.
virtual void CancelClippingRegion()=0
Cancels the current clipping region.
virtual void SetBrushOrigin(const TPoint &aOrigin)=0
Sets the brush pattern origin.
virtual void DrawBitmapMasked(const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask)=0
Draws a specified rectangle of a source bitmap to fit into a given rectangle using a given mask.
virtual IMPORT_C void Reserved()
Reserved function for future use.
IMPORT_C TInt DrawTextExtended(const TDesC &aText, const TPoint &aPosition, const TDrawTextExtendedParam &aParam)
Draws text, optionally changing its direction (right-to-left / left-to-right).
virtual void CancelClippingRect()=0
Cancels any clipping rectangle.
virtual void DiscardFont()=0
Discards a font.
IMPORT_C TBool IsFbsBitGc() const
Determine if the Gc is a CFbsBitGc.
virtual void SetDrawMode(TDrawMode aDrawingMode)=0
Sets the drawing mode.
virtual IMPORT_C TInt APIExtension(TUid aUid, TAny *&aOutput, TAny *aInput)
Specifies the interface for concrete device classes.
Definition gdi.h:1205
virtual TDisplayMode DisplayMode() const =0
Gets the display mode of the device.
virtual TSize SizeInTwips() const =0
Gets the size of the device area in twips.
virtual void SetPalette(CPalette *aPalette)=0
Sets the device's palette.
virtual TInt GetPalette(CPalette *&aPalette) const =0
Gets the device's current palette.
virtual void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const =0
Gets typeface information for a specified typeface.
virtual TInt CreateContext(CGraphicsContext *&aGC)=0
Creates a graphics context for the device.
virtual TSize SizeInPixels() const =0
Gets the size of the device area in pixels.
virtual TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const =0
Get the height of a font in twips.
virtual TInt NumTypefaces() const =0
Gets the number of typefaces supported by the graphics device.
virtual void PaletteAttributes(TBool &aModifiable, TInt &aNumEntries) const =0
Gets the palette attributes of the device.
Provides user-definable palette support to the GDI.
Definition gdi.h:365
IMPORT_C TRgb NearestEntry(const TRgb &aColor) const
Gets the colour in the palette which is closest to the specified colour.
TInt Entries() const
Gets the number of entries in the palette.
IMPORT_C void Clear()
Clears all the entries in the palette to TRgb(0).
IMPORT_C ~CPalette()
Destructor.
static IMPORT_C CPalette * NewDefaultL(TDisplayMode aDispMode)
Creates a new default palette for the specified display mode.
void ConstructL(TInt aNumberOfEntries)
IMPORT_C TInt NearestIndex(const TRgb &aColor) const
Gets the index of the colour in the palette which is closest to the specified colour.
IMPORT_C void GetDataPtr(TInt aFirstColor, TInt aNumColors, TPtr8 &aPtr)
Returns a descriptor over the palette entries for the specifed colors.
IMPORT_C void SetEntry(TInt aPaletteIndex, const TRgb &aPaletteEntry)
Sets the palette entry at aPaletteIndex to the RGB value aPaletteEntry.
static IMPORT_C CPalette * NewL(TInt aNumberOfEntries)
Creates a new palette with the specified number of entries.
TInt iNumEntries
Definition gdi.h:382
IMPORT_C CPalette()
IMPORT_C TRgb GetEntry(TInt aPaletteIndex) const
Gets the RGB value of the palette entry at aPaletteIndex.
TRgb * iArray
Definition gdi.h:381
Implements a printer model list interface for a collection of PDR files.
Definition gdi.h:4256
IMPORT_C TInt ModelCount() const
Gets the number of printer models in the printer model list.
IMPORT_C const TPrinterModelEntry operator[](TInt anIndex)
Gets printer model name.
virtual IMPORT_C ~CPdrModelList()
Virtual destructor.
IMPORT_C TInt UidToNum(TUid aModelUid) const
Gets a printer models index within the model list from its UID.
IMPORT_C void AddDirectoryL(const TDesC &aDir)
Adds a directory to the list of directories to be scanned for printer models.
IMPORT_C CPrinterModelList * ScanForModelsL()
Scans through through the list of directories for all .pdr files and generates a list of printer mode...
IMPORT_C CPrinterDriver * CreatePrinterDriverL(TInt anIndex)
Creates an object for accessing the specified store that contains printer specification data.
static IMPORT_C CPdrModelList * NewL()
Constructs, and returns a pointer to a new instance of the printer model list interface.
Abstract base class for: drawing a picture to a graphics context, storing and restoring the picture.
Definition gdi.h:3591
virtual IMPORT_C ~CPicture()
Frees all resources owned by the object prior to its destruction.
virtual void Draw(CGraphicsContext &aGc, const TPoint &aTopLeft, const TRect &aClipRect, MGraphicsDeviceMap *aMap) const =0
Draws a picture.
virtual void DetachFromStoreL(TDetach=EDetachFull)
Definition gdi.h:3619
virtual IMPORT_C void GetCropInTwips(TMargins &aMargins) const
Gets the cropping margins of a picture in twips.
IMPORT_C void AddCropInPixels(MGraphicsDeviceMap *aMap, const TMargins &aMargins)
Adds pixel cropping margins to the picture.
virtual IMPORT_C TInt ScaleFactorWidth() const
Gets the picture's width scale factor.
virtual IMPORT_C TPictureCapability Capability() const
Gets the picture's capabilities.
virtual void ExternalizeL(RWriteStream &aStream) const =0
Externalises the picture to a stream.
virtual IMPORT_C TBool LineBreakPossible(TUint aClass, TBool aBeforePicture, TBool aHaveSpaces) const
States whether a line break is possible, either before or after a picture.
IMPORT_C void SetSizeInTwips(const TSize &aSize)
Sets the picture's size, in twips.
IMPORT_C void GetSizeInTwips(TSize &aSize) const
Gets the picture's size, in twips.
IMPORT_C void GetSizeInPixels(MGraphicsDeviceMap *aMap, TSize &aSize) const
Gets the picture's size in pixels.
IMPORT_C CPicture()
virtual IMPORT_C TBool NativePixelSize(TSize &aPixelSize)
Derived classes might be implemented as bitmaps, in that case it might be interesting to now the nati...
virtual IMPORT_C void SetCropInTwips(const TMargins &aMargins)
Sets the cropping margins of a picture in twips.
TDetach
Options for detaching pictures from stores.
Definition gdi.h:3595
@ EDetachFull
Internalise all data that is required to fully store the picture later; null any references to contai...
Definition gdi.h:3598
@ EDetachDraw
Internalise enough information to draw the picture (and no more); null any references to containing s...
Definition gdi.h:3601
IMPORT_C void SetSizeInPixels(MGraphicsDeviceMap *aMap, const TSize &aSize)
Sets the picture's size in pixels.
virtual IMPORT_C TInt ScaleFactorHeight() const
Gets the pictures height scale factor.
virtual void GetOriginalSizeInTwips(TSize &aSize) const =0
Gets the pictur's original size, in twips.
IMPORT_C void ResetToOriginal()
Resets the picture's scaling and cropping attributes to their original values.
virtual IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight)
Sets the picture's scale factors.
virtual IMPORT_C TStreamId StoreL(CStreamStore &aStore) const
Stores the picture to the specified store.
Printer control interface.
Definition gdi.h:3907
virtual void QueueEndPrint(TRequestStatus &aStatus)=0
Terminates the print process.
CPrinterPort * iPrinterPort
Printer port.
Definition gdi.h:3969
virtual void AbortPrint()=0
Aborts the print process before it has completed.
TMoreOnPage
Flags indicating whether there is more on the page to print.
Definition gdi.h:3911
@ ENoMoreOnPage
Indicates there is no more to print on the current page.
Definition gdi.h:3915
@ EMoreOnPage
Indicates there is more to print on the current page.
Definition gdi.h:3913
IMPORT_C ~CPrinterControl()
Destructor.
TState
State flags.
Definition gdi.h:3960
@ EPrinting
Printing.
Definition gdi.h:3964
@ ENotPrinting
Not printing.
Definition gdi.h:3962
TState iState
Printing state.
Definition gdi.h:3967
virtual TMoreOnPage QueueGetBand(TRequestStatus &aStatus, TBandAttributes &aBand)=0
Prints the next band on the page.
virtual TInt BandsPerPage()=0
Gets the number of bands per page.
Printer graphics device interface.
Definition gdi.h:4003
IMPORT_C void RestorePropertiesL()
Restores printer properties.
virtual TInt SetModel(const TPrinterModelHeader &aModel, CStreamStore &aStore)=0
Sets the printer model header and the store.
virtual IMPORT_C void SelectPageSpecInTwips(const TPageSpec &aPageSpec)
Sets the page specification in twips.
virtual TPrinterModelEntry Model() const =0
Gets the printer model entry.
virtual void ExternalizePropertiesL(RWriteStream &) const
Externalizes printer properties to the store.
Definition gdi.h:4054
IMPORT_C void StorePropertiesL() const
Stores the printer properties.
virtual IMPORT_C TRect PrintablePageInPixels() const
Gets the dimensions of the area to which the printer device can print.
TPageSpec iCurrentPageSpecInTwips
Current page specification in twips.
Definition gdi.h:4067
virtual void InternalizePropertiesL(RReadStream &)
Externalizes printer properties to the store.
Definition gdi.h:4047
CPrinterControl * iControl
The printer control.
Definition gdi.h:4064
TPageSpec CurrentPageSpecInTwips() const
Gets the current page specification in twips.
Definition gdi.h:4010
IMPORT_C CPrinterDevice()
Standard constructor.
virtual void CreateControlL(CPrinterPort *aPrinterPort)=0
Creates a printer control.
virtual IMPORT_C void DeleteControl()
Deletes the printer control owned by this object.
IMPORT_C ~CPrinterDevice()
Destructor.
Printer specific user interface.
Definition gdi.h:4167
virtual IMPORT_C void AfterPrintL()
Provides an opportunity for a dialog to be put up after printing is complete.
IMPORT_C CPrinterDriverUI()
virtual IMPORT_C TBool CanSetProperties()
Tests whether printer properties can be set.
virtual TInt SetPrinterDevice(CPrinterDevice *aPrinterDevice)=0
Sets the printer device.
virtual IMPORT_C TBool BeforePrintL()
Provides an opportunity for a dialog to be put up before printing begins.
virtual IMPORT_C void SetPropertiesL()
Provides an opportunity for a dialog to be put up to capture or change printer properties.
Provides access to a store containing printer specification data.
Definition gdi.h:4213
IMPORT_C TInt NumModels() const
Gets the number of printer models defined by the printer specification.
static IMPORT_C CPrinterDriver * NewL()
Constructs, and returns a pointer to a new instance for accessing a printer specification data store.
IMPORT_C ~CPrinterDriver()
Destructor.
IMPORT_C void Close()
Closes the printer specification data store and frees resources.
IMPORT_C TPrinterModelEntry Model(TInt aNum) const
Gets the specified printer model.
IMPORT_C void OpenPdrL(const TDesC &aName)
Opens the specified printer specification data store.
CPrinterDevice * PrinterDevice()
Gets the associated graphics printer device.
Definition gdi.h:4225
IMPORT_C CPrinterDevice * CreatePrinterDeviceL(TUid aModelUid)
Creates the physical graphics device to be used for printing.
IMPORT_C CPrinterDriverUI * CreatePrinterDriverUIL()
Constructs a printer specific user interface.
Printer model list interface.
Definition gdi.h:4084
virtual TInt ModelCount() const =0
Gets the number of printer models in the printer model list.
virtual const TPrinterModelEntry operator[](TInt anIndex)=0
Gets printer model name.
virtual TInt UidToNum(TUid aModelUid) const =0
Gets a printer models index within the model list from its UID.
Printer port interface.
Definition gdi.h:3828
virtual void Cancel()=0
Cancels an outstanding WriteRequest() operation.
virtual void WriteRequest(const TDesC8 &aBuf, TRequestStatus &aRequestStatus)=0
Writes data asynchronously to the printer port.
Typeface store abstract base interface.
Definition gdi.h:865
virtual TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec)=0
IMPORT_C void ConstructL()
Second phase constructor.
static IMPORT_C TInt SuperSubHeight(TInt aHeight, TFontPrintPosition aPos)
Gets the height for a font in subscript or superscript form.
CArrayFixFlat< TFontAccess > * iFontAccess
A list of fonts accessed by clients of the typeface store, which pairs a font with a count of the num...
Definition gdi.h:996
virtual TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec)=0
virtual TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight)=0
IMPORT_C void ReleaseFont(CFont *aFont)
Releases the hold of a typeface store client on a specified font.
IMPORT_C void AddFontL(CFont *aFont)
Adds a hold, by a client of the typeface store, on the specified font.
virtual void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const =0
Gets typeface information for a specified typeface index.
static IMPORT_C TInt BaselineOffset(TInt aHeight, TFontPrintPosition aPos)
Gets the baseline offset, in twips, for any font in subscript or superscript form.
IMPORT_C TBool IncrementFontCount(const CFont *aFont)
Search for the font in iFontAccess and increment its count.
virtual TInt NumTypefaces() const =0
Gets the number of typefaces supported by the typeface store.
virtual TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const =0
Gets the height of the font with specified height and typeface indices, in twips.
IMPORT_C CTypefaceStore()
IMPORT_C ~CTypefaceStore()
Destroys the typeface store and reclaims the memory allocated to it.
Window server bitmap.
Definition w32std.h:2038
Interface class for mapping between twips and device-specific units (pixels).
Definition gdi.h:1065
virtual IMPORT_C ~MGraphicsDeviceMap()
Destructor.
virtual TInt HorizontalPixelsToTwips(TInt aPixels) const =0
Converts a horizontal dimension from pixels to twips.
virtual TInt GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)
Definition gdi.h:1148
virtual TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec)=0
virtual void ReleaseFont(CFont *aFont)=0
Releases the specified font.
virtual TInt VerticalPixelsToTwips(TInt aPixels) const =0
Converts a vertical dimension from pixels to twips.
virtual TInt HorizontalTwipsToPixels(TInt aTwips) const =0
Converts a horizontal dimension from twips to pixels.
virtual TInt GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)
Definition gdi.h:1174
IMPORT_C TPoint PixelsToTwips(const TPoint &aPixelPoint) const
Converts a point in pixels to a point in twips.
IMPORT_C MGraphicsDeviceMap()
Default constructor.
IMPORT_C TPoint TwipsToPixels(const TPoint &aTwipPoint) const
Converts a point in twips to a point in pixels.
virtual TInt VerticalTwipsToPixels(TInt aTwips) const =0
Converts a vertical dimension from twips to pixels.
Interface for printing in bands.
Definition gdi.h:4122
virtual void PrintBandL(CGraphicsDevice *aDevice, TInt aPageNo, const TBandAttributes &aBandInPixels)=0
Prints a band.
Abstract interface for instantiating and restoring new CPicture derived objects.
Definition gdi.h:3699
virtual void NewPictureL(TPictureHeader &aHeader, const CStreamStore &aDeferredPictureStore) const =0
Interface to the picture restoration process that ensures that a picture of the correct type is resto...
A handle to a file server session.
Definition f32file.h:2076
A handle to a dynamically loadable DLL.
Definition e32std.h:3335
Controls the attributes of the band to be printed.
Definition gdi.h:3801
TRect iRect
The width and height of the band in twips or pixels.
Definition gdi.h:3804
TBool iFirstBandOnPage
ETrue if band is the first band on the page; EFalse if not.
Definition gdi.h:3810
TBool iTextIsIgnored
ETrue to draw no text to the band; EFalse to draw text.
Definition gdi.h:3806
TBool iGraphicsIsIgnored
ETrue to draw no graphics to the band; EFalse to draw graphics.
Definition gdi.h:3808
A build-independent non-modifiable buffer descriptor.
Definition e32cmn.h:1523
A build-independent modifiable buffer descriptor.
Definition e32cmn.h:1578
Holds a character value and provides a number of utility functions to manipulate it and test its prop...
Definition e32cmn.h:480
Code section range information.
Definition gdi.h:1305
TInt iStart
The beginning of the range.
Definition gdi.h:1308
TInt iEnd
The end of the range.
Definition gdi.h:1310
Enables conversion, in both directions, between a TRgb object and an index into an arbitrary 256 colo...
Definition gdi.h:394
TUint8 iInverseColorTable[0x1000]
Inverse colour lookup table.
Definition gdi.h:419
static IMPORT_C const TColor256Util * Default()
Returns a pointer to the system default 256 colour palette.
TUint32 iColorTable[256]
256 colour lookup table.
Definition gdi.h:408
IMPORT_C TInt Color256(TRgb aRgb) const
Gets the entry from the inverse colour lookup table for the colour that most closely matches the spec...
IMPORT_C void Construct(const CPalette &aPalette)
Initialises the two lookup tables using the specified palette.
A set of static utility functions to get information about a display mode.
Definition gdi.h:331
static IMPORT_C TBool IsDisplayModeColor(TDisplayMode aDispMode)
Tests whether the display mode specified is colour or greyscale.
static IMPORT_C TInt NumDisplayModeBitsPerPixel(TDisplayMode aDispMode)
Gets the number of bits required by each pixel when displayed in the specified display mode.
static IMPORT_C TInt NumDisplayModeColors(TDisplayMode aDispMode)
Gets the number of colours or shades of grey supported by the specified display mode.
static IMPORT_C TBool IsDisplayModeValid(TDisplayMode aDispMode)
Tests whether the display mode specified is one of the valid values.
Specifies the font specification in device independent terms.
Definition gdi.h:775
TFontStyle iFontStyle
The font style of the typeface.
Definition gdi.h:790
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises the font specification to a write stream.
IMPORT_C TBool operator==(const TFontSpec &aFontSpec) const
Compares this font specification with another.
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a font specification from a read stream.
IMPORT_C TInt ScriptTypeForMetrics() const
Returns the script with which font metrics calculation will be based on.
IMPORT_C TFontSpec()
Default constructor.
TInt iHeight
The height of the typeface (in twips).
Definition gdi.h:788
IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage)
Specifies the script with which font metrics calculation will be based on.
TTypeface iTypeface
The typeface.
Definition gdi.h:786
Encapsulates a font style.
Definition gdi.h:732
IMPORT_C void SetStrokeWeight(TFontStrokeWeight aStrokeWeight)
Sets the stroke weight attribute.
IMPORT_C void SetEffects(TUint32 aEffects)
Sets the font effects flags.
IMPORT_C TBool IsEffectOn(FontEffect::TEffect aEffect) const
Checks if a font effect is on.
IMPORT_C TBool operator==(const TFontStyle &aFontStyle) const
Compares a font style for equality.
TGlyphBitmapType BitmapType() const
Gets the anti-aliasing setting for the font, as set by SetBitmapType().
IMPORT_C TFontPrintPosition PrintPosition() const
Gets the print position attribute.
IMPORT_C TFontStrokeWeight StrokeWeight() const
Gets the stroke weight attribute.
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a font style from a read stream.
IMPORT_C void SetPrintPosition(TFontPrintPosition aPrintPosition)
Sets the print position attribute.
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises the font style to a write stream.
IMPORT_C TFontPosture Posture() const
Gets the posture attribute.
IMPORT_C TUint32 Effects() const
Gets the font effects flags.
IMPORT_C void SetPosture(TFontPosture aPosture)
Sets the posture attribute.
IMPORT_C TFontStyle()
Default C++ constructor.
void SetBitmapType(TGlyphBitmapType aBitmapType)
Sets whether the font should be drawn using anti-aliasing.
Linear digital differential analyser.
Definition gdi.h:437
IMPORT_C void JumpToYCoord2(TInt &aXCoord, TInt aYCoord)
Jumps to a y co-ordinate.
IMPORT_C TBool SingleStep(TPoint &aPosition)
Gets the pixel co-ordinates of the next pixel on the pixel line.
IMPORT_C TBool NextStep(TPoint &aPosition)
Gets the pixel co-ordinates of the start of the next scan line.
IMPORT_C TBool SingleScanline(TPoint &aStartPosition, TPoint &aEndPosition)
Gets the start and end pixel co-ordinates that define the next scan line.
IMPORT_C void Construct(const TPoint &aStart, const TPoint &aFinish, TLineMode aMode=ECenter)
Constructs a linear DDA, setting the start and end points of the line.
TLineMode
LDDA Line mode.
Definition gdi.h:441
@ ELeft
Starts at the beginning of a complete scan line.
Definition gdi.h:446
@ ECenter
Centres scan-lines in the pixel line.
Definition gdi.h:443
IMPORT_C void JumpToYCoord(TInt &aXCoord, const TInt aYCoord)
Jumps to a y co-ordinate.
IMPORT_C TLinearDDA()
Constructs the default linear DDA.
IMPORT_C void JumpToRect(const TRect &aRect)
Jumps to start of a clipping rectangle.
IMPORT_C void JumpToXCoord(const TInt aXCoord, TInt &aYCoord)
Jumps to x co-ordinate.
IMPORT_C void JumpToXCoord2(TInt aXCoord, TInt &aYCoord)
Jumps to x co-ordinate.
A set of margins used for cropping a picture.
Definition gdi.h:3512
IMPORT_C TBool operator!=(const TMargins &aMargins) const
Tests margins for inequality.
TInt iRight
Right margin, (in twips or pixels).
Definition gdi.h:3522
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a set of margins from a read stream.
IMPORT_C TBool operator==(const TMargins &aMargins) const
Tests margins for equality.
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises a set of margins to a write stream.
TInt iTop
Top margin, (in twips or pixels).
Definition gdi.h:3524
TInt iLeft
Left margin, (in twips or pixels).
Definition gdi.h:3520
TInt iBottom
Bottom margin, (in twips or pixels).
Definition gdi.h:3526
Page specification for a print operation.
Definition gdi.h:3758
TPageOrientation
The available page orientations.
Definition gdi.h:3762
@ EPortrait
Portrait page orientation.
Definition gdi.h:3764
@ ELandscape
Landscape page orientation.
Definition gdi.h:3766
IMPORT_C TSize OrientedPageSize() const
Gets the oriented page size.
IMPORT_C TBool operator!=(const TPageSpec &aPageSpec) const
Inequality operator.
TSize iPortraitPageSize
The width and height of the page in portrait orientation in twips or pixels.
Definition gdi.h:3782
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a page specification object from a read stream.
IMPORT_C TBool operator==(const TPageSpec &aPageSpec) const
Equality operator.
IMPORT_C TPageSpec()
Default constructor.
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises the page specification object to a write stream.
TPageOrientation iOrientation
The page orientation.
Definition gdi.h:3784
Parses filenames.
Definition f32file.h:1948
Picture capabilities.
Definition gdi.h:3539
TBool iIsCroppable
Scaling type.
Definition gdi.h:3558
TScalingType
Scaling types.
Definition gdi.h:3543
@ ENotScaleable
The picture is not scalable.
Definition gdi.h:3545
@ EFullyScaleable
The picture is fully scalable.
Definition gdi.h:3547
@ EScaleableMaintainingAspectRatio
The picture is scalable to any size, as long as its aspect ratio (the ratio of its height to its widt...
Definition gdi.h:3550
TScalingType iScalingType
Whether or not the picture is croppable.
Definition gdi.h:3556
Picture header providing an interface to a stored picture.
Definition gdi.h:3670
TUid iPictureType
A UID specifying the type of the picture.
Definition gdi.h:3681
TSwizzle< CPicture > iPicture
A swizzle storing either the ID of the stream in which the picture is stored, or a pointer to the int...
Definition gdi.h:3679
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a picture header object from a read stream.
IMPORT_C TPictureHeader()
Constructs a default picture header.
TSize iSize
The original size of the picture.
Definition gdi.h:3683
IMPORT_C void DeletePicture()
Deletes the internalised picture.
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises a picture header object to a write stream.
Stores a two-dimensional point in Cartesian co-ordinates.
Definition e32cmn.h:2285
Detailed information about a printer model.
Definition gdi.h:3852
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises the printer model entry to a write stream.
TPrinterModelName iModelName
The name of the printer model.
Definition gdi.h:3855
TUid iUid
The UID associated with this printer model.
Definition gdi.h:3859
TBool iRequiresPrinterPort
If ETrue, then a printer port is required.
Definition gdi.h:3857
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a printer model entry from a read stream.
Information about a printer model.
Definition gdi.h:3878
TPrinterModelEntry iEntry
The printer model.
Definition gdi.h:3881
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a printer model header from a read stream.
TStreamId iModelDataStreamId
The stream ID for model data.
Definition gdi.h:3883
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises the printer model header to a write stream.
Geometric rectangle.
Definition e32std.h:2670
@ EUninitialized
Definition e32std.h:2672
Clipping region - abstract base class.
Definition e32std.h:2774
Indicates the completion status of a request made to a service provider.
Definition e32cmn.h:2243
24-bit RGB colour value with 8 bits each for red, green and blue.
Definition gdi.h:221
TRgb operator|(const TRgb &aColor)
Bitwise logical OR operator.
TInt _Gray4() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C void SetBlue(TInt aBlue)
Sets the blue component.
TUint32 Internal() const
Gets the 32-bit value of the TRgb as an integer.
TInt _Gray2() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TInt _Color16M() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C TUint _Color16MAP() const
Converts the TRgb to EColor16MAP (with color channels pre-multiplied with the alpha channel.
TInt _Gray256() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C void SetAlpha(TInt aAlpha)
Sets the alpha component.
IMPORT_C TInt Gray16() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TRgb operator&(const TRgb &aColor)
Bitwise logical AND operator.
IMPORT_C TInt Color16() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C TInt Color4K() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TRgb & operator|=(const TRgb &aColor)
Logical OR assignment operator.
TInt Red() const
Gets the red component.
IMPORT_C TInt Difference(const TRgb &aColor) const
Gets the difference between two TRgbs.
IMPORT_C TInt Gray2() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TUint _Color16MA() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TRgb operator~() const
Bitwise logical inversion operator.
TInt Green() const
Gets the green component.
TRgb & operator^=(const TRgb &aColor)
Logical EXCLUSIVE OR assignment operator.
TRgb()
Constructs a TRgb initialised to KRgbWhite.
IMPORT_C void SetRed(TInt aRed)
Sets the red component.
IMPORT_C TUint Color16MAP() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TInt _Color64K() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TRgb & operator&=(const TRgb &aColor)
Logical AND assignment operator.
TUint32 Value() const
Gets the 32-bit value of the TRgb as an integer.
IMPORT_C TInt Gray4() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C TInt Color16M() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C TUint Color16MA() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C TInt Color64K() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a TRgb object from a stream.
IMPORT_C TInt Color256() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TInt Alpha() const
Gets the alpha component.
TRgb operator^(const TRgb &aColor)
Bitwise EXCLUSIVE OR operator.
IMPORT_C TInt Gray256() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
void SetInternal(TUint32 aInternal)
Sets the 32-bit value of the TRgb as a 32-bit integer.
TInt _Gray16() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises a TRgb object to a stream.
TBool operator!=(const TRgb &aColor) const
Compares this colour with the specified colour for inequality.
IMPORT_C TInt Color16MU() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
TBool operator==(const TRgb &aColor) const
Compares this colour with the specified colour for equality.
TInt _Color16MU() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
IMPORT_C void SetGreen(TInt aGreen)
Sets the green component.
TInt Blue() const
Gets the blue component.
TInt _Color4K() const
Gets the index of the closest TRgb value to this, based on the matching display mode.
Stores a two-dimensional size as a width and a height value.
Definition e32cmn.h:2442
@ EUninitialized
Definition e32cmn.h:2445
Typeface family support information.
Definition gdi.h:807
TTypeface iTypeface
The name and attributes of the typeface.
Definition gdi.h:810
TInt iMaxHeightInTwips
The typeface's maximum font height, in twips.
Definition gdi.h:816
TBool iIsScalable
Whether the typeface is scaleable.
Definition gdi.h:819
TInt iNumHeights
The number of distinct font heights available in the typeface.
Definition gdi.h:812
TInt iMinHeightInTwips
The typeface's minimum font height, in twips.
Definition gdi.h:814
Typeface name and attributes.
Definition gdi.h:591
IMPORT_C TInt Attributes() const
Gets the combination of attributes of the typeface.
IMPORT_C void SetAttributes(TInt aAttributes)
Set the combination of attributes for this typeface.
IMPORT_C TInt ScriptTypeForMetrics() const
Gets the script with which font metrics calculation will be based on.
@ ESerif
Typeface is a serif typeface (e.g.
Definition gdi.h:600
@ ESymbol
Typeface is a symbol typeface (e.g.
Definition gdi.h:603
@ EProportional
Typeface is a proportional typeface (e.g.
Definition gdi.h:597
TBufC< KMaxTypefaceNameLength > iName
The typeface name.
Definition gdi.h:628
IMPORT_C void ExternalizeL(RWriteStream &aStream) const
Externalises a typeface to a write stream.
IMPORT_C void SetIsSerif(TBool aIsSerif)
Sets the typeface's serif attribute.
IMPORT_C const TDesC & Name() const
Returns the name of the typeface.
IMPORT_C TBool operator==(const TTypeface &aTypeface) const
Compares two typefaces for equality.
IMPORT_C TBool IsProportional() const
Gets the typeface's proportional attribute.
IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage)
Specifies the script with which font metrics calculation will be based on.
IMPORT_C void SetName(const TDesC &aName)
IMPORT_C void SetIsProportional(TBool aIsProportional)
Sets the typeface's proportional attribute.
IMPORT_C void InternalizeL(RReadStream &aStream)
Internalises a typeface from a read stream.
IMPORT_C TBool IsSymbol() const
Gets the typeface's symbol attribute.
IMPORT_C TTypeface()
Default C++ constructor.
IMPORT_C TBool IsSerif() const
Gets the typeface's serif attribute.
IMPORT_C void SetIsSymbol(TBool aIsSymbol)
Sets the typeface's symbol attribute.
A globally unique 32-bit number.
Definition e32cmn.h:1959
The interface for mapping between twips and device-specific units enriched with facilities to allow z...
Definition gdi.h:4308
IMPORT_C TInt VerticalTwipsToPixels(TInt aTwipHeight) const
Converts a vertical dimension from twips to pixels.
IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight)
void SetGraphicsDeviceMap(const MGraphicsDeviceMap *aDevice)
Sets the graphics device map for this zoom factor object.
IMPORT_C void ReleaseFont(CFont *aFont)
Releases the specified font.
IMPORT_C TInt ZoomFactor() const
Gets the zoom factor.
IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwipWidth) const
Converts a horizontal dimension from twips to pixels.
IMPORT_C void SetZoomFactor(TInt aZoomFactor)
Sets the zoom factor.
@ EZoomOneToOne
Definition gdi.h:4330
IMPORT_C ~TZoomFactor()
Destructor.
IMPORT_C void SetTwipToPixelMapping(const TSize &aSizeInPixels, const TSize &aSizeInTwips)
Sets the twips to pixels mapping for the graphics device with which the zoom factor is associated.
IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixelWidth) const
Converts a horizontal dimension from pixels to twips.
const MGraphicsDeviceMap * GraphicsDeviceMap() const
Gets the graphics device map of this zoom factor object.
IMPORT_C TZoomFactor()
Constructs a default zoom factor object.
IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec)
IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec)
IMPORT_C TInt VerticalPixelsToTwips(TInt aPixelHeight) const
Converts a vertical dimension from pixels to twips.
HBufC8 HBufC
Defines a build-independent heap descriptor.
Definition e32cmn.h:1431
TPtrC8 TPtrC
Defines a build-independent non-modifiable pointer descriptor.
Definition e32cmn.h:1366
TDesC8 TDesC
Defines a build-independent non-modifiable descriptor.
Definition e32cmn.h:1345
const TSize KC5PaperSizeInTwips(9184, 12983)
const TUid KFontGetFontTable
Definition gdi.h:1325
TBuf< KMaxPrinterModelNameLength > TPrinterModelName
Defines a modifiable buffer descriptor that can contain the name of a printer model.
Definition gdi.h:3742
TFontStrikethrough
Font strike-through flags.
Definition gdi.h:557
@ EStrikethroughOn
Font is struck-through.
Definition gdi.h:561
@ EStrikethroughOff
Font is not struck-through.
Definition gdi.h:559
const TUid KFontReleaseGlyphOutline
Definition gdi.h:1327
TGlyphBitmapType
An enumerated type for the format of a glyph bitmap.
Definition gdi.h:647
@ ESubPixelGlyphBitmap
The format used when sub-pixel font rendering is used.
Definition gdi.h:656
@ EDefaultGlyphBitmap
The font store's default glyph bitmap format is used.
Definition gdi.h:649
@ EFourColourBlendGlyphBitmap
The format used when outline and shadow font rendering is used.
Definition gdi.h:663
@ EAntiAliasedOrMonochromeGlyphBitmap
This is used to inform the rasterizer that the best match should be found for the bitmap type based u...
Definition gdi.h:675
@ EMonochromeGlyphBitmap
The standard monochrome format: no anti-aliasing, 1 bit per pixel, run-length encoded.
Definition gdi.h:652
@ EAntiAliasedGlyphBitmap
Standard 8-bits-per-pixel with anti-aliasing.
Definition gdi.h:654
@ EGlyphBitmapTypeNotDefined
This is used for glyphs, and not fonts, and is needed to inform the font drawing routines that the ch...
Definition gdi.h:669
const TSize KDLPaperSizeInTwips(6236, 12472)
const TUid KFontMaxAscent
Definition gdi.h:1321
const TUid KFontLineGap
Definition gdi.h:1324
const TInt KTwipsPerInch
Number of twips per inch.
Definition gdi.h:41
const TInt KSubscriptOffsetPercentage
The percentage of a font height used to calculate its baseline offset for a subscript print position.
Definition gdi.h:850
TFontStrokeWeight
Font stroke weight flags.
Definition gdi.h:509
@ EStrokeWeightNormal
Font stroke weight is normal.
Definition gdi.h:511
@ EStrokeWeightBold
Font stroke weight is bold.
Definition gdi.h:513
const TInt KSuperSubScalingPercentage
The percentage used to multiply a normal font height when calculating its superscript or subscript he...
Definition gdi.h:830
const TInt KMaxFontCacheEntries
The maximum number of entries in the font cache.
Definition gdi.h:1002
TFontPosture
Font posture flags.
Definition gdi.h:494
@ EPostureUpright
Font posture is normal (upright).
Definition gdi.h:496
@ EPostureItalic
Font posture is italic.
Definition gdi.h:498
TGdiPanic
This enumeration holds the possible panic codes that may be raised by the GDI API on detecting an unr...
Definition gdi.h:161
@ EGdiPanic_Unknown
Not used.
Definition gdi.h:163
@ EGdiPanic_Unused1
Unused panic codes.
Definition gdi.h:171
@ EGdiPanic_TypefaceNameOverflow
Setting a typeface name that is too long.
Definition gdi.h:174
@ EGdiPanic_InvalidInputParam
One or more of the input parameters to the interface were invalid.
Definition gdi.h:165
@ EGdiPanic_Invariant
Internal failure.
Definition gdi.h:169
@ EGdiPanic_Unused2
Definition gdi.h:172
@ EGdiPanic_OutOfText
Insufficient text for successful completion of the method.
Definition gdi.h:167
const TUid KFontStandardDescent
Definition gdi.h:1322
const TUid KFontGetGlyphOutline
Definition gdi.h:1326
const TUid KFontCapitalAscent
WARNING: this Class is for internal use ONLY.
Definition gdi.h:1320
const TSize KLegalPaperSizeInTwips(12240, 20160)
TFontPrintPosition
Font print position flags.
Definition gdi.h:525
@ EPrintPosNormal
Font is normal.
Definition gdi.h:527
@ EPrintPosSuperscript
Font is superscript.
Definition gdi.h:529
@ EPrintPosSubscript
Font is subscript.
Definition gdi.h:531
const TSize KMonarchPaperSizeInTwips(5580, 10800)
const TSize KA4PaperSizeInTwips(11906, 16838)
const TUid KFontReleaseFontTable
Definition gdi.h:1328
const TUid KFontMaxDescent
Definition gdi.h:1323
const TInt KSuperscriptOffsetPercentage
The percentage of a font height used to calculate its baseline offset for a superscript print positio...
Definition gdi.h:840
const TInt KPointsPerInch
Number of points per inch.
Definition gdi.h:59
const TSize KLetterPaperSizeInTwips(12240, 15840)
const TInt KPdlUidVal
Definition gdi.h:4146
const TInt KTwipsPerPoint
Number of twips per point.
Definition gdi.h:50
const TInt KTwipsPerCm
Number of twips per cm.
Definition gdi.h:68
const TInt KMaxTypefaceNameLength
The maximum length of a typeface name (in characters).
Definition gdi.h:571
NONSHARABLE_CLASS(FontEffect)
Defines a set of font effects flags.
Definition gdi.h:687
const TInt KUdlUidVal
Definition gdi.h:4147
const TInt KMaxPrinterModelNameLength
The maximum length of a printer model name.
Definition gdi.h:3731
const TSize KExecutivePaperSizeInTwips(10440, 15120)
const TSize KCom_10PaperSizeInTwips(5940, 13680)
TFontUnderline
Font underline flags.
Definition gdi.h:542
@ EUnderlineOff
Font is not underlined.
Definition gdi.h:544
@ EUnderlineOn
Font is underlined.
Definition gdi.h:546
const TInt KPdrStoreFileUidVal
The UID value of a printer specification data store.
Definition gdi.h:4144
Parameters for extended text drawing and measuring.
Definition gdi.h:2098
TBool iParRightToLeft
ETrue if the text direction is right-to-left (for scripts like Arabic and Hebrew).
Definition gdi.h:2107
Parameters to control the drawing of text.
Definition gdi.h:2070
TInt iCharJustExcess
amount of space to be used for letterspacing
Definition gdi.h:2086
TDrawTextParam()
Reserved for future use.
Definition gdi.h:2072
TInt iWordJustExcess
amount of space to be used for wordspacing
Definition gdi.h:2090
CFont::TTextDirection iDirection
the direction in which to draw the text.
Definition gdi.h:2082
TInt iWordJustNum
number of spaces to be used for wordspacing
Definition gdi.h:2088
TInt iCharJustNum
number of glyph groups to be letterspaced
Definition gdi.h:2084