os/kernelhwsrv/userlibandfileserver/domainmgr/inc/domainmanager.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) 2002-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 the License "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
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    16
//          to change without notice. Such APIs should therefore not be used
sl@0
    17
//          outside the Kernel and Hardware Services package.
sl@0
    18
//
sl@0
    19
sl@0
    20
#ifndef __DOMAIN_MANAGER_H__
sl@0
    21
#define __DOMAIN_MANAGER_H__
sl@0
    22
sl@0
    23
#include <e32std.h>
sl@0
    24
sl@0
    25
#include <domaindefs.h>
sl@0
    26
sl@0
    27
/**
sl@0
    28
@internalComponent
sl@0
    29
*/
sl@0
    30
#define KDmManagerFileNameLit	_L("domainSrv.exe")
sl@0
    31
sl@0
    32
/**
sl@0
    33
@internalComponent
sl@0
    34
*/
sl@0
    35
class RDmManagerSession : public RSessionBase
sl@0
    36
	{
sl@0
    37
public:
sl@0
    38
	TInt Connect();
sl@0
    39
	TInt Connect(TDmHierarchyId aHierarchyId);
sl@0
    40
	TInt ConnectObserver(TDmHierarchyId aHierarchyId);
sl@0
    41
	void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
sl@0
    42
	void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
sl@0
    43
	void CancelTransition();
sl@0
    44
	TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
sl@0
    45
	TInt GetTransitionFailureCount();
sl@0
    46
	TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
sl@0
    47
	// Observer related functions
sl@0
    48
	TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType);
sl@0
    49
	void GetNotification(TRequestStatus& aStatus);
sl@0
    50
	TInt GetEventCount();
sl@0
    51
	TInt GetEvents(RArray<const TTransInfo>& aTransitions);
sl@0
    52
	void CancelObserver();
sl@0
    53
	TInt ObserverDomainCount();
sl@0
    54
	};
sl@0
    55
sl@0
    56
sl@0
    57
/**
sl@0
    58
@publishedPartner
sl@0
    59
@released
sl@0
    60
sl@0
    61
The policy's interface to the domain manager.
sl@0
    62
*/
sl@0
    63
class RDmDomainManager
sl@0
    64
	{
sl@0
    65
public:
sl@0
    66
	IMPORT_C static TInt WaitForInitialization();
sl@0
    67
public:
sl@0
    68
	IMPORT_C TInt Connect();
sl@0
    69
	IMPORT_C void Close();
sl@0
    70
sl@0
    71
	IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus);
sl@0
    72
	IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus);
sl@0
    73
	IMPORT_C void CancelTransition();
sl@0
    74
sl@0
    75
	IMPORT_C void SystemShutdown();
sl@0
    76
	/**
sl@0
    77
	@internalAll
sl@0
    78
	*/
sl@0
    79
	IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId);
sl@0
    80
	/**
sl@0
    81
	@internalAll
sl@0
    82
	*/
sl@0
    83
	IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
sl@0
    84
	/**
sl@0
    85
	@internalAll
sl@0
    86
	*/
sl@0
    87
	IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
sl@0
    88
	/**
sl@0
    89
	@internalAll
sl@0
    90
	*/
sl@0
    91
	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
sl@0
    92
	/**
sl@0
    93
	@internalAll
sl@0
    94
	*/
sl@0
    95
	IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
sl@0
    96
	/**
sl@0
    97
	@internalAll
sl@0
    98
	*/
sl@0
    99
	IMPORT_C TInt GetTransitionFailureCount();
sl@0
   100
private:
sl@0
   101
	RDmManagerSession	iSession;
sl@0
   102
	};
sl@0
   103
sl@0
   104
sl@0
   105
sl@0
   106
sl@0
   107
/**
sl@0
   108
@internalComponent
sl@0
   109
sl@0
   110
An abstract class to allow a domain controller to interface to the domain manager.
sl@0
   111
sl@0
   112
To make use of this class an application must derive from it and implement a RunL() 
sl@0
   113
method to handle notifications.
sl@0
   114
After the derived class has been instantiated, it must call ConstructL().
sl@0
   115
*/
sl@0
   116
class CDmDomainManager : public CActive
sl@0
   117
	{
sl@0
   118
public:
sl@0
   119
	IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId);
sl@0
   120
	IMPORT_C ~CDmDomainManager();
sl@0
   121
sl@0
   122
	IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection);
sl@0
   123
	IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection);
sl@0
   124
	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
sl@0
   125
	IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
sl@0
   126
	IMPORT_C TInt GetTransitionFailureCount();
sl@0
   127
	virtual void RunL() = 0;
sl@0
   128
protected:
sl@0
   129
	// from CActive
sl@0
   130
	IMPORT_C void DoCancel();
sl@0
   131
	IMPORT_C void ConstructL();
sl@0
   132
sl@0
   133
private:
sl@0
   134
	RDmDomainManager iManager;
sl@0
   135
	TDmHierarchyId iHierarchyId;
sl@0
   136
	TInt iReserved[4];	
sl@0
   137
	};
sl@0
   138
sl@0
   139
#endif