epoc32/include/e32cmn.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
  1716 @see CObject
  1716 @see CObject
  1717 */
  1717 */
  1718 typedef TBuf<KMaxName> TName;
  1718 typedef TBuf<KMaxName> TName;
  1719 
  1719 
  1720 
  1720 
  1721 
       
  1722 
       
  1723 /**
       
  1724 @internalTechnology
       
  1725 */
       
  1726 typedef TBuf<KMaxKernelName> TKName;
       
  1727 
       
  1728 
       
  1729 /**
       
  1730 @internalTechnology
       
  1731 */
       
  1732 typedef TBuf<KMaxInfoName> TInfoName;
       
  1733 
       
  1734 
       
  1735 
       
  1736 
       
  1737 /**
  1721 /**
  1738 @publishedAll
  1722 @publishedAll
  1739 @released
  1723 @released
  1740 
  1724 
  1741 Defines a modifiable buffer descriptor that can contain the full name of a 
  1725 Defines a modifiable buffer descriptor that can contain the full name of a 
  1789 */
  1773 */
  1790 typedef TBuf<KMaxPath> TPath;
  1774 typedef TBuf<KMaxPath> TPath;
  1791 
  1775 
  1792 
  1776 
  1793 
  1777 
  1794 /**
       
  1795 @internalComponent
       
  1796 */
       
  1797 typedef TBuf<KMaxDeviceInfo> TDeviceInfo;
       
  1798 
       
  1799 
       
  1800 
  1778 
  1801 /**
  1779 /**
  1802 @publishedAll
  1780 @publishedAll
  1803 @released
  1781 @released
  1804 
  1782 
  1809 information in a descriptor of this type.
  1787 information in a descriptor of this type.
  1810 
  1788 
  1811 @see TVersion
  1789 @see TVersion
  1812 */
  1790 */
  1813 typedef TBuf<KMaxVersionName> TVersionName;
  1791 typedef TBuf<KMaxVersionName> TVersionName;
  1814 
       
  1815 
       
  1816 
       
  1817 
       
  1818 typedef TBuf<KMaxPassword> TPassword;
       
  1819 
  1792 
  1820 
  1793 
  1821 
  1794 
  1822 
  1795 
  1823 /**
  1796 /**
  2180 	The y co-ordinate.
  2153 	The y co-ordinate.
  2181 	*/
  2154 	*/
  2182 	TInt iY;
  2155 	TInt iY;
  2183 	};
  2156 	};
  2184 
  2157 
  2185 /**
  2158 
  2186 @internalTechnology
  2159 
  2187 @prototype For now, only intended to be used by TRwEvent and the Windows Server
  2160 
       
  2161 /**
       
  2162 @publishedAll
       
  2163 @prototype
  2188 
  2164 
  2189 Stores a three-dimensional point in Cartesian or polar co-ordinates.
  2165 Stores a three-dimensional point in Cartesian or polar co-ordinates.
  2190 
       
  2191 Its data members (iX, iY and iZ) are public and can be manipulated directly.
  2166 Its data members (iX, iY and iZ) are public and can be manipulated directly.
       
  2167 
  2192 */
  2168 */
  2193 class TPoint3D
  2169 class TPoint3D
  2194 	{
  2170 	{
       
  2171 public:
       
  2172 #ifndef __KERNEL_MODE__
       
  2173 	enum TUninitialized { EUninitialized };
       
  2174 
       
  2175 	/**
       
  2176 	TUninitialized Constructor
       
  2177 	*/
       
  2178 	TPoint3D(TUninitialized) {}
       
  2179 	/**
       
  2180 	Constructs default TPoint3D, initialising its iX , iY and iZ members to zero.
       
  2181 	*/
       
  2182 	inline TPoint3D();
       
  2183 	/**
       
  2184 	Constructs  TPoint3D with the specified x,y  and z co-ordinates.
       
  2185 	*/
       
  2186 	inline TPoint3D(TInt aX,TInt aY,TInt aZ);
       
  2187 	/** 
       
  2188 	Copy Construct from TPoint , initialises Z co-ordinate to  Zero
       
  2189 	*/
       
  2190 	inline TPoint3D(const  TPoint& aPoint);
       
  2191 
       
  2192 	IMPORT_C TBool operator==(const TPoint3D& aPoint3D) const;
       
  2193 	IMPORT_C TBool operator!=(const TPoint3D& aPoint3D) const;
       
  2194 
       
  2195 	IMPORT_C TPoint3D& operator-=(const TPoint3D& aPoint3D);
       
  2196 	IMPORT_C TPoint3D& operator-=(const TPoint& aPoint);
       
  2197 
       
  2198 	IMPORT_C TPoint3D& operator+=(const TPoint3D& aPoint3D);	
       
  2199 	IMPORT_C TPoint3D& operator+=(const TPoint& aPoint);
       
  2200 
       
  2201 	IMPORT_C TPoint3D operator-(const TPoint3D& aPoint3D) const;
       
  2202 	IMPORT_C TPoint3D operator-(const TPoint& aPoint) const;	
       
  2203 
       
  2204 	IMPORT_C TPoint3D operator+(const TPoint3D& aPoint3D) const;
       
  2205 	IMPORT_C TPoint3D operator+(const TPoint& aPoint) const;
       
  2206 	/**
       
  2207     Unary minus operator. The operator returns the negation of this Point3D 
       
  2208 	*/
       
  2209 	IMPORT_C TPoint3D operator-() const;
       
  2210 	
       
  2211 	/**
       
  2212 	Set Method to set the xyz co-ordinates of TPoint3D
       
  2213 	*/
       
  2214 	IMPORT_C void SetXYZ(TInt aX,TInt aY,TInt aZ);
       
  2215 	
       
  2216 	/**
       
  2217 	TPoint3D from TPoint, sets the Z co-ordinate to  Zero
       
  2218 	*/
       
  2219 	IMPORT_C void SetPoint(const TPoint& aPoint);
       
  2220 
       
  2221 	/**
       
  2222 	Returns TPoint from TPoint3D
       
  2223 	*/
       
  2224 	IMPORT_C TPoint AsPoint() const;
       
  2225 #endif
  2195 public:
  2226 public:
  2196 	/**
  2227 	/**
  2197 	The x co-ordinate.
  2228 	The x co-ordinate.
  2198 	*/
  2229 	*/
  2199 	TInt iX;
  2230 	TInt iX;
  2204 	/**
  2235 	/**
  2205 	The z co-ordinate.
  2236 	The z co-ordinate.
  2206 	*/
  2237 	*/
  2207 	TInt iZ;
  2238 	TInt iZ;
  2208 	};
  2239 	};
       
  2240 
       
  2241 
  2209 
  2242 
  2210 /**
  2243 /**
  2211 @internalTechnology
  2244 @internalTechnology
  2212 @prototype For now, only intended to be used by TRwEvent and the Windows Server
  2245 @prototype For now, only intended to be used by TRwEvent and the Windows Server
  2213 
  2246 
  2361 */
  2394 */
  2362 class RHandleBase
  2395 class RHandleBase
  2363 	{
  2396 	{
  2364 public:
  2397 public:
  2365     /**
  2398     /**
  2366     @internalComponent
  2399     @publishedAll
       
  2400     @released
       
  2401 
       
  2402 	Read/Write attributes for the handle.
  2367     */
  2403     */
  2368     enum
  2404     enum TAttributes
  2369 		{
  2405 		{
  2370 		EReadAccess=0x1,
  2406 		EReadAccess=0x1,
  2371 		EWriteAccess=0x2,
  2407 		EWriteAccess=0x2,
  2372 		EDirectReadAccess=0x4,
  2408 		EDirectReadAccess=0x4,
  2373 		EDirectWriteAccess=0x8,
  2409 		EDirectWriteAccess=0x8,
  2455 	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
  2491 	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
  2456 	IMPORT_C void Wait();
  2492 	IMPORT_C void Wait();
  2457 	IMPORT_C void Signal();
  2493 	IMPORT_C void Signal();
  2458 private:
  2494 private:
  2459 	TInt iCount;
  2495 	TInt iCount;
       
  2496 	};
       
  2497 
       
  2498 
       
  2499 
       
  2500 
       
  2501 /**
       
  2502 @publishedAll
       
  2503 @released
       
  2504 
       
  2505 A read-write lock.
       
  2506 
       
  2507 This is a lock for co-ordinating readers and writers to shared resources.
       
  2508 It is designed to allow multiple concurrent readers.
       
  2509 It is not a kernel side object and so does not inherit from RHandleBase.
       
  2510 */
       
  2511 class RReadWriteLock
       
  2512 	{
       
  2513 public:
       
  2514 	enum TReadWriteLockPriority
       
  2515 		{
       
  2516 		/** Pending writers always get the lock before pending readers */
       
  2517 		EWriterPriority,
       
  2518 		/** Lock is given alternately to pending readers and writers */
       
  2519 		EAlternatePriority,
       
  2520 		/** Pending readers always get the lock before pending writers - beware writer starvation! */
       
  2521 		EReaderPriority,
       
  2522 		};
       
  2523 	enum TReadWriteLockClientCategoryLimit
       
  2524 		{
       
  2525 		/** Maximum number of clients in each category: read locked, read lock pending, write lock pending */
       
  2526 		EReadWriteLockClientCategoryLimit = KMaxTUint16
       
  2527 		};
       
  2528 
       
  2529 public:
       
  2530 	inline RReadWriteLock();
       
  2531 	IMPORT_C TInt CreateLocal(TReadWriteLockPriority aPriority = EWriterPriority);
       
  2532 	IMPORT_C void Close();
       
  2533 
       
  2534 	IMPORT_C void ReadLock();
       
  2535 	IMPORT_C void WriteLock();
       
  2536 	IMPORT_C TBool TryReadLock();
       
  2537 	IMPORT_C TBool TryWriteLock();
       
  2538 	IMPORT_C TBool TryUpgradeReadLock();
       
  2539 	IMPORT_C void DowngradeWriteLock();
       
  2540 	IMPORT_C void Unlock();
       
  2541 
       
  2542 private:
       
  2543 	RReadWriteLock(const RReadWriteLock& aLock);
       
  2544 	RReadWriteLock& operator=(const RReadWriteLock& aLock);
       
  2545 
       
  2546 	TInt UnlockWriter();
       
  2547 	TInt UnlockAlternate();
       
  2548 	TInt UnlockReader();
       
  2549 
       
  2550 private:
       
  2551 	volatile TUint64 iValues; // Bits 0-15: readers; bit 16: writer; bits 32-47: readersPending; bits 48-63: writersPending
       
  2552 	TReadWriteLockPriority iPriority;
       
  2553 	RSemaphore iReaderSem;
       
  2554 	RSemaphore iWriterSem;
       
  2555 	TUint32 iSpare[4]; // Reserved for future development
  2460 	};
  2556 	};
  2461 
  2557 
  2462 
  2558 
  2463 
  2559 
  2464 
  2560 
  2661 	                  */
  2757 	                  */
  2662 	                  EAllowMoveOnShrink=2
  2758 	                  EAllowMoveOnShrink=2
  2663 	                  };
  2759 	                  };
  2664 	                  
  2760 	                  
  2665 	                  
  2761 	                  
  2666 	enum TFlags {ESingleThreaded=1, EFixedSize=2, ETraceAllocs=4};
  2762 	enum TFlags {ESingleThreaded=1, EFixedSize=2, ETraceAllocs=4, EMonitorMemory=8,};
  2667 	struct SCheckInfo {TBool iAll; TInt iCount; const TDesC8* iFileName; TInt iLineNum;};
  2763 	struct SCheckInfo {TBool iAll; TInt iCount; const TDesC8* iFileName; TInt iLineNum;};
  2668 	struct SRAllocatorBurstFail {TInt iBurst; TInt iRate; TInt iUnused[2];};	/**< @internalComponent*/
  2764 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  2765 	struct SRAllocatorBurstFail {TInt iBurst; TInt iRate; TInt iUnused[2];};
       
  2766 #endif
  2669 	enum {EMaxHandles=32};
  2767 	enum {EMaxHandles=32};
       
  2768 
  2670 public:
  2769 public:
  2671 	inline RAllocator();
  2770 	inline RAllocator();
  2672 #ifndef __KERNEL_MODE__
  2771 #ifndef __KERNEL_MODE__
  2673 	IMPORT_C TInt Open();
  2772 	IMPORT_C TInt Open();
  2674 	IMPORT_C void Close();
  2773 	IMPORT_C void Close();
  2765 	                  /**
  2864 	                  /**
  2766 	                  The cumulative number of allocated cells
  2865 	                  The cumulative number of allocated cells
  2767 	                  */
  2866 	                  */
  2768 	                  TInt allocCount;
  2867 	                  TInt allocCount;
  2769 	                  };
  2868 	                  };
  2770 	                  
  2869 
  2771     /**
       
  2772     @internalComponent
       
  2773     */
       
  2774 	struct _s_align {char c; double d;};
       
  2775 
       
  2776 	
       
  2777 	/**
  2870 	/**
  2778     @internalComponent
  2871     @internalComponent
  2779     */
  2872     */
  2780 	struct SHeapCellInfo { RHeap* iHeap; TInt iTotalAlloc;	TInt iTotalAllocSize; TInt iTotalFree; TInt iLevelAlloc; SDebugCell* iStranded; };
  2873 	struct SHeapCellInfo { RHeap* iHeap; TInt iTotalAlloc;	TInt iTotalAllocSize; TInt iTotalFree; TInt iLevelAlloc; SDebugCell* iStranded; };
  2781 
  2874 
  2782 
  2875 	/**
  2783     /** 
  2876 	@internalComponent
  2784     The default cell alignment.
  2877 	*/
  2785     */
  2878 	struct _s_align {char c; double d;};
       
  2879 
       
  2880 	/** 
       
  2881 	The default cell alignment.
       
  2882 	*/
  2786 	enum {ECellAlignment = sizeof(_s_align)-sizeof(double)};
  2883 	enum {ECellAlignment = sizeof(_s_align)-sizeof(double)};
  2787 	
       
  2788 	
  2884 	
  2789 	/**
  2885 	/**
  2790 	Size of a free cell header.
  2886 	Size of a free cell header.
  2791 	*/
  2887 	*/
  2792 	enum {EFreeCellSize = sizeof(SCell)};
  2888 	enum {EFreeCellSize = sizeof(SCell)};
  2826     
  2922     
  2827     /**
  2923     /**
  2828     @internalComponent
  2924     @internalComponent
  2829     */
  2925     */
  2830     enum TDefaultShrinkRatios {EShrinkRatio1=256, EShrinkRatioDflt=512};
  2926     enum TDefaultShrinkRatios {EShrinkRatio1=256, EShrinkRatioDflt=512};
  2831     	
  2927 
  2832     /**
  2928 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  2929 	/**
  2833     @internalComponent
  2930     @internalComponent
  2834     */
  2931     */
       
  2932 #else
       
  2933 private:
       
  2934 #endif
  2835     typedef void (*TWalkFunc)(TAny*, TCellType, TAny*, TInt);
  2935     typedef void (*TWalkFunc)(TAny*, TCellType, TAny*, TInt);
       
  2936 
  2836 public:
  2937 public:
  2837 	UIMPORT_C virtual TAny* Alloc(TInt aSize);
  2938 	UIMPORT_C virtual TAny* Alloc(TInt aSize);
  2838 	UIMPORT_C virtual void Free(TAny* aPtr);
  2939 	UIMPORT_C virtual void Free(TAny* aPtr);
  2839 	UIMPORT_C virtual TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
  2940 	UIMPORT_C virtual TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
  2840 	UIMPORT_C virtual TInt AllocLen(const TAny* aCell) const;
  2941 	UIMPORT_C virtual TInt AllocLen(const TAny* aCell) const;
  2966 	inline   void SetProcessPriorityL(TProcessPriority aPriority) const;
  3067 	inline   void SetProcessPriorityL(TProcessPriority aPriority) const;
  2967 	IMPORT_C TInt Client(RThread& aClient, TOwnerType aOwnerType=EOwnerProcess) const;
  3068 	IMPORT_C TInt Client(RThread& aClient, TOwnerType aOwnerType=EOwnerProcess) const;
  2968 	inline   void ClientL(RThread& aClient, TOwnerType aOwnerType=EOwnerProcess) const;
  3069 	inline   void ClientL(RThread& aClient, TOwnerType aOwnerType=EOwnerProcess) const;
  2969 	IMPORT_C TUint ClientProcessFlags() const;
  3070 	IMPORT_C TUint ClientProcessFlags() const;
  2970 	IMPORT_C const TRequestStatus* ClientStatus() const;
  3071 	IMPORT_C const TRequestStatus* ClientStatus() const;
  2971 
  3072 	IMPORT_C TBool ClientIsRealtime() const;
       
  3073 	
  2972 	/**
  3074 	/**
  2973 	Return the Secure ID of the process which sent this message.
  3075 	Return the Secure ID of the process which sent this message.
  2974 
  3076 
  2975 	If an intended use of this method is to check that the Secure ID is
  3077 	If an intended use of this method is to check that the Secure ID is
  2976 	a given value, then the use of a TSecurityPolicy object should be
  3078 	a given value, then the use of a TSecurityPolicy object should be
  2984 	this could be used;
  3086 	this could be used;
  2985 
  3087 
  2986 	@code
  3088 	@code
  2987 		RMessagePtr2& message;
  3089 		RMessagePtr2& message;
  2988 		static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
  3090 		static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
  2989 		TInt error = mySidPolicy().CheckPolicy(message);
  3091 		TBool pass = mySidPolicy().CheckPolicy(message);
  2990 	@endcode
  3092 	@endcode
  2991 
  3093 
  2992 	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
  3094 	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
  2993 	configured by the system wide Platform Security configuration. I.e. are
  3095 	configured by the system wide Platform Security configuration. I.e. are
  2994 	capable of emitting diagnostic messages when a check fails and/or the
  3096 	capable of emitting diagnostic messages when a check fails and/or the
  3019 	this could be used;
  3121 	this could be used;
  3020 
  3122 
  3021 	@code
  3123 	@code
  3022 		RMessagePtr2& message;
  3124 		RMessagePtr2& message;
  3023 		static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
  3125 		static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
  3024 		TInt error = myVidPolicy().CheckPolicy(message);
  3126 		TBool pass = myVidPolicy().CheckPolicy(message);
  3025 	@endcode
  3127 	@endcode
  3026 
  3128 
  3027 	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
  3129 	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
  3028 	configured by the system wide Platform Security configuration. I.e. are
  3130 	configured by the system wide Platform Security configuration. I.e. are
  3029 	capable of emitting diagnostic messages when a check fails and/or the
  3131 	capable of emitting diagnostic messages when a check fails and/or the
  3297 	/** Shared chunk buffer flag settings. */
  3399 	/** Shared chunk buffer flag settings. */
  3298 	TUint iFlags;
  3400 	TUint iFlags;
  3299 	};
  3401 	};
  3300 
  3402 
  3301 
  3403 
  3302 /** Default value to clear all data to committed to a chunk to.
       
  3303 @see TChunkCreateInfo::SetClearByte()
       
  3304 @see RChunk::Create()
       
  3305 @internalComponent
       
  3306 */
       
  3307 const TUint8 KChunkClearByteDefault = 0x3;
       
  3308 
       
  3309 /**
       
  3310 Values that specify the attributes of a chunk to be created.
       
  3311 
       
  3312 @see RChunk::Create()
       
  3313 @internalComponent
       
  3314 */
       
  3315 enum TChunkCreateAttributes
       
  3316 	{
       
  3317 	/**	Force local chunk to be named.  Internal as only required for
       
  3318 	thread heap chunks, all other local chunks should be nameless.
       
  3319 	*/
       
  3320 	EChunkAttLocalNamed = 0x400,
       
  3321 
       
  3322 	EChunkAttMask =	EChunkAttLocalNamed,
       
  3323 	};
       
  3324 
       
  3325 /**@internalComponent */
       
  3326 const TUint32 KEmulatorImageFlagAllowDllData = 0x01;
       
  3327 
       
  3328 /** Maximum size of capability set
  3404 /** Maximum size of capability set
  3329 
  3405 
  3330 @internalTechnology
  3406 @internalTechnology
  3331 */
  3407 */
  3332 const TInt KCapabilitySetMaxSize = (((TInt)ECapability_HardLimit + 7)>>3);
  3408 const TInt KCapabilitySetMaxSize = (((TInt)ECapability_HardLimit + 7)>>3);
  3334 /** Maximum size of any future extension to TSecurityPolicy
  3410 /** Maximum size of any future extension to TSecurityPolicy
  3335 
  3411 
  3336 @internalTechnology
  3412 @internalTechnology
  3337 */
  3413 */
  3338 const TInt KMaxSecurityPolicySize = KCapabilitySetMaxSize + 3*sizeof(TUint32);
  3414 const TInt KMaxSecurityPolicySize = KCapabilitySetMaxSize + 3*sizeof(TUint32);
       
  3415 
  3339 
  3416 
  3340 /** Class representing an arbitrary set of capabilities.
  3417 /** Class representing an arbitrary set of capabilities.
  3341 
  3418 
  3342 This class can only contain capabilities supported by the current OS version.
  3419 This class can only contain capabilities supported by the current OS version.
  3343 
  3420 
  3369 	IMPORT_C void SetDisabled();
  3446 	IMPORT_C void SetDisabled();
  3370 	/**
  3447 	/**
  3371 	@internalComponent
  3448 	@internalComponent
  3372 	*/
  3449 	*/
  3373 	TBool NotEmpty() const;
  3450 	TBool NotEmpty() const;
       
  3451 
  3374 private:
  3452 private:
  3375 	TUint32 iCaps[KCapabilitySetMaxSize / sizeof(TUint32)];
  3453 	TUint32 iCaps[KCapabilitySetMaxSize / sizeof(TUint32)];
  3376 	};
  3454 	};
  3377 
  3455 
  3378 #ifndef __SECURITY_INFO_DEFINED__
  3456 #ifndef __SECURITY_INFO_DEFINED__
  3451 */
  3529 */
  3452 class TSecurityInfo
  3530 class TSecurityInfo
  3453 	{
  3531 	{
  3454 public:
  3532 public:
  3455 	inline TSecurityInfo();
  3533 	inline TSecurityInfo();
  3456 #ifndef __KERNEL_MODE__
  3534 #ifdef __KERNEL_MODE__
       
  3535 	IMPORT_C TSecurityInfo(DProcess* aProcess);
       
  3536 	IMPORT_C TSecurityInfo(DThread* aThread);
       
  3537 #else
  3457 	IMPORT_C TSecurityInfo(RProcess aProcess);
  3538 	IMPORT_C TSecurityInfo(RProcess aProcess);
  3458 	IMPORT_C TSecurityInfo(RThread aThread);
  3539 	IMPORT_C TSecurityInfo(RThread aThread);
  3459 	IMPORT_C TSecurityInfo(RMessagePtr2 aMesPtr);
  3540 	IMPORT_C TSecurityInfo(RMessagePtr2 aMesPtr);
  3460 	inline void Set(RProcess aProcess);
  3541 	inline void Set(RProcess aProcess);
  3461 	inline void Set(RThread aThread);
  3542 	inline void Set(RThread aThread);
  3630 		ETypeC7=3,		/**< Up to 7 capabilities*/
  3711 		ETypeC7=3,		/**< Up to 7 capabilities*/
  3631 		ETypeS3=4,		/**< Secure ID and up to 3 capabilities*/
  3712 		ETypeS3=4,		/**< Secure ID and up to 3 capabilities*/
  3632 		ETypeV3=5,		/**< Vendor ID and up to 3 capabilities*/
  3713 		ETypeV3=5,		/**< Vendor ID and up to 3 capabilities*/
  3633 
  3714 
  3634 		/** The number of possible TSecurityPolicy types
  3715 		/** The number of possible TSecurityPolicy types
  3635 		This is intended of internal Symbian use only.
  3716 		This is intended for internal Symbian use only.
  3636 		@internalTechnology
  3717 		@internalTechnology
  3637 		*/
  3718 		*/
  3638 		ETypeLimit
  3719 		ETypeLimit
  3639 
  3720 
  3640 		// other values may be added to indicate expanded policy objects (future extensions)
  3721 		// other values may be added to indicate expanded policy objects (future extensions)
  4742 	/** @internalTechnology */
  4823 	/** @internalTechnology */
  4743 	static inline TInt CreatorPolicyCheckFail(const SSecurityInfo& aMissingCaps);
  4824 	static inline TInt CreatorPolicyCheckFail(const SSecurityInfo& aMissingCaps);
  4744 #endif //__KERNEL_MODE__
  4825 #endif //__KERNEL_MODE__
  4745 
  4826 
  4746 private:
  4827 private:
  4747 	/** @internalTechnology */
       
  4748 	UIMPORT_C static TInt EmitDiagnostic(TPlatSecDiagnostic& aDiagnostic, const char* aContextText);
  4828 	UIMPORT_C static TInt EmitDiagnostic(TPlatSecDiagnostic& aDiagnostic, const char* aContextText);
  4749 #else //__REMOVE_PLATSEC_DIAGNOSTICS__
  4829 #else //__REMOVE_PLATSEC_DIAGNOSTICS__
  4750 #ifndef __KERNEL_MODE__
  4830 #ifndef __KERNEL_MODE__
  4751 private:
  4831 private:
  4752 	/** @internalTechnology */
       
  4753 	IMPORT_C static TInt EmitDiagnostic(TPlatSecDiagnostic& aDiagnostic, const char* aContextText);
  4832 	IMPORT_C static TInt EmitDiagnostic(TPlatSecDiagnostic& aDiagnostic, const char* aContextText);
  4754 #endif // !__KERNEL_MODE__
  4833 #endif // !__KERNEL_MODE__
  4755 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
  4834 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
  4756 
  4835 
  4757 public:
  4836 public:
  4758 	/** @internalTechnology */
  4837 	/** @internalTechnology */
  4759 	UIMPORT_C static TInt EmitDiagnostic();
  4838 	UIMPORT_C static TInt EmitDiagnostic();
  4760 	};
  4839 	};
  4761 
  4840 
  4762 
  4841 
  4763 
  4842 #define KMaxSerialNumLength 64
  4764 /**
  4843 typedef TBuf8<KMaxSerialNumLength> TMediaSerialNumber;
  4765 @internalTechnology
       
  4766  */
       
  4767 struct TEmulatorImageHeader
       
  4768 	{
       
  4769 	TUid iUids[KMaxCheckedUid];
       
  4770 	TProcessPriority iPriority;
       
  4771 	SSecurityInfo iS;
       
  4772 	TUint32 iSpare1;
       
  4773 	TUint32 iSpare2;
       
  4774 	TUint32 iModuleVersion;
       
  4775 	TUint32 iFlags;
       
  4776 	};
       
  4777 
       
  4778 
       
  4779 
  4844 
  4780 
  4845 
  4781 /**
  4846 /**
  4782 @publishedAll
  4847 @publishedAll
  4783 @released
  4848 @released
  4972 */
  5037 */
  4973 template <class T>
  5038 template <class T>
  4974 class TIdentityRelation
  5039 class TIdentityRelation
  4975 	{
  5040 	{
  4976 public:
  5041 public:
       
  5042 	inline TIdentityRelation();
  4977 	inline TIdentityRelation( TBool (*anIdentity)(const T&, const T&) );
  5043 	inline TIdentityRelation( TBool (*anIdentity)(const T&, const T&) );
  4978 	inline operator TGeneralIdentityRelation() const;
  5044 	inline operator TGeneralIdentityRelation() const;
       
  5045 private:
       
  5046 	inline static TBool EqualityOperatorCompare(const T& aLeft, const T& aRight);
  4979 private:
  5047 private:
  4980 	TGeneralIdentityRelation iIdentity;
  5048 	TGeneralIdentityRelation iIdentity;
  4981 	};
  5049 	};
  4982 
  5050 
  4983 
  5051 
  6143 	}
  6211 	}
  6144 
  6212 
  6145 
  6213 
  6146 #endif //__LEAVE_EQUALS_THROW__
  6214 #endif //__LEAVE_EQUALS_THROW__
  6147 
  6215 
       
  6216 /* The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
       
  6217  * In this case, operator new and operator delete below should not be declared
       
  6218  * to avoid clashing with StdC++ declarations.
       
  6219  */ 
       
  6220 
       
  6221 #ifndef __SYMBIAN_STDCPP_SUPPORT__
       
  6222 
       
  6223 #ifndef __OPERATOR_NEW_DECLARED__
       
  6224 
       
  6225 /* Some operator new and operator delete overloads may be declared in compiler
       
  6226  * pre-include files.
       
  6227  *
       
  6228  * __OPERATOR_NEW_DECLARED__ is #defined if they are, so that we can avoid
       
  6229  * re-declaring them here.
       
  6230  */
       
  6231 
       
  6232 #define __OPERATOR_NEW_DECLARED__
       
  6233 
  6148 /**
  6234 /**
  6149 @publishedAll
  6235 @publishedAll
  6150 @released
  6236 @released
  6151 */
  6237 */
  6152 GLREF_C TAny* operator new(TUint aSize) __NO_THROW;
  6238 GLREF_C TAny* operator new(TUint aSize) __NO_THROW;
  6161 @publishedAll
  6247 @publishedAll
  6162 @released
  6248 @released
  6163 */
  6249 */
  6164 GLREF_C void operator delete(TAny* aPtr) __NO_THROW;
  6250 GLREF_C void operator delete(TAny* aPtr) __NO_THROW;
  6165 
  6251 
       
  6252 #ifndef __OMIT_VEC_OPERATOR_NEW_DECL__
       
  6253 /**
       
  6254 @publishedAll
       
  6255 @released
       
  6256 */
       
  6257 GLREF_C TAny* operator new[](TUint aSize) __NO_THROW;
       
  6258 
       
  6259 /**
       
  6260 @publishedAll
       
  6261 @released
       
  6262 */
       
  6263 GLREF_C void operator delete[](TAny* aPtr) __NO_THROW;
       
  6264 #endif // !__OMIT_VEC_OPERATOR_NEW_DECL__
       
  6265 
       
  6266 #endif // !__OPERATOR_NEW_DECLARED__
       
  6267 
       
  6268 #endif // !__SYMBIAN_STDCPP_SUPPORT__
       
  6269 
       
  6270 /**
       
  6271 @publishedAll
       
  6272 @released
       
  6273 */
       
  6274 inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW;
       
  6275 
       
  6276 /**
       
  6277 @publishedAll
       
  6278 @released
       
  6279 */
       
  6280 inline void operator delete(TAny* aPtr, TAny* aBase) __NO_THROW;
       
  6281 
  6166 #ifndef __PLACEMENT_VEC_NEW_INLINE
  6282 #ifndef __PLACEMENT_VEC_NEW_INLINE
  6167 /**
  6283 /**
  6168 @publishedAll
  6284 @publishedAll
  6169 @released
  6285 @released
  6170 */
  6286 */
  6171 GLREF_C TAny* operator new[](TUint aSize) __NO_THROW;
       
  6172 
       
  6173 /**
       
  6174 @publishedAll
       
  6175 @released
       
  6176 */
       
  6177 GLREF_C void operator delete[](TAny* aPtr) __NO_THROW;
       
  6178 #endif
       
  6179 
       
  6180 /**
       
  6181 @publishedAll
       
  6182 @released
       
  6183 */
       
  6184 inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW;
       
  6185 
       
  6186 #ifndef __PLACEMENT_VEC_NEW_INLINE
       
  6187 /**
       
  6188 @publishedAll
       
  6189 @released
       
  6190 */
       
  6191 inline TAny* operator new[](TUint aSize, TAny* aBase) __NO_THROW;
  6287 inline TAny* operator new[](TUint aSize, TAny* aBase) __NO_THROW;
  6192 
  6288 
  6193 #endif // !__PLACEMENT_VEC_NEW_INLINE
       
  6194 
       
  6195 /**
       
  6196 @publishedAll
       
  6197 @released
       
  6198 */
       
  6199 inline void operator delete(TAny* aPtr, TAny* aBase) __NO_THROW;
       
  6200 
       
  6201 #ifndef __PLACEMENT_VEC_NEW_INLINE
       
  6202 /**
  6289 /**
  6203 @publishedAll
  6290 @publishedAll
  6204 @released
  6291 @released
  6205 */
  6292 */
  6206 inline void operator delete[](TAny* aPtr, TAny* aBase) __NO_THROW;
  6293 inline void operator delete[](TAny* aPtr, TAny* aBase) __NO_THROW;
  6278 		};
  6365 		};
  6279 
  6366 
  6280 
  6367 
  6281     /**
  6368     /**
  6282     @internalComponent
  6369     @internalComponent
  6283     
       
  6284     Bit width of type information.
       
  6285 	*/
  6370 	*/
  6286 	enum {
  6371 	enum 
  6287 	     KBitsPerType=3 /** Number of bits of type information used for each of the 4 arguments. */
  6372 		{
  6288 	     };
  6373 		KBitsPerType	= 3, 		/**< Number of bits of type information used for each of the 4 arguments.*/
       
  6374 		KPinArgShift	= KBitsPerType*KMaxMessageArguments,	/**< Bit number of the start of the pin flags. */
       
  6375 		KPinArg0		= 1<<(KPinArgShift+0),	/**< Set to pin argument at index 0.*/
       
  6376 		KPinArg1		= 1<<(KPinArgShift+1),	/**< Set to pin argument at index 1.*/
       
  6377 		KPinArg2		= 1<<(KPinArgShift+2),	/**< Set to pin argument at index 2.*/
       
  6378 		KPinArg3		= 1<<(KPinArgShift+3),	/**< Set to pin argument at index 3.*/
       
  6379 		KPinMask 		= 0xf<<KPinArgShift,	/**< The bits used for the pinning attributes of each argument.*/
       
  6380 		};
  6289 	
  6381 	
  6290 	
  6382 	
  6291 	/**
  6383 	/**
  6292 	Indicates a Null argument.
  6384 	Indicates a Null argument.
  6293 	*/
  6385 	*/
  6405 #endif
  6497 #endif
  6406 	inline void Set(TInt aIndex,TDes8* aValue);
  6498 	inline void Set(TInt aIndex,TDes8* aValue);
  6407 #ifndef __KERNEL_MODE__
  6499 #ifndef __KERNEL_MODE__
  6408 	inline void Set(TInt aIndex,TDes16* aValue);
  6500 	inline void Set(TInt aIndex,TDes16* aValue);
  6409 #endif
  6501 #endif
       
  6502 
       
  6503 	inline TIpcArgs& PinArgs(TBool aPinArg0=ETrue, TBool aPinArg1=ETrue, TBool aPinArg2=ETrue, TBool aPinArg3=ETrue);
  6410 private:
  6504 private:
  6411 	inline static TArgType Type(TNothing);
  6505 	inline static TArgType Type(TNothing);
  6412 	inline static TArgType Type(TInt);
  6506 	inline static TArgType Type(TInt);
  6413 	inline static TArgType Type(const TAny*);
  6507 	inline static TArgType Type(const TAny*);
  6414 	inline static TArgType Type(RHandleBase aValue);
  6508 	inline static TArgType Type(RHandleBase aValue);
  6564 	TInt iR;
  6658 	TInt iR;
  6565 	};
  6659 	};
  6566 
  6660 
  6567 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
  6661 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
  6568 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
  6662 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
  6569 // when we move to supporting Standard C++. 
  6663 // when we move to supporting Standard C++.
  6570 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
  6664 
       
  6665 // The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
       
  6666 // In this case, we include the StdC++ specification <exception> rather than declaring uncaught_exception.
       
  6667  
       
  6668 #ifdef __SYMBIAN_STDCPP_SUPPORT__
       
  6669 	#include <stdapis/stlportv5/exception>
       
  6670 #elif !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
  6571 // Declare standard C++ functions relating to exceptions here
  6671 // Declare standard C++ functions relating to exceptions here
  6572 namespace std {
  6672 namespace std {
  6573   bool uncaught_exception(void);
  6673 #if defined(__VC32__) || defined(__CW32__)
       
  6674   bool uncaught_exception();
       
  6675 #else
       
  6676   IMPORT_C bool uncaught_exception();
       
  6677 #endif
  6574   void terminate(void);
  6678   void terminate(void);
  6575   void unexpected(void);
  6679   void unexpected(void);
  6576   typedef void (*terminate_handler)();
  6680   typedef void (*terminate_handler)();
  6577   terminate_handler set_terminate(terminate_handler h) throw();
  6681   terminate_handler set_terminate(terminate_handler h) throw();
  6578   typedef void (*unexpected_handler)();
  6682   typedef void (*unexpected_handler)();
  6666 	UIMPORT_C void UnTrap();
  6770 	UIMPORT_C void UnTrap();
  6667 	};
  6771 	};
  6668 #endif //__X86__
  6772 #endif //__X86__
  6669 #endif //__WINS__
  6773 #endif //__WINS__
  6670 
  6774 
       
  6775 /**
       
  6776 @internalTechnology
       
  6777  */
       
  6778 struct TEmulatorImageHeader
       
  6779 	{
       
  6780 	TUid iUids[KMaxCheckedUid];
       
  6781 	TProcessPriority iPriority;
       
  6782 	SSecurityInfo iS;
       
  6783 	TUint32 iSpare1;
       
  6784 	TUint32 iSpare2;
       
  6785 	TUint32 iModuleVersion;
       
  6786 	TUint32 iFlags;
       
  6787 	};
       
  6788 
       
  6789 // forward declaration of shareable data buffers pool infomation
       
  6790 class TShPoolInfo;
       
  6791 
  6671 #include <e32cmn.inl>
  6792 #include <e32cmn.inl>
  6672 
  6793 
       
  6794 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  6795 #include <e32cmn_private.h>
       
  6796 #endif
       
  6797 
  6673 #endif //__E32CMN_H__
  6798 #endif //__E32CMN_H__
       
  6799