os/kernelhwsrv/userlibandfileserver/domainmgr/inc/domainobserver.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) 2004-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
sl@0
    16
#ifndef __DOMAIN_OBSERVER_H__
sl@0
    17
#define __DOMAIN_OBSERVER_H__
sl@0
    18
sl@0
    19
#include <e32std.h>
sl@0
    20
sl@0
    21
#include <domaindefs.h>
sl@0
    22
#include <domainmanager.h>
sl@0
    23
sl@0
    24
sl@0
    25
/**
sl@0
    26
@internalTechnology
sl@0
    27
sl@0
    28
An interface to the domain manager for an observer.
sl@0
    29
sl@0
    30
To make use of this class, an application must derive from it and implement the pure vitual functions
sl@0
    31
to handle transition event notifications.
sl@0
    32
*/
sl@0
    33
class MHierarchyObserver
sl@0
    34
	{
sl@0
    35
public:
sl@0
    36
	/**
sl@0
    37
	When the observer is active, then upon any successful transition, this will be called indicating 
sl@0
    38
	the Id of the transitioned domain and the state of the domain after the transition. Clients are 
sl@0
    39
	expected to use this for debugging purpose.
sl@0
    40
	*/
sl@0
    41
	virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState) = 0;
sl@0
    42
	/**
sl@0
    43
	When observer is active, then upon any failing transition, this will be called indicating 
sl@0
    44
	the Id of the domain, the state of the domain for the transition and the error occured. 
sl@0
    45
	Clients are expected to use this for debugging purpose.
sl@0
    46
	*/
sl@0
    47
	virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError) = 0;
sl@0
    48
	/**
sl@0
    49
	When observer is active, then upon any request for transition, this will be called indicating 
sl@0
    50
	the Id of the domain and the desired state of the domain. 
sl@0
    51
	Clients are expected to use this for debugging purpose.
sl@0
    52
	*/
sl@0
    53
	virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState) = 0;
sl@0
    54
	};
sl@0
    55
sl@0
    56
sl@0
    57
sl@0
    58
 
sl@0
    59
/**
sl@0
    60
@internalTechnology
sl@0
    61
sl@0
    62
An abstract class to allow a domain controller to interface to the domain manager.
sl@0
    63
sl@0
    64
To make use of this class an application must derive from it.
sl@0
    65
*/
sl@0
    66
class CHierarchyObserver: public CActive
sl@0
    67
	{
sl@0
    68
public:
sl@0
    69
	/**
sl@0
    70
	@internalAll
sl@0
    71
	*/
sl@0
    72
	IMPORT_C static CHierarchyObserver* NewL(MHierarchyObserver& aHierarchyObserver,TDmHierarchyId aHierarchyId);
sl@0
    73
	/**
sl@0
    74
	@internalAll
sl@0
    75
	*/
sl@0
    76
	IMPORT_C ~CHierarchyObserver();
sl@0
    77
	/**
sl@0
    78
	@internalAll
sl@0
    79
	*/
sl@0
    80
	IMPORT_C TInt StartObserver(TDmDomainId aDomainId, TDmNotifyType aNotifyType);
sl@0
    81
	/**
sl@0
    82
	@internalAll
sl@0
    83
	*/
sl@0
    84
	IMPORT_C TInt StopObserver();
sl@0
    85
	/**
sl@0
    86
	@internalAll
sl@0
    87
	*/
sl@0
    88
	IMPORT_C TInt ObserverDomainCount();
sl@0
    89
sl@0
    90
private:
sl@0
    91
	CHierarchyObserver(MHierarchyObserver& aHierarchyObserver,TDmHierarchyId aHierarchyId);
sl@0
    92
	void RunL();
sl@0
    93
	void DoCancel();
sl@0
    94
	void GetNotification();
sl@0
    95
	TInt GetEvents();
sl@0
    96
sl@0
    97
private:
sl@0
    98
	RDmManagerSession iSession;
sl@0
    99
	TDmHierarchyId iHierarchyId; 
sl@0
   100
	MHierarchyObserver& iObserver;
sl@0
   101
	TDmNotifyType iNotifyType;
sl@0
   102
	TDmDomainId iDomainId;
sl@0
   103
	TBool iObserverStarted;
sl@0
   104
	RArray<const TTransInfo> iTransitionEvents;
sl@0
   105
	};
sl@0
   106
sl@0
   107
#endif