os/graphics/graphicscomposition/surfaceupdate/inc/updateserverprovider.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2006-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
#ifndef __UPDATESERVERPROVIDER_H__
sl@0
    17
#define __UPDATESERVERPROVIDER_H__
sl@0
    18
sl@0
    19
#include <e32cmn.h>
sl@0
    20
sl@0
    21
class TSurfaceId;
sl@0
    22
sl@0
    23
sl@0
    24
sl@0
    25
/**
sl@0
    26
@publishedPartner
sl@0
    27
sl@0
    28
sl@0
    29
The class is aimed for use within WSERV process only by the Content update receiver. 
sl@0
    30
It provides interface for registering Content update receiver instances for each screen. 
sl@0
    31
*/
sl@0
    32
class MSurfaceUpdateServerProvider
sl@0
    33
	{
sl@0
    34
public:	
sl@0
    35
	/**
sl@0
    36
	Assign Content update receiver instance to particular screen. 
sl@0
    37
	The following calls of this function for the same screen will override the previous.
sl@0
    38
	
sl@0
    39
	@param aScreen - screen number, associated with the output, 
sl@0
    40
		varies from 0 to number of screens present - 1
sl@0
    41
	@param aUpdateReceiver - pointer to a Content update receiver interface associated 
sl@0
    42
		with the aScreen. NULL signifies that particular screen doesn't 
sl@0
    43
		correspond any composition receiver. The ownership of this parameter 
sl@0
    44
		will not be transferred.
sl@0
    45
	@param aPriority - priority of the Content update receiver. 
sl@0
    46
        The higher the number is the higher the priority of the screen. 
sl@0
    47
		This number will be used to identify the master screen for any particular surface. 
sl@0
    48
		It is not acceptable to have more than one screen with the same priority.
sl@0
    49
	@return KErrNone if an operation is successful. 
sl@0
    50
	@return KErrArgument Arguments don’t lie in expected range.
sl@0
    51
	@return KErrNotReady The server has not been started.
sl@0
    52
	@return KErrAlreadyExists Another Content update receiver with the same priority number has already been registered with the SUS. Any other system error codes otherwise.
sl@0
    53
	@panic EUpdateServPanicRegister If another registration method has already been used.
sl@0
    54
	*/
sl@0
    55
	virtual TInt Register(TInt aScreen, CBase* aUpdateReceiver, TInt aPriority) = 0;
sl@0
    56
private:
sl@0
    57
	friend class CTSurfaceUpdateStep;	
sl@0
    58
	/**
sl@0
    59
	Close the Surface Update Server
sl@0
    60
	This function is intended for test/debugging only
sl@0
    61
	The implementation will do nothing in released builds 	
sl@0
    62
	
sl@0
    63
	WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
sl@0
    64
	*/
sl@0
    65
	virtual void Terminate() = 0;
sl@0
    66
	};
sl@0
    67
sl@0
    68
/**
sl@0
    69
Spawn a thread within WSERV process. This will lead to starting the surface update server in it 
sl@0
    70
@publishedPartner
sl@0
    71
sl@0
    72
	
sl@0
    73
@param aUpdateProvider - [out] reference pointer to surface update server provider, 
sl@0
    74
		which will be set when the server is started. The variable will be used to registry 
sl@0
    75
		content update receiver instances. The caller doesn't acquire the ownership of this instance,
sl@0
    76
		thus mustn't delete it. The pointer will be valid until server is operating, 
sl@0
    77
		i.e. system is up.
sl@0
    78
		
sl@0
    79
@return KErrNone if an operation is successful, any other system error codes otherwise
sl@0
    80
*/
sl@0
    81
IMPORT_C TInt StartSurfaceUpdateServer(MSurfaceUpdateServerProvider*& aSurfaceUpdateServerProvider);
sl@0
    82
sl@0
    83
sl@0
    84
sl@0
    85
#endif