graphicsdeviceinterface/directgdiadaptation/inc/directgdiextensioninterfaces.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef DIRECTGDIEXTENSIONINTERFACES_H
       
    17 #define DIRECTGDIEXTENSIONINTERFACES_H
       
    18 
       
    19 #include <e32cmn.h>
       
    20 #include <gdi.h>
       
    21 
       
    22 /**
       
    23 An interface used for testing the VGImage cache in the VG DirectGDI adaptation.
       
    24 
       
    25 @internalTechnology
       
    26 */
       
    27 class MVgImageCache
       
    28 	{
       
    29 public:
       
    30 	virtual TBool IsInCache(TInt64 aSerialNumberList) = 0;
       
    31 	virtual TInt TouchCount(TInt64 aSerialNumberList) = 0;
       
    32 	virtual TInt NumEntries() const = 0;
       
    33 	virtual void GetOrderedCacheEntries(TInt64& aSerialNumberList, TInt aListSize) = 0;
       
    34 	virtual TInt CacheSizeInBytes() const = 0;
       
    35 	virtual TInt MaxCacheSize() const = 0;
       
    36 	virtual void ResetCache() = 0;
       
    37 	};
       
    38 
       
    39 const TUint32 KDirectGdiVgImageCacheUid = 0x10285A74;
       
    40 
       
    41 /**
       
    42 An interface for retrieving images from the storage and obtaining various glyph cache parameters . 
       
    43 Many functions are intended to be used by test code only to exersize glyph image cache implementation. 
       
    44 
       
    45 @internalTechnology
       
    46 */
       
    47 class MFontGlyphImageStorage
       
    48 	{
       
    49 public:
       
    50 	virtual TInt GlyphImage(TUint32 aFontId, TChar aGlyphCode, TGlyphBitmapType aGlyphBitmapType, 
       
    51 						const TUint8* aGlyphImage, const TSize& aGlyphImageSize, 
       
    52 						TAny* aImageForeground, TAny* aImageShadow, TAny* aImageOutline) = 0;
       
    53 	//for test purpose
       
    54 	//current glyph cache size in bytes
       
    55 	virtual TInt GlyphCacheSize() const = 0;
       
    56 	//max glyph cache size in bytes
       
    57 	virtual TInt MaxGlyphCacheSize() const = 0;
       
    58 	//mainly for OOM testing
       
    59 	//delete all VG Images from the cache
       
    60 	virtual void CleanGlyphImageCache() = 0;
       
    61 	//Fills aFontListId parameter with font Id in order from most to least usable. 
       
    62 	virtual TInt FontIdInOrder(RArray<TUint32> & aFontListId) const = 0;
       
    63 	//Enforce to emulate OOM condition. The system will use pre-allocated buffers.
       
    64 	virtual void EnforceOOMFailure(TBool aEnforce) = 0;
       
    65 	};
       
    66 
       
    67 const TUint32 KDirectGdiGetGlyphStorageUid = 0x10285A75;
       
    68 
       
    69 /**
       
    70 Interface intended for implementation by CDirectGdiDriverInternal to allow clients 
       
    71 control over the maximum sizes used by an image cache and a glyph cache.
       
    72  
       
    73 @internalTechnology
       
    74  */
       
    75 class MDirectGdiDriverCacheSize
       
    76 	{
       
    77 public:
       
    78 	/** Sets the maximum size of the image cache used by the driver 
       
    79 	implementation.
       
    80 	@param aSize The maximum size in bytes that the image cache should use.
       
    81 	@return KErrNone if the maximum cache size was set successfully, 
       
    82 	KErrNotSupported if this method is not supported.
       
    83 	 */
       
    84 	virtual TInt SetMaxImageCacheSize(TInt aSize) = 0;
       
    85 	/** Gets the maximum size of the driver's image cache.
       
    86 	@return The current maximum size in bytes of the driver's image cache.
       
    87 	 */
       
    88 	virtual TInt MaxImageCacheSize() const = 0;
       
    89 	/** Sets the maximum size of the glyph cache used by the driver
       
    90 	implementation.
       
    91 	@param aSize The maximum size in bytes that the glyph cache should use.
       
    92 	@return KErrNone if the maximum cache size was set successfully, 
       
    93 	KErrNotSupported if this method is not supported.
       
    94 	 */
       
    95 	virtual TInt SetMaxGlyphCacheSize(TInt aSize) = 0;
       
    96 	/** Gets the maximum size of the driver's glyph cache.
       
    97 	@return The current maximum size in bytes of the driver's glyph cache.
       
    98 	 */
       
    99 	virtual TInt MaxGlyphCacheSize() const = 0;
       
   100 	};
       
   101 
       
   102 const TUint32 KDirectGdiDriverCacheSizeUid = 0x10286A32;
       
   103 
       
   104 #endif /*DIRECTGDIEXTENSIONINTERFACES_H*/