userlibandfileserver/domainmgr/inc/domainmember.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2002-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 // WARNING: This file contains some APIs which are internal and are subject
       
    16 //          to change without notice. Such APIs should therefore not be used
       
    17 //          outside the Kernel and Hardware Services package.
       
    18 //
       
    19 
       
    20 #ifndef __DOMAIN_MEMBER_H__
       
    21 #define __DOMAIN_MEMBER_H__
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <e32property.h>
       
    25 #include <domaindefs.h>
       
    26 
       
    27 /**
       
    28 @internalComponent
       
    29 */
       
    30 class RDmDomainSession : public RSessionBase
       
    31 	{
       
    32 public:
       
    33 	TInt Connect(TDmHierarchyId aHierarchyId, TDmDomainId, TUint* aKey);
       
    34 	void Acknowledge(TInt aValue, TInt aError);
       
    35 	void RequestTransitionNotification();
       
    36 	void CancelTransitionNotification();
       
    37 	};
       
    38 
       
    39 
       
    40 /**
       
    41 @publishedPartner
       
    42 @released
       
    43 
       
    44 The application's interface to the domain manager.
       
    45 */
       
    46 class RDmDomain
       
    47 	{
       
    48 public:
       
    49 	IMPORT_C TInt Connect(TDmDomainId aId);
       
    50 	IMPORT_C void Close();
       
    51 
       
    52 	IMPORT_C void RequestTransitionNotification(TRequestStatus& aStatus);
       
    53 	IMPORT_C void CancelTransitionNotification();
       
    54 
       
    55 	IMPORT_C TPowerState GetPowerState();
       
    56 	IMPORT_C void AcknowledgeLastState();
       
    57 
       
    58 	/**
       
    59 	@internalAll
       
    60 	*/
       
    61 	IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
       
    62 	/**
       
    63 	@internalAll
       
    64 	*/
       
    65 	IMPORT_C void AcknowledgeLastState(TInt aError);
       
    66 	/**
       
    67 	@internalAll
       
    68 	*/
       
    69 	IMPORT_C TDmDomainState GetState();
       
    70 
       
    71 private:
       
    72 	RDmDomainSession	iSession;
       
    73 	RProperty			iStateProperty;
       
    74 	TInt				iLastStatePropertyValue;	
       
    75 	};
       
    76 
       
    77 
       
    78 
       
    79 /**
       
    80 @publishedPartner
       
    81 @released
       
    82 
       
    83 An abstract class for interfacing to a domain managed by the domain manager.
       
    84 
       
    85 To make use of this class an application must derive from it and implement a RunL()
       
    86 method to handle notifications.
       
    87 */
       
    88 class CDmDomain : public CActive
       
    89 	{
       
    90 public:
       
    91 	IMPORT_C CDmDomain(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
       
    92 	IMPORT_C ~CDmDomain();
       
    93 
       
    94 	IMPORT_C void RequestTransitionNotification();
       
    95 	/**
       
    96 	@internalTechnology
       
    97 	*/
       
    98 	IMPORT_C void AcknowledgeLastState(TInt aError);
       
    99 	/**
       
   100 	@internalTechnology
       
   101 	*/
       
   102 	IMPORT_C TDmDomainState GetState();
       
   103 	virtual void RunL() = 0;
       
   104 protected:
       
   105 	// from CActive
       
   106 	IMPORT_C void DoCancel();
       
   107 	IMPORT_C void ConstructL();
       
   108 
       
   109 private:
       
   110 	RDmDomain iDomain;
       
   111 	TDmHierarchyId iHierarchyId;
       
   112 	TDmDomainId iDomainId;
       
   113 	TInt iReserved[4];	
       
   114 	};
       
   115 
       
   116 
       
   117 #endif