Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Declaration of a Direct Graphics Device Interface (GDI) Driver, this class
15 // defines the API which is intended to be used by DirectGDI client applications.
19 #ifndef DIRECTGDIDRIVER_H
20 #define DIRECTGDIDRIVER_H
33 class RDirectGdiImageTarget;
34 class RDirectGdiDrawableSource;
35 class CDirectGdiContext;
36 class MDirectGdiEngine;
37 class CDirectGdiDriverInternal;
38 class CTDirectGdiDriver;
41 Provides an interface which is intended to be used by DirectGDI client applications. It will be implemented using
42 the handle/body idiom, where the handle part will form the public and private API that is intended to be used by
43 DirectGDI client applications and other DirectGDI generic parts, and the body part defines the HAI that needs to be
44 implemented by an adaptation. The implementation of the handle part will be generic for all adaptations. The implementation
45 of the body part is adaptation specific and provides interfaces for initialisation, termination, construction
46 of the concrete drawing engine and the creation of source or target rendering. Initialisation and termination are
47 intended to give opportunities for an adaptation to perform any thread specific tasks which may be required. This class
48 is intended to be a singleton within a thread. It delegates to an adaptation-specific implementation that provides a
49 platform-specific mechanism.
55 NONSHARABLE_CLASS(CDirectGdiDriver): public CBase
57 friend class CDirectGdiContext;
58 friend class RDirectGdiImageTarget;
59 friend class RDirectGdiDrawableSource;
60 friend class CTDirectGdiDriver;
63 IMPORT_C static CDirectGdiDriver* Static();
64 IMPORT_C static TInt Open();
65 IMPORT_C void Close();
66 IMPORT_C void Flush();
67 IMPORT_C void Finish();
68 IMPORT_C TInt GetError();
69 IMPORT_C TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
74 TInt CreateDrawableSource(RDirectGdiDrawableSource& aRDirectGdiDrawableSource, const RSgDrawable& aRSgDrawable);
75 void CloseDrawableSource(RDirectGdiDrawableSource& aRDirectGdiDrawableSource);
76 TInt CreateImageTarget(RDirectGdiImageTarget& aRDirectGdiImageTarget, const RSgImage& aRSgImage);
77 void CloseImageTarget(RDirectGdiImageTarget& aRDirectGdiImageTarget);
78 TInt CreateEngine(MDirectGdiEngine*& aMDirectGdiEngine);
79 void DestroyEngine(MDirectGdiEngine* aMDirectGdiEngine);
80 IMPORT_C void SetError(TInt aErr);
82 TInt CreateInternalDriver(const RLibrary& aLibrary);
84 TInt CreateInternalDriver();
88 TInt iOpenCount; /**< A count of how many times this driver object has been opened.*/
89 CDirectGdiDriverInternal* iDriverInternal; /**< To delegate calls to adaptation.*/
92 #endif //__DIRECTGDIDRIVER_H__