dependencies/domaindefs.h
branchv5backport
changeset 29 f9c0abe18432
equal deleted inserted replaced
28:c98d4e1e5d8e 29:f9c0abe18432
       
     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_DEFS_H__
       
    21 #define __DOMAIN_DEFS_H__
       
    22 
       
    23 #include <e32cmn.h>
       
    24 #include <e32power.h>
       
    25 
       
    26 /**
       
    27 @internalTechnology
       
    28 */
       
    29 // Property category UID value reserved for Domain Management services.
       
    30 // This is the same as the process SID (see domainsrv.mmp)
       
    31 static const TInt32 KUidDmPropertyCategoryValue = 0x1020E406;
       
    32 /**
       
    33 @internalTechnology
       
    34 */
       
    35 // Property category UID reserved for Domain Management services
       
    36 static const TUid KUidDmPropertyCategory = { KUidDmPropertyCategoryValue };
       
    37 /**
       
    38 @internalTechnology
       
    39 */
       
    40 static const TUint KDmPropertyKeyInit				= 0x00000001;
       
    41 
       
    42 
       
    43 
       
    44 
       
    45 /**
       
    46 @internalAll
       
    47 
       
    48 Defines the ways in which a domain hierarchy can be traversed.
       
    49 
       
    50 @see CDmDomainManager::RequestSystemTransition()
       
    51 @see CDmDomainManager::RequestDomainTransition()
       
    52 */
       
    53 enum TDmTraverseDirection
       
    54 	{
       
    55 	/**
       
    56 	Transition parents first (i.e. before their children).
       
    57 	*/
       
    58 	ETraverseParentsFirst,
       
    59 
       
    60 	/**
       
    61 	Transition children first (i.e. before their parents).
       
    62 	*/
       
    63 	ETraverseChildrenFirst,
       
    64 
       
    65 	/**
       
    66 	Use the default direction specified in policy
       
    67 	*/
       
    68 	ETraverseDefault,
       
    69 	
       
    70 	/**
       
    71 	Maximum value for traverse mode
       
    72 	*/
       
    73 	ETraverseMax = ETraverseDefault
       
    74 	};
       
    75 
       
    76 
       
    77 
       
    78 
       
    79 /**
       
    80 @internalAll
       
    81 
       
    82 Defines the type of transitions that will be notified to the observer.
       
    83 
       
    84 One of these values is specified when the observer is started through a 
       
    85 call to CHierarchyObserver::StartObserver().
       
    86 */
       
    87 enum TDmNotifyType
       
    88 	{
       
    89 	/**
       
    90 	Notifies the observer about all transition requests.
       
    91 	*/
       
    92 	EDmNotifyTransRequest =0x02,
       
    93 	
       
    94 	/**
       
    95 	Notifies the observer about successful transitions only.
       
    96 	*/
       
    97 	EDmNotifyPass =0x04, 
       
    98 	
       
    99 	/**
       
   100 	Notifies the observer about failing transitions only.
       
   101 	*/
       
   102 	EDmNotifyFail=0x08, 
       
   103 	
       
   104 	/**
       
   105 	Notifies the observer about all completed transitions.
       
   106 	*/
       
   107 	EDmNotifyTransOnly=EDmNotifyPass|EDmNotifyFail,
       
   108 	
       
   109 	/**
       
   110 	Notifies the observer about successful transitions and transition requests.
       
   111 	*/
       
   112 	EDmNotifyReqNPass=EDmNotifyTransRequest|EDmNotifyPass,
       
   113 	
       
   114 	/**
       
   115 	Notifies the observer about failed transitions and transition requests.
       
   116 	*/
       
   117 	EDmNotifyReqNFail=EDmNotifyTransRequest|EDmNotifyFail,
       
   118 	
       
   119 	/**
       
   120 	Notifies the observer about every event.
       
   121 	*/
       
   122 	EDmNotifyAll=EDmNotifyTransRequest|EDmNotifyFail|EDmNotifyPass, 
       
   123 	};
       
   124 
       
   125 
       
   126 
       
   127 
       
   128 /**
       
   129 @internalAll
       
   130 
       
   131 Domain hierarchy identifier type.
       
   132  
       
   133 Domain hierarchies are designated by "well known" domain hierarchy identifiers.
       
   134 The domain policy statically defines the list of domain hierarchies and their 
       
   135 identifiers.
       
   136 
       
   137 @see RDmDomainManager::Connect()
       
   138 @see RDmDomainManager::AddDomainHierarchy()
       
   139 @see RDmDomain::Connect()
       
   140 @see CHierarchyObserver
       
   141 @see CDmDomainManager
       
   142 @see CDmDomain
       
   143 */
       
   144 typedef TUint8 TDmHierarchyId;
       
   145 
       
   146 
       
   147 
       
   148 
       
   149 /**
       
   150 @internalAll
       
   151 
       
   152 A type used to describe the state of a domain.
       
   153 */
       
   154 typedef TUint TDmDomainState;
       
   155 
       
   156 
       
   157 
       
   158 
       
   159 /**
       
   160 @internalTechnology
       
   161 
       
   162 The power domain hierarchy Id.
       
   163 */
       
   164 static const TDmHierarchyId	KDmHierarchyIdPower		= 1;
       
   165 
       
   166 
       
   167 
       
   168 
       
   169 /**
       
   170 @internalAll
       
   171 
       
   172 The start-up domain hierarchy Id.
       
   173 */
       
   174 static const TDmHierarchyId	KDmHierarchyIdStartup	= 2;
       
   175 
       
   176 
       
   177 
       
   178 /**
       
   179 @internalAll
       
   180 
       
   181 The start-up domain hierarchy Id. (For use by domain manager and/or SSMA)
       
   182 */
       
   183 static const TDmHierarchyId KDmHierarchyIdSystemState = KDmHierarchyIdStartup;
       
   184 
       
   185 
       
   186 
       
   187 /**
       
   188 @publishedPartner
       
   189 @released
       
   190 
       
   191 Domain identifier type.
       
   192  
       
   193 Domains are designated by "well known" domain identifiers.
       
   194 The domain manager statically defines the list of domains and their identifiers.
       
   195 */
       
   196 typedef TUint16 TDmDomainId;
       
   197 
       
   198 
       
   199 
       
   200 /**
       
   201 @internalAll
       
   202 
       
   203 A structure use to describe a transition failure.
       
   204 */
       
   205 class TTransitionFailure
       
   206 	{
       
   207 public:
       
   208 	inline TTransitionFailure() {};
       
   209 	TTransitionFailure(	TDmDomainId aDomainId, TInt aError);
       
   210 
       
   211 public:
       
   212 	/**
       
   213 	Id of the domain of interest
       
   214 	*/
       
   215 	TDmDomainId iDomainId;
       
   216 	/**
       
   217 	error code in transition
       
   218 	*/
       
   219 	TInt iError;
       
   220 	};
       
   221 
       
   222 
       
   223 /**
       
   224 @internalTechnology
       
   225 
       
   226 A structure use to describe a successful transition.
       
   227 */
       
   228 class TTransInfo
       
   229 	{
       
   230 public:
       
   231 	inline TTransInfo() {};
       
   232 	TTransInfo(	TDmDomainId aDomainId, TDmDomainState aState, TInt aError);
       
   233 
       
   234 public:
       
   235 	/**
       
   236 	Id of the domain of interest
       
   237 	*/
       
   238 	TDmDomainId iDomainId;				 
       
   239 	/**
       
   240 	Final state of the domain after the transition 
       
   241 	*/
       
   242 	TDmDomainState iState;
       
   243 	/**
       
   244 	Any error in transition
       
   245 	*/
       
   246 	TInt iError;
       
   247 	};
       
   248 
       
   249 
       
   250 
       
   251 
       
   252 /**
       
   253 @publishedPartner
       
   254 @released
       
   255 
       
   256 The null domain identifier.
       
   257 
       
   258 There are no domains with this identifier.
       
   259 */
       
   260 static const TDmDomainId	KDmIdNone	= 0x00;
       
   261 
       
   262 
       
   263 
       
   264 
       
   265 /**
       
   266 @publishedPartner
       
   267 @released
       
   268 
       
   269 The common ancestor of all domains.
       
   270 */
       
   271 static const TDmDomainId	KDmIdRoot	= 0x01;
       
   272 
       
   273 
       
   274 
       
   275 
       
   276 /**
       
   277 @publishedPartner
       
   278 @released
       
   279 
       
   280 The usual domain for all non-UI applications.
       
   281 */
       
   282 static const TDmDomainId	KDmIdApps	= 0x02;
       
   283 
       
   284 
       
   285 
       
   286 
       
   287 /**
       
   288 @publishedPartner
       
   289 @released
       
   290 
       
   291 The usual domain for all UI applications.
       
   292 */
       
   293 static const TDmDomainId	KDmIdUiApps	= 0x03;
       
   294 
       
   295 
       
   296 
       
   297 
       
   298 /**
       
   299 @publishedPartner
       
   300 @released
       
   301 
       
   302 Domain manager specific error code - the domain designated by
       
   303 the specified domain identifier does not exist.
       
   304 */
       
   305 static const TInt KDmErrBadDomainId		= -256;
       
   306 
       
   307 
       
   308 
       
   309 
       
   310 /**
       
   311 @publishedPartner
       
   312 @released
       
   313 
       
   314 Domain manager specific error code - this RDmDomain object has already been
       
   315 connected to a domain.
       
   316 */
       
   317 static const TInt KDmErrAlreadyJoin		= -257;
       
   318 
       
   319 
       
   320 
       
   321 
       
   322 /**
       
   323 @publishedPartner
       
   324 @released
       
   325 
       
   326 Domain manager specific error code - this RDmDomain object is not connected
       
   327 to any domain.
       
   328 */
       
   329 static const TInt KDmErrNotJoin			= -258;
       
   330 
       
   331 
       
   332 
       
   333 
       
   334 /**
       
   335 @publishedPartner
       
   336 @released
       
   337 
       
   338 Domain manager specific error code - indicates a client-server protocol internal error.
       
   339 */
       
   340 static const TInt KDmErrBadRequest		= -259;
       
   341 
       
   342 
       
   343 
       
   344 
       
   345 /**
       
   346 @publishedPartner
       
   347 @released
       
   348 
       
   349 Domain manager specific error code - indicates an internal Domain Manager error.
       
   350 */
       
   351 static const TInt KDmErrBadDomainSpec	= -260;
       
   352 
       
   353 
       
   354 
       
   355 
       
   356 /**
       
   357 @publishedPartner
       
   358 @released
       
   359 
       
   360 Domain manager specific error code - indicates a bad sequence of requests.
       
   361 
       
   362 Typically, this occurs when a new request been made while an ongoing domain
       
   363 transition request has not yet completed.
       
   364 */
       
   365 static const TInt KDmErrBadSequence		= -261;
       
   366 
       
   367 
       
   368 
       
   369 
       
   370 /**
       
   371 @internalTechnology
       
   372 
       
   373 Domain manager specific error code - indicates that a transition is outstanding.
       
   374  
       
   375 */
       
   376 static const TInt KDmErrOutstanding		= -262;
       
   377 
       
   378 
       
   379 
       
   380 
       
   381 /**
       
   382 @internalAll
       
   383 
       
   384 Domain manager specific error code - indicates that the domain hierarchy does not exist.
       
   385 */
       
   386 static const TInt KErrBadHierarchyId	= -263;
       
   387 
       
   388 #endif
       
   389