1.1 --- a/epoc32/include/bitdev.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/bitdev.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,189 @@
1.4 -bitdev.inl
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +
1.21 +
1.22 +/**
1.23 + Creates a font and bitmap server graphics context for the device and activates
1.24 + it.
1.25 +
1.26 + It is the responsibility of the caller to delete the graphics context when
1.27 + it is no longer needed.
1.28 +
1.29 + @param aGc On return, contains a pointer to the graphics context.
1.30 + @return KErrNone if successful, otherwise, another one of the system-wide error
1.31 + codes.
1.32 +*/
1.33 +TInt CFbsDevice::CreateContext(CGraphicsContext*& aGc)
1.34 + {
1.35 + return CreateContext((CFbsBitGc*&)aGc);// relies on CFbsDevice deriving _only_ from CBitmapDevice
1.36 + }
1.37 +
1.38 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.39 +that most closely matches a font specification.
1.40 +
1.41 +When the font is no longer needed, call ReleaseFont().
1.42 +
1.43 +This function is replaced by GetNearestFontToDesignHeightInTwips().
1.44 +
1.45 +@param aFont On return, points to the font which most closely matches the
1.46 +specified font.
1.47 +@param aFontSpec An absolute font specification. Its iHeight member is interpreted
1.48 +as being in twips.
1.49 +@return KErrNone if successful; otherwise, another one of the system-wide error
1.50 +codes.
1.51 +@deprecated */
1.52 +TInt CFbsDevice::GetNearestFontInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec)
1.53 + {
1.54 + return GetNearestFontToDesignHeightInTwips(aFont, aFontSpec);
1.55 + }
1.56 +
1.57 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.58 +that most closely matches a font specification.
1.59 +
1.60 +When the font is no longer needed, call ReleaseFont().
1.61 +
1.62 +This function is replaced by GetNearestFontToDesignHeightInPixels().
1.63 +
1.64 +@param aFont On return, points to the font which most closely matches the
1.65 +specified font.
1.66 +@param aFontSpec An absolute font specification. Its iHeight member is interpreted
1.67 +as being in pixels.
1.68 +@return KErrNone if successful; otherwise, another of the system-wide error
1.69 +codes.
1.70 +@deprecated */
1.71 +TInt CFbsDevice::GetNearestFontInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec)
1.72 + {
1.73 + return GetNearestFontToDesignHeightInPixels(aFont, aFontSpec);
1.74 + }
1.75 +
1.76 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.77 +that most closely matches a font specification.
1.78 +
1.79 +When the font is no longer needed, call ReleaseFont().
1.80 +
1.81 +This function replaces GetNearestFontInTwips().
1.82 +
1.83 +@param aFont On return, points to the font which most closely matches the
1.84 +specified font.
1.85 +@param aFontSpec An absolute font specification. Its iHeight member is interpreted
1.86 +as being in twips.
1.87 +@return KErrNone if successful; otherwise, another one of the system-wide error
1.88 +codes. */
1.89 +TInt CFbsDevice::GetNearestFontToDesignHeightInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec)
1.90 + {
1.91 + return GetNearestFontToDesignHeightInTwips((CFont*&)aFont, aFontSpec); // relies on CFbsFont deriving _only_ from CFont
1.92 + }
1.93 +
1.94 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.95 +that most closely matches a font specification.
1.96 +
1.97 +When the font is no longer needed, call ReleaseFont().
1.98 +
1.99 +This function replaces GetNearestFontInPixels().
1.100 +
1.101 +@param aFont On return, points to the font which most closely matches the
1.102 +specified font.
1.103 +@param aFontSpec An absolute font specification. Its iHeight member is interpreted
1.104 +as being in pixels.
1.105 +@return KErrNone if successful; otherwise, another of the system-wide error
1.106 +codes. */
1.107 +TInt CFbsDevice::GetNearestFontToDesignHeightInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec)
1.108 + {
1.109 + return GetNearestFontToDesignHeightInPixels((CFont*&)aFont, aFontSpec); // relies on CFbsFont deriving _only_ from CFont
1.110 + }
1.111 +
1.112 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.113 +that most closely matches a font specification.
1.114 +
1.115 +When the font is no longer needed, call ReleaseFont().
1.116 +
1.117 +The font and bitmap server returns a pointer to the nearest matching font
1.118 +from those available. Matches to max height of font - this does its best
1.119 +to return a font that will fit within the maximum height specified (but
1.120 +note that variations due to hinting algorithms may rarely result in this
1.121 +height being exceeded by up to one pixel). Problems can also be
1.122 +encountered with bitmap fonts where the typeface exists but doesn't have
1.123 +a font small enough.
1.124 +
1.125 +@param aFont On return, the pointer is set to point to the device font which
1.126 +most closely approximates to the required font specification.
1.127 +@param aFontSpec An absolute font specification.
1.128 +@param aMaxHeight The maximum height in twips within which the font must
1.129 +fit - this overrides the height specified in aFontSpec.
1.130 +@return KErrNone, if successful; otherwise, another of the system-wide error
1.131 +codes. */
1.132 +TInt CFbsDevice::GetNearestFontToMaxHeightInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight)
1.133 + {
1.134 + return GetNearestFontToMaxHeightInTwips((CFont*&)aFont, aFontSpec, aMaxHeight); // relies on CFbsFont deriving _only_ from CFont
1.135 + }
1.136 +
1.137 +/** Creates a client-side FBSERV font from those available in the device's typeface store
1.138 +that most closely matches a font specification.
1.139 +
1.140 +When the font is no longer needed, call ReleaseFont().
1.141 +
1.142 +The font and bitmap server returns a pointer to the nearest matching font
1.143 +from those available. Matches to max height of font - this does its best
1.144 +to return a font that will fit within the maximum height specified (but
1.145 +note that variations due to hinting algorithms may rarely result in this
1.146 +height being exceeded by up to one pixel). Problems can also be
1.147 +encountered with bitmap fonts where the typeface exists but doesn't have
1.148 +a font small enough.
1.149 +
1.150 +@param aFont On return, the pointer is set to point to the device font which
1.151 +most closely approximates to the required font specification.
1.152 +@param aFontSpec An absolute font specification.
1.153 +@param aMaxHeight The maximum height in pixels within which the font must
1.154 +fit - this overrides the height specified in aFontSpec.
1.155 +@return KErrNone, if successful; otherwise, another of the system-wide error
1.156 +codes. */
1.157 +TInt CFbsDevice::GetNearestFontToMaxHeightInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight)
1.158 + {
1.159 + return GetNearestFontToMaxHeightInPixels((CFont*&)aFont, aFontSpec, aMaxHeight); // relies on CFbsFont deriving _only_ from CFont
1.160 + }
1.161 +
1.162 +/** Gets a specific bitmap font, identified by its UID, from the device's typeface store.
1.163 +
1.164 +When the font is no longer needed, call ReleaseFont().
1.165 +
1.166 +@param aFont On return, set to point to the font.
1.167 +@param aFileId The UID identifying the bitmap font.
1.168 +@param aStyle Algorithmic style for the font.
1.169 +@return KErrNone if successful; otherwise, another of the system-wide error
1.170 +codes. */
1.171 +TInt CFbsDevice::GetFontById(CFbsFont*& aFont,TUid aFileId,const TAlgStyle& aStyle)
1.172 + {
1.173 + return GetFontById((CFont*&)aFont,aFileId,aStyle);// relies on CFbsFont deriving _only_ from CFont
1.174 + }
1.175 +
1.176 +/** Gets a pointer to the 2D graphics accelerator owned by the device. If one is
1.177 +available, it is used to accelerate various CFbsBitGc graphics operations.
1.178 +
1.179 +@return Pointer to the graphics accelerator or NULL if not supported.
1.180 +@see CFbsBitmapDevice::NewL() */
1.181 +CGraphicsAccelerator* CFbsDevice::GraphicsAccelerator() const
1.182 + {
1.183 + return iGraphicsAccelerator;
1.184 + }
1.185 +
1.186 +
1.187 +/** Gets the device's orientation. The orientation can be set using CFbsBitGc::SetOrientation().
1.188 +
1.189 +@return The device's orientation. */
1.190 +CFbsBitGc::TGraphicsOrientation CFbsDevice::Orientation() const
1.191 + {
1.192 + return iOrientation;
1.193 + }