Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1994-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\e32std.h
21 #ifdef __KERNEL_MODE__
22 #error !! Including e32std.h in kernel code !!
34 IMPORT_C virtual void operator()() =0;
41 Encapsulates a general call-back function.
43 The class encapsulates:
45 1. a pointer to a function which takes an argument of type TAny* and returns
48 2. a pointer which is passed to the function every time it is called.
49 The pointer can point to any object. It can also be NULL.
51 The callback function can be a static function of a class,
52 e.g. TInt X::Foo(TAny *) or it can be a function which is not a member of
53 any class, e.g. TInt Foo(TAny *).
55 When used with the CIdle and the CPeriodic classes, the callback function
56 is intended to be called repeatedly; the encapsulated pointer is passed on
57 each call. Typically, the pointer refers to an object which records the state
58 of the task across each call. When used with CIdle, the callback function
59 should also return a true (non-zero) value if it is intended to be called
60 again, otherwise it should return a false (zero) value.
69 inline TCallBack(TInt (*aFunction)(TAny* aPtr));
70 inline TCallBack(TInt (*aFunction)(TAny* aPtr),TAny* aPtr);
71 inline TInt CallBack() const;
75 A pointer to the callback function.
77 TInt (*iFunction)(TAny* aPtr);
81 A pointer that is passed to the callback function when
82 the function is called.
94 An object embedded within a class T so that objects of type T can form part
95 of a singly linked list.
97 A link object encapsulates a pointer to the next link object in the list.
105 inline TSglQueLink() : iNext(NULL)
107 An explicitly coded default constructor that is only defined for DEBUG builds.
109 It sets the pointer to the next link object to NULL.
116 IMPORT_C void Enque(TSglQueLink* aLink);
119 A pointer to the next link object in the list.
122 friend class TSglQueBase;
132 A base class that provides implementation for the link object of a doubly
135 It also encapsulates pointers both to the next and the previous link
136 objects in the doubly linked list.
138 The class is abstract and is not intended to be instantiated.
142 class TDblQueLinkBase
145 inline TDblQueLinkBase() : iNext(NULL)
149 It sets the pointer to the next link object to NULL.
154 IMPORT_C void Enque(TDblQueLinkBase* aLink);
155 IMPORT_C void AddBefore(TDblQueLinkBase* aLink);
158 A pointer to the next link object in the list.
160 TDblQueLinkBase* iNext;
163 A pointer to the previous link object in the list.
165 TDblQueLinkBase* iPrev;
175 An object embedded within a class T so that objects of type T can form part
176 of a doubly linked list.
178 class TDblQueLink : public TDblQueLinkBase
181 IMPORT_C void Deque();
191 An object embedded within a class T so that objects of type T can form part
192 of an ordered doubly linked list.
194 Objects are added to the doubly linked list in descending priority order.
196 class TPriQueLink : public TDblQueLink
202 Objects are added to the doubly linked list in descending order of this value.
214 An object embedded within a class T so that objects of type T can form part
215 of a delta doubly linked list.
217 class TDeltaQueLink : public TDblQueLinkBase
233 An object embedded within a class T so that objects of type T can form part
234 of a doubly linked list sorted by tick count.
236 class TTickCountQueLink : public TDblQueLink
252 A base class that provides implementation for the singly linked list header.
254 It also encapsulates the offset value of a link object.
256 The class is abstract and is not intended to be instantiated.
263 IMPORT_C TBool IsEmpty() const;
264 IMPORT_C void SetOffset(TInt aOffset);
265 IMPORT_C void Reset();
267 IMPORT_C TSglQueBase();
268 IMPORT_C TSglQueBase(TInt aOffset);
269 IMPORT_C void DoAddFirst(TAny* aPtr);
270 IMPORT_C void DoAddLast(TAny* aPtr);
271 IMPORT_C void DoRemove(TAny* aPtr);
274 A pointer to the first element in the list.
279 A pointer to the last element in the list.
284 The offset of a component link object within elements that form the list.
288 TSglQueBase(const TSglQueBase& aQue);
289 TSglQueBase &operator=(const TSglQueBase& aQue);
290 friend class TSglQueIterBase;
300 A base class that provides implementation for the doubly linked list header.
302 It also encapsulates the offset value of a link object.
304 The class is abstract and is not intended to be instantiated.
311 IMPORT_C TBool IsEmpty() const;
312 IMPORT_C void SetOffset(TInt aOffset);
313 IMPORT_C void Reset();
315 IMPORT_C TDblQueBase();
316 IMPORT_C TDblQueBase(TInt aOffset);
317 IMPORT_C void DoAddFirst(TAny* aPtr);
318 IMPORT_C void DoAddLast(TAny* aPtr);
319 IMPORT_C void DoAddPriority(TAny* aPtr);
320 IMPORT_C void __DbgTestEmpty() const;
323 The head, or anchor point of the queue.
328 The offset of a component link object within elements that form the list.
332 TDblQueBase(const TDblQueBase& aQue);
333 TDblQueBase& operator=(const TDblQueBase& aQue);
334 friend class TDblQueIterBase;
344 A base class that provides implementation for the TDeltaQue template class.
346 The class is abstract and is not intended to be instantiated.
350 class TDeltaQueBase : public TDblQueBase
353 IMPORT_C TBool CountDown();
354 IMPORT_C TBool CountDown(TInt aValue);
355 IMPORT_C TBool FirstDelta(TInt& aValue);
356 IMPORT_C void Reset();
358 IMPORT_C TDeltaQueBase();
359 IMPORT_C TDeltaQueBase(TInt aOffset);
360 IMPORT_C void DoAddDelta(TAny* aPtr,TInt aDelta);
361 IMPORT_C void DoRemove(TAny* aPtr);
362 IMPORT_C TAny* DoRemoveFirst();
365 Pointer to the delta value in the first link element.
377 A templated class that provides the behaviour for managing a singly linked
380 It also acts as the head of the list, maintaining the pointers into the list.
382 The template parameter defines the type of element that forms the singly linked
383 list and is the class that acts as host to the link object.
388 class TSglQue : public TSglQueBase
392 inline explicit TSglQue(TInt aOffset);
393 inline void AddFirst(T& aRef);
394 inline void AddLast(T& aRef);
395 inline TBool IsFirst(const T* aPtr) const;
396 inline TBool IsLast(const T* aPtr) const;
397 inline T* First() const;
398 inline T* Last() const;
399 inline void Remove(T& aRef);
409 A templated class that provides the behaviour for managing a doubly linked
412 It also acts as the head of the list, maintaining the pointers into the list.
414 The template parameter defines the type of element that forms the doubly linked
415 list and is the class that acts as host to the link object.
420 class TDblQue : public TDblQueBase
424 inline explicit TDblQue(TInt aOffset);
425 inline void AddFirst(T& aRef);
426 inline void AddLast(T& aRef);
427 inline TBool IsHead(const T* aPtr) const;
428 inline TBool IsFirst(const T* aPtr) const;
429 inline TBool IsLast(const T* aPtr) const;
430 inline T* First() const;
431 inline T* Last() const;
441 A templated class that provides the behaviour for managing a doubly linked
442 list in which the elements are added in descending priority order.
444 Priority is defined by the value of the TPriQueLink::iPriority member of
447 The template parameter defines the type of element that forms the doubly linked
448 list and is the class that acts as host to the link object.
451 @see TPriQueLink::iPriority
454 class TPriQue : public TDblQueBase
458 inline explicit TPriQue(TInt aOffset);
459 inline void Add(T& aRef);
460 inline TBool IsHead(const T* aPtr) const;
461 inline TBool IsFirst(const T* aPtr) const;
462 inline TBool IsLast(const T* aPtr) const;
463 inline T* First() const;
464 inline T* Last() const;
474 A templated class that provides the behaviour for managing a doubly linked
475 list in which elements represent values which are increments, or deltas, on
476 the value represented by a preceding element.
478 The list is ordered so that the head of the queue represents a nominal zero
481 The delta value of a new element represents its 'distance' from the nominal
482 zero point. The new element is added into the list, and the delta values of
483 adjacent elements (and of the new element, if necessary) are adjusted, so
484 that the sum of all deltas, up to and including the new element, is the same
485 as the new element's intended 'distance' from the nominal zero point.
487 A common use for a list of this type is as a queue of timed events, where
488 the delta values represent the intervals between the events.
490 The delta value is defined by the value of the TDeltaQueLink::iDelta member
493 The template parameter defines the type of element that forms the doubly linked
494 list and is the class that acts as host to the link object.
497 @see TDeltaQueLink::iDelta
500 class TDeltaQue : public TDeltaQueBase
504 inline explicit TDeltaQue(TInt aOffset);
505 inline void Add(T& aRef,TInt aDelta);
506 inline void Remove(T& aRef);
507 inline T* RemoveFirst();
513 // Forward declaration
514 class TTickCountQueLink;
520 A class that provides the behaviour for managing a doubly linked list
521 in which elements are added in order of the time until their tick count.
523 A common use for a list of this type is as a queue of timed events, where
524 the tick counts are the expiry times of the events.
526 The tick count is defined by the value of the TTickCountQueLink::iTickCount
527 member of the link element.
529 @see TTickCountQueLink
530 @see TTickCountQueLink::iTickCount
532 class TTickCountQue : public TDblQueBase
536 void Add(TTickCountQueLink& aRef);
537 TTickCountQueLink* First() const;
538 TTickCountQueLink* RemoveFirst();
539 TTickCountQueLink* RemoveFirst(TUint aTickCount);
549 A base class that provides implementation for the singly linked list iterator.
551 It also encapsulates a pointer to the current link link list element.
553 The class is abstract and is not intended to be instantiated.
555 class TSglQueIterBase
558 IMPORT_C void SetToFirst();
560 IMPORT_C TSglQueIterBase(TSglQueBase& aQue);
561 IMPORT_C TAny* DoPostInc();
562 IMPORT_C TAny* DoCurrent();
563 IMPORT_C void DoSet(TAny* aLink);
577 A templated class that provides the behaviour for iterating through a set of
578 singly linked list elements.
580 The template parameter defines the type of element that forms the singly linked
581 list. The class defined in the template parameter contains the link object.
584 class TSglQueIter : public TSglQueIterBase
587 inline TSglQueIter(TSglQueBase& aQue);
588 inline void Set(T& aLink);
589 inline operator T*();
590 inline T* operator++(TInt);
600 A base class that provides implementation for the doubly linked list iterator.
602 It also encapsulates a pointer to the current link list element.
604 The class is abstract and is not intended to be instantiated.
606 class TDblQueIterBase
609 IMPORT_C void SetToFirst();
610 IMPORT_C void SetToLast();
612 IMPORT_C TDblQueIterBase(TDblQueBase& aQue);
613 IMPORT_C TAny* DoPostInc();
614 IMPORT_C TAny* DoPostDec();
615 IMPORT_C TAny* DoCurrent();
616 IMPORT_C void DoSet(TAny* aLink);
619 The offset of a component link object within elements that form the list.
624 Pointer to the anchor for the list.
626 TDblQueLinkBase* iHead;
629 Pointer to the current element.
631 TDblQueLinkBase* iNext;
641 A templated class that provides the behaviour for iterating through a set of
642 doubly linked list elements.
644 The template parameter defines the type of element that forms the doubly linked
645 list. The class defined in the template parameter contains the link object.
648 class TDblQueIter : public TDblQueIterBase
651 inline TDblQueIter(TDblQueBase& aQue);
652 inline void Set(T& aLink);
653 inline operator T*();
654 inline T* operator++(TInt);
655 inline T* operator--(TInt);
665 Governs the type of comparison to be made between descriptor keys or between
675 For a Unicode build, this is the same as ECmpNormal16.
676 For a non-Unicode build, this is the same as ECmpNormal8.
678 Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText)
679 allows the compiler to chose the correct variant according to the build.
685 For descriptor keys, the key is assumed to be the 8 bit variant, derived
686 from TDesc8. A simple comparison is done between the content of the
687 descriptors; the data is not folded and collation rules are not applied for
688 the purpose of the comparison.
690 For text keys, the key is assumed to be the 8 bit variant, of type TText8.
691 A normal comparison is done between the text data; the data is not folded
692 and collation rules are not applied for the purpose of the comparison.
698 For descriptor keys, the key is assumed to be the 16 bit variant, derived
699 from TDesc16. A simple comparison is done between the content of the
700 descriptors; the data is not folded and collation rules are not applied for
701 the purpose of the comparison.
703 For text keys, the key is assumed to be the 16 bit variant, of type
704 TText16. A normal comparison is done between the text data; the data is
705 not folded and collation rules are not applied for the purpose of the
712 For a Unicode build, this is the same as EcmpFolded16.
713 For a non-Unicode build, this is the same as EcmpFolded8.
715 Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText)
716 allows the compiler to chose the correct variant according to the build.
722 For descriptor keys, the key is assumed to be the 8 bit variant,
723 derived from TDesc8. The descriptor contents are folded for the purpose
726 For text keys, the key is assumed to be the 8 bit variant, of type
727 TText8. The text data is folded for the purpose of the comparison.
733 For descriptor keys, the key is assumed to be the 16 bit variant,
734 derived from TDesc16. The descriptor contents are folded for the purpose
737 For text keys, the key is assumed to be the 16 bit variant, of type
738 TText16. The text data is folded for the purpose of the comparison.
744 For a Unicode build, this is the same as EcmpCollated16.
745 For a non-Unicode build, this is the same as EcmpCollated8.
747 Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText)
748 allows the compiler to chose the correct variant according to the build.
754 For descriptor keys, the key is assumed to be the 8 bit variant,
755 derived from TDesc8. Collation rules are applied for the purpose of
758 For text keys, the key is assumed to be the 8 bit variant, of type
759 TText8. Collation rules are applied for the purpose of the comparison.
765 For descriptor keys, the key is assumed to be the 16 bit variant,
766 derived from TDesc16. Collation rules are applied for the purpose of
769 For text keys, the key is assumed to be the 16 bit variant,
770 of type TText16. Collation rules are applied for the purpose of
783 Governs the type of comparison to be made between numeric keys.
792 The key is assumed to be of type TInt8.
794 ECmpTInt8=((ECmpCollated16+1)<<1),
798 The key is assumed to be of type TInt16.
804 The key is assumed to be of type TInt32.
810 The key is assumed to be of type TInt.
816 The key is assumed to be of type TUint8.
822 The key is assumed to be of type TUint16.
828 The key is assumed to be of type TUint32.
834 The key is assumed to be of type TUint.
840 The key is assumed to be of type TInt64.
852 Defines the characteristics of a key used to access the elements of an array.
854 The class is abstract and cannot be instantiated. A derived class must be
855 defined and implemented.
857 The classes TKeyArrayFix, TKeyArrayVar and TKeyArrayPak, derived from TKey,
858 are already supplied to implement keys for the fixed length element, variable
859 length element and packed arrays.
861 A derived class would normally be written to define the characteristics of
862 a key for a non standard array.
871 inline void SetPtr(const TAny* aPtr);
872 IMPORT_C virtual TInt Compare(TInt aLeft,TInt aRight) const;
873 IMPORT_C virtual TAny* At(TInt anIndex) const;
876 IMPORT_C TKey(TInt aOffset,TKeyCmpText aType);
877 IMPORT_C TKey(TInt aOffset,TKeyCmpText aType,TInt aLength);
878 IMPORT_C TKey(TInt aOffset,TKeyCmpNumeric aType);
890 Defines the basic behaviour for swapping two elements of an array.
892 The class is abstract. A derived class must be defined and implemented to
893 use the functionality.
895 A derived class can define how to swap two elements of an array. In practice,
896 this means providing an implementation for the virtual function Swap().
898 To support this, the derived class is also likely to need a pointer to the
899 array itself and suitable constructors and/or other member functions to set
906 IMPORT_C virtual void Swap(TInt aLeft,TInt aRight) const;
916 Folds a specified character and provides functions to fold additional
917 characters after construction of the object.
919 Folding converts the character to a form which can be used in tolerant
920 comparisons without control over the operations performed. Tolerant comparisons
921 are those which ignore character differences like case and accents.
923 Note that folding is locale-independent behaviour. It is also important to
924 note that there can be no guarantee that folding is in any way culturally
925 appropriate, and should not be used for matching characters in
930 class TCharF : public TChar
933 inline TCharF(TUint aChar);
934 inline TCharF(const TChar& aChar);
935 inline TCharF& operator=(TUint aChar);
936 inline TCharF& operator=(const TChar& aChar);
946 Converts a specified character to lower case and provides functions to convert
947 additional characters after construction of the object.
949 class TCharLC : public TChar
952 inline TCharLC(TUint aChar);
953 inline TCharLC(const TChar& aChar);
954 inline TCharLC& operator=(TUint aChar);
955 inline TCharLC& operator=(const TChar& aChar);
965 Converts a specified character to upper case and provides functions to convert
966 additional characters after construction of the object.
968 class TCharUC : public TChar
971 inline TCharUC(TUint aChar);
972 inline TCharUC(const TChar& aChar);
973 inline TCharUC& operator=(TUint aChar);
974 inline TCharUC& operator=(const TChar& aChar);
983 Defines the character representation of a real number type such
984 as a TReal or a TRealX.
986 An object of this type is used by functions that convert real values to
987 character format, for example, the descriptor functions:
988 Num(), AppendNum() and Format().
990 There are three constructors for constructing a suitable object.
991 The data members of the class, however, are public and can be
992 explicitly set after construction.
997 IMPORT_C TRealFormat();
998 IMPORT_C TRealFormat(TInt aWidth);
999 IMPORT_C TRealFormat(TInt aWidth,TInt aDecimalPlaces);
1002 Governs the format of the character representation of the real number.
1004 This is set to one of the defined format types.
1006 One or more of the defined format flags can subsequently be ORed into this member.
1008 @see KRealFormatFixed
1009 @see KRealFormatExponent
1010 @see KRealFormatGeneral
1011 @see KRealFormatNoExponent
1012 @see KRealFormatCalculator
1013 @see KExtraSpaceForSign
1014 @see KAllowThreeDigitExp
1015 @see KDoNotUseTriads
1023 Defines the maximum number of characters required to represent the number.
1029 Defines either the number of characters to be used to represent the decimal
1030 portion of the number, or the maximum number of significant digits in
1031 the character representation of the number.
1033 The interpretation depends on the chosen format as defined by iType.
1035 @see TRealFormat::iType
1041 Defines the character to be used to separate the integer portion of
1042 a number representation from its decimal portion.
1044 In general, the character used for this purpose is a matter of local
1045 convention. The TLocale::DecimalSeparator() function can supply the
1054 Defines the character to be used to delimit groups of three digits in
1055 the integer part of the number.
1057 In general, the character used for this purpose is a matter of local
1058 convention. The TLocale::ThousandsSeparator() function can supply the
1067 Defines the threshold number of digits above which triad separation is to
1068 occur. A value of zero disables triad separation and no triad separation
1069 character (i.e. the character held in iTriad) is inserted into the
1070 resulting character representation regardless of the number of characters.
1072 For example, a value of 1 causes the number 1000 to be represented by the
1073 characters "1,000" whereas a value of 4 causes the same number to be
1074 represented by the characters "1000" (This assumes the ‘,’ triad separation
1077 Note that no triad separation occurs if the flag KDoNotUseTriads is set in
1078 the iType data member.
1080 @see TRealFormat::iTriad
1081 @see KDoNotUseTriads
1093 Defines the extraction mark used by the TLex8 class to indicate the current
1094 lexical element being analysed.
1096 In practice, objects of this type are accessed through the TLexMark typedef.
1106 inline TLexMark8(const TUint8* aString);
1120 Provides general string-parsing functions suitable for numeric format
1121 conversions and syntactical-element parsing.
1123 The class is the 8-bit variant for non-Unicode strings and 8-bit wide
1126 An instance of this class stores a string, maintaining an extraction mark
1127 to indicate the current lexical element being analysed and a pointer to the
1128 next character to be examined.
1130 Objects of this type are normally accessed through the build independent type
1139 inline TLex8(const TUint8* aString);
1140 inline TLex8(const TDesC8& aDes);
1141 inline TLex8& operator=(const TUint8* aString);
1142 inline TLex8& operator=(const TDesC8& aDes);
1143 inline TBool Eos() const;
1144 inline void Mark(TLexMark8& aMark) const;
1146 IMPORT_C void Inc();
1147 IMPORT_C void Inc(TInt aNumber);
1148 IMPORT_C TChar Get();
1149 IMPORT_C TChar Peek() const;
1150 IMPORT_C void UnGet();
1151 inline void UnGetToMark();
1152 IMPORT_C void UnGetToMark(const TLexMark8 aMark);
1153 IMPORT_C void SkipSpace();
1154 inline void SkipAndMark(TInt aNumber);
1155 IMPORT_C void SkipAndMark(TInt aNumber, TLexMark8& aMark);
1156 inline void SkipSpaceAndMark();
1157 IMPORT_C void SkipSpaceAndMark(TLexMark8& aMark);
1158 IMPORT_C void SkipCharacters();
1159 inline TInt TokenLength() const;
1160 IMPORT_C TInt TokenLength(const TLexMark8 aMark) const;
1161 IMPORT_C TPtrC8 MarkedToken() const;
1162 IMPORT_C TPtrC8 MarkedToken(const TLexMark8 aMark) const;
1163 IMPORT_C TPtrC8 NextToken();
1164 IMPORT_C TPtrC8 Remainder() const;
1165 IMPORT_C TPtrC8 RemainderFromMark() const;
1166 IMPORT_C TPtrC8 RemainderFromMark(const TLexMark8 aMark) const;
1167 IMPORT_C TInt Offset() const;
1168 inline TInt MarkedOffset() const;
1169 IMPORT_C TInt MarkedOffset(const TLexMark8 aMark) const;
1170 IMPORT_C TInt Val(TInt8& aVal);
1171 IMPORT_C TInt Val(TInt16& aVal);
1172 IMPORT_C TInt Val(TInt32& aVal);
1173 IMPORT_C TInt Val(TInt64& aVal);
1174 inline TInt Val(TInt& aVal);
1175 IMPORT_C TInt Val(TUint8& aVal,TRadix aRadix);
1176 IMPORT_C TInt Val(TUint16& aVal,TRadix aRadix);
1177 IMPORT_C TInt Val(TUint32& aVal,TRadix aRadix);
1178 IMPORT_C TInt Val(TInt64& aVal, TRadix aRadix);
1179 inline TInt Val(TUint& aVal,TRadix aRadix=EDecimal);
1180 IMPORT_C TInt BoundedVal(TInt32& aVal,TInt aLimit);
1181 IMPORT_C TInt BoundedVal(TInt64& aVal, const TInt64& aLimit);
1182 IMPORT_C TInt BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit);
1183 IMPORT_C TInt BoundedVal(TInt64& aVal, TRadix aRadix, const TInt64& aLimit);
1184 IMPORT_C TInt Val(TReal32& aVal);
1185 IMPORT_C TInt Val(TReal32& aVal,TChar aPoint);
1186 IMPORT_C TInt Val(TReal64& aVal);
1187 IMPORT_C TInt Val(TReal64& aVal,TChar aPoint);
1188 inline void Assign(const TLex8& aLex);
1189 IMPORT_C void Assign(const TUint8* aString);
1190 IMPORT_C void Assign(const TDesC8& aDes);
1191 TInt Val(TRealX& aVal);
1192 TInt Val(TRealX& aVal, TChar aPoint);
1194 /** @deprecated Use BoundedVal(TInt32& aVal,TInt aLimit) */
1195 inline TInt Val(TInt32& aVal,TInt aLimit) { return BoundedVal(aVal,aLimit); };
1197 /** @deprecated Use BoundedVal(TInt64& aVal,const TInt64& aLimit) */
1198 inline TInt Val(TInt64& aVal,const TInt64& aLimit) { return BoundedVal(aVal,aLimit); };
1200 /** @deprecated Use BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit) */
1201 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
1203 /** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) */
1204 inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
1206 void Scndig(TInt& aSig,TInt& aExp,TInt64& aDl);
1207 void ScndigAfterPoint(TInt& aSig,TInt64& aDl);
1208 void ValidateMark(const TLexMark8 aMark) const;
1210 const TUint8* iNext;
1224 Defines the extraction mark used by the TLex16 class to indicate the current
1225 lexical element being analysed.
1227 In practice, objects of this type are accessed through the TLexMark typedef.
1235 inline TLexMark16();
1237 inline TLexMark16(const TUint16* aString);
1238 const TUint16* iPtr;
1239 friend class TLex16;
1250 Provides general string-parsing functions suitable for numeric format
1251 conversions and syntactical-element parsing.
1253 The class is the 16-bit variant for Unicode strings and 16-bit wide
1256 An instance of this class stores a string, maintaining an extraction mark
1257 to indicate the current lexical element being analysed and a pointer to the
1258 next character to be examined.
1260 Objects of this type are normally accessed through the build independent type
1269 inline TLex16(const TUint16* aString);
1270 inline TLex16(const TDesC16& aDes);
1271 inline TLex16& operator=(const TUint16* aString);
1272 inline TLex16& operator=(const TDesC16& aDes);
1273 inline TBool Eos() const;
1275 inline void Mark(TLexMark16& aMark) const;
1276 IMPORT_C void Inc();
1277 IMPORT_C void Inc(TInt aNumber);
1278 IMPORT_C TChar Get();
1279 IMPORT_C TChar Peek() const;
1280 IMPORT_C void UnGet();
1281 inline void UnGetToMark();
1282 IMPORT_C void UnGetToMark(const TLexMark16 aMark);
1283 IMPORT_C void SkipSpace();
1284 inline void SkipAndMark(TInt aNumber);
1285 IMPORT_C void SkipAndMark(TInt aNumber, TLexMark16& aMark);
1286 IMPORT_C void SkipSpaceAndMark(TLexMark16& aMark);
1287 inline void SkipSpaceAndMark();
1288 IMPORT_C void SkipCharacters();
1289 inline TInt TokenLength() const;
1290 IMPORT_C TInt TokenLength(const TLexMark16 aMark) const;
1291 IMPORT_C TPtrC16 MarkedToken() const;
1292 IMPORT_C TPtrC16 MarkedToken(const TLexMark16 aMark) const;
1293 IMPORT_C TPtrC16 NextToken();
1294 IMPORT_C TPtrC16 Remainder() const;
1295 IMPORT_C TPtrC16 RemainderFromMark() const;
1296 IMPORT_C TPtrC16 RemainderFromMark(const TLexMark16 aMark) const;
1297 IMPORT_C TInt Offset() const;
1298 inline TInt MarkedOffset() const;
1299 IMPORT_C TInt MarkedOffset(const TLexMark16 aMark) const;
1300 IMPORT_C TInt Val(TInt8& aVal);
1301 IMPORT_C TInt Val(TInt16& aVal);
1302 IMPORT_C TInt Val(TInt32& aVal);
1303 IMPORT_C TInt Val(TInt64& aVal);
1304 inline TInt Val(TInt& aVal);
1305 IMPORT_C TInt Val(TUint8& aVal,TRadix aRadix);
1306 IMPORT_C TInt Val(TUint16& aVal,TRadix aRadix);
1307 IMPORT_C TInt Val(TUint32& aVal,TRadix aRadix);
1308 IMPORT_C TInt Val(TInt64& aVal, TRadix aRadix);
1309 // inline TInt Val(TInt64& aVal, TRadix aRadix) {return Val(aVal,aRadix);}
1310 inline TInt Val(TUint& aVal,TRadix aRadix=EDecimal);
1311 IMPORT_C TInt BoundedVal(TInt32& aVal,TInt aLimit);
1312 IMPORT_C TInt BoundedVal(TInt64& aVal, const TInt64& aLimit);
1313 IMPORT_C TInt BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit);
1314 IMPORT_C TInt BoundedVal(TInt64& aVal, TRadix aRadix, const TInt64& aLimit);
1315 IMPORT_C TInt Val(TReal32& aVal);
1316 IMPORT_C TInt Val(TReal32& aVal,TChar aPoint);
1317 IMPORT_C TInt Val(TReal64& aVal);
1318 IMPORT_C TInt Val(TReal64& aVal,TChar aPoint);
1319 inline void Assign(const TLex16& aLex);
1320 IMPORT_C void Assign(const TUint16* aString);
1321 IMPORT_C void Assign(const TDesC16& aDes);
1322 TInt Val(TRealX& aVal);
1323 TInt Val(TRealX& aVal, TChar aPoint);
1325 /** @deprecated Use BoundedVal(TInt32& aVal,TInt aLimit) */
1326 inline TInt Val(TInt32& aVal,TInt aLimit) { return BoundedVal(aVal,aLimit); };
1328 /** @deprecated Use BoundedVal(TInt64& aVal,const TInt64& aLimit) */
1329 inline TInt Val(TInt64& aVal,const TInt64& aLimit) { return BoundedVal(aVal,aLimit); };
1331 /** @deprecated Use BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit) */
1332 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
1334 /** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) */
1335 inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
1337 void Scndig(TInt& aSig,TInt& aExp,TInt64& aDl);
1338 void ValidateMark(const TLexMark16 aMark) const;
1340 const TUint16* iNext;
1341 const TUint16* iBuf;
1342 const TUint16* iEnd;
1350 #if defined(_UNICODE)
1355 Provides access to general string-parsing functions suitable for numeric format
1356 conversions and syntactical-element parsing.
1358 It maps directly to either a TLex16 for a Unicode build or a TLex8 for a non-Unicode
1361 The build independent type should always be used unless an explicit 16 bit
1362 or 8 bit build variant is required.
1367 typedef TLex16 TLex;
1376 Defines the extraction mark used by the TLex classes to indicate the current
1377 lexical element being analysed.
1379 It maps directly to either a TLexMark16 for a Unicode build or a TLexMark8
1380 for a non-Unicode build.
1382 The build independent type should always be used unless an explicit 16 bit
1383 or 8 bit build variant is required.
1385 typedef TLexMark16 TLexMark;
1398 Provides access to general string-parsing functions suitable for numeric format
1399 conversions and syntactical-element parsing.
1401 It maps directly to either a TLex16 for a Unicode build or a TLex8 for a non-Unicode
1404 The build independent type should always be used unless an explicit 16 bit
1405 or 8 bit build variant is required.
1419 Defines the extraction mark used by the TLex classes to indicate the current
1420 lexical element being analysed.
1422 It maps directly to either a TLexMark16 for a Unicode build or a TLexMark8
1423 for a non-Unicode build.
1425 The build independent type should always be used unless an explicit 16 bit
1426 or 8 bit build variant is required.
1428 typedef TLexMark8 TLexMark;
1438 Packages a Uid type together with a checksum.
1445 IMPORT_C TCheckedUid();
1446 IMPORT_C TCheckedUid(const TUidType& aUidType);
1447 IMPORT_C TCheckedUid(const TDesC8& aPtr);
1448 IMPORT_C void Set(const TUidType& aUidType);
1449 IMPORT_C void Set(const TDesC8& aPtr);
1450 IMPORT_C TPtrC8 Des() const;
1451 inline const TUidType& UidType() const;
1453 IMPORT_C TUint Check() const;
1466 A date and time object in which the individual components are accessible in
1467 human-readable form.
1469 The individual components are: year, month, day, hour, minute,
1470 second and microsecond.
1472 These components are stored as integers and all except the year are checked for
1473 validity when a TDateTime is constructed or assigned new values.
1475 This class only supports getting and setting the entire date/time or any component
1476 of it. It does not support adding or subtracting intervals to or from a time.
1477 For functions which manipulate times, use class TTime.
1485 IMPORT_C TDateTime(TInt aYear,TMonth aMonth,TInt aDay,TInt aHour,TInt aMinute, TInt aSecond,TInt aMicroSecond);
1486 IMPORT_C TInt Set(TInt aYear,TMonth aMonth,TInt aDay,TInt aHour,TInt aMinute, TInt aSecond,TInt aMicroSecond);
1487 IMPORT_C TInt SetYear(TInt aYear);
1488 IMPORT_C TInt SetYearLeapCheck(TInt aYear);
1489 IMPORT_C TInt SetMonth(TMonth aMonth);
1490 IMPORT_C TInt SetDay(TInt aDay);
1491 IMPORT_C TInt SetHour(TInt aHour);
1492 IMPORT_C TInt SetMinute(TInt aMinute);
1493 IMPORT_C TInt SetSecond(TInt aSecond);
1494 IMPORT_C TInt SetMicroSecond(TInt aMicroSecond);
1495 inline TInt Year() const;
1496 inline TMonth Month() const;
1497 inline TInt Day() const;
1498 inline TInt Hour() const;
1499 inline TInt Minute() const;
1500 inline TInt Second() const;
1501 inline TInt MicroSecond() const;
1519 Represents a time interval of a millionth of a second stored as
1522 It supports the initialisation, setting and getting of an interval and provides
1523 standard comparison operations. Objects of this class can be added to and
1524 subtracted from TTime objects.
1528 class TTimeIntervalMicroSeconds
1531 inline TTimeIntervalMicroSeconds();
1532 inline TTimeIntervalMicroSeconds(const TInt64& aInterval);
1533 inline TTimeIntervalMicroSeconds& operator=(const TInt64& aInterval);
1534 inline TBool operator==(const TTimeIntervalMicroSeconds& aInterval) const;
1535 inline TBool operator!=(const TTimeIntervalMicroSeconds& aInterval) const;
1536 inline TBool operator>=(const TTimeIntervalMicroSeconds& aInterval) const;
1537 inline TBool operator<=(const TTimeIntervalMicroSeconds& aInterval) const;
1538 inline TBool operator>(const TTimeIntervalMicroSeconds& aInterval) const;
1539 inline TBool operator<(const TTimeIntervalMicroSeconds& aInterval) const;
1540 inline const TInt64& Int64() const;
1552 Provides a base class for all time interval classes using
1553 a 32-bit representation.
1555 It supports retrieving the interval and provides various operations for
1556 comparing intervals. Its concrete derived classes can be added to and
1557 subtracted from a TTime.
1559 The comparison operators simply compare the integer representations of the
1560 two intervals. They do not take account of different time interval units.
1561 So, for example, when comparing for equality an interval of three hours with
1562 an interval of three days, the result is true.
1566 class TTimeIntervalBase
1569 inline TBool operator==(TTimeIntervalBase aInterval) const;
1570 inline TBool operator!=(TTimeIntervalBase aInterval) const;
1571 inline TBool operator>=(TTimeIntervalBase aInterval) const;
1572 inline TBool operator<=(TTimeIntervalBase aInterval) const;
1573 inline TBool operator>(TTimeIntervalBase aInterval) const;
1574 inline TBool operator<(TTimeIntervalBase aInterval) const;
1575 inline TInt Int() const;
1577 inline TTimeIntervalBase();
1578 inline TTimeIntervalBase(TInt aInterval);
1590 Represents a microsecond time interval stored in 32 rather than 64 bits.
1592 Its range is +-2147483647, which is +-35 minutes, 47 seconds. Comparison and
1593 interval retrieval functions are provided by the base class TTimeIntervalBase.
1595 class TTimeIntervalMicroSeconds32 : public TTimeIntervalBase
1598 inline TTimeIntervalMicroSeconds32();
1599 inline TTimeIntervalMicroSeconds32(TInt aInterval);
1600 inline TTimeIntervalMicroSeconds32& operator=(TInt aInterval);
1610 Represents a time interval in seconds.
1612 Comparison and interval retrieval functions
1613 are provided by the base class TTimeIntervalBase.
1615 The range of values which it can represent is +-2147483647, which is equal to
1616 +-24855 days (approximately 68 years).
1618 class TTimeIntervalSeconds : public TTimeIntervalBase
1621 inline TTimeIntervalSeconds();
1622 inline TTimeIntervalSeconds(TInt aInterval);
1623 inline TTimeIntervalSeconds& operator=(TInt aInterval);
1633 Represents a time interval in minutes.
1635 Comparison and interval retrieval functions
1636 are provided by the base class TTimeIntervalBase.
1638 class TTimeIntervalMinutes : public TTimeIntervalBase
1641 inline TTimeIntervalMinutes();
1642 inline TTimeIntervalMinutes(TInt aInterval);
1643 inline TTimeIntervalMinutes& operator=(TInt aInterval);
1653 Represents a time interval in hours.
1655 Comparison and interval retrieval functions
1656 are provided by the base class TTimeIntervalBase.
1658 class TTimeIntervalHours : public TTimeIntervalBase
1661 inline TTimeIntervalHours();
1662 inline TTimeIntervalHours(TInt aInterval);
1663 inline TTimeIntervalHours& operator=(TInt aInterval);
1673 Represents a time interval in days.
1675 Comparison and interval retrieval functions
1676 are provided by the base class TTimeIntervalBase.
1678 class TTimeIntervalDays : public TTimeIntervalBase
1681 inline TTimeIntervalDays();
1682 inline TTimeIntervalDays(TInt aInterval);
1683 inline TTimeIntervalDays& operator=(TInt aInterval);
1693 Represents a time interval in months.
1695 Comparison and interval retrieval functions
1696 are provided by the base class TTimeIntervalBase.
1698 class TTimeIntervalMonths : public TTimeIntervalBase
1701 inline TTimeIntervalMonths();
1702 inline TTimeIntervalMonths(TInt aInterval);
1703 inline TTimeIntervalMonths& operator=(TInt aInterval);
1713 Represents a time interval in years.
1715 Comparison and interval retrieval functions
1716 are provided by the base class TTimeIntervalBase.
1718 class TTimeIntervalYears : public TTimeIntervalBase
1721 inline TTimeIntervalYears();
1722 inline TTimeIntervalYears(TInt aInterval);
1723 inline TTimeIntervalYears& operator=(TInt aInterval);
1732 An enumeration one or both of whose enumerator values may be returned
1739 Indicates that a time is present.
1743 EParseTimePresent=0x1,
1745 Indicates that a date is present.
1749 EParseDatePresent=0x2
1759 Stores and manipulates the date and time.
1761 It represents a date and time as a number of microseconds since midnight,
1762 January 1st, 0 AD nominal Gregorian. BC dates are represented by negative
1763 TTime values. A TTime object may be constructed from a TInt64, a TDateTime
1764 a string literal, or by default, which initialises the time to an arbitrary
1765 value. To access human-readable time information, the TTime may be converted
1766 from a TInt64 into a TDateTime, which represents the date and time as seven
1767 numeric fields and provides functions to extract these fields. Alternatively,
1768 to display the time as text, the time may be formatted and placed into a
1769 descriptor using a variety of formatting commands and which may or may not
1770 honour the system's locale settings. The conversion between time and text may
1771 be performed the other way around, so that a descriptor can be parsed and
1772 converted into a TTime value.
1774 In addition to setting and getting the date and time and converting between
1775 text and time, TTime provides functions to get intervals between times and
1776 standard comparison and arithmetic operators which enable time intervals to
1777 be added or subtracted to or from the time.
1786 inline TTime(const TInt64& aTime);
1787 IMPORT_C TTime(const TDesC& aString);
1788 IMPORT_C TTime(const TDateTime& aDateTime);
1789 inline TTime& operator=(const TInt64& aTime);
1790 IMPORT_C TTime& operator=(const TDateTime& aDateTime);
1791 IMPORT_C void HomeTime();
1792 IMPORT_C void UniversalTime();
1793 IMPORT_C TInt Set(const TDesC& aString);
1794 IMPORT_C TInt HomeTimeSecure();
1795 IMPORT_C TInt UniversalTimeSecure();
1797 IMPORT_C TDateTime DateTime() const;
1798 IMPORT_C TTimeIntervalMicroSeconds MicroSecondsFrom(TTime aTime) const;
1799 IMPORT_C TInt SecondsFrom(TTime aTime,TTimeIntervalSeconds& aInterval) const;
1800 IMPORT_C TInt MinutesFrom(TTime aTime,TTimeIntervalMinutes& aInterval) const;
1801 IMPORT_C TInt HoursFrom(TTime aTime,TTimeIntervalHours& aInterval) const;
1802 IMPORT_C TTimeIntervalDays DaysFrom(TTime aTime) const;
1803 IMPORT_C TTimeIntervalMonths MonthsFrom(TTime aTime) const;
1804 IMPORT_C TTimeIntervalYears YearsFrom(TTime aTime) const;
1806 IMPORT_C TInt DaysInMonth() const;
1807 IMPORT_C TDay DayNoInWeek() const;
1808 IMPORT_C TInt DayNoInMonth() const;
1809 IMPORT_C TInt DayNoInYear() const;
1810 IMPORT_C TInt DayNoInYear(TTime aStartDate) const;
1811 IMPORT_C TInt WeekNoInYear() const;
1812 IMPORT_C TInt WeekNoInYear(TTime aStartDate) const;
1813 IMPORT_C TInt WeekNoInYear(TFirstWeekRule aRule) const;
1814 IMPORT_C TInt WeekNoInYear(TTime aStartDate,TFirstWeekRule aRule) const;
1815 IMPORT_C void FormatL(TDes& aDes,const TDesC& aFormat) const;
1816 IMPORT_C void FormatL(TDes& aDes,const TDesC& aFormat,const TLocale& aLocale) const;
1817 IMPORT_C void RoundUpToNextMinute();
1818 IMPORT_C TInt Parse(const TDesC& aDes,TInt aCenturyOffset=0);
1820 IMPORT_C TTime operator+(TTimeIntervalYears aYear) const;
1821 IMPORT_C TTime operator+(TTimeIntervalMonths aMonth) const;
1822 IMPORT_C TTime operator+(TTimeIntervalDays aDay) const;
1823 IMPORT_C TTime operator+(TTimeIntervalHours aHour) const;
1824 IMPORT_C TTime operator+(TTimeIntervalMinutes aMinute) const;
1825 IMPORT_C TTime operator+(TTimeIntervalSeconds aSecond) const;
1826 IMPORT_C TTime operator+(TTimeIntervalMicroSeconds aMicroSecond) const;
1827 IMPORT_C TTime operator+(TTimeIntervalMicroSeconds32 aMicroSecond) const;
1828 IMPORT_C TTime operator-(TTimeIntervalYears aYear) const;
1829 IMPORT_C TTime operator-(TTimeIntervalMonths aMonth) const;
1830 IMPORT_C TTime operator-(TTimeIntervalDays aDay) const;
1831 IMPORT_C TTime operator-(TTimeIntervalHours aHour) const;
1832 IMPORT_C TTime operator-(TTimeIntervalMinutes aMinute) const;
1833 IMPORT_C TTime operator-(TTimeIntervalSeconds aSecond) const;
1834 IMPORT_C TTime operator-(TTimeIntervalMicroSeconds aMicroSecond) const;
1835 IMPORT_C TTime operator-(TTimeIntervalMicroSeconds32 aMicroSecond) const;
1836 IMPORT_C TTime& operator+=(TTimeIntervalYears aYear);
1837 IMPORT_C TTime& operator+=(TTimeIntervalMonths aMonth);
1838 IMPORT_C TTime& operator+=(TTimeIntervalDays aDay);
1839 IMPORT_C TTime& operator+=(TTimeIntervalHours aHour);
1840 IMPORT_C TTime& operator+=(TTimeIntervalMinutes aMinute);
1841 IMPORT_C TTime& operator+=(TTimeIntervalSeconds aSecond);
1842 IMPORT_C TTime& operator+=(TTimeIntervalMicroSeconds aMicroSecond);
1843 IMPORT_C TTime& operator+=(TTimeIntervalMicroSeconds32 aMicroSecond);
1844 IMPORT_C TTime& operator-=(TTimeIntervalYears aYear);
1845 IMPORT_C TTime& operator-=(TTimeIntervalMonths aMonth);
1846 IMPORT_C TTime& operator-=(TTimeIntervalDays aDay);
1847 IMPORT_C TTime& operator-=(TTimeIntervalHours aHour);
1848 IMPORT_C TTime& operator-=(TTimeIntervalMinutes aMinute);
1849 IMPORT_C TTime& operator-=(TTimeIntervalSeconds aSecond);
1850 IMPORT_C TTime& operator-=(TTimeIntervalMicroSeconds aMicroSecond);
1851 IMPORT_C TTime& operator-=(TTimeIntervalMicroSeconds32 aMicroSecond);
1852 inline TBool operator==(TTime aTime) const;
1853 inline TBool operator!=(TTime aTime) const;
1854 inline TBool operator>=(TTime aTime) const;
1855 inline TBool operator<=(TTime aTime) const;
1856 inline TBool operator>(TTime aTime) const;
1857 inline TBool operator<(TTime aTime) const;
1858 inline const TInt64& Int64() const;
1860 static TTime Convert(const TDateTime& aDateTime);
1873 A utility class whose functions may be used by the other date/time related
1879 IMPORT_C static TTime NullTTime();
1880 IMPORT_C static TTime MaxTTime();
1881 IMPORT_C static TTime MinTTime();
1882 IMPORT_C static TInt DaysInMonth(TInt aYear, TMonth aMonth);
1883 IMPORT_C static TBool IsLeapYear(TInt aYear);
1884 IMPORT_C static TInt LeapYearsUpTo(TInt aYear);
1894 Gets a copy of the current locale's full text name for a day of the week.
1896 After construction or after a call to Set(), the copy of the text can be accessed
1897 and manipulated using the standard descriptor member functions provided by
1902 class TDayName : public TBuf<KMaxDayName>
1905 IMPORT_C TDayName();
1906 IMPORT_C TDayName(TDay aDay);
1907 IMPORT_C void Set(TDay aDay);
1917 Gets a copy of the current locale's abbreviated text name for a day of the
1920 After construction or after a call to Set(), the copy of the abbreviated text
1921 can be accessed and manipulated using the standard descriptor member functions
1922 provided by the base class.
1924 The abbreviated day name cannot be assumed to be one character. In English,
1925 it is 3 characters (Mon, Tue, Wed etc.), but the length can vary from locale
1926 to locale, with a maximum length of KMaxDayNameAbb.
1930 class TDayNameAbb : public TBuf<KMaxDayNameAbb>
1933 IMPORT_C TDayNameAbb();
1934 IMPORT_C TDayNameAbb(TDay aDay);
1935 IMPORT_C void Set(TDay aDay);
1945 Gets a copy of the current locale's full text name for a month.
1947 After construction or after a call to Set(), the copy of the text can be accessed
1948 and manipulated using the standard descriptor member functions provided by
1953 class TMonthName : public TBuf<KMaxMonthName>
1956 IMPORT_C TMonthName();
1957 IMPORT_C TMonthName(TMonth aMonth);
1958 IMPORT_C void Set(TMonth aMonth);
1968 Gets a copy of the current locale's abbreviated text name for a month.
1970 After construction or after a call to Set(), the copy of the abbreviated text
1971 can be accessed and manipulated using the standard descriptor member functions
1972 provided by the base class.
1974 @see KMaxMonthNameAbb
1976 class TMonthNameAbb : public TBuf<KMaxMonthNameAbb>
1979 IMPORT_C TMonthNameAbb();
1980 IMPORT_C TMonthNameAbb(TMonth aMonth);
1981 IMPORT_C void Set(TMonth aMonth);
1991 Gets a copy of the current locale's date suffix text for a specific day in
1994 The text is the set of characters which can be appended to dates of the month
1995 (e.g. in English, st for 1st, nd for 2nd etc).
1997 After construction or after a call to Set(), the copy of the suffix text can
1998 be accessed and manipulated using the standard descriptor member functions
1999 provided by the base class.
2001 class TDateSuffix : public TBuf<KMaxSuffix>
2004 IMPORT_C TDateSuffix();
2005 IMPORT_C TDateSuffix(TInt aDateSuffix);
2006 IMPORT_C void Set(TInt aDateSuffix);
2016 Current locale's am/pm text
2018 This class retrieves a copy of the current locale's text identifying time
2019 before and after noon. In English, this is am and pm.
2021 After construction or after a call to Set(), the copy of the text can be accessed
2022 and manipulated using the standard descriptor member functions provided by
2025 class TAmPmName : public TBuf<KMaxAmPmName>
2028 IMPORT_C TAmPmName();
2029 IMPORT_C TAmPmName(TAmPm aSelector);
2030 IMPORT_C void Set(TAmPm aSelector);
2040 Gets a copy of the currency symbol(s) in use by the current locale.
2042 After construction or after a call to TCurrencySymbol::Set(), the copy of
2043 the currency symbol(s) can be accessed and manipulated using the standard
2044 descriptor member functions provided by the base class.
2046 class TCurrencySymbol : public TBuf<KMaxCurrencySymbol>
2049 IMPORT_C TCurrencySymbol();
2050 IMPORT_C void Set();
2060 Contains a format list that defines the short date format.
2062 An instance of this class should be passed as the second argument
2063 to TTime::FormatL().
2064 The string does not include any time components. The content of the long
2065 date format specification is taken from the system-wide settings.
2067 For example, in the English locale, the short date format would be something
2070 This class is used as follows:
2075 TBuf<KMaxShortDateFormatSpec*2> buffer;
2076 now.FormatL(buffer,TShortDateFormatSpec());
2079 @see KMaxShortDateFormatSpec
2082 class TShortDateFormatSpec : public TBuf<KMaxShortDateFormatSpec> // to be passed into TTime::FormatL
2085 IMPORT_C TShortDateFormatSpec();
2086 IMPORT_C void Set();
2096 Contains a format list that defines the long date format.
2098 An instance of this class should be passed as the second argument
2099 to TTime::FormatL().
2100 The string does not include any time components. The content of the long
2101 date format specification is taken from the system-wide settings.
2103 For example, in the English locale, the long date format would be
2104 something like 14th January 2000.
2106 This class is used as follows:
2111 TBuf<KMaxLongDateFormatSpec*2> buffer;
2112 now.FormatL(buffer,TLongDateFormatSpec());
2115 @see KMaxLongDateFormatSpec
2118 class TLongDateFormatSpec : public TBuf<KMaxLongDateFormatSpec> // to be passed into TTime::FormatL
2121 IMPORT_C TLongDateFormatSpec();
2122 IMPORT_C void Set();
2132 Contains a format list that defines the time string format.
2134 An instance of this class should be passed as the second argument
2135 to TTime::FormatL().
2136 The string does not include any time components. The content of the time format
2137 specification is taken from the system-wide settings.
2139 This class is used as follows:
2144 TBuf<KMaxTimeFormatSpec*2> buffer;
2145 now.FormatL(buffer,TTimeFormatSpec());
2148 @see KMaxTimeFormatSpec
2151 class TTimeFormatSpec : public TBuf<KMaxTimeFormatSpec> // to be passed into TTime::FormatL
2154 IMPORT_C TTimeFormatSpec();
2155 IMPORT_C void Set();
2165 Sets and gets the system's locale settings.
2167 Symbian OS maintains the locale information internally. On
2168 construction, this object is initialized with the system information
2169 for all locale items.
2176 Indicates how negative currency values are formatted.
2178 enum TNegativeCurrencyFormat
2181 A minus sign is inserted before the currency symbol and value.
2186 The currency value and symbol are enclosed in brackets (no minus sign
2189 EInBrackets, //this one must be non-zero for binary compatibility with the old TBool TLocale::iCurrencyNegativeInBrackets which was exposed in the binary interface because it was accessed via *inline* functions
2192 A minus sign is inserted after the currency symbol and value.
2197 A minus sign is inserted between the currency symbol and the value.
2199 EInterveningMinusSign
2203 Flags for negative currency values formatting
2208 If this flag is set and the currency value being formatted is negative,
2209 if there is a space between the currency symbol and the value,
2212 EFlagNegativeLoseSpace = 0x00000001,
2215 If this flag is set and the currency value being formatted is negative,
2216 the position of the currency symbol is placed in the opposite direction
2217 from the position set for the positive currency value.
2219 EFlagNegativeCurrencySymbolOpposite=0x00000002
2221 /** Indicates how the device universal time is maintained */
2222 enum TDeviceTimeState
2224 /** Universal time is maintained by the device RTC and the user selection
2225 of the locale of the device indicating offset from GMT and daylight saving*/
2228 /** Universal time and offset from GMT is supplied by the mobile network
2229 and maintained by device RTC */
2230 ENITZNetworkTimeSync
2234 inline TLocale(TInt);
2235 IMPORT_C void Refresh();
2236 IMPORT_C TInt Set() const;
2237 IMPORT_C void FormatCurrency(TDes& aText, TInt aAmount);
2238 IMPORT_C void FormatCurrency(TDes& aText, TInt64 aAmount);
2239 IMPORT_C void FormatCurrency(TDes& aText, TDesOverflow& aOverflowHandler, TInt aAmount);
2240 IMPORT_C void FormatCurrency(TDes& aText, TDesOverflow& aOverflowHandler, TInt64 aAmount);
2242 inline TInt CountryCode() const;
2243 inline void SetCountryCode(TInt aCode);
2244 inline TTimeIntervalSeconds UniversalTimeOffset() const;
2245 inline TDateFormat DateFormat() const;
2246 inline void SetDateFormat(TDateFormat aFormat);
2247 inline TTimeFormat TimeFormat() const;
2248 inline void SetTimeFormat(TTimeFormat aFormat);
2249 inline TLocalePos CurrencySymbolPosition() const;
2250 inline void SetCurrencySymbolPosition(TLocalePos aPos);
2251 inline TBool CurrencySpaceBetween() const;
2252 inline void SetCurrencySpaceBetween(TBool aSpace);
2253 inline TInt CurrencyDecimalPlaces() const;
2254 inline void SetCurrencyDecimalPlaces(TInt aPlaces);
2255 inline TBool CurrencyNegativeInBrackets() const; // These two functions are deprecated
2256 inline void SetCurrencyNegativeInBrackets(TBool aBool); // They are here to maintain compatibility. Use the New functions -> NegativeCurrencyFormat setter/getter.
2257 inline TBool CurrencyTriadsAllowed() const;
2258 inline void SetCurrencyTriadsAllowed(TBool aBool);
2259 inline TChar ThousandsSeparator() const;
2260 inline void SetThousandsSeparator(const TChar& aChar);
2261 inline TChar DecimalSeparator() const;
2262 inline void SetDecimalSeparator(const TChar& aChar);
2263 inline TChar DateSeparator(TInt aIndex) const;
2264 inline void SetDateSeparator(const TChar& aChar,TInt aIndex);
2265 inline TChar TimeSeparator(TInt aIndex) const;
2266 inline void SetTimeSeparator(const TChar& aChar,TInt aIndex);
2267 inline TBool AmPmSpaceBetween() const;
2268 inline void SetAmPmSpaceBetween(TBool aSpace);
2269 inline TLocalePos AmPmSymbolPosition() const;
2270 inline void SetAmPmSymbolPosition(TLocalePos aPos);
2271 inline TUint DaylightSaving() const;
2272 inline TBool QueryHomeHasDaylightSavingOn() const;
2273 inline TDaylightSavingZone HomeDaylightSavingZone() const;
2274 inline TUint WorkDays() const;
2275 inline void SetWorkDays(TUint aMask);
2276 inline TDay StartOfWeek() const;
2277 inline void SetStartOfWeek(TDay aDay);
2278 inline TClockFormat ClockFormat() const;
2279 inline void SetClockFormat(TClockFormat aFormat);
2280 inline TUnitsFormat UnitsGeneral() const;
2281 inline void SetUnitsGeneral(TUnitsFormat aFormat);
2282 inline TUnitsFormat UnitsDistanceShort() const;
2283 inline void SetUnitsDistanceShort(TUnitsFormat aFormat);
2284 inline TUnitsFormat UnitsDistanceLong() const;
2285 inline void SetUnitsDistanceLong(TUnitsFormat aFormat);
2286 inline TNegativeCurrencyFormat NegativeCurrencyFormat() const;
2287 inline void SetNegativeCurrencyFormat(TNegativeCurrencyFormat aNegativeCurrencyFormat);
2288 inline TBool NegativeLoseSpace() const;
2289 inline void SetNegativeLoseSpace(TBool aBool);
2290 inline TBool NegativeCurrencySymbolOpposite() const;
2291 inline void SetNegativeCurrencySymbolOpposite(TBool aBool);
2292 inline TLanguage LanguageDowngrade(TInt aIndex) const; // 0 <= aIndex < 3
2293 inline void SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage);
2294 inline TDigitType DigitType() const;
2295 inline void SetDigitType(TDigitType aDigitType);
2296 inline TDeviceTimeState DeviceTime() const;
2297 inline void SetDeviceTime(TDeviceTimeState aState);
2299 void SetDefaults(); /**< @internalComponent */
2302 friend class TExtendedLocale;
2305 TTimeIntervalSeconds iUniversalTimeOffset;
2306 TDateFormat iDateFormat;
2307 TTimeFormat iTimeFormat;
2308 TLocalePos iCurrencySymbolPosition;
2309 TBool iCurrencySpaceBetween;
2310 TInt iCurrencyDecimalPlaces;
2311 TNegativeCurrencyFormat iNegativeCurrencyFormat; // replaced TBool iCurrencyNegativeInBrackets
2312 TBool iCurrencyTriadsAllowed;
2313 TChar iThousandsSeparator;
2314 TChar iDecimalSeparator;
2315 TChar iDateSeparator[KMaxDateSeparators];
2316 TChar iTimeSeparator[KMaxTimeSeparators];
2317 TLocalePos iAmPmSymbolPosition;
2318 TBool iAmPmSpaceBetween;
2319 TUint iDaylightSaving;
2320 TDaylightSavingZone iHomeDaylightSavingZone;
2323 TClockFormat iClockFormat;
2324 TUnitsFormat iUnitsGeneral;
2325 TUnitsFormat iUnitsDistanceShort;
2326 TUnitsFormat iUnitsDistanceLong;
2327 TUint iExtraNegativeCurrencyFormatFlags;
2328 TUint16 iLanguageDowngrade[3];
2330 TDigitType iDigitType;
2331 TDeviceTimeState iDeviceTimeState;
2339 const TUint KLocaleLanguageKey = 0x10208903;
2344 const TUint KLocaleDataKey = 0x10208904;
2349 const TUint KLocaleDataExtraKey = 0x10208905;
2354 const TUint KLocaleTimeDateFormatKey = 0x10208907;
2359 const TUint KLocaleDefaultCharSetKey = 0x10208908;
2364 const TUint KLocalePreferredCharSetKey = 0x10208909;
2369 enum TLocaleFunctions
2389 FnShortDateFormatSpec,
2390 FnLongDateFormatSpec,
2392 FnFatUtilityFunctions
2402 Enumeration used with TExtendedLocale::LoadLocaleAspect to select which
2403 locale information is to be replaced from the contents of the Locale
2406 ELocaleLanguageSettings - Replaces everything that should change with
2407 language selection e.g. Month names, Day names,
2410 ELocaleLocaleSettings - Replaces the currently selected currency symbol,
2411 TLocale settings, and FAT utility functions
2413 ELocaleTimeAndDateSettings - Replaces the current time and date display
2416 ELocaleCollateSettings - Replaces the "system" preferred Charset
2417 (because that's where the collation table
2418 is!). The "Default" charset will remain
2419 unchanged until after the next power
2424 ELocaleLanguageSettings = 0x01,
2425 ELocaleCollateSetting = 0x02,
2426 ELocaleLocaleSettings = 0x04,
2427 ELocaleTimeDateSettings = 0x08,
2433 struct SLocaleLanguage
2435 TLanguage iLanguage;
2436 const TText* iDateSuffixTable;
2437 const TText* iDayTable;
2438 const TText* iDayAbbTable;
2439 const TText* iMonthTable;
2440 const TText* iMonthAbbTable;
2441 const TText* iAmPmTable;
2442 const TText16* const* iMsgTable;
2448 struct SLocaleLocaleSettings
2450 TText iCurrencySymbol[KMaxCurrencySymbol+1];
2451 TAny* iLocaleExtraSettingsDllPtr;
2457 struct SLocaleTimeDateFormat
2459 TText iShortDateFormatSpec[KMaxShortDateFormatSpec+1];
2460 TText iLongDateFormatSpec[KMaxLongDateFormatSpec+1];
2461 TText iTimeFormatSpec[KMaxTimeFormatSpec+1];
2462 TAny* iLocaleTimeDateFormatDllPtr;
2471 Extended locale class
2473 This class holds a collection of locale information. It contains a TLocale internally.
2474 It has methods to load a locale DLL and to set the system wide locale information.
2477 class TExtendedLocale
2481 // Default constructor, create an empty instance
2482 IMPORT_C TExtendedLocale();
2484 // Initialise to (or restore from!) current system wide locale
2486 IMPORT_C void LoadSystemSettings();
2488 // Overwrite current system wide locale settings with the current
2489 // contents of this TExtendedLocale
2490 IMPORT_C TInt SaveSystemSettings();
2492 // Load a complete set of locale data from a named Locale DLL
2493 IMPORT_C TInt LoadLocale(const TDesC& aLocaleDllName);
2495 // Load an additional Locale DLL and over-ride a selected subset
2496 // (currently ELocaleLanguageSettings to select an alternative set
2497 // of language specific text strings, ELocaleCollateSetting to
2498 // select a new system collation table,
2499 // ELocaleOverRideMatchCollationTable to locally select an
2500 // alternative collation order for matching text strings, or
2501 // ELocaleOverRideSortCollationTable for ordering text strings)
2502 // of settings with its contents
2503 IMPORT_C TInt LoadLocaleAspect(TUint aAspectGroup, const TDesC& aLocaleDllName);
2505 // Set the currency Symbol
2506 IMPORT_C TInt SetCurrencySymbol(const TDesC &aSymbol);
2508 // Get the name of the DLL holding the data for a particular set
2509 // of Locale properties
2510 IMPORT_C TInt GetLocaleDllName(TLocaleAspect aLocaleDataSet, TDes& aDllName);
2512 // Get the preferred collation method.
2513 // Note that some Charsets may contain more than one Collation
2514 // method (e.g "dictionary" v "phonebook" ordering) so an optional
2515 // index parameter can be used to select between them
2516 IMPORT_C TCollationMethod GetPreferredCollationMethod(TInt index = 0) ;
2518 //Get the Currency Symbol
2519 IMPORT_C TPtrC GetCurrencySymbol();
2521 //Get the Long Date Format
2522 IMPORT_C TPtrC GetLongDateFormatSpec();
2524 //Get the Short Date Format
2525 IMPORT_C TPtrC GetShortDateFormatSpec();
2527 //Get the Time Format
2528 IMPORT_C TPtrC GetTimeFormatSpec();
2530 // Retrieve a reference to the encapsulated TLocale
2531 inline TLocale* GetLocale();
2535 TInt DoLoadLocale(const TDesC& aLocaleDllName, TLibraryFunction* aExportList);
2536 void DoUpdateLanguageSettings(TLibraryFunction* aExportList);
2537 void DoUpdateLocaleSettings(TLibraryFunction* aExportList);
2538 void DoUpdateTimeDateFormat(TLibraryFunction* aExportList);
2543 SLocaleLanguage iLanguageSettings;
2544 SLocaleLocaleSettings iLocaleExtraSettings;
2545 SLocaleTimeDateFormat iLocaleTimeDateFormat;
2546 const LCharSet* iDefaultCharSet;
2547 const LCharSet* iPreferredCharSet;
2557 Geometric rectangle.
2559 The class represents a rectangle whose sides are parallel with the axes of
2560 the co-ordinate system.
2562 The co-ordinates of the top-left and bottom-right corners are used to set
2563 the dimensions of the rectangle. The bottom right co-ordinate is outside the
2564 rectangle. Thus TRect(TPoint(2,2),TSize(4,4)) is equal
2565 to TRect(TPoint(2,2),TPoint(6,6)),
2566 and in both cases you get a 4x4 pixel rectangle on the screen.
2568 Functions are provided to initialise and manipulate the rectangle and to extract
2569 information about it.
2574 enum TUninitialized { EUninitialized };
2576 Constructs a default rectangle.
2578 This initialises the co-ordinates of its top
2579 left and bottom right corners to (0,0).
2581 TRect(TUninitialized) {}
2583 IMPORT_C TRect(TInt aAx,TInt aAy,TInt aBx,TInt aBy);
2584 IMPORT_C TRect(const TPoint& aPointA,const TPoint& aPointB);
2585 IMPORT_C TRect(const TPoint& aPoint,const TSize& aSize);
2586 IMPORT_C TRect(const TSize& aSize);
2587 IMPORT_C TBool operator==(const TRect& aRect) const;
2588 IMPORT_C TBool operator!=(const TRect& aRect) const;
2589 IMPORT_C void SetRect(TInt aAx,TInt aAy,TInt aBx,TInt aBy);
2590 IMPORT_C void SetRect(const TPoint& aPointTL,const TPoint& aPointBR);
2591 IMPORT_C void SetRect(const TPoint& aPoint,const TSize& aSize);
2592 IMPORT_C void Move(TInt aDx,TInt aDy);
2593 IMPORT_C void Move(const TPoint& aOffset);
2594 IMPORT_C void Resize(TInt aDx,TInt aDy);
2595 IMPORT_C void Resize(const TSize& aSize);
2596 IMPORT_C void Shrink(TInt aDx,TInt aDy);
2597 IMPORT_C void Shrink(const TSize& aSize);
2598 IMPORT_C void Grow(TInt aDx,TInt aDy);
2599 IMPORT_C void Grow(const TSize& aSize);
2600 IMPORT_C void BoundingRect(const TRect& aRect);
2601 IMPORT_C TBool IsEmpty() const;
2602 IMPORT_C TBool Intersects(const TRect& aRect) const;
2603 IMPORT_C void Intersection(const TRect& aRect);
2604 IMPORT_C void Normalize();
2605 IMPORT_C TBool Contains(const TPoint& aPoint) const;
2606 IMPORT_C TSize Size() const;
2607 IMPORT_C TInt Width() const;
2608 IMPORT_C TInt Height() const;
2609 IMPORT_C TBool IsNormalized() const;
2610 IMPORT_C TPoint Center() const;
2611 IMPORT_C void SetSize(const TSize& aSize);
2612 IMPORT_C void SetWidth(TInt aWidth);
2613 IMPORT_C void SetHeight(TInt aHeight);
2615 void Adjust(TInt aDx,TInt aDy);
2618 The x and y co-ordinates of the top left hand corner of the rectangle.
2623 The x and y co-ordinates of the bottom right hand corner of the rectangle.
2635 Clipping region - abstract base class.
2637 This abstract base class represents a 2-dimensional area which is used by
2638 Graphics, the graphics window server, and the text window server to define
2639 regions of the display which need to be updated, or regions within which all
2640 operations must occur.
2642 A TRegion is defined in terms of an array of TRects and the more complex the
2643 region, the more TRects are required to represent it.
2645 A clipping region initially has space allocated for five rectangles.
2646 If manipulations result in a region which requires more than this, an attempt
2647 is made to allocate more rectangles. If this cannot be done, an error flag
2648 is set, and all subsequent operations involving the region have no effect
2649 (except possibly to propagate the error flag to other regions).
2650 The CheckError() member function allows
2651 the error flag to be tested; Clear() can be used to clear it.
2653 The redraw logic of application programs may use the TRegion in various ways:
2655 1. minimally, they pass it to the graphics context as the clipping region; when
2656 a graphics context is activated to a window, the clipping region is set up
2659 2. if they wish to avoid redrawing objects which are outside the general area
2660 of the region, they may use TRegion::BoundingRect() to return the rectangle
2661 which bounds the clipping region, and draw only primitives that lie within
2664 3. if they wish to exercise finer control, they may extract the individual rectangles
2665 that comprise the clipping region using Operator[]().
2667 Application programs may also manipulate clipping regions in order to constrain
2668 parts of their redrawing to narrower areas of the screen than the clipping
2669 region offered by the window server. To do this, functions that allow clipping
2670 region manipulation may be used; for example, adding or removing rectangles
2671 or finding the intersection or union of two regions.
2676 inline TInt Count() const;
2677 inline const TRect* RectangleList() const;
2678 inline TBool CheckError() const;
2679 IMPORT_C TBool IsEmpty() const;
2680 IMPORT_C TRect BoundingRect() const;
2681 IMPORT_C const TRect& operator[](TInt aIndex) const;
2682 IMPORT_C void Copy(const TRegion& aRegion);
2683 IMPORT_C void AddRect(const TRect& aRect);
2684 IMPORT_C void SubRect(const TRect& aRect,TRegion* aSubtractedRegion=NULL);
2685 IMPORT_C void Offset(TInt aXoffset,TInt aYoffset);
2686 IMPORT_C void Offset(const TPoint& aOffset);
2687 IMPORT_C void Union(const TRegion& aRegion);
2688 IMPORT_C void Intersection(const TRegion& aRegion,const TRegion& aRegion2);
2689 IMPORT_C void Intersect(const TRegion& aRegion);
2690 IMPORT_C void SubRegion(const TRegion& aRegion,TRegion* aSubtractedRegion=NULL);
2691 IMPORT_C void ClipRect(const TRect& aRect);
2692 IMPORT_C void Clear();
2693 IMPORT_C void Tidy();
2694 IMPORT_C TInt Sort();
2695 IMPORT_C TInt Sort(const TPoint& aOffset);
2696 IMPORT_C void ForceError();
2697 IMPORT_C TBool IsContainedBy(const TRect& aRect) const;
2698 IMPORT_C TBool Contains(const TPoint& aPoint) const;
2699 IMPORT_C TBool Intersects(const TRect& aRect) const;
2701 IMPORT_C TRect* RectangleListW();
2702 IMPORT_C TRegion(TInt aAllocedRects);
2704 TBool SetListSize(TInt aCount);
2705 void AppendRect(const TRect& aRect);
2706 void DeleteRect(TRect* aRect);
2707 void AppendRegion(TRegion& aRegion);
2708 void MergeRect(const TRect& aRect, TBool aEnclosed);
2709 void SubtractRegion(const TRegion &aRegion,TRegion *aSubtractedRegion=NULL);
2710 void ShrinkRegion();
2711 TRect* ExpandRegion(TInt aCount);
2717 enum {ERRegionBuf=0x40000000};
2729 This class provides for the construction and destruction of a TRegion, including
2730 a granularity for expanding the region. A region;s granularity represents
2731 the number of memory slots allocated when the object is created, and the number
2732 of new memory slots allocated each time an RRegion is expanded beyond the
2733 number of free slots. The default granularity is five.
2735 class RRegion : public TRegion
2738 enum {EDefaultGranularity=5};
2740 IMPORT_C RRegion(TInt aBuf,TInt aGran);
2743 IMPORT_C RRegion(TInt aGran);
2744 IMPORT_C RRegion(const RRegion& aRegion);
2745 IMPORT_C RRegion(const TRect& aRect,TInt aGran=EDefaultGranularity);
2746 IMPORT_C RRegion(TInt aCount,TRect* aRectangleList,TInt aGran=EDefaultGranularity);
2747 IMPORT_C void Close();
2748 IMPORT_C void Destroy();
2749 inline TInt CheckSpare() const;
2752 TRect* iRectangleList;
2753 friend class TRegion;
2763 Region with pre-allocated buffer.
2765 This class provides the functionality of an RRegion, but in addition, for
2766 optimisation purposes, uses a buffer containing pre-allocated space for as
2767 many rectangles as are specified in the granularity.
2769 When this buffer is full, cell allocation takes place as for an RRegion, and
2770 the RRegionBuf effectively becomes an RRegion. In this case, the region does
2771 not revert to using the buffer, even if the region were to shrink so that
2772 the buffer could, once again, contain the region. When the region is no longer
2773 required, call Close(), defined in the base class RRegion, to free up all
2777 class RRegionBuf : public RRegion
2780 inline RRegionBuf();
2781 inline RRegionBuf(const RRegion& aRegion);
2782 inline RRegionBuf(const RRegionBuf<S>& aRegion);
2783 inline RRegionBuf(const TRect& aRect);
2785 TInt8 iRectangleBuf[S*sizeof(TRect)];
2795 A fixed size region.
2797 The region consists of a fixed number of rectangles; this number is specified
2798 in the templated argument. The region cannot be expanded to contain more than
2799 this number of rectangles. If an attempt is made to do so, the region's
2800 error flag is set, and the region is cleared.
2802 Note that when adding a rectangle to a region, if that rectangle overlaps
2803 an existing rectangle, the operation causes more than one rectangle to be
2807 class TRegionFix : public TRegion
2810 inline TRegionFix();
2811 inline TRegionFix(const TRect& aRect);
2812 inline TRegionFix(const TRegionFix<S>& aRegion);
2814 TInt8 iRectangleBuf[S*sizeof(TRect)];
2824 Base class for searching for global kernel objects.
2826 This is the base class for a number of classes which are used to find specific
2827 types of global kernel object such as semaphores, threads and mutexes;
2828 TFindSemaphore, TFindThread and TFindMutex are typical examples of such
2831 The class implements the common behaviour, specifically, the storage of the
2832 match pattern which is used to search for object names.
2834 This class is not intended to be explicitly instantiated; it has public
2835 constructors but they are part of the class implementation and are described
2836 for information only.
2838 class TFindHandleBase : public TFindHandle
2841 IMPORT_C TFindHandleBase();
2842 IMPORT_C TFindHandleBase(const TDesC& aMatch);
2843 IMPORT_C void Find(const TDesC& aMatch);
2845 TInt NextObject(TFullName& aResult,TInt aObjectType);
2849 The full name of the last kernel side object found.
2861 Finds all global semaphores whose full names match a specified pattern.
2863 The match pattern can be set into the TFindSemaphore object at construction;
2864 it can also be changed at any time after construction by using the Find()
2865 member function of the TFindHandleBase base class.
2867 After construction, the Next() member function can be used repeatedly to find
2868 successive global semaphores whose full names match the current pattern.
2870 A successful call to Next() means that a matching global semaphore has been
2871 found. To open a handle on this semaphore, call the RSemaphore::Open() function
2872 and pass a reference to this TFindSemaphore.
2874 Pattern matching is part of descriptor behaviour.
2876 @see TFindHandleBase::Find
2877 @see TFindSemaphore::Next
2878 @see RSemaphore::Open
2882 class TFindSemaphore : public TFindHandleBase
2885 inline TFindSemaphore();
2886 inline TFindSemaphore(const TDesC& aMatch);
2887 IMPORT_C TInt Next(TFullName& aResult);
2897 Finds all global mutexes whose full names match a specified pattern.
2899 The match pattern can be set into the object at construction; it can also
2900 be changed at any time after construction by using the Find() member function
2903 After construction, the Next() member function may be used repeatedly to find
2904 successive global mutexes whose full names match the current pattern.
2906 A successful call to Next() means that a matching global mutex has been found.
2907 To open a handle on this mutex, call the Open() member function of RMutex
2908 and pass a reference to this TFindMutex object.
2910 Pattern matching is part of descriptors behaviour.
2912 @see TFindHandleBase::Find
2913 @see TFindMutex::Next
2918 class TFindMutex : public TFindHandleBase
2921 inline TFindMutex();
2922 inline TFindMutex(const TDesC& aMatch);
2923 IMPORT_C TInt Next(TFullName& aResult);
2933 Searches for all global chunks by pattern matching against the names of (Kernel
2934 side) chunk objects.
2936 The match pattern can be set into this object at construction; it can also
2937 be changed at any time after construction by using TFindHandleBase::Find().
2939 After construction, call TFindChunk::Next() repeatedly to find successive
2940 chunks whose names match the current pattern. A successful call
2941 to TFindChunk::Next() means that a matching chunk has been found.
2943 @see TFindHandleBase
2945 class TFindChunk : public TFindHandleBase
2948 inline TFindChunk();
2949 inline TFindChunk(const TDesC& aMatch);
2950 IMPORT_C TInt Next(TFullName& aResult);
2961 Searches for threads by pattern matching against the names
2964 The match pattern can be set into this object at construction; it can also be
2965 changed at any time after construction by using TFindHandleBase::Find().
2967 After construction, call TFindThread::Next() repeatedly to find successive
2968 threads whose names match the current pattern.
2969 A successful call to TFindThread::Next() means that a matching thread has
2970 been found. To open a handle on this thread, call RThread::Open() and pass
2971 a reference to this TFindThread.
2975 class TFindThread : public TFindHandleBase
2978 inline TFindThread();
2979 inline TFindThread(const TDesC& aMatch);
2980 IMPORT_C TInt Next(TFullName& aResult);
2990 Searches for processes by pattern matching against the names
2993 The match pattern can be set into this object at construction; it can also be
2994 changed at any time after construction by using TFindHandleBase::Find().
2996 After construction, call TFindProcess::Next() repeatedly to find successive
2997 processes whose names match the current pattern.
2998 A successful call to TFindProcess::Next() means that a matching process has
2999 been found. To open a handle on this process, call RProcess::Open() and pass
3000 a reference to this TFindProcess.
3004 class TFindProcess : public TFindHandleBase
3007 inline TFindProcess();
3008 inline TFindProcess(const TDesC& aMatch);
3009 IMPORT_C TInt Next(TFullName& aResult);
3018 Searches for LDD factory objects by pattern matching against the names of
3019 LDD factory objects.
3021 An LDD factory object is an instance of a DLogicalDevice derived class.
3023 The match pattern can be set into this object at construction; it can also
3024 be changed at any time after construction by using TFindHandleBase::Find().
3026 After construction, call TFindLogicalDevice::Next() repeatedly to find successive
3027 LDD factory objects whose names match the current pattern. A successful call to
3028 TFindLogicalDevice::Next() means that a matching LDD factory object has been found.
3030 The name of an LDD factory object is set by its Install() member function as
3031 part of the construction process.
3033 class TFindLogicalDevice : public TFindHandleBase
3036 inline TFindLogicalDevice();
3037 inline TFindLogicalDevice(const TDesC& aMatch);
3038 IMPORT_C TInt Next(TFullName& aResult);
3045 Searches for PDD factory objects by pattern matching against the names of
3046 PDD factory objects.
3048 A PDD factory object is an instance of a DPhysicalDevice derived class.
3050 The match pattern can be set into this object at construction; it can also be
3051 changed at any time after construction by using TFindHandleBase::Find().
3053 After construction, call TFindPhysicalDevice::Next() repeatedly to find successive
3054 PDD factory objects whose names match the current pattern. A successful call to
3055 TFindPhysicalDevice::Next() means that a matching PDD factory object has been found.
3057 The name of a PDD factory object is set by its Install() member function as part
3058 of the construction process.
3060 class TFindPhysicalDevice : public TFindHandleBase
3063 inline TFindPhysicalDevice();
3064 inline TFindPhysicalDevice(const TDesC& aMatch);
3065 IMPORT_C TInt Next(TFullName& aResult);
3076 Searches for servers by pattern matching against the names of kernel side
3079 The match pattern can be set into this object at construction; it can also
3080 be changed at any time after construction by using the TFindHandleBase::Find()
3083 After construction, call TFindServer::Next() repeatedly to find successive
3084 servers whose names match the current pattern.
3085 A successful call to TFindServer::Next() means that a matching server
3088 class TFindServer : public TFindHandleBase
3091 inline TFindServer();
3092 inline TFindServer(const TDesC& aMatch);
3093 IMPORT_C TInt Next(TFullName& aResult);
3103 Searches for DLLs whose full names match a specified pattern.
3105 The match pattern is set at construction but can also be changed at any time
3106 after construction by using TFindHandleBase::Find().
3108 After construction, use TFindLibrary::Next() to repeatedly find successive DLLs
3109 whose names match the current pattern. A successful call to
3110 TFindLibrary::Next() means that a matching DLL has been found.
3112 class TFindLibrary : public TFindHandleBase
3115 inline TFindLibrary();
3116 inline TFindLibrary(const TDesC& aMatch);
3117 IMPORT_C TInt Next(TFullName& aResult);
3126 User side handle to an LDD factory object, an instance of a DLogicalDevice
3129 The LDD factory object is a Kernel side object which is constructed on the
3130 Kernel heap when the logical device is opened using User::LoadLogicalDevice().
3131 The handle allows the User side to get information about the logical device.
3133 To use the device, a thread must create and use an instance of an
3134 RBusLogicalChannel derived class.
3137 class RDevice : public RHandleBase
3140 inline TInt Open(const TFindLogicalDevice& aFind,TOwnerType aType=EOwnerProcess);
3141 IMPORT_C TInt Open(const TDesC& aName,TOwnerType aType=EOwnerProcess);
3142 IMPORT_C void GetCaps(TDes8& aDes) const;
3143 IMPORT_C TBool QueryVersionSupported(const TVersion& aVer) const;
3144 IMPORT_C TBool IsAvailable(TInt aUnit, const TDesC* aPhysicalDevice, const TDesC8* anInfo) const;
3151 Asynchronous timer services.
3153 Five types of asynchronous request are supported by the class:
3155 1. Requesting an event after a specified interval
3157 2. Requesting an event at a specified system time
3159 3. Requesting a timer event on a specific second fraction
3161 4. Requesting an event if an interval elapses with no user activity.
3163 5. Requesting an event after a specified interval, to a resolution of 1ms.
3165 Each of these requests can be cancelled.
3167 The timer exists from its creation, following a call to RTimer::CreateLocal(),
3168 until it is destroyed by a call to the Close() member function of the base
3171 This class is ultimately implemented in terms of the nanokernel tick, and
3172 therefore the granularity of the generated events is limited to the period of
3173 this timer. This is variant specific, but is usually 1 millisecond.
3175 Note that the CTimer active object uses an RTimer.
3177 class RTimer : public RHandleBase
3180 IMPORT_C TInt CreateLocal();
3181 IMPORT_C void Cancel();
3182 IMPORT_C void After(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
3183 IMPORT_C void AfterTicks(TRequestStatus &aStatus, TInt aTicks);
3184 IMPORT_C void At(TRequestStatus& aStatus,const TTime& aTime);
3185 IMPORT_C void AtUTC(TRequestStatus& aStatus,const TTime& aUTCTime);
3186 IMPORT_C void Lock(TRequestStatus& aStatus,TTimerLockSpec aLock);
3187 IMPORT_C void Inactivity(TRequestStatus& aStatus, TTimeIntervalSeconds aSeconds);
3188 IMPORT_C void HighRes(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
3198 A handle to a dynamically loadable DLL.
3200 The class is not intended for user derivation.
3202 class RLibrary : public RHandleBase
3205 IMPORT_C void Close();
3206 IMPORT_C TInt Load(const TDesC& aFileName, const TUidType& aType);
3207 IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath=KNullDesC);
3208 IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath, const TUidType& aType);
3209 IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath, const TUidType& aType, TUint32 aModuleVersion);
3210 IMPORT_C TInt LoadRomLibrary(const TDesC& aFileName, const TDesC& aPath);
3211 IMPORT_C TLibraryFunction Lookup(TInt anOrdinal) const;
3212 IMPORT_C TUidType Type() const;
3213 IMPORT_C TFileName FileName() const;
3214 IMPORT_C TInt GetRamSizes(TInt& aCodeSize, TInt& aConstDataSize);
3215 IMPORT_C TInt Init(); /**< @internalTechnology */
3218 Class representing information about an executable binary, (DLL or EXE).
3223 TUint32 iModuleVersion; /**< Version number */
3224 TUidType iUids; /**< UIDs */
3225 TSecurityInfo iSecurityInfo; /**< Security Info */
3229 Class representing information about an executable binary, (DLL or EXE), version 2.
3232 struct TInfoV2 : public TInfo
3234 TUint8 iHardwareFloatingPoint; /**< Which hardware floating point used, from TFloatingPointType */
3235 enum TDebugAttributes
3237 EDebugAllowed = 1<<0, ///< Flags set if executable may be debugged.
3238 ETraceAllowed = 1<<1 ///< Flags set if executable may be traced.
3240 TUint8 iDebugAttributes; ///< Bitmask of values from enum TDebugAttributes
3245 Type representing a TInfo struct packaged as a descriptor.
3248 typedef TPckgBuf<TInfo> TInfoBuf;
3251 Type representing a TInfo struct packaged as a descriptor, version 2.
3254 typedef TPckgBuf<TInfoV2> TInfoBufV2;
3259 enum TRequiredImageHeaderSize
3263 Size of header data which should be passed to GetInfoFromHeader()
3265 KRequiredImageHeaderSize = KMaxTInt
3267 KRequiredImageHeaderSize = 9*1024
3271 IMPORT_C static TInt GetInfoFromHeader(const TDesC8& aHeader, TDes8& aInfoBuf);
3275 @deprecated Use TInfo
3279 TUint32 iModuleVersion;
3286 @deprecated Use TInfoBuf
3288 typedef TPckgBuf<SInfo> SInfoBuf;
3293 IMPORT_C static TInt GetInfo(const TDesC& aFileName, TDes8& aInfoBuf);
3305 A handle to a critical section.
3307 A critical section itself is a kernel object, and is implemented using
3308 a semaphore. The class RCriticalSection inherits privately from RSemaphore
3309 as a matter of implementation and this is, in effect, equivalent to using
3312 The public functions of RSemaphore are not part of the public API of this
3315 As with all handles, they should be closed after use. This class provides
3316 the necessary Close() function, which should be called when the handle is
3319 @see RHandleBase::Close
3321 class RCriticalSection : private RSemaphore
3324 IMPORT_C RCriticalSection();
3325 IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
3326 IMPORT_C void Close();
3327 IMPORT_C void Wait();
3328 IMPORT_C void Signal();
3329 inline TBool IsBlocked() const;
3340 A handle to a mutex.
3342 The mutex itself is a kernel side object.
3344 Handles should be closed after use. RHandleBase provides the necessary Close()
3345 function which should be called when the handle is no longer required.
3347 @see RHandleBase::Close
3349 class RMutex : public RHandleBase
3352 inline TInt Open(const TFindMutex& aFind,TOwnerType aType=EOwnerProcess);
3353 IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
3354 IMPORT_C TInt CreateGlobal(const TDesC& aName,TOwnerType aType=EOwnerProcess);
3355 IMPORT_C TInt OpenGlobal(const TDesC& aName,TOwnerType aType=EOwnerProcess);
3356 IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType=EOwnerProcess);
3357 IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
3358 IMPORT_C void Wait();
3359 IMPORT_C void Signal();
3360 IMPORT_C TBool IsHeld();
3369 A handle to a condition variable.
3371 The condition variable itself is a kernel side object.
3373 Handles should be closed after use. RHandleBase provides the necessary Close()
3374 function which should be called when the handle is no longer required.
3376 @see RHandleBase::Close
3378 class RCondVar : public RHandleBase
3381 IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
3382 IMPORT_C TInt CreateGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
3383 IMPORT_C TInt OpenGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
3384 IMPORT_C TInt Open(RMessagePtr2 aMessage, TInt aParam, TOwnerType aType=EOwnerProcess);
3385 IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
3386 IMPORT_C TInt Wait(RMutex& aMutex);
3387 IMPORT_C TInt TimedWait(RMutex& aMutex, TInt aTimeout); // timeout in microseconds
3388 IMPORT_C void Signal();
3389 IMPORT_C void Broadcast();
3396 struct TChunkCreateInfo;
3401 A handle to a chunk.
3403 The chunk itself is a kernel side object.
3405 class RChunk : public RHandleBase
3423 Set of flags used by SetRestrictions().
3425 @see RChunk::SetRestrictions
3429 EPreventAdjust = 0x01, // Prevent Adjust, Commit, Allocate and Decommit
3432 inline TInt Open(const TFindChunk& aFind,TOwnerType aType=EOwnerProcess);
3433 IMPORT_C TInt CreateLocal(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3434 IMPORT_C TInt CreateLocalCode(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3435 IMPORT_C TInt CreateGlobal(const TDesC& aName,TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3436 IMPORT_C TInt CreateDoubleEndedLocal(TInt aInitialBottom, TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3437 IMPORT_C TInt CreateDoubleEndedGlobal(const TDesC& aName,TInt aInitialBottom,TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3438 IMPORT_C TInt CreateDisconnectedLocal(TInt aInitialBottom, TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3439 IMPORT_C TInt CreateDisconnectedGlobal(const TDesC& aName,TInt aInitialBottom,TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
3440 IMPORT_C TInt Create(TChunkCreateInfo& aCreateInfo);
3441 IMPORT_C TInt SetRestrictions(TUint aFlags);
3442 IMPORT_C TInt OpenGlobal(const TDesC& aName,TBool isReadOnly,TOwnerType aType=EOwnerProcess);
3443 IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TBool isReadOnly,TOwnerType aType=EOwnerProcess);
3444 IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
3445 IMPORT_C TInt Adjust(TInt aNewSize) const;
3446 IMPORT_C TInt AdjustDoubleEnded(TInt aBottom, TInt aTop) const;
3447 IMPORT_C TInt Commit(TInt anOffset, TInt aSize) const;
3448 IMPORT_C TInt Allocate(TInt aSize) const;
3449 IMPORT_C TInt Decommit(TInt anOffset, TInt aSize) const;
3450 IMPORT_C TInt Unlock(TInt aOffset, TInt aSize); /**< @internalTechnology */
3451 IMPORT_C TInt Lock(TInt aOffset, TInt aSize); /**< @internalTechnology */
3452 IMPORT_C TUint8* Base() const;
3453 IMPORT_C TInt Size() const;
3454 IMPORT_C TInt Bottom() const;
3455 IMPORT_C TInt Top() const;
3456 IMPORT_C TInt MaxSize() const;
3457 inline TBool IsReadable() const;
3458 inline TBool IsWritable() const;
3460 friend class UserHeap;
3465 This structure specifies the type and properties of the chunk to be created. It
3466 is passed as a parameter to the RChunk::Create() method.
3471 struct TChunkCreateInfo
3475 Currently supported version numbers
3478 enum TChunkCreateVersions
3484 friend class RChunk;
3486 IMPORT_C TChunkCreateInfo();
3487 IMPORT_C void SetNormal(TInt aInitialSize, TInt aMaxSize);
3488 IMPORT_C void SetCode(TInt aInitialSize, TInt aMaxSize);
3489 IMPORT_C void SetDoubleEnded(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize);
3490 IMPORT_C void SetDisconnected(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize);
3491 IMPORT_C void SetOwner(TOwnerType aType);
3492 IMPORT_C void SetGlobal(const TDesC& aName);
3493 IMPORT_C void SetClearByte(TUint8 aClearByte);
3494 void SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName);
3497 /** The version number of this TChunkCreateInfo.
3500 TUint iVersionNumber;
3501 /** The type of the chunk to be created.
3505 /** Specify if chunk is global or not.
3509 /** The maximum size in bytes of the chunk to be created.
3513 /** An enumeration whose enumerators define the ownership of this chunk
3514 handle. If not explicitly specified, EOwnerProcess is taken as default.
3517 TOwnerType iOwnerType;
3518 /** A pointer to a descriptor containing the name to be assigned to
3519 global chunks. The length of the descriptor must be no greater than
3520 that allowed for a TKName type. Must be NULL for local chunks.
3524 /** The offset of the bottom of the region to commit to the chunk on
3525 creation from the base of the chunk's reserved region.
3526 This is only used for double ended and disconnected chunks.
3529 TInt iInitialBottom;
3530 /** The offset of the top of the region to commit to the chunk on
3531 creation from the base of the chunk's reserved region.
3532 This is only used for double ended and disconnected chunks.
3536 /** Attributes to the chunk to be created should have.
3537 Should be set from one or more the values in TChunkCreateAttributes.
3541 /** The byte to clear all the memory committed to the chunk to.
3545 /** @internalComponent*/
3547 /** @internalComponent*/
3552 struct SStdEpocThreadCreateInfo;
3557 A set of static functions for constructing fixed length heaps and local or
3566 enum TChunkHeapCreateMode {EChunkHeapSwitchTo=1, EChunkHeapDuplicate=2};
3567 IMPORT_C static RHeap* FixedHeap(TAny* aBase, TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue);
3568 IMPORT_C static RHeap* ChunkHeap(const TDesC* aName, TInt aMinLength, TInt aMaxLength, TInt aGrowBy=1, TInt aAlign=0, TBool aSingleThread=EFalse);
3569 IMPORT_C static RHeap* ChunkHeap(RChunk aChunk, TInt aMinLength, TInt aGrowBy=1, TInt aMaxLength=0, TInt aAlign=0, TBool aSingleThread=EFalse, TUint32 aMode=0);
3570 IMPORT_C static RHeap* OffsetChunkHeap(RChunk aChunk, TInt aMinLength, TInt aOffset, TInt aGrowBy=1, TInt aMaxLength=0, TInt aAlign=0, TBool aSingleThread=EFalse, TUint32 aMode=0);
3571 IMPORT_C static TInt SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo);
3572 IMPORT_C static TInt CreateThreadHeap(SStdEpocThreadCreateInfo& aInfo, RHeap*& aHeap, TInt aAlign=0, TBool aSingleThread=EFalse);
3582 Encapsulates the Id of a kernel object.
3588 inline TObjectId(TUint64 anId);
3589 inline TUint64 Id() const;
3590 inline operator TUint() const;
3591 inline TBool operator==(TObjectId aId) const;
3592 inline TBool operator!=(TObjectId aId) const;
3604 Encapsulates the Id of a thread.
3606 An object of this type is not explicitly constructed in open code,
3607 but is returned by the Id() member function of a thread handle,
3612 class TThreadId : public TObjectId
3616 inline TThreadId(TUint64 anId);
3629 A handle to a thread.
3631 The thread itself is a kernel object.
3633 class RThread : public RHandleBase
3637 IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize, TAny *aPtr, TOwnerType aType=EOwnerProcess);
3638 IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, RAllocator* aHeap, TAny* aPtr, TOwnerType aType=EOwnerProcess);
3639 IMPORT_C TInt Open(const TDesC& aFullName, TOwnerType aType=EOwnerProcess);
3640 IMPORT_C TInt Open(TThreadId aID, TOwnerType aType=EOwnerProcess);
3641 IMPORT_C TThreadId Id() const;
3642 IMPORT_C void Resume() const;
3643 IMPORT_C void Suspend() const;
3646 @deprecated Use User::RenameThread() instead
3648 inline static TInt RenameMe(const TDesC& aName);
3650 IMPORT_C void Kill(TInt aReason);
3651 IMPORT_C void Terminate(TInt aReason);
3652 IMPORT_C void Panic(const TDesC& aCategory,TInt aReason);
3653 IMPORT_C TInt Process(RProcess& aProcess) const;
3654 IMPORT_C TThreadPriority Priority() const;
3655 IMPORT_C void SetPriority(TThreadPriority aPriority) const;
3656 IMPORT_C TProcessPriority ProcessPriority() const;
3657 IMPORT_C void SetProcessPriority(TProcessPriority aPriority) const;
3658 IMPORT_C TInt RequestCount() const;
3659 IMPORT_C TExitType ExitType() const;
3660 IMPORT_C TInt ExitReason() const;
3661 IMPORT_C TExitCategoryName ExitCategory() const;
3662 IMPORT_C void RequestComplete(TRequestStatus*& aStatus,TInt aReason) const;
3663 IMPORT_C void RequestSignal() const;
3664 IMPORT_C void Logon(TRequestStatus& aStatus) const;
3665 IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const;
3666 IMPORT_C void HandleCount(TInt& aProcessHandleCount, TInt& aThreadHandleCount) const;
3667 IMPORT_C void Context(TDes8& aDes) const;
3668 IMPORT_C TInt StackInfo(TThreadStackInfo& aInfo) const;
3669 IMPORT_C TInt GetCpuTime(TTimeIntervalMicroSeconds& aCpuTime) const;
3670 inline TInt Open(const TFindThread& aFind,TOwnerType aType=EOwnerProcess);
3671 IMPORT_C void Rendezvous(TRequestStatus& aStatus) const;
3672 IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const;
3673 IMPORT_C static void Rendezvous(TInt aReason);
3676 Return the Secure ID of the process to which the thread belongs.
3678 If an intended use of this method is to check that the Secure ID is
3679 a given value, then the use of a TSecurityPolicy object should be
3680 considered. E.g. Instead of something like:
3684 TInt error = thread.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;
3691 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
3692 TInt error = mySidPolicy().CheckPolicy(thread);
3695 This has the benefit that the TSecurityPolicy::CheckPolicy methods are
3696 configured by the system wide Platform Security configuration. I.e. are
3697 capable of emitting diagnostic messages when a check fails and/or the
3698 check can be forced to always pass.
3700 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
3701 @see _LIT_SECURITY_POLICY_S0
3703 @return The Secure ID.
3707 IMPORT_C TSecureId SecureId() const;
3710 Return the Vendor ID of the process to which the thread belongs.
3712 If an intended use of this method is to check that the Vendor ID is
3713 a given value, then the use of a TSecurityPolicy object should be
3714 considered. E.g. Instead of something like:
3718 TInt error = thread.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;
3725 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
3726 TInt error = myVidPolicy().CheckPolicy(thread);
3729 This has the benefit that the TSecurityPolicy::CheckPolicy methods are
3730 configured by the system wide Platform Security configuration. I.e. are
3731 capable of emitting diagnostic messages when a check fails and/or the
3732 check can be forced to always pass.
3734 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
3735 @see _LIT_SECURITY_POLICY_V0
3737 @return The Vendor ID.
3741 IMPORT_C TVendorId VendorId() const;
3744 Check if the process to which the thread belongs has a given capability
3746 When a check fails the action taken is determined by the system wide Platform Security
3747 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
3748 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
3751 @param aCapability The capability to test.
3752 @param aDiagnostic A string that will be emitted along with any diagnostic message
3753 that may be issued if the test finds the capability is not present.
3754 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
3755 which enables it to be easily removed from the system.
3756 @return ETrue if the process to which the thread belongs has the capability, EFalse otherwise.
3760 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3761 inline TBool HasCapability(TCapability aCapability, const char* aDiagnostic=0) const;
3762 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3763 // Only available to NULL arguments
3764 inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL) const;
3765 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3766 // For things using KSuppressPlatSecDiagnostic
3767 inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
3768 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3769 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3772 Check if the process to which the thread belongs has both of the given capabilities
3774 When a check fails the action taken is determined by the system wide Platform Security
3775 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
3776 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
3779 @param aCapability1 The first capability to test.
3780 @param aCapability2 The second capability to test.
3781 @param aDiagnostic A string that will be emitted along with any diagnostic message
3782 that may be issued if the test finds a capability is not present.
3783 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
3784 which enables it to be easily removed from the system.
3785 @return ETrue if the process to which the thread belongs has both the capabilities, EFalse otherwise.
3789 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3790 inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0) const;
3791 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3792 // Only available to NULL arguments
3793 inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL) const;
3794 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3795 // For things using KSuppressPlatSecDiagnostic
3796 inline TBool HasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
3797 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3798 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3800 /** Function only temporarily supported to aid migration to process emulation...
3803 @deprecated Use process emulation instead
3805 inline TInt Create(const TDesC& aName,TThreadFunction aFunction,TInt aStackSize,TAny* aPtr,RLibrary* aLibrary,RHeap* aHeap, TInt aHeapMinSize,TInt aHeapMaxSize,TOwnerType aType);
3808 // Implementations of functions with diagnostics
3809 IMPORT_C TBool DoHasCapability(TCapability aCapability, const char* aDiagnostic) const;
3810 IMPORT_C TBool DoHasCapability(TCapability aCapability) const;
3811 IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const;
3812 IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2) const;
3819 inline TInt RThread::Create(const TDesC& /*aName*/,TThreadFunction /*aFunction*/,TInt /*aStackSize*/,TAny* /*aPtr*/,RLibrary* /*aLibrary*/,RHeap* /*aHeap*/, TInt /*aHeapMinSize*/,TInt /*aHeapMaxSize*/,TOwnerType /*aType*/)
3820 {return KErrNotSupported; }
3828 Encapsulates the Id of a process.
3830 An object of this type is not explicitly constructed in open code,
3831 but is returned by the Id() member function of a process handle,
3836 class TProcessId : public TObjectId
3839 inline TProcessId();
3840 inline TProcessId(TUint64 anId);
3846 class RSubSessionBase;
3852 A handle to a process.
3854 The process itself is a kernel object.
3856 class RProcess : public RHandleBase
3860 IMPORT_C TInt Create(const TDesC& aFileName,const TDesC& aCommand,TOwnerType aType=EOwnerProcess);
3861 IMPORT_C TInt Create(const TDesC& aFileName,const TDesC& aCommand,const TUidType &aUidType, TOwnerType aType=EOwnerProcess);
3862 IMPORT_C TInt Open(const TDesC& aName,TOwnerType aType=EOwnerProcess);
3863 IMPORT_C TInt Open(TProcessId aId,TOwnerType aType=EOwnerProcess);
3864 IMPORT_C TUidType Type() const;
3865 IMPORT_C TProcessId Id() const;
3868 @deprecated Use User::RenameProcess() instead
3870 inline static TInt RenameMe(const TDesC& aName);
3872 IMPORT_C void Kill(TInt aReason);
3873 IMPORT_C void Terminate(TInt aReason);
3874 IMPORT_C void Panic(const TDesC& aCategory,TInt aReason);
3875 IMPORT_C void Resume();
3876 IMPORT_C TFileName FileName() const;
3877 IMPORT_C TExitType ExitType() const;
3878 IMPORT_C TInt ExitReason() const;
3879 IMPORT_C TExitCategoryName ExitCategory() const;
3880 IMPORT_C TProcessPriority Priority() const;
3881 IMPORT_C void SetPriority(TProcessPriority aPriority) const;
3882 IMPORT_C TBool JustInTime() const;
3883 IMPORT_C void SetJustInTime(TBool aBoolean) const;
3884 IMPORT_C void Logon(TRequestStatus& aStatus) const;
3885 IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const;
3886 IMPORT_C TInt GetMemoryInfo(TModuleMemoryInfo& aInfo) const;
3887 inline TInt Open(const TFindProcess& aFind,TOwnerType aType=EOwnerProcess);
3888 IMPORT_C void Rendezvous(TRequestStatus& aStatus) const;
3889 IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const;
3890 IMPORT_C static void Rendezvous(TInt aReason);
3893 Return the Secure ID of the process.
3895 If an intended use of this method is to check that the Secure ID is
3896 a given value, then the use of a TSecurityPolicy object should be
3897 considered. E.g. Instead of something like:
3901 TInt error = process.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;
3908 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
3909 TInt error = mySidPolicy().CheckPolicy(process);
3912 This has the benefit that the TSecurityPolicy::CheckPolicy methods are
3913 configured by the system wide Platform Security configuration. I.e. are
3914 capable of emitting diagnostic messages when a check fails and/or the
3915 check can be forced to always pass.
3917 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
3918 @see _LIT_SECURITY_POLICY_S0
3920 @return The Secure ID.
3924 IMPORT_C TSecureId SecureId() const;
3927 Return the Vendor ID of the process.
3929 If an intended use of this method is to check that the Vendor ID is
3930 a given value, then the use of a TSecurityPolicy object should be
3931 considered. E.g. Instead of something like:
3935 TInt error = process.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;
3942 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
3943 TInt error = myVidPolicy().CheckPolicy(process);
3946 This has the benefit that the TSecurityPolicy::CheckPolicy methods are
3947 configured by the system wide Platform Security configuration. I.e. are
3948 capable of emitting diagnostic messages when a check fails and/or the
3949 check can be forced to always pass.
3951 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
3952 @see _LIT_SECURITY_POLICY_V0
3954 @return The Vendor ID.
3958 IMPORT_C TVendorId VendorId() const;
3961 Check if the process has a given capability
3963 When a check fails the action taken is determined by the system wide Platform Security
3964 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
3965 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
3968 @param aCapability The capability to test.
3969 @param aDiagnostic A string that will be emitted along with any diagnostic message
3970 that may be issued if the test finds the capability is not present.
3971 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
3972 which enables it to be easily removed from the system.
3973 @return ETrue if the process has the capability, EFalse otherwise.
3977 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3978 inline TBool HasCapability(TCapability aCapability, const char* aDiagnostic=0) const;
3979 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3980 // Only available to NULL arguments
3981 inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL) const;
3982 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3983 // For things using KSuppressPlatSecDiagnostic
3984 inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
3985 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3986 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3989 Check if the process has both of the given capabilities
3991 When a check fails the action taken is determined by the system wide Platform Security
3992 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
3993 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
3996 @param aCapability1 The first capability to test.
3997 @param aCapability2 The second capability to test.
3998 @param aDiagnostic A string that will be emitted along with any diagnostic message
3999 that may be issued if the test finds a capability is not present.
4000 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
4001 which enables it to be easily removed from the system.
4002 @return ETrue if the process has both the capabilities, EFalse otherwise.
4006 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4007 inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0) const;
4008 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4009 // Only available to NULL arguments
4010 inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL) const;
4011 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
4012 // For things using KSuppressPlatSecDiagnostic
4013 inline TBool HasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
4014 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
4015 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4017 IMPORT_C TInt SetParameter(TInt aIndex, RHandleBase aHandle);
4018 IMPORT_C TInt SetParameter(TInt aSlot, const RSubSessionBase& aSession);
4019 IMPORT_C TInt SetParameter(TInt aSlot, const TDesC16& aDes);
4020 IMPORT_C TInt SetParameter(TInt aSlot, const TDesC8& aDes);
4021 IMPORT_C TInt SetParameter(TInt aSlot, TInt aData);
4022 inline RProcess(TInt aHandle);
4025 @deprecated Use RProcess::SecureId() instead
4027 inline TUid Identity() const { return SecureId(); }
4030 Legacy Platform Security development and migration support
4032 @deprecated No replacement
4034 enum TSecureApi { ESecureApiOff, ESecureApiOn, ESecureApiQuery }; // __SECURE_API__ remove this
4037 Legacy Platform Security development and migration support
4039 @deprecated No replacement
4041 IMPORT_C TInt SecureApi(TInt aState); // __SECURE_API__ remove this
4044 Legacy Platform Security development and migration support
4046 @deprecated No replacement
4048 enum TDataCaging { EDataCagingOff, EDataCagingOn, EDataCagingQuery}; // __DATA_CAGING__ __SECURE_API__ remove this
4051 Legacy Platform Security development and migration support
4053 @deprecated No replacement
4055 IMPORT_C TInt DataCaging(TInt aState); // __DATA_CAGING__ __SECURE_API__ remove this
4062 IMPORT_C TInt CreateWithStackOverride(const TDesC& aFileName,const TDesC& aCommand, const TUidType &aUidType, TInt aMinStackSize, TOwnerType aType);
4064 IMPORT_C static TAny* ExeExportData(void);
4067 // Implementations of functions with diagnostics
4068 IMPORT_C TBool DoHasCapability(TCapability aCapability, const char* aDiagnostic) const;
4069 IMPORT_C TBool DoHasCapability(TCapability aCapability) const;
4070 IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const;
4071 IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2) const;
4085 class RServer2 : public RHandleBase
4088 IMPORT_C TInt CreateGlobal(const TDesC& aName);
4089 IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode);
4090 IMPORT_C void Receive(RMessage2& aMessage,TRequestStatus& aStatus);
4091 IMPORT_C void Receive(RMessage2& aMessage);
4092 IMPORT_C void Cancel();
4102 Client-side handle to a session with a server.
4104 This is the client-side interface through which communication with the server
4107 Clients normally define and implement a derived class to provide
4110 class RSessionBase : public RHandleBase
4112 friend class RSubSessionBase;
4115 Indicates whether or not threads in the process are automatically attached
4116 to the session when passed as a parameter to the Share() function.
4118 enum TAttachMode {EExplicitAttach,EAutoAttach};
4121 Creates a session that can be shared by other threads in the current
4124 After calling this function the session object may be used by threads other
4125 than than the one that created it.
4127 Note that this can only be done with servers that mark their sessions
4130 @return KErrNone, if the session is successfully shared;
4131 KErrNoMmemory, if the attempt fails for lack of memory.
4133 @panic KERN-EXEC 23 The session cannot be shared.
4136 @see RSessionBase::ShareProtected()
4137 @see CServer2::TServerType
4139 inline TInt ShareAuto() { return DoShare(EAutoAttach); }
4143 Creates a session handle that can be be passed via IPC to another process
4144 as well as being shared by other threads in the current process.
4146 After calling this function the session object may be used by threads other
4147 than than the one that created it.
4149 Note that this can only be done with servers that mark their sessions
4150 as globally sharable.
4152 @return KErrNone, if the session is successfully shared;
4153 KErrNoMmemory, if the attempt fails for lack of memory.
4155 @panic KERN-EXEC 23 The session cannot be shared.
4158 @see RSessionBase::ShareAuto()
4159 @see CServer2::TServerType
4161 inline TInt ShareProtected() { return DoShare(EAutoAttach|KCreateProtectedObject); }
4164 IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType=EOwnerProcess);
4165 IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,const TSecurityPolicy& aServerPolicy,TOwnerType aType=EOwnerProcess);
4166 IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
4167 IMPORT_C TInt Open(TInt aArgumentIndex, const TSecurityPolicy& aServerPolicy, TOwnerType aType=EOwnerProcess);
4168 inline TInt SetReturnedHandle(TInt aHandleOrError);
4169 IMPORT_C TInt SetReturnedHandle(TInt aHandleOrError,const TSecurityPolicy& aServerPolicy);
4171 inline TInt CreateSession(const TDesC& aServer,const TVersion& aVersion);
4172 IMPORT_C TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots);
4173 IMPORT_C TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
4174 inline TInt CreateSession(RServer2 aServer,const TVersion& aVersion);
4175 IMPORT_C TInt CreateSession(RServer2 aServer,const TVersion& aVersion,TInt aAsyncMessageSlots);
4176 IMPORT_C TInt CreateSession(RServer2 aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
4177 inline static TInt SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle);
4180 @deprecated Use CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
4182 inline TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TRequestStatus* aStatus)
4183 { return CreateSession(aServer, aVersion, aAsyncMessageSlots, EIpcSession_Unsharable, (TSecurityPolicy*)0, aStatus); }
4184 inline TInt Send(TInt aFunction,const TIpcArgs& aArgs) const;
4185 inline void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
4186 inline TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
4187 inline TInt Send(TInt aFunction) const;
4188 inline void SendReceive(TInt aFunction,TRequestStatus& aStatus) const;
4189 inline TInt SendReceive(TInt aFunction) const;
4191 IMPORT_C TInt DoSend(TInt aFunction,const TIpcArgs* aArgs) const;
4192 IMPORT_C void DoSendReceive(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus& aStatus) const;
4193 IMPORT_C TInt DoSendReceive(TInt aFunction,const TIpcArgs* aArgs) const;
4194 TInt SendAsync(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus* aStatus) const;
4195 TInt SendSync(TInt aFunction,const TIpcArgs* aArgs) const;
4196 IMPORT_C TInt DoShare(TInt aAttachMode);
4197 TInt DoConnect(const TVersion &aVersion,TRequestStatus* aStatus);
4207 Client-side handle to a sub-session.
4209 It represents a client-side sub-session, and has a corresponding sub-session
4210 object on the server-side.
4212 Clients normally define and implement a derived class to provide a richer
4213 interface. In particular, a derived class should:
4215 1. provide a function to create a new sub-session with the server;
4216 this should call CreateSubSession().
4218 2. provide a function to close the current sub-session;
4219 this should call CloseSubSession().
4221 A session must already exist with a server before a client can establish
4224 class RSubSessionBase
4227 inline TInt SubSessionHandle() const;
4229 inline RSubSessionBase();
4230 IMPORT_C const RSessionBase Session() const;
4231 inline TInt CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs);
4232 inline TInt CreateSubSession(const RSessionBase& aSession,TInt aFunction);
4233 IMPORT_C TInt CreateAutoCloseSubSession(RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs);
4234 IMPORT_C void CloseSubSession(TInt aFunction);
4235 inline TInt Send(TInt aFunction,const TIpcArgs& aArgs) const;
4236 inline void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
4237 inline TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
4238 inline TInt Send(TInt aFunction) const;
4239 inline void SendReceive(TInt aFunction,TRequestStatus& aStatus) const;
4240 inline TInt SendReceive(TInt aFunction) const;
4242 IMPORT_C TInt DoCreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs* aArgs);
4243 IMPORT_C TInt DoSend(TInt aFunction,const TIpcArgs* aArgs) const;
4244 IMPORT_C void DoSendReceive(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus& aStatus) const;
4245 IMPORT_C TInt DoSendReceive(TInt aFunction,const TIpcArgs* aArgs) const;
4246 TInt DoCreateSubSession(RSessionBase& aSession,TInt aFunction,const TIpcArgs* aArgs, TBool aAutoClose);
4248 RSessionBase iSession;
4249 TInt iSubSessionHandle;
4259 Base class that provides an implementation for the templated
4267 IMPORT_C void Free();
4270 inline RRefBase(const RRefBase& aRef);
4271 IMPORT_C void DoAlloc(const TAny* aPtr,TInt aSize);
4272 IMPORT_C void DoAllocL(const TAny* aPtr,TInt aSize);
4273 IMPORT_C void Copy(const RRefBase& aRef);
4275 IMPORT_C void operator=(const RRefBase& aRef);
4287 Contains, or packages, a copy of an instance of another class.
4289 The template parameter defines the type of the contained object.
4291 The contained object is held in allocated memory, and can be accessed
4292 through the member selection and dereference operators.
4295 class RRef : public RRefBase
4299 inline RRef(const RRef<T>& anObject);
4300 inline void operator=(const RRef<T>& anObject);
4301 inline T* operator->();
4302 inline operator T*();
4303 inline void Alloc(const T& anObject);
4304 inline void Alloc(const T& anObject,TInt aSize);
4305 inline void AllocL(const T& anObject);
4306 inline void AllocL(const T& anObject,TInt aSize);
4316 A handle to a change notifier.
4318 The change notifier itself is a kernel object.
4320 class RChangeNotifier : public RHandleBase
4323 IMPORT_C TInt Create();
4324 IMPORT_C TInt Logon(TRequestStatus& aStatus) const;
4325 IMPORT_C TInt LogonCancel() const;
4335 Handle to a thread death notifier.
4337 The notifier allows threads to be notified of the death of another thread.
4339 The thread-death notifier itself is a kernel object.
4341 class RUndertaker : public RHandleBase
4344 IMPORT_C TInt Create();
4345 IMPORT_C TInt Logon(TRequestStatus& aStatus,TInt& aThreadHandle) const;
4346 IMPORT_C TInt LogonCancel() const;
4358 A handle to a session with the extended notifier server that provides support
4359 for plug-in notifiers.
4361 The interface allows engines or other low level components
4362 to communicate with the UI.
4364 class RNotifier : public RSessionBase
4367 IMPORT_C RNotifier();
4368 IMPORT_C TInt Connect();
4369 IMPORT_C void Close();
4370 IMPORT_C TInt StartNotifier(TUid aNotifierUid,const TDesC8& aBuffer);
4371 IMPORT_C TInt StartNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4372 IMPORT_C TInt StartNotifier(TUid aNotifierDllUid,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4373 IMPORT_C TInt CancelNotifier(TUid aNotifierUid);
4374 IMPORT_C TInt UpdateNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4375 IMPORT_C void UpdateNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4376 IMPORT_C void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4377 IMPORT_C void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierDllUid,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
4378 IMPORT_C TInt UnloadNotifiers(TUid aNotifierUid);
4379 IMPORT_C TInt LoadNotifiers(TUid aNotifierUid);
4380 IMPORT_C void Notify(const TDesC& aLine1,const TDesC& aLine2,const TDesC& aBut1,const TDesC& aBut2,TInt& aButtonVal,TRequestStatus& aStatus);
4381 IMPORT_C void NotifyCancel();
4382 IMPORT_C TInt InfoPrint(const TDesC& aDes);
4385 HBufC16* iCombinedBuffer;
4398 const TInt KMediaPasswordNotifyUid(0x10004c00);
4403 enum TMediaPswdNotifyExitMode {EMPEMUnlock, EMPEMCancel, EMPEMUnlockAndStore};
4408 struct TMediaPswdNotifyBase
4410 enum TCardType {ECTMmcPassword} iCT;
4417 struct TMediaPswdSendNotifyInfoV1 : public TMediaPswdNotifyBase
4425 struct TMediaPswdSendNotifyInfoV1Debug : public TMediaPswdSendNotifyInfoV1
4427 TInt iSleepPeriod; // us, -ve means maximum range
4428 TMediaPswdNotifyExitMode iEM;
4429 TText8 iPW[KMaxMediaPassword];
4435 struct TMediaPswdReplyNotifyInfoV1 : public TMediaPswdNotifyBase
4437 TText8 iPW[KMaxMediaPassword];
4438 TMediaPswdNotifyExitMode iEM;
4448 Abstract class that defines a handler to work with the TRAP mechanism.
4450 Symbian OS provides a trap handler and this class does not normally need to be
4451 used or accessed directly by applications and third party code.
4456 IMPORT_C TTrapHandler();
4459 Called when a TRAP is invoked.
4461 IMPORT_C virtual void Trap()=0;
4464 Called when a function exits a TRAP without leaving.
4466 IMPORT_C virtual void UnTrap()=0;
4469 Called when a function within a TRAP leaves.
4471 @param aValue The leave value.
4473 IMPORT_C virtual void Leave(TInt aValue)=0;
4479 struct TCollationMethod; // forward declaration
4488 Contains a set of static functions which perform manipulation of
4491 The arguments passed to the functions of this class are pointers to memory
4492 locations and length values. These functions are, therefore, not normally
4493 used in open code but are suitable for implementing data manipulation for
4494 other classes. Typically the interface provided by such classes is typesafe
4495 and hides this direct memory to memory manipulation.
4500 inline static TUint8* Copy(TAny* aTrg, const TAny* aSrc, TInt aLength);
4501 inline static TUint8* Move(TAny* aTrg, const TAny* aSrc, TInt aLength);
4502 inline static void Fill(TAny* aTrg, TInt aLength, TChar aChar);
4503 inline static void FillZ(TAny* aTrg, TInt aLength);
4505 inline static TInt Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
4507 IMPORT_C static TInt Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
4510 IMPORT_C static TInt Compare(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
4511 IMPORT_C static TInt CompareF(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
4512 IMPORT_C static TInt CompareF(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
4513 IMPORT_C static TInt CompareC(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
4514 IMPORT_C static TInt CompareC(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
4515 IMPORT_C static TInt CompareC(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL,
4516 TInt aMaxLevel, const TCollationMethod* aCollationMethod);
4517 IMPORT_C static TInt CollationMethods();
4518 IMPORT_C static TUint CollationMethodId(TInt aIndex);
4519 IMPORT_C static const TCollationMethod* CollationMethodByIndex(TInt aIndex);
4520 IMPORT_C static const TCollationMethod* CollationMethodById(TUint aId);
4521 IMPORT_C static const TCollationMethod* GetDefaultMatchingTable();
4522 IMPORT_C static void Swap(TAny* aPtr1, TAny* aPtr2, TInt aLength);
4523 IMPORT_C static void Crc(TUint16& aCrc, const TAny* aPtr, TInt aLength);
4524 IMPORT_C static void Crc32(TUint32& aCrc, const TAny* aPtr, TInt aLength);
4535 Set of static user functions.
4537 These functions are related to a number of System component APIs.
4539 The majority of the functions are related to either the current thread, or
4540 its heap. Examples in this category include User::Exit(), which causes the
4541 thread to terminate, and User::Alloc(), which allocates memory from the current
4544 Some of these functions are equivalent to functions in the RThread or RHeap
4545 classes. In these cases, the User function is a convenient way to access the
4546 function without first having to get a handle to the current thread.
4548 Functions are also provided to support debugging of memory leaks. These function
4549 calls can be written explicitly or can be generated using a corresponding
4550 macro - the advantage of using a macro is that the function call is only
4551 generated for debug builds.
4553 A final category of functions, which includes User::BinarySearch() and User::QuickSort(),
4554 are just useful functions which have no other natural home.
4559 class User : public UserHeap
4562 // Execution control
4563 IMPORT_C static void InitProcess(); /**< @internalComponent */
4564 IMPORT_C static void Exit(TInt aReason);
4565 IMPORT_C static void Panic(const TDesC& aCategory,TInt aReason);
4566 IMPORT_C static void HandleException(TAny* aInfo); /**< @internalComponent */
4568 IMPORT_C static void Leave(TInt aReason);
4569 IMPORT_C static void LeaveNoMemory();
4570 IMPORT_C static TInt LeaveIfError(TInt aReason);
4571 IMPORT_C static TAny* LeaveIfNull(TAny* aPtr);
4572 IMPORT_C static TTrapHandler* SetTrapHandler(TTrapHandler* aHandler);
4573 IMPORT_C static TTrapHandler* TrapHandler();
4574 IMPORT_C static TTrapHandler* MarkCleanupStack(); /**< @internalComponent */
4575 IMPORT_C static void UnMarkCleanupStack(TTrapHandler* aHandler); /**< @internalComponent */
4576 IMPORT_C static void LeaveEnd(); /**< @internalComponent */
4578 IMPORT_C static TInt InfoPrint(const TDesC& aDes);
4579 // Asynchronous service support
4580 IMPORT_C static void RequestComplete(TRequestStatus*& aStatus,TInt aReason);
4581 IMPORT_C static void WaitForAnyRequest();
4582 IMPORT_C static void WaitForRequest(TRequestStatus& aStatus);
4583 IMPORT_C static void WaitForRequest(TRequestStatus& aStatus1,TRequestStatus& aStatus2);
4584 IMPORT_C static void WaitForNRequest(TRequestStatus *aStatusArray[], TInt aNum);
4585 // User heap management
4586 IMPORT_C static TInt AllocLen(const TAny* aCell);
4587 IMPORT_C static TAny* Alloc(TInt aSize);
4588 IMPORT_C static TAny* AllocL(TInt aSize);
4589 IMPORT_C static TAny* AllocLC(TInt aSize);
4590 IMPORT_C static TAny* AllocZ(TInt aSize);
4591 IMPORT_C static TAny* AllocZL(TInt aSize);
4592 IMPORT_C static TInt AllocSize(TInt& aTotalAllocSize);
4593 IMPORT_C static TInt Available(TInt& aBiggestBlock);
4594 IMPORT_C static TInt CountAllocCells();
4595 IMPORT_C static TInt CountAllocCells(TInt& aFreeCount);
4596 IMPORT_C static void Free(TAny* aCell);
4597 IMPORT_C static void FreeZ(TAny*& aCell);
4598 IMPORT_C static RAllocator& Allocator();
4599 inline static RHeap& Heap();
4600 IMPORT_C static TAny* ReAlloc(TAny* aCell, TInt aSize, TInt aMode=0);
4601 IMPORT_C static TAny* ReAllocL(TAny* aCell, TInt aSize, TInt aMode=0);
4602 IMPORT_C static RAllocator* SwitchAllocator(RAllocator* aAllocator);
4603 inline static RHeap* SwitchHeap(RAllocator* aHeap);
4604 IMPORT_C static TInt CompressAllHeaps();
4605 // Synchronous timer services
4606 IMPORT_C static void After(TTimeIntervalMicroSeconds32 aInterval);
4607 IMPORT_C static TInt At(const TTime& aTime);
4608 IMPORT_C static void AfterHighRes(TTimeIntervalMicroSeconds32 aInterval);
4609 // Set time and deal with timezones
4610 IMPORT_C static TInt SetHomeTime(const TTime& aTime);
4611 IMPORT_C static TInt SetHomeTimeSecure(const TTime& aTime);
4612 IMPORT_C static TInt SetUTCTime(const TTime& aUTCTime);
4613 IMPORT_C static TInt SetUTCTimeSecure(const TTime& aUTCTime);
4614 IMPORT_C static TTimeIntervalSeconds UTCOffset();
4615 IMPORT_C static void SetUTCOffset(TTimeIntervalSeconds aOffset);
4616 IMPORT_C static TInt SetUTCTimeAndOffset(const TTime& aUTCTime, TTimeIntervalSeconds aOffset);
4617 // Set locale information
4618 IMPORT_C static TInt SetCurrencySymbol(const TDesC& aSymbol);
4619 // Set floating point mode
4620 IMPORT_C static TInt SetFloatingPointMode(TFloatingPointMode aMode, TFloatingPointRoundingMode aRoundingMode=EFpRoundToNearest);
4622 IMPORT_C static TUint TickCount();
4623 IMPORT_C static TUint32 NTickCount();
4624 IMPORT_C static TTimerLockSpec LockPeriod();
4625 IMPORT_C static TTimeIntervalSeconds InactivityTime();
4626 IMPORT_C static void ResetInactivityTime();
4627 IMPORT_C static TUint32 FastCounter();
4628 // Atomic operations
4629 IMPORT_C static TInt LockedInc(TInt& aValue);
4630 IMPORT_C static TInt LockedDec(TInt& aValue);
4631 IMPORT_C static TInt SafeInc(TInt& aValue);
4632 IMPORT_C static TInt SafeDec(TInt& aValue);
4634 IMPORT_C static TInt Beep(TInt aFrequency,TTimeIntervalMicroSeconds32 aDuration);
4636 IMPORT_C static TInt IsRomAddress(TBool& aBool,TAny* aPtr);
4638 IMPORT_C static TInt BinarySearch(TInt aCount,const TKey& aKey,TInt& aPos);
4639 IMPORT_C static TInt QuickSort(TInt aCount,const TKey& aKey,const TSwap& aSwap);
4640 // Language-dependent character functions
4641 IMPORT_C static TLanguage Language();
4642 IMPORT_C static TUint Collate(TUint aChar);
4643 IMPORT_C static TUint Fold(TUint aChar);
4644 IMPORT_C static TUint LowerCase(TUint aChar);
4645 IMPORT_C static TUint UpperCase(TUint aChar);
4646 IMPORT_C static TUint Fold(TUint aChar,TInt aFlags);
4647 IMPORT_C static TUint TitleCase(TUint aChar);
4648 // C-style string length
4649 IMPORT_C static TInt StringLength(const TUint8* aString);
4650 IMPORT_C static TInt StringLength(const TUint16* aString);
4651 // Device management
4652 IMPORT_C static TInt FreeLogicalDevice(const TDesC& aDeviceName);
4653 IMPORT_C static TInt FreePhysicalDevice(const TDesC& aDriverName);
4654 IMPORT_C static TInt LoadLogicalDevice(const TDesC& aFileName);
4655 IMPORT_C static TInt LoadPhysicalDevice(const TDesC& aFileName);
4656 // Version information
4657 IMPORT_C static TBool QueryVersionSupported(const TVersion& aCurrent,const TVersion& aRequested);
4658 IMPORT_C static TVersion Version();
4659 // Machine configuration
4660 IMPORT_C static TInt SetMachineConfiguration(const TDesC8& aConfig);
4661 IMPORT_C static TInt MachineConfiguration(TDes8& aConfig,TInt& aSize);
4662 // Debugging support
4663 IMPORT_C static void SetDebugMask(TUint32 aVal);
4664 IMPORT_C static void SetDebugMask(TUint32 aVal, TUint aIndex);
4665 IMPORT_C static void SetJustInTime(const TBool aBoolean);
4666 IMPORT_C static void Check();
4667 IMPORT_C static void Invariant();
4668 IMPORT_C static TBool JustInTime();
4669 IMPORT_C static void __DbgMarkStart(TBool aKernel);
4670 IMPORT_C static void __DbgMarkCheck(TBool aKernel, TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum);
4671 IMPORT_C static TUint32 __DbgMarkEnd(TBool aKernel, TInt aCount);
4672 IMPORT_C static void __DbgSetAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TInt aRate);
4673 IMPORT_C static void __DbgSetBurstAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TUint aRate, TUint aBurst);
4674 IMPORT_C static TUint __DbgCheckFailure(TBool aKernel);
4675 IMPORT_C static void PanicUnexpectedLeave(); /**< @internalComponent */
4677 IMPORT_C static TInt ValidateName(const TDesC& aName);
4678 // Instruction Memory Barrier
4679 IMPORT_C static void IMB_Range(TAny* aStart, TAny* aEnd);
4681 IMPORT_C static TInt CommandLineLength();
4682 IMPORT_C static void CommandLine(TDes &aCommand);
4683 IMPORT_C static TExceptionHandler ExceptionHandler();
4684 IMPORT_C static TInt SetExceptionHandler(TExceptionHandler aHandler,TUint32 aMask);
4685 IMPORT_C static void ModifyExceptionMask(TUint32 aClearMask, TUint32 aSetMask);
4686 IMPORT_C static TInt RaiseException(TExcType aType);
4687 IMPORT_C static TBool IsExceptionHandled(TExcType aType);
4690 A set of values that defines the effect that terminating a thread
4691 has, either on its owning process or on the whole system.
4693 A thread is said to be critical if its owning process or the entire system
4694 terminates when the thread itself terminates.
4696 You pass one of these values to the functions:
4697 - User::SetCritical()
4698 - User::SetProcessCritical()
4700 The meaning of a value when passed to one function is different to
4701 its meaning when passed the other function. See the description of each
4704 @see User::SetCritical()
4705 @see User::SetProcessCritical()
4711 This value can be passed to both:
4712 - User::SetCritical(), which means that the current thread
4713 is no longer critical, i.e. termination of the current
4714 thread will no longer cause termination of the current thread's
4715 owning process (i.e. the current process) or a reboot of the system.
4716 - User::SetProcessCritical(), which means that threads
4717 subsequently created in the current thread's owning
4718 process (i.e. the current process) will no longer cause termination of that
4719 process or a reboot of the system. Note, however, that existing
4720 threads are NOT affected when you call this function.
4722 @see User::SetCritical()
4723 @see User::SetProcessCritical()
4729 This value can only be passed to User::SetCritical() and
4730 affects the current thread only.
4732 It means that the owning process (i.e.the current process)
4734 - the current thread is terminated.
4735 - the current thread panics.
4737 @see User::SetCritical()
4743 This value can only be passed to User::SetCritical() and
4744 affects the current thread only.
4746 It means that the owning process (i.e.the current process)
4747 terminates if the current thread terminates for any reason.
4749 @see User::SetCritical()
4755 This value can only be passed to User::SetProcessCritical() and
4756 affects any new threads created in the current process.
4758 It means that the current process terminates if:
4759 - any new thread subsequently created in the current process is terminated.
4760 - any new thread subsequently created in the current process panics.
4762 Note, however, that existing threads in the current process
4763 are NOT affected when you call User::SetProcessCritical()
4766 @see EProcessCritical
4767 @see User::SetProcessCritical()
4769 EAllThreadsCritical,
4773 This value can be passed to both: User::SetCritical() and
4774 User::SetProcessCritical().
4776 When passed to User::SetCritical(), it means that
4777 the entire system is rebooted if:
4778 - the current thread is terminated.
4779 - the current thread panics.
4781 When passed to User::SetProcessCritical(), it means that
4782 the entire system is rebooted if:
4783 - any new thread subsequently created in the current process is terminated.
4784 - any new thread subsequently created in the current process panics.
4785 - the process itself is terminated
4786 - the process itself panics
4789 -# existing threads in the current process are NOT affected when you
4790 call User::SetProcessCritical() with this value.
4791 -# Only a process with 'Protected Server' capability can set a
4792 thread to system-critical.
4794 @see User::SetCritical()
4795 @see User::SetProcessCritical()
4801 This value can be passed to both: User::SetCritical()
4802 and User::SetProcessCritical().
4804 When passed to User::SetCritical(), it means that
4805 the entire system is rebooted if the current thread
4806 exits for any reason.
4808 When passed to User::SetProcessCritical(), it means that
4809 the entire system is rebooted if any new thread
4810 subsequently created in the current process exits
4811 for any reason, or if the process itself exits for any reason.
4814 -# existing threads in the current process are NOT affected when you
4815 call User::SetProcessCritical() with this value.
4816 -# Only a process with 'Protected Server' capability can set a
4817 thread to system-permanent.
4819 @see User::SetCritical()
4820 @see User::SetProcessCritical()
4824 IMPORT_C static TCritical Critical();
4825 IMPORT_C static TCritical Critical(RThread aThread);
4826 IMPORT_C static TInt SetCritical(TCritical aCritical);
4827 IMPORT_C static TCritical ProcessCritical();
4828 IMPORT_C static TCritical ProcessCritical(RProcess aProcess);
4829 IMPORT_C static TInt SetProcessCritical(TCritical aCritical);
4830 IMPORT_C static TBool PriorityControl();
4831 IMPORT_C static void SetPriorityControl(TBool aEnable);
4834 A threads realtime state.
4835 Some non-realtime behaviour can be detected by the kernel. When it does so,
4836 action is taken depending on the thread state:
4837 - ERealtimeStateOff - no action.
4838 - ERealtimeStateOn - the the thread will be panicked with KERN-EXEC 61 (EIllegalFunctionForRealtimeThread).
4839 - ERealtimeStateWarn - no action. However, if the kernel trace flag KREALTIME is enabled
4840 then tracing will be emitted as if the thread state was ERealtimeStateOn.
4846 ERealtimeStateOff, /**< Thread is not realtime */
4847 ERealtimeStateOn, /**< Thread is realtime */
4848 ERealtimeStateWarn /**< Thread is realtime but doesn't want this enforced */
4852 Set the current threads realtime state.
4854 @param aState The state
4855 @return KErrNone if successful. KErrArgument if aState is invalid.
4859 IMPORT_C static TInt SetRealtimeState(TRealtimeState aState);
4862 Return the Secure ID of the process that created the current process.
4863 @return The Secure ID.
4867 IMPORT_C static TSecureId CreatorSecureId();
4870 Return the Vendor ID of the process that created the current process.
4871 @return The Vendor ID.
4875 IMPORT_C static TVendorId CreatorVendorId();
4878 Check if the process that created the current process has a given capability
4880 When a check fails the action taken is determined by the system wide Platform Security
4881 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
4882 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
4885 @param aCapability The capability to test.
4886 @param aDiagnostic A string that will be emitted along with any diagnostic message
4887 that may be issued if the test finds the capability is not present.
4888 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
4889 which enables it to be easily removed from the system.
4890 @return ETrue if the creator process has the capability, EFalse otherwise.
4894 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4895 inline static TBool CreatorHasCapability(TCapability aCapability, const char* aDiagnostic=0);
4896 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4897 // Only available to NULL arguments
4898 inline static TBool CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL);
4899 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
4900 // For things using KSuppressPlatSecDiagnostic
4901 inline static TBool CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress);
4902 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
4903 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4906 Check if the process that created the current process has both of the given capabilities
4908 When a check fails the action taken is determined by the system wide Platform Security
4909 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
4910 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
4913 @param aCapability1 The first capability to test.
4914 @param aCapability2 The second capability to test.
4915 @param aDiagnostic A string that will be emitted along with any diagnostic message
4916 that may be issued if the test finds a capability is not present.
4917 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
4918 which enables it to be easily removed from the system.
4919 @return ETrue if the creator process has both the capabilities, EFalse otherwise.
4923 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4924 inline static TBool CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0);
4925 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4926 // Only available to NULL arguments
4927 inline static TBool CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL);
4928 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
4929 // For things using KSuppressPlatSecDiagnostic
4930 inline static TBool CreatorHasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress);
4931 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
4932 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4934 IMPORT_C static TInt ParameterLength(TInt aSlot);
4935 IMPORT_C static TInt GetTIntParameter(TInt aSlot, TInt& aData);
4936 IMPORT_C static TInt GetDesParameter(TInt aSlot, TDes8& aDes);
4937 IMPORT_C static TInt GetDesParameter(TInt aSlot, TDes16& aDes);
4938 IMPORT_C static TInt RenameThread(const TDesC &aName);
4939 IMPORT_C static TInt RenameProcess(const TDesC &aName);
4941 User::Identity() has been deprecated and is available for backward
4942 compatibility purposes only.
4944 Use RProcess().SecureId() instead.
4948 inline static TUid Identity() { return RProcess().SecureId(); }
4951 User::CreatorIdentity() has been deprecated and is available for backward
4952 compatibility purposes only.
4954 Use CreatorSecureId() instead.
4958 static inline TUid CreatorIdentity() { return CreatorSecureId(); }
4960 IMPORT_C static void NotifyOnIdle(TRequestStatus& aStatus); /**< @internalTechnology */
4961 IMPORT_C static void CancelMiscNotifier(TRequestStatus& aStatus); /**< @internalTechnology */
4963 // Implementations of functions with diagnostics
4964 IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability, const char* aDiagnostic);
4965 IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability);
4966 IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic);
4967 IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2);
4979 typedef void (*TTlsCleanupHandler)(TAny*); //don't use
4985 A collection of static functions involved in managing access to
4986 thread-local storage.
4988 Thread-local storage is a single machine word of static writable memory.
4989 The scope of this machine word is the thread, which means that there is one
4990 word per thread. The word is only accessible to code running in a DLL.
4992 In practice, this word is almost always used to hold a pointer to allocated
4993 memory; this makes that memory available to all DLL code running on behalf
4996 Note that DLL code running on behalf of one thread does not see the same word when
4997 running on behalf of another thread.
4999 The class in not intended for user derivation.
5004 static TInt SetTls(TAny* aPtr);
5006 static void FreeTls();
5007 static void FileName(TFileName &aFileName);
5018 A thin wrapper class for C++ arrays allowing automatic checking of index values
5019 to ensure that all accesses are legal.
5021 The class also supports the deletion of objects.
5023 The class is templated, based on a class type and an integer value. The class
5024 type defines the type of object contained in the array; the integer value
5025 defines the size (dimension) of the array.
5027 A wrapper object can be:
5029 1. embedded in objects allocated on the heap.
5031 2. used on the program stack.
5033 template <class T,TInt S>
5036 typedef TFixedArray<T,S> ThisClass;
5038 inline TFixedArray();
5039 inline TFixedArray(const T* aList, TInt aLength);
5041 inline void Copy(const T* aList, TInt aLength);
5042 inline void Reset(); // zero fill
5043 inline void DeleteAll();
5045 inline TInt Count() const;
5046 inline TInt Length() const;
5047 // Accessors - debug range checking
5048 inline T& operator[](TInt aIndex);
5049 inline const T& operator[] (TInt aIndex) const;
5050 // Accessors - always range checking
5051 inline T& At(TInt aIndex);
5052 inline const T& At(TInt aIndex) const;
5053 // Provides pointers to the beginning and end of the array
5056 inline const T* Begin() const;
5057 inline const T* End() const;
5059 inline TArray<T> Array() const;
5061 inline static TBool InRange(TInt aIndex);
5062 inline static TInt CountFunctionR(const CBase* aThis);
5063 inline static const TAny* AtFunctionR(const CBase* aThis,TInt aIndex);
5075 #define DECLARE_ROM_ARRAY( AName, AData, AType ) \
5076 const TFixedArray<AType,(sizeof(AData)/sizeof((AData)[0]))>& \
5077 AName = *(reinterpret_cast<const TFixedArray<AType, \
5078 (sizeof(AData)/sizeof((AData)[0]))>* > (AData))
5081 // Global leaving operator new
5086 inline TAny* operator new(TUint aSize, TLeave);
5091 inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize);
5092 #if !defined(__VC32__) || defined (__MSVCDOTNET__)
5097 inline TAny* operator new[](TUint aSize, TLeave);
5101 #ifdef __LEAVE_EQUALS_THROW__
5102 /** Macro to assert in all builds that code does not leave
5104 @param _s C++ statements to be executed which should not leave
5105 @panic USER 194 if the code being checked does leave
5110 #define __ASSERT_ALWAYS_NO_LEAVE(_s) \
5113 TTrapHandler* ____t = User::MarkCleanupStack(); \
5115 User::UnMarkCleanupStack(____t); \
5117 catch (XLeaveException& /*l*/) \
5119 User::PanicUnexpectedLeave(); \
5123 User::Invariant(); \
5128 /** Macro to assert in all builds that code does not leave
5130 @param _s C++ statements to be executed which should not leave
5131 @panic USER 194 if the code being checked does leave
5136 #define __ASSERT_ALWAYS_NO_LEAVE(_s) \
5140 if (_t.Trap(_r) == 0) \
5146 User::PanicUnexpectedLeave(); \
5150 /** Macro to assert in debug builds that code does not leave
5152 @param _s C++ statements to be executed which should not leave
5153 @panic USER 194 if the code being checked does leave
5159 #define __ASSERT_DEBUG_NO_LEAVE(_s) __ASSERT_ALWAYS_NO_LEAVE(_s)
5161 #define __ASSERT_DEBUG_NO_LEAVE(_s) { _s; }
5167 #include <e32std.inl>