Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __DOMAIN_OBSERVER_H__
17 #define __DOMAIN_OBSERVER_H__
21 #include <domaindefs.h>
22 #include <domainmanager.h>
28 An interface to the domain manager for an observer.
30 To make use of this class, an application must derive from it and implement the pure vitual functions
31 to handle transition event notifications.
33 class MHierarchyObserver
37 When the observer is active, then upon any successful transition, this will be called indicating
38 the Id of the transitioned domain and the state of the domain after the transition. Clients are
39 expected to use this for debugging purpose.
41 virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState) = 0;
43 When observer is active, then upon any failing transition, this will be called indicating
44 the Id of the domain, the state of the domain for the transition and the error occured.
45 Clients are expected to use this for debugging purpose.
47 virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError) = 0;
49 When observer is active, then upon any request for transition, this will be called indicating
50 the Id of the domain and the desired state of the domain.
51 Clients are expected to use this for debugging purpose.
53 virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState) = 0;
62 An abstract class to allow a domain controller to interface to the domain manager.
64 To make use of this class an application must derive from it.
66 class CHierarchyObserver: public CActive
72 IMPORT_C static CHierarchyObserver* NewL(MHierarchyObserver& aHierarchyObserver,TDmHierarchyId aHierarchyId);
76 IMPORT_C ~CHierarchyObserver();
80 IMPORT_C TInt StartObserver(TDmDomainId aDomainId, TDmNotifyType aNotifyType);
84 IMPORT_C TInt StopObserver();
88 IMPORT_C TInt ObserverDomainCount();
91 CHierarchyObserver(MHierarchyObserver& aHierarchyObserver,TDmHierarchyId aHierarchyId);
94 void GetNotification();
98 RDmManagerSession iSession;
99 TDmHierarchyId iHierarchyId;
100 MHierarchyObserver& iObserver;
101 TDmNotifyType iNotifyType;
102 TDmDomainId iDomainId;
103 TBool iObserverStarted;
104 RArray<const TTransInfo> iTransitionEvents;