epoc32/include/cdsb.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __CDSB_H__
williamr@2
    17
#define __CDSB_H__
williamr@2
    18
williamr@2
    19
#include <e32base.h>
williamr@2
    20
#include <bitdev.h>
williamr@2
    21
williamr@2
    22
/**
williamr@2
    23
Direct Screen Bitmap.
williamr@2
    24
API to allow provide synchronisation of the display of images with the
williamr@2
    25
displays refresh to prevent tearing.
williamr@2
    26
 
williamr@2
    27
This is an abstract base class, so must be derived from on a per-variant basis.
williamr@2
    28
williamr@2
    29
@internalComponent
williamr@2
    30
*/ 
williamr@2
    31
class CDirectScreenBitmap : public CBase
williamr@2
    32
	{
williamr@2
    33
public:
williamr@2
    34
	enum TSettingsFlags
williamr@2
    35
		{
williamr@2
    36
		ENone = 0,
williamr@2
    37
		EDoubleBuffer = 1,
williamr@2
    38
		EIncrementalUpdate = 2
williamr@2
    39
		};
williamr@2
    40
williamr@2
    41
public:
williamr@2
    42
	/**
williamr@2
    43
	Constructs a CDirectScreenBitmap derived object.
williamr@2
    44
    The default screen (with number 0) will be used.
williamr@2
    45
    @return A pointer to the created CDirectScreenBitmap object
williamr@2
    46
    @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
williamr@2
    47
	*/
williamr@2
    48
	IMPORT_C static CDirectScreenBitmap* NewL();	
williamr@2
    49
williamr@2
    50
	/**
williamr@2
    51
	Constructs a CDirectScreenBitmap derived object.
williamr@2
    52
	@param aScreenNo Screen number, used by the CDirectScreenBitmap object.
williamr@2
    53
    @return A pointer to the created CDirectScreenBitmap object
williamr@2
    54
    @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
williamr@2
    55
	*/
williamr@2
    56
	IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo);	
williamr@2
    57
williamr@2
    58
    /**
williamr@2
    59
	Creates a CDirectScreenBitmap object which can be used for drawing to
williamr@2
    60
	a region of the screen indicated by aScreenRect.  This region must have
williamr@2
    61
	previously been 'claimed' via the Window Servers Direct Screen Access API.
williamr@2
    62
williamr@2
    63
	@param aScreenRect The region to be displayed
williamr@2
    64
	@param aSettingsFlags The mode of operation. The upper 3 bits are used 
williamr@2
    65
                          for the screen number value: 0..7.  By default the screen 
williamr@2
    66
                          with  number 0 will be used.
williamr@2
    67
	@return KErrNone if successful
williamr@2
    68
	        KErrNoMemory if there was insufficient memory
williamr@2
    69
	        KErrNotSupported if the creation failed for other reasons
williamr@2
    70
	*/
williamr@2
    71
	virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0;
williamr@2
    72
williamr@2
    73
	/**
williamr@2
    74
	Returns a TAcceleratedBitmapInfo referring to a bitmap which the
williamr@2
    75
	applicationcan render to.
williamr@2
    76
williamr@2
    77
	@param aBitmapInfo The Bitmap
williamr@2
    78
	@return KErrNone if successful, another error code otherwise
williamr@2
    79
	*/
williamr@2
    80
	virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0;
williamr@2
    81
williamr@2
    82
	/**
williamr@2
    83
	Indicates to the Video Driver that the bitmap corresponding to the
williamr@2
    84
	update has been fully rendered.  The video driver will perform
williamr@2
    85
	the actions required to copy this to the frame buffer.
williamr@2
    86
williamr@2
    87
	The request status aComplete will be signalled when the copying has completed.
williamr@2
    88
	
williamr@2
    89
	@param aComplete Asynchronous completion status
williamr@2
    90
	*/
williamr@2
    91
	virtual void EndUpdate(TRequestStatus& aComplete) =0;
williamr@2
    92
williamr@2
    93
	/**
williamr@2
    94
	Indicates to the Video Driver that the area indicated in aScreenRect has
williamr@2
    95
	been fully rendered.  The video driver will perform the actions required 
williamr@2
    96
	to copy this to the frame buffer.
williamr@2
    97
	
williamr@2
    98
	The request status aComplete will be signalled when the copying has completed.
williamr@2
    99
	
williamr@2
   100
	Note: aScreenRects coordinates are relative to the screen, not the update region specified
williamr@2
   101
	in Create().  aScreenRect must fit entirely within the bounds of the original region passed
williamr@2
   102
	to Create().
williamr@2
   103
williamr@2
   104
	@param aScreenRect The region to update
williamr@2
   105
	@param aComplete Asynchronous completion status
williamr@2
   106
	*/
williamr@2
   107
	virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0;
williamr@2
   108
williamr@2
   109
	/**
williamr@2
   110
	Deletes all resources associated with the CDirectScreenBitmap object.
williamr@2
   111
	*/
williamr@2
   112
	virtual void Close() =0;
williamr@2
   113
	};
williamr@2
   114
williamr@2
   115
#endif