1.1 --- a/epoc32/include/pdrstore.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/pdrstore.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 // All rights reserved.
1.6 // This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 // which accompanies this distribution, and is available
1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 //
1.13 // Initial Contributors:
1.14 // Nokia Corporation - initial contribution.
1.15 @@ -16,25 +16,22 @@
1.16 #ifndef PDRSTORE_H
1.17 #define PDRSTORE_H
1.18
1.19 +/**
1.20 +@file
1.21 +@publishedAll
1.22 +@released
1.23 +*/
1.24 +
1.25 #include <s32mem.h>
1.26 #include <gdi.h>
1.27 #include <fbs.h>
1.28
1.29 +class CPdrControl;
1.30 class CStreamStore;
1.31 -
1.32 -class CFontInfo;
1.33 -class TPdrResource;
1.34 -class CPdrTranslates;
1.35 -class CTypefaceFonts;
1.36 class CBandedDevice;
1.37 -class CFbsBitGc;
1.38 -class CFbsFont;
1.39 -class CWsBitmap;
1.40
1.41 /**
1.42 Codes used by printer drivers.
1.43 -@publishedAll
1.44 -@released
1.45 */
1.46 enum TFbsEncoding
1.47 {
1.48 @@ -54,8 +51,6 @@
1.49
1.50 /**
1.51 Determines the raster mode used by printer drivers.
1.52 -@publishedAll
1.53 -@released
1.54 */
1.55 enum TFbsRasterGraphicsMode
1.56 {
1.57 @@ -67,8 +62,6 @@
1.58
1.59 /**
1.60 Enumerates resources used by printer drivers.
1.61 -@publishedAll
1.62 -@released
1.63 */
1.64 enum TPdrResourceId // Corresponds to IdentResource in PDRREADR.H
1.65 {
1.66 @@ -144,36 +137,21 @@
1.67
1.68 /**
1.69 Maximum length of a printer command string.
1.70 -@publishedAll
1.71 -@released
1.72 */
1.73 const TInt KMaxCommandStringLength = 0x40;
1.74 /**
1.75 Defines a command string used by printer drivers.
1.76 -@publishedAll
1.77 -@released
1.78 */
1.79 typedef TBuf8<KMaxCommandStringLength> TCommandString;
1.80
1.81 +// Forward declarations
1.82 +class CFontInfo;
1.83 +class CPdrTranslates;
1.84 +class CPdrDevice;
1.85
1.86 -class CPdrResources : public CBase
1.87 -/** @internalAll Internal to Symbian */
1.88 - {
1.89 -public:
1.90 - IMPORT_C CPdrResources();
1.91 - IMPORT_C void RestoreL(CStreamStore& aStore, TStreamId aStreamId);
1.92 - IMPORT_C ~CPdrResources();
1.93 - IMPORT_C TPtrC8 ResourceString(TInt anId) const;
1.94 -private:
1.95 - TInt iNumResources;
1.96 -
1.97 - TPdrResource* iResourceList;
1.98 - };
1.99 -
1.100 -
1.101 -class CPdrDevice;
1.102 +/** WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases.
1.103 + */
1.104 class CInfoFont : public CFont
1.105 -/** @internalTechnology */
1.106 {
1.107 friend class CPdrTypefaceStore;
1.108 public:
1.109 @@ -215,96 +193,6 @@
1.110 };
1.111
1.112
1.113 -class TTypefaceFontsEntry
1.114 -/** @internalAll Internal to Symbian */
1.115 - {
1.116 -public:
1.117 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.118 -public:
1.119 -
1.120 - TStreamId iStreamId;
1.121 -
1.122 - TBool iNotInPortrait;
1.123 -
1.124 - TBool iNotInLandscape;
1.125 - };
1.126 -
1.127 -
1.128 -class CPdrModelInfo : public CBase
1.129 -/** @internalAll Internal to Symbian */
1.130 - {
1.131 -public:
1.132 - IMPORT_C CPdrModelInfo();
1.133 - IMPORT_C ~CPdrModelInfo();
1.134 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.135 -public:
1.136 -
1.137 - TInt iFlags;
1.138 -
1.139 - TInt iKPixelWidthInTwips;
1.140 -
1.141 - TInt iKPixelHeightInTwips;
1.142 -
1.143 - TPoint iPortraitOffsetInPixels;
1.144 -
1.145 - TPoint iLandscapeOffsetInPixels;
1.146 -
1.147 - TMargins iMinMarginsInPixels;
1.148 -
1.149 - TDisplayMode iDisplayMode;
1.150 -
1.151 - TInt iNumTypefaceFonts;
1.152 -
1.153 - TTypefaceFontsEntry* iTypefaceFontsEntryList;
1.154 -
1.155 - TStreamId iResourcesStreamId;
1.156 -
1.157 - TStreamId iSpareStreamId;
1.158 - };
1.159 -
1.160 -
1.161 -class CPdrTypefaceStore : public CTypefaceStore
1.162 -/** @internalTechnology */
1.163 - {
1.164 -public:
1.165 - IMPORT_C static CPdrTypefaceStore* NewL(CStreamStore& aStore, TInt aNumTypefacesFonts, TTypefaceFontsEntry* aTypefaceFontsEntryList, TPageSpec::TPageOrientation aPageOrientation, TInt aKPixelHeightInTwips, CPdrDevice* aPdrDevice);
1.166 - IMPORT_C ~CPdrTypefaceStore();
1.167 - // CTypefaceStore implementation
1.168 - IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
1.169 - IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
1.170 - IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
1.171 - IMPORT_C TInt NumTypefaces() const;
1.172 - IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
1.173 - IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const;
1.174 - IMPORT_C void SetPageOrientation(TPageSpec::TPageOrientation aPageOrientation);
1.175 -private:
1.176 - CPdrTypefaceStore(CStreamStore& aStore, TInt aKPixelHeightInTwips, CPdrDevice* aPdrDevice);
1.177 - void ConstructL(TInt aNumTypefacesFonts, TTypefaceFontsEntry* aTypefaceFontsEntryList, TPageSpec::TPageOrientation aPageOrientation);
1.178 - CFontInfo* FontInfoL(TStreamId aStreamId) const;
1.179 - CPdrTranslates* TranslatesL(TStreamId aStreamId) const;
1.180 - TInt GetNearestFontHeightIndex(TInt aTypefaceIndex, TInt aHeightInTwips) const;
1.181 - TFontStyle GetNearestFontStyle(TInt aTypefaceIndex, TInt aHeightIndex, const TFontStyle& aFontStyle) const;
1.182 - TBool IsFontLoaded(CFont*& aFont, const TFontSpec& aFontSpecInTwips, TInt aHeightInPixels) const;
1.183 - CInfoFont* NewFontL(TInt aBaselineOffsetInPixels, const TFontSpec& aFontSpecInTwips, TInt aFontInfoHeightInTwips, TInt aHeightInPixels, CPdrTranslates* aTranslates, const TDesC8& aCommandString, TStreamId aFontInfoStreamId);
1.184 - TInt VerticalTwipsToPixels(TInt aTwipsHeight) const;
1.185 -public:
1.186 - CPdrDevice* iPdrDevice;
1.187 -private:
1.188 - CStreamStore* iStore;
1.189 - TInt iKPixelHeightInTwips;
1.190 - CArrayPtr<CTypefaceFonts>* iTypefaceFontsList;
1.191 - CArrayPtr<CTypefaceFonts>* iPortraitTypefaceFontsList;
1.192 - CArrayPtr<CTypefaceFonts>* iLandscapeTypefaceFontsList;
1.193 - CArrayPtr<CTypefaceFonts>* iCurrentTypefaceFontsList;
1.194 - CArrayPtr<CPdrTranslates>* iTranslatesList;
1.195 - CArrayPtr<CFontInfo>* iFontInfoList;
1.196 - };
1.197 -
1.198 -
1.199 -/**
1.200 -@publishedAll
1.201 -@released
1.202 -*/
1.203 class CPageBuffer : public CActive
1.204 {
1.205 public:
1.206 @@ -341,8 +229,9 @@
1.207 };
1.208
1.209
1.210 -class TTextFormat
1.211 -/** @internalAll Internal to Symbian */
1.212 +/** WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases.
1.213 + */
1.214 +class TTextFormat
1.215 {
1.216 public:
1.217 IMPORT_C TTextFormat();
1.218 @@ -362,57 +251,11 @@
1.219 };
1.220
1.221
1.222 -class CPageTextEntry : public CBase
1.223 -/** @internalAll Internal to Symbian */
1.224 - {
1.225 -public:
1.226 - IMPORT_C CPageTextEntry(const TPoint& aDrawPos, TInt aHeightInPixels, TInt aTextWidthInPixels, HBufC8* aText, TTextFormat* aTextFormat);
1.227 - IMPORT_C ~CPageTextEntry();
1.228 - IMPORT_C TPoint TopTextPos();
1.229 -public:
1.230 -
1.231 - TPoint iDrawPos;
1.232 -
1.233 - TInt iHeightInPixels;
1.234 -
1.235 - TInt iTextWidthInPixels;
1.236 -
1.237 - HBufC8* iText;
1.238 -
1.239 - TTextFormat* iTextFormat;
1.240 - };
1.241 -
1.242 -
1.243 -class CPageText : public CBase
1.244 -/** @internalAll Internal to Symbian */
1.245 - {
1.246 -private:
1.247 - CPageText();
1.248 - void ConstructL();
1.249 -public:
1.250 - IMPORT_C static CPageText* NewL();
1.251 - IMPORT_C ~CPageText();
1.252 - IMPORT_C void Reset();
1.253 - IMPORT_C void AddEntryL(const TPoint& aPoint, const TFontUnderline aUnderlineStyle, const TFontStrikethrough aStrikethroughStyle, const TRgb& aColor, const CInfoFont* aFont, const TDesC& aString);
1.254 - IMPORT_C TInt NumEntries();
1.255 - IMPORT_C CPageTextEntry* operator [] (TInt anIndex);
1.256 - /** This function is internal only, and is not intended for use. */
1.257 - inline TInt MaxFontHeightInPixels() const {return iMaxFontHeightInPixels;}
1.258 -private:
1.259 -
1.260 - TInt iMaxFontHeightInPixels;
1.261 -
1.262 - CArrayPtr<TTextFormat>* iTextFormatList;
1.263 -
1.264 - CArrayPtr<CPageTextEntry>* iPageTextEntryList;
1.265 - };
1.266 -
1.267 -class CPdrControl;
1.268 -
1.269 +// Forward declarations
1.270 +class CPdrModelInfo;
1.271 +class CPdrTypefaceStore;
1.272
1.273 /**
1.274 -@publishedAll
1.275 -@released
1.276 @see CFbsDrvDevice
1.277 */
1.278 class CPdrDevice : public CPrinterDevice
1.279 @@ -461,10 +304,10 @@
1.280 };
1.281
1.282
1.283 -/**
1.284 -@publishedAll
1.285 -@released
1.286 -*/
1.287 +//Forward declarations
1.288 +class CPdrResources;
1.289 +class CPageText;
1.290 +
1.291 class CPdrControl : public CPrinterControl
1.292 {
1.293 public:
1.294 @@ -524,120 +367,6 @@
1.295 };
1.296
1.297
1.298 -class CPdrGc : public CGraphicsContext
1.299 -/** @internalAll Internal to Symbian */
1.300 - {
1.301 -private:
1.302 - CPdrGc(CPdrDevice* aDevice);
1.303 - void ConstructL();
1.304 -public:
1.305 - static CPdrGc* NewL(CPdrDevice* aDevice);
1.306 - IMPORT_C ~CPdrGc();
1.307 -
1.308 - IMPORT_C CGraphicsDevice* Device() const;
1.309 - IMPORT_C void SetOrigin(const TPoint& aPos = TPoint(0, 0));
1.310 - IMPORT_C void SetDrawMode(TDrawMode aDrawingMode);
1.311 - IMPORT_C void SetClippingRect(const TRect& aRect);
1.312 - IMPORT_C void CancelClippingRect();
1.313 - IMPORT_C void Reset();
1.314 -
1.315 - IMPORT_C void UseFont(const CFont* aFont);
1.316 - IMPORT_C void DiscardFont();
1.317 -
1.318 - IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
1.319 - IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
1.320 - IMPORT_C void SetWordJustification(TInt aExcessWidth, TInt aNumGaps);
1.321 - IMPORT_C void SetCharJustification(TInt aExcessWidth, TInt aNumChars);
1.322 -
1.323 - IMPORT_C void SetPenColor(const TRgb& aColor);
1.324 - IMPORT_C void SetPenStyle(TPenStyle aPenStyle);
1.325 - IMPORT_C void SetPenSize(const TSize& aSize = TSize(1, 1));
1.326 -
1.327 - IMPORT_C void SetBrushColor(const TRgb& aColor);
1.328 - IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);
1.329 - IMPORT_C void SetBrushOrigin(const TPoint& aOrigin);
1.330 - IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap);
1.331 - IMPORT_C void DiscardBrushPattern();
1.332 -
1.333 - IMPORT_C void MoveTo(const TPoint& aPoint);
1.334 - IMPORT_C void MoveBy(const TPoint& aVector);
1.335 - IMPORT_C void Plot(const TPoint& aPoint);
1.336 -
1.337 - IMPORT_C void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
1.338 - IMPORT_C void DrawLine(const TPoint& aPoint1, const TPoint& aPoint2);
1.339 - IMPORT_C void DrawLineTo(const TPoint& aPoint);
1.340 - IMPORT_C void DrawLineBy(const TPoint& aVector);
1.341 - IMPORT_C void DrawPolyLine(const CArrayFix<TPoint>* aPointList);
1.342 - IMPORT_C void DrawPolyLine(const TPoint* aPointList, TInt aNumPoints);
1.343 -
1.344 - IMPORT_C void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
1.345 - IMPORT_C void DrawEllipse(const TRect& aRect);
1.346 - IMPORT_C void DrawRect(const TRect& aRect);
1.347 - IMPORT_C void DrawRoundRect(const TRect& aRect, const TSize& aCornerSize);
1.348 - IMPORT_C TInt DrawPolygon(const CArrayFix<TPoint>* aPointList, TFillRule aFillRule = EAlternate);
1.349 - IMPORT_C TInt DrawPolygon(const TPoint* aPointList, TInt aNumPoints, TFillRule aFillRule = EAlternate);
1.350 -
1.351 - IMPORT_C void DrawBitmap(const TPoint& aTopLeft, const CFbsBitmap* aSource);
1.352 - IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource);
1.353 - IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource, const TRect& aSourceRect);
1.354 - IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
1.355 - IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask);
1.356 -
1.357 - IMPORT_C void DrawText(const TDesC& aString, const TPoint& aPosition);
1.358 - IMPORT_C void DrawTextL(const TDesC& aString, const TPoint& aPosition);
1.359 - IMPORT_C void DrawText(const TDesC& aString, const TRect& aBox, TInt aBaselineOffset, TTextAlign aHoriz = ELeft, TInt aLeftMrg = 0);
1.360 -
1.361 - IMPORT_C void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs,TBool aMapForwards);
1.362 - IMPORT_C TInt SetClippingRegion(const TRegion &aRegion);
1.363 - IMPORT_C void CancelClippingRegion();
1.364 - IMPORT_C void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
1.365 - IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
1.366 - IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.367 - IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.368 -
1.369 -private:
1.370 - inline CPdrControl* PdrControl() const {return ((CPdrControl*) iPdrDevice->iControl);}
1.371 -
1.372 -private:
1.373 -
1.374 - CPdrDevice* iPdrDevice;
1.375 -
1.376 - CFbsBitGc* iBandedGc;
1.377 -
1.378 - CFbsFont* iFbsFont;
1.379 -
1.380 - CFont* iBandedFont;
1.381 -
1.382 - CInfoFont* iFont;
1.383 -
1.384 - TPoint iOrigin;
1.385 -
1.386 - TPoint iPosition;
1.387 -
1.388 - TFontUnderline iUnderlineStyle;
1.389 -
1.390 - TFontStrikethrough iStrikethroughStyle;
1.391 -
1.392 - TRect iClippingRect; // Relative to absolute origin
1.393 -
1.394 - TInt iWordExcessWidthInPixels;
1.395 -
1.396 - TInt iNumGaps;
1.397 -
1.398 - TInt iCharExcessWidthInPixels;
1.399 -
1.400 - TInt iNumChars;
1.401 -
1.402 - TRgb iPenColor;
1.403 -
1.404 - TBool iPrintTextUsingBitmaps;
1.405 - };
1.406 -
1.407 -
1.408 -/**
1.409 -@publishedAll
1.410 -@released
1.411 -*/
1.412 class CFbsDrvDevice : public CPdrDevice
1.413 {
1.414 public:
1.415 @@ -680,10 +409,6 @@
1.416 };
1.417
1.418
1.419 -/**
1.420 -@publishedAll
1.421 -@released
1.422 -*/
1.423 class CFbsDrvControl : public CPdrControl
1.424 {
1.425 public: