os/graphics/graphicsdeviceinterface/directgdiinterface/inc/directgdiengine.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
#ifndef DIRECTGDIENGINE_H
sl@0
    18
#define DIRECTGDIENGINE_H
sl@0
    19
sl@0
    20
/**
sl@0
    21
@file
sl@0
    22
@publishedPartner
sl@0
    23
@prototype
sl@0
    24
*/
sl@0
    25
sl@0
    26
#include <graphics/directgditypes.h>
sl@0
    27
#include <e32std.h>
sl@0
    28
sl@0
    29
// Forward declarations.
sl@0
    30
//
sl@0
    31
class CFbsBitmap;
sl@0
    32
class RDirectGdiImageSource;
sl@0
    33
class RDirectGdiImageTarget;
sl@0
    34
class RDirectGdiDrawableSource;
sl@0
    35
sl@0
    36
/**
sl@0
    37
Pure virtual interface for licensee adaptation of GDI platform implementation.
sl@0
    38
sl@0
    39
@publishedPartner
sl@0
    40
@prototype
sl@0
    41
@deprecated
sl@0
    42
*/
sl@0
    43
class MDirectGdiEngine
sl@0
    44
	{
sl@0
    45
public:
sl@0
    46
sl@0
    47
	/**
sl@0
    48
	@see	CDirectGdiContext::Activate()
sl@0
    49
	@see	Deactivate()
sl@0
    50
	 */
sl@0
    51
	virtual TInt Activate(RDirectGdiImageTarget& aTarget) = 0;
sl@0
    52
	
sl@0
    53
	/**
sl@0
    54
	Unbinds the current rendering target (if any) from drawing engine. Drawing engine states or settings which
sl@0
    55
	are not dependent or non-target-specific remain unchanged.
sl@0
    56
	
sl@0
    57
	The DirectGDI generic layer will call this method prior to activating the drawing engine for another 
sl@0
    58
	rendering target.
sl@0
    59
	
sl@0
    60
	@see	Activate()
sl@0
    61
	
sl@0
    62
	@pre	None.
sl@0
    63
	@post	Drawing engine is no longer associated with any rendering target.
sl@0
    64
	 */
sl@0
    65
	virtual void Deactivate() = 0;
sl@0
    66
	
sl@0
    67
	/**
sl@0
    68
	@see	CDirectGdiContext::SetOrigin()
sl@0
    69
	 */
sl@0
    70
	virtual void SetOrigin(const TPoint& aOrigin) = 0;
sl@0
    71
	
sl@0
    72
	/**
sl@0
    73
	@see	CDirectGdiContext::ResetClippingRegion()
sl@0
    74
	@see	SetClippingRegion()
sl@0
    75
	 */
sl@0
    76
	virtual void SetClippingRegion(const TRegion& aRegion) = 0;
sl@0
    77
	
sl@0
    78
	/**
sl@0
    79
	@see	CDirectGdiContext::ReetClippingRegion()
sl@0
    80
	@see	SetClippingRegion()
sl@0
    81
	 */
sl@0
    82
	virtual void ResetClippingRegion() = 0;
sl@0
    83
	
sl@0
    84
	/**
sl@0
    85
	@see	CDirectGdiContext::SetDrawMode()
sl@0
    86
	 */
sl@0
    87
	virtual void SetDrawMode(DirectGdi::TDrawMode aMode) = 0;
sl@0
    88
	
sl@0
    89
	/**
sl@0
    90
	@see	CDirectGdiContext::SetPenColor()
sl@0
    91
	@see	DrawLine()
sl@0
    92
	@see	DrawLineTo()
sl@0
    93
	@see	DrawLineBy()
sl@0
    94
	@see	DrawPolyLine()
sl@0
    95
	@see	DrawPolygon()
sl@0
    96
	@see	DrawRect()
sl@0
    97
	@see	DrawRoundRect()
sl@0
    98
	 */
sl@0
    99
	virtual void SetPenColor(const TRgb& aColor) = 0;
sl@0
   100
	
sl@0
   101
	/**
sl@0
   102
	@see	CDirectGdiContext::SetPenStyle()
sl@0
   103
	@see	DrawLine()
sl@0
   104
	@see	DrawLineTo()
sl@0
   105
	@see	DrawLineBy()
sl@0
   106
	@see	DrawPolyLine()
sl@0
   107
	@see	DrawPolygon()
sl@0
   108
	@see	DrawRect()
sl@0
   109
	@see	DrawRoundRect()
sl@0
   110
	 */
sl@0
   111
	virtual void SetPenStyle(DirectGdi::TPenStyle aStyle) = 0;
sl@0
   112
	
sl@0
   113
	/**
sl@0
   114
	@see	CDirectGdiContext::SetPenSize()
sl@0
   115
	@see	DrawLine()
sl@0
   116
	@see	DrawLineTo()
sl@0
   117
	@see	DrawLineBy()
sl@0
   118
	@see	DrawPolyLine()
sl@0
   119
	@see	DrawPolygon()
sl@0
   120
	@see	DrawRect()
sl@0
   121
	@see	DrawRoundRect()
sl@0
   122
	@see	Plot()
sl@0
   123
	 */
sl@0
   124
	virtual void SetPenSize(const TSize& aSize) = 0;
sl@0
   125
	
sl@0
   126
	/**
sl@0
   127
	@see	CDirectGdiContext::SetTextShadowColor()
sl@0
   128
	 */
sl@0
   129
	virtual void SetTextShadowColor(const TRgb& aColor) = 0;
sl@0
   130
	
sl@0
   131
	/**
sl@0
   132
	@see	CDirectGdiContext::SetBrushColor()
sl@0
   133
	 */
sl@0
   134
	virtual void SetBrushColor(const TRgb& aColor) = 0;
sl@0
   135
	
sl@0
   136
	/**
sl@0
   137
	@see 	CDirectGdiContext::SetBrushStyle()
sl@0
   138
	@see	SetBrushPattern()
sl@0
   139
	 */
sl@0
   140
	virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle) = 0;
sl@0
   141
	
sl@0
   142
	/**
sl@0
   143
	@see	CDirectGdiContext::SetBrushOrigin()
sl@0
   144
	@see	SetBrushPattern()
sl@0
   145
	 */
sl@0
   146
	virtual void SetBrushOrigin(const TPoint& aOrigin) = 0;
sl@0
   147
	
sl@0
   148
	/**
sl@0
   149
	@see	CDirectGdiContext::SetBrushPattern()
sl@0
   150
	@see	ResetBrushPattern()
sl@0
   151
	
sl@0
   152
	@return KErrNone if successful, otherwise one of the system-wide error codes.
sl@0
   153
	 */
sl@0
   154
	virtual TInt SetBrushPattern(const CFbsBitmap& aPattern) = 0;
sl@0
   155
	
sl@0
   156
	/**
sl@0
   157
	@see 	CDirectGdiContext::ResetBrushPattern()
sl@0
   158
	@see	SetBrushPattern()
sl@0
   159
	 */
sl@0
   160
	virtual void ResetBrushPattern() = 0;
sl@0
   161
	
sl@0
   162
	/**
sl@0
   163
	@see 	CDirectGdiContext::SetFont()
sl@0
   164
	
sl@0
   165
	@param  aFontId The Font identifier.
sl@0
   166
	*/
sl@0
   167
	virtual void SetFont(TUint32 aFontId) = 0;
sl@0
   168
	
sl@0
   169
	/**
sl@0
   170
	@see 	CDirectGdiContext::ResetFont()
sl@0
   171
	 */
sl@0
   172
	virtual void ResetFont() = 0;
sl@0
   173
	
sl@0
   174
	/**
sl@0
   175
	Resets the engine state to default values. 
sl@0
   176
	 
sl@0
   177
	@see 	CDirectGdiContext::Reset()
sl@0
   178
	 */
sl@0
   179
	virtual void Reset() = 0;
sl@0
   180
	
sl@0
   181
	/**
sl@0
   182
	@see	CDirectGdiContext::Clear(const TRect&)
sl@0
   183
	@see	Clear()
sl@0
   184
	@see    SetBrushColor()
sl@0
   185
	 */
sl@0
   186
	virtual void Clear(const TRect& aRect) = 0;
sl@0
   187
	
sl@0
   188
	/**
sl@0
   189
	@see	CDirectGdiContext::Clear()
sl@0
   190
	@see	Clear(const TRect&)
sl@0
   191
	@see    SetBrushColor()
sl@0
   192
	 */
sl@0
   193
	virtual void Clear() = 0;
sl@0
   194
	
sl@0
   195
	/**
sl@0
   196
	@see    CDirectGdiContext::MoveTo()
sl@0
   197
	@see	MoveBy()
sl@0
   198
	 */
sl@0
   199
	virtual void MoveTo(const TPoint& aPoint) = 0;
sl@0
   200
	
sl@0
   201
	/**
sl@0
   202
	@see    CDirectGdiContext::MoveBy()
sl@0
   203
	@see	MoveTo()
sl@0
   204
	 */
sl@0
   205
	virtual void MoveBy(const TPoint& aVector) = 0;
sl@0
   206
	
sl@0
   207
	/**
sl@0
   208
	@see    CDirectGdiContext::Plot()	
sl@0
   209
	@see    SetPenSize()
sl@0
   210
	@see    SetPenColor()
sl@0
   211
	@see    SetDrawMode()
sl@0
   212
	 */
sl@0
   213
	virtual void Plot(const TPoint& aPoint) = 0;
sl@0
   214
	
sl@0
   215
	/**
sl@0
   216
	@see    CDirectGdiContext::DrawLine()	
sl@0
   217
	@see    DrawLineTo()
sl@0
   218
	@see    DrawLineBy()
sl@0
   219
	@see    SetPenSize()
sl@0
   220
	@see    SetPenStyle()
sl@0
   221
	@see    SetPenColor()
sl@0
   222
	@see    SetDrawMode()
sl@0
   223
	 */
sl@0
   224
	virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd) = 0;
sl@0
   225
	
sl@0
   226
	/**
sl@0
   227
	@see    CDirectGdiContext::DrawLineTo()	
sl@0
   228
	@see    DrawLine()
sl@0
   229
	@see    DrawLineBy()
sl@0
   230
	@see    SetPenSize()
sl@0
   231
	@see    SetPenStyle()
sl@0
   232
	@see    SetPenColor()
sl@0
   233
	@see    SetDrawMode()
sl@0
   234
	@see    MoveTo()
sl@0
   235
	@see    MoveBy()
sl@0
   236
	 */
sl@0
   237
	virtual void DrawLineTo(const TPoint& aPoint) = 0;
sl@0
   238
	
sl@0
   239
	/**
sl@0
   240
	@see    CDirectGdiContext::DrawLineBy()	
sl@0
   241
	@see    DrawLine()
sl@0
   242
	@see    DrawLineTo()
sl@0
   243
	@see    SetPenSize()
sl@0
   244
	@see    SetPenStyle()
sl@0
   245
	@see    SetPenColor()
sl@0
   246
	@see    DrawMode()
sl@0
   247
	@see    MoveTo()
sl@0
   248
	@see    MoveBy()
sl@0
   249
	 */
sl@0
   250
	virtual void DrawLineBy(const TPoint& aVector) = 0;
sl@0
   251
	
sl@0
   252
	/**
sl@0
   253
	@see	CDirectGdiContext::DrawRect()
sl@0
   254
	 */
sl@0
   255
	virtual void DrawRect(const TRect& aRect) = 0;
sl@0
   256
	
sl@0
   257
	/**
sl@0
   258
	@see	CDirectGdiContext::DrawRoundRect()
sl@0
   259
	 */
sl@0
   260
	virtual void DrawRoundRect(const TRect& aRect, const TSize& aCornerSize) = 0;
sl@0
   261
	
sl@0
   262
	/**
sl@0
   263
	@see	CDirectGdiContext::DrawPolyLine()	
sl@0
   264
	@see	SetPenColor()
sl@0
   265
	@see	SetPenSize()
sl@0
   266
	@see	SetPenStyle()
sl@0
   267
	@see	SetDrawMode()
sl@0
   268
	 */
sl@0
   269
	virtual void DrawPolyLine(const TArray<TPoint>& aPointList) = 0;
sl@0
   270
	
sl@0
   271
	/**
sl@0
   272
	@see	CDirectGdiContext::DrawPolyLineNoEndPoint()	
sl@0
   273
	@see	SetPenColor()
sl@0
   274
	@see	SetPenSize()
sl@0
   275
	@see	SetPenStyle()
sl@0
   276
	@see	SetDrawMode()
sl@0
   277
	 */
sl@0
   278
	virtual void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList) = 0;
sl@0
   279
	
sl@0
   280
	/**
sl@0
   281
	@see	CDirectGdiContext::DrawPolygon()
sl@0
   282
	 */
sl@0
   283
	virtual void DrawPolygon(const TArray<TPoint>& aPoints,	DirectGdi::TFillRule aRule) = 0;
sl@0
   284
	
sl@0
   285
	/**
sl@0
   286
	@see	CDirectGdiContext::DrawArc()
sl@0
   287
	@see	DrawPie()
sl@0
   288
	 */
sl@0
   289
	virtual void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) = 0;
sl@0
   290
	
sl@0
   291
	/**
sl@0
   292
	@see	CDirectGdiContext::DrawPie()
sl@0
   293
	 */
sl@0
   294
	virtual void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) = 0;
sl@0
   295
	
sl@0
   296
	/**
sl@0
   297
	@see	CDirectGdiContext::DrawEllipse()
sl@0
   298
	 */
sl@0
   299
	virtual void DrawEllipse(const TRect& aRect) = 0;
sl@0
   300
	
sl@0
   301
	/** 
sl@0
   302
	@see	CDirectGdiContext::BitBlt(const TPoint&, const CFbsBitmap&, const TRect&)
sl@0
   303
	 */
sl@0
   304
	virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap, const TRect& aSourceRect) = 0;
sl@0
   305
	
sl@0
   306
	/**
sl@0
   307
	@see	CDirectGdiContext::BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
sl@0
   308
	 */
sl@0
   309
	virtual void BitBltMasked(const TPoint& aDestPos,				
sl@0
   310
							const CFbsBitmap& aBitmap,
sl@0
   311
							const TRect& aSourceRect,				
sl@0
   312
							const CFbsBitmap& aMask,
sl@0
   313
							TBool aInvertMask) = 0;
sl@0
   314
	
sl@0
   315
	/**
sl@0
   316
	@see	CDirectGdiContext::BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, const TPoint&)
sl@0
   317
	 */
sl@0
   318
	virtual void BitBltMasked(const TPoint& aDestPos,			
sl@0
   319
							const CFbsBitmap& aBitmap,
sl@0
   320
							const TRect& aSourceRect,				
sl@0
   321
							const CFbsBitmap& aMask,
sl@0
   322
							const TPoint& aMaskPos) = 0;
sl@0
   323
	
sl@0
   324
	/**
sl@0
   325
	@see	CDirectGdiContext::DrawBitmap(const TRect&, const CFbsBitmap&, const TRect&)
sl@0
   326
	 */
sl@0
   327
	virtual void DrawBitmap(const TRect& aDestRect, 
sl@0
   328
							const CFbsBitmap& aBitmap, 
sl@0
   329
							const TRect& aSourceRect) = 0;
sl@0
   330
	
sl@0
   331
	/**
sl@0
   332
	@see	CDirectGdiContext::DrawBitmapMasked(const TRect&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
sl@0
   333
	 */
sl@0
   334
	virtual void DrawBitmapMasked(const TRect& aDestRect,				
sl@0
   335
								const CFbsBitmap& aBitmap,
sl@0
   336
								const TRect& aSourceRect,				
sl@0
   337
								const CFbsBitmap& aMask,
sl@0
   338
								TBool aInvertMask) = 0;
sl@0
   339
	
sl@0
   340
	/**
sl@0
   341
	@see	CDirectGdiContext::DrawResource(const TPoint&, const RDirectGdiImageSource&, DirectGdi::TGraphicsRotation)
sl@0
   342
	 */
sl@0
   343
	virtual void DrawResource(const TPoint& aPos, 
sl@0
   344
							const RDirectGdiDrawableSource& aSource, 
sl@0
   345
							DirectGdi::TGraphicsRotation aRotation) = 0;
sl@0
   346
	
sl@0
   347
	/**
sl@0
   348
	@see	CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiImageSource&, DirectGdi::TGraphicsRotation)
sl@0
   349
	 */
sl@0
   350
	virtual void DrawResource(const TRect& aDestRect,
sl@0
   351
							const RDirectGdiDrawableSource& aSource,
sl@0
   352
							DirectGdi::TGraphicsRotation aRotation) = 0;
sl@0
   353
	
sl@0
   354
	/**
sl@0
   355
	@see	CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiImageSource&, const TRect&, DirectGdi::TGraphicsRotation)
sl@0
   356
	 */
sl@0
   357
	virtual void DrawResource(const TRect& aDestRect,				
sl@0
   358
							const RDirectGdiDrawableSource& aSource,
sl@0
   359
							const TRect& aSourceRect,
sl@0
   360
							DirectGdi::TGraphicsRotation aRotation) = 0;
sl@0
   361
	
sl@0
   362
	/**
sl@0
   363
	@see	CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiDrawableSource&, const TDesC8&)
sl@0
   364
	 */
sl@0
   365
	virtual void DrawResource(const TRect& aDestRect, const RDirectGdiDrawableSource& aSource, const TDesC8& aParam) = 0;
sl@0
   366
	
sl@0
   367
	/**
sl@0
   368
	Draws a glyph.
sl@0
   369
	
sl@0
   370
	@param	aPos			Position to start drawing the glyph after rotation has been applied (if necessary).
sl@0
   371
	@param	aChar			Character being drawn.
sl@0
   372
	@param	aGlyphImage		Pointer to the glyph image data.
sl@0
   373
	@param	aBitmapType		Type of bitmap format.
sl@0
   374
	@param	aGlyphImageSize	Glyph image size.
sl@0
   375
	@param	aClipRect		Clipping rect.
sl@0
   376
	@param	aRotation		Rotation specifying how the glyph will be drawn.
sl@0
   377
	
sl@0
   378
	@pre	The rendering target has been activated.
sl@0
   379
	@post	Request to draw the glyph has been accepted.
sl@0
   380
	 */
sl@0
   381
	virtual void DrawGlyph(const TPoint& aPos, 
sl@0
   382
						const TChar aChar, 
sl@0
   383
						const TUint8* aGlyphImage,
sl@0
   384
						const TGlyphBitmapType aBitmapType, 
sl@0
   385
						const TSize& aGlyphImageSize, 
sl@0
   386
						const TRect& aClipRect,
sl@0
   387
						const DirectGdi::TGraphicsRotation aRotation = DirectGdi::EGraphicsRotationNone) = 0;
sl@0
   388
	
sl@0
   389
	/**
sl@0
   390
	Copies the contents of a rectangular area on the target to another location.
sl@0
   391
	The source rectangle will be intersected with the full extent of the target.
sl@0
   392
	
sl@0
   393
	@param	aOffset Offset from the top left corner of the rectangle to be copied to the top left corner of the copy.
sl@0
   394
	@param	aRect Area to be copied.
sl@0
   395
	
sl@0
   396
	@pre 	The rendering target has been activated.
sl@0
   397
	@post 	Request to copy an area has been accepted. There is no guarantee that the
sl@0
   398
			request has been processed when this method returns.
sl@0
   399
	 */
sl@0
   400
	virtual void CopyRect(const TPoint& aOffset, const TRect& aRect) = 0;
sl@0
   401
	
sl@0
   402
	/**
sl@0
   403
	Writes the drawing engine object state to the passed write stream.
sl@0
   404
	
sl@0
   405
	@see    CDirectGdiContext::ExternalizeL()
sl@0
   406
	@see	InternalizeL()
sl@0
   407
	
sl@0
   408
	@param	aWriteStream Write stream.
sl@0
   409
sl@0
   410
	@pre	None.
sl@0
   411
	@post	The drawing engine object state has been written to the write stream.
sl@0
   412
	 */
sl@0
   413
	virtual void ExternalizeL(RWriteStream& aWriteStream) = 0;
sl@0
   414
	
sl@0
   415
	/**
sl@0
   416
	Sets the drawing engine object state from the read stream.
sl@0
   417
	
sl@0
   418
	@see    CDirectGdiContext::InternalizeL()
sl@0
   419
	@see	ExternalizeL()
sl@0
   420
	 
sl@0
   421
	@param	aReadStream Read stream.
sl@0
   422
	 
sl@0
   423
	@pre	None.
sl@0
   424
	@post	The drawing engine object state has been updated with the values from the read stream.
sl@0
   425
	 */
sl@0
   426
	virtual void InternalizeL(RReadStream& aReadStream) = 0;
sl@0
   427
	
sl@0
   428
	/**
sl@0
   429
	@see CDirectGdiContext::GetInterface()
sl@0
   430
	 */
sl@0
   431
	virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface) = 0;
sl@0
   432
	
sl@0
   433
	/**
sl@0
   434
	Prepares the drawing engine for drawing text as multiple DrawGlyph() commands.
sl@0
   435
	This function must always have a corresponding call to EndDrawGlyph() after the multiple 
sl@0
   436
	DrawGlyph() commands have been made.
sl@0
   437
	Other than DrawGlyph(), no other rendering should be issued to the engine until EndDrawGlyph() has been called.
sl@0
   438
	
sl@0
   439
	@see EndDrawGlyph()
sl@0
   440
	@see DrawGlyph()
sl@0
   441
	
sl@0
   442
	@pre None.
sl@0
   443
	@post None.
sl@0
   444
	 */
sl@0
   445
	virtual void BeginDrawGlyph() = 0;
sl@0
   446
	
sl@0
   447
	/**
sl@0
   448
	Notifies the drawing engine that the last call to DrawGlyph() has been made for the 
sl@0
   449
	text string. This function must always be matched to a corresponding BeginDrawGlyph() call. 
sl@0
   450
	Other than DrawGlyph(), no other rendering should be issued to the engine until EndDrawGlyph() has 
sl@0
   451
	been called.
sl@0
   452
	
sl@0
   453
	@see BeginDrawGlyph()
sl@0
   454
	@see DrawGlyph()
sl@0
   455
	
sl@0
   456
	@pre BeginDrawGlyph() has been called.
sl@0
   457
	@post None.  
sl@0
   458
	 */
sl@0
   459
	virtual void EndDrawGlyph() = 0;
sl@0
   460
	
sl@0
   461
	};
sl@0
   462
sl@0
   463
const TUid KDirectGdiEngineUid = {0x10285A72};
sl@0
   464
sl@0
   465
sl@0
   466
#endif