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