1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
1201 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1201 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1202 |
1202 |
1203 /** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& 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); }; |
1204 inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1205 private: |
1205 private: |
1206 void Scndig(TInt& aSig,TInt& aExp,TInt64& aDl); |
1206 void Scndig(TInt& aSig, TInt& aExp, TUint64& aDl); |
1207 void ScndigAfterPoint(TInt& aSig,TInt64& aDl); |
1207 void ScndigAfterPoint(TInt& aSig, TUint64& aDl); |
1208 void ValidateMark(const TLexMark8 aMark) const; |
1208 void ValidateMark(const TLexMark8 aMark) const; |
1209 private: |
1209 private: |
1210 const TUint8* iNext; |
1210 const TUint8* iNext; |
1211 const TUint8* iBuf; |
1211 const TUint8* iBuf; |
1212 const TUint8* iEnd; |
1212 const TUint8* iEnd; |
1332 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1332 inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1333 |
1333 |
1334 /** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& 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); }; |
1335 inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); }; |
1336 private: |
1336 private: |
1337 void Scndig(TInt& aSig,TInt& aExp,TInt64& aDl); |
1337 void Scndig(TInt& aSig, TInt& aExp, TUint64& aDl); |
1338 void ValidateMark(const TLexMark16 aMark) const; |
1338 void ValidateMark(const TLexMark16 aMark) const; |
1339 private: |
1339 private: |
1340 const TUint16* iNext; |
1340 const TUint16* iNext; |
1341 const TUint16* iBuf; |
1341 const TUint16* iBuf; |
1342 const TUint16* iEnd; |
1342 const TUint16* iEnd; |
1757 @released |
1757 @released |
1758 |
1758 |
1759 Stores and manipulates the date and time. |
1759 Stores and manipulates the date and time. |
1760 |
1760 |
1761 It represents a date and time as a number of microseconds since midnight, |
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 |
1762 January 1st, 1 AD nominal Gregorian. BC dates are represented by negative |
1763 TTime values. A TTime object may be constructed from a TInt64, a TDateTime |
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 |
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 |
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 |
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, |
1767 numeric fields and provides functions to extract these fields. Alternatively, |
2293 inline void SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage); |
2293 inline void SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage); |
2294 inline TDigitType DigitType() const; |
2294 inline TDigitType DigitType() const; |
2295 inline void SetDigitType(TDigitType aDigitType); |
2295 inline void SetDigitType(TDigitType aDigitType); |
2296 inline TDeviceTimeState DeviceTime() const; |
2296 inline TDeviceTimeState DeviceTime() const; |
2297 inline void SetDeviceTime(TDeviceTimeState aState); |
2297 inline void SetDeviceTime(TDeviceTimeState aState); |
|
2298 inline TInt RegionCode() const; |
2298 |
2299 |
2299 void SetDefaults(); /**< @internalComponent */ |
2300 void SetDefaults(); /**< @internalComponent */ |
2300 |
2301 |
2301 private: |
2302 private: |
2302 friend class TExtendedLocale; |
2303 friend class TExtendedLocale; |
2324 TUnitsFormat iUnitsGeneral; |
2325 TUnitsFormat iUnitsGeneral; |
2325 TUnitsFormat iUnitsDistanceShort; |
2326 TUnitsFormat iUnitsDistanceShort; |
2326 TUnitsFormat iUnitsDistanceLong; |
2327 TUnitsFormat iUnitsDistanceLong; |
2327 TUint iExtraNegativeCurrencyFormatFlags; |
2328 TUint iExtraNegativeCurrencyFormatFlags; |
2328 TUint16 iLanguageDowngrade[3]; |
2329 TUint16 iLanguageDowngrade[3]; |
2329 TUint16 iSpare16; |
2330 TUint16 iRegionCode; |
2330 TDigitType iDigitType; |
2331 TDigitType iDigitType; |
2331 TDeviceTimeState iDeviceTimeState; |
2332 TDeviceTimeState iDeviceTimeState; |
2332 TInt iSpare[0x1E]; |
2333 TInt iSpare[0x1E]; |
2333 }; |
2334 }; |
2334 |
|
2335 |
|
2336 /** |
|
2337 @internalComponent |
|
2338 */ |
|
2339 const TUint KLocaleLanguageKey = 0x10208903; |
|
2340 |
|
2341 /** |
|
2342 @internalComponent |
|
2343 */ |
|
2344 const TUint KLocaleDataKey = 0x10208904; |
|
2345 |
|
2346 /** |
|
2347 @internalComponent |
|
2348 */ |
|
2349 const TUint KLocaleDataExtraKey = 0x10208905; |
|
2350 |
|
2351 /** |
|
2352 @internalComponent |
|
2353 */ |
|
2354 const TUint KLocaleTimeDateFormatKey = 0x10208907; |
|
2355 |
|
2356 /** |
|
2357 @internalComponent |
|
2358 */ |
|
2359 const TUint KLocaleDefaultCharSetKey = 0x10208908; |
|
2360 |
|
2361 /** |
|
2362 @internalComponent |
|
2363 */ |
|
2364 const TUint KLocalePreferredCharSetKey = 0x10208909; |
|
2365 |
|
2366 /** |
|
2367 @internalComponent |
|
2368 */ |
|
2369 enum TLocaleFunctions |
|
2370 { |
|
2371 FnDummy, |
|
2372 FnAmPmTable, |
|
2373 FnCharSet, |
|
2374 FnCollTable, |
|
2375 FnCurrencySymbol, |
|
2376 FnDateSuffixTable, |
|
2377 FnDayAbbTable, |
|
2378 FnDayTable, |
|
2379 FnFoldTable, |
|
2380 FnLanguage, |
|
2381 FnLocaleData, |
|
2382 FnLowerTable, |
|
2383 FnMonthAbbTable, |
|
2384 FnMonthTable, |
|
2385 FnMsgTable, |
|
2386 FnTypeTable, |
|
2387 FnUniCode, |
|
2388 FnUpperTable, |
|
2389 FnShortDateFormatSpec, |
|
2390 FnLongDateFormatSpec, |
|
2391 FnTimeFormatSpec, |
|
2392 FnFatUtilityFunctions |
|
2393 }; |
|
2394 |
|
2395 |
2335 |
2396 /** |
2336 /** |
2397 @publishedAll |
2337 @publishedAll |
2398 @released |
2338 @released |
2399 |
2339 |
2487 |
2427 |
2488 // Overwrite current system wide locale settings with the current |
2428 // Overwrite current system wide locale settings with the current |
2489 // contents of this TExtendedLocale |
2429 // contents of this TExtendedLocale |
2490 IMPORT_C TInt SaveSystemSettings(); |
2430 IMPORT_C TInt SaveSystemSettings(); |
2491 |
2431 |
2492 // Load a complete set of locale data from a named Locale DLL |
2432 //load a complete locale data from a single locale dll |
2493 IMPORT_C TInt LoadLocale(const TDesC& aLocaleDllName); |
2433 IMPORT_C TInt LoadLocale(const TDesC& aLocaleDllName); |
2494 |
2434 |
|
2435 //load a complete locale data from three locale dlls, which are language lcoale dll, region locale dll, and collation locale dll. |
|
2436 IMPORT_C TInt LoadLocale(const TDesC& aLanguageLocaleDllName, const TDesC& aRegionLocaleDllName, const TDesC& aCollationLocaleDllName); |
|
2437 |
2495 // Load an additional Locale DLL and over-ride a selected subset |
2438 // Load an additional Locale DLL and over-ride a selected subset |
2496 // (currently ELocaleLanguageSettings to select an alternative set |
2439 // (currently ELocaleLanguageSettings to select an alternative set |
2497 // of language specific text strings, ELocaleCollateSetting to |
2440 // of language specific text strings, ELocaleCollateSetting to |
2498 // select a new system collation table, |
2441 // select a new system collation table, |
2499 // ELocaleOverRideMatchCollationTable to locally select an |
2442 // ELocaleOverRideMatchCollationTable to locally select an |
2500 // alternative collation order for matching text strings, or |
2443 // alternative collation order for matching text strings, or |
2501 // ELocaleOverRideSortCollationTable for ordering text strings) |
2444 // ELocaleOverRideSortCollationTable for ordering text strings) |
2502 // of settings with its contents |
2445 // of settings with its contents |
2503 IMPORT_C TInt LoadLocaleAspect(TUint aAspectGroup, const TDesC& aLocaleDllName); |
2446 IMPORT_C TInt LoadLocaleAspect(TUint aAspectGroup, const TDesC& aLocaleDllName); |
|
2447 |
|
2448 //load a locale aspect from a locale dll. |
|
2449 //Such as load language locale aspect from locale language dll; |
|
2450 //load region locale aspect from locale region dll; |
|
2451 //load collation locale aspect from locale collation dll. |
|
2452 //There are in all three aspect, which are langauge, region, and collation. |
|
2453 IMPORT_C TInt LoadLocaleAspect(const TDesC& aLocaleDllName); |
2504 |
2454 |
2505 // Set the currency Symbol |
2455 // Set the currency Symbol |
2506 IMPORT_C TInt SetCurrencySymbol(const TDesC &aSymbol); |
2456 IMPORT_C TInt SetCurrencySymbol(const TDesC &aSymbol); |
2507 |
2457 |
2508 // Get the name of the DLL holding the data for a particular set |
2458 // Get the name of the DLL holding the data for a particular set |
2534 |
2484 |
2535 TInt DoLoadLocale(const TDesC& aLocaleDllName, TLibraryFunction* aExportList); |
2485 TInt DoLoadLocale(const TDesC& aLocaleDllName, TLibraryFunction* aExportList); |
2536 void DoUpdateLanguageSettings(TLibraryFunction* aExportList); |
2486 void DoUpdateLanguageSettings(TLibraryFunction* aExportList); |
2537 void DoUpdateLocaleSettings(TLibraryFunction* aExportList); |
2487 void DoUpdateLocaleSettings(TLibraryFunction* aExportList); |
2538 void DoUpdateTimeDateFormat(TLibraryFunction* aExportList); |
2488 void DoUpdateTimeDateFormat(TLibraryFunction* aExportList); |
|
2489 |
|
2490 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL |
|
2491 void DoUpdateLanguageSettingsV2(TLibraryFunction* aExportList); |
|
2492 void DoUpdateLocaleSettingsV2(TLibraryFunction* aExportList); |
|
2493 TInt CheckLocaleDllName(const TDesC& aLocaleDllName, TInt& languageID); |
|
2494 void AddExtension(TDes& aFileName, TInt aExtension); |
|
2495 #endif |
2539 |
2496 |
2540 private: |
2497 private: |
2541 |
2498 |
2542 TLocale iLocale; |
2499 TLocale iLocale; |
2543 SLocaleLanguage iLanguageSettings; |
2500 SLocaleLanguage iLanguageSettings; |
3403 The chunk itself is a kernel side object. |
3360 The chunk itself is a kernel side object. |
3404 */ |
3361 */ |
3405 class RChunk : public RHandleBase |
3362 class RChunk : public RHandleBase |
3406 { |
3363 { |
3407 public: |
3364 public: |
3408 /** |
|
3409 @internalComponent |
|
3410 */ |
|
3411 enum TAttribs |
|
3412 { |
|
3413 ENormal=0x00, |
|
3414 EDoubleEnded=0x01, |
|
3415 EDisconnected=0x02, |
|
3416 ELocal=0x00, |
|
3417 EGlobal=0x10, |
|
3418 EData=0x00, |
|
3419 ECode=0x20, |
|
3420 }; |
|
3421 |
|
3422 /** |
3365 /** |
3423 Set of flags used by SetRestrictions(). |
3366 Set of flags used by SetRestrictions(). |
3424 |
3367 |
3425 @see RChunk::SetRestrictions |
3368 @see RChunk::SetRestrictions |
3426 */ |
3369 */ |
3427 enum TRestrictions |
3370 enum TRestrictions |
3428 { |
3371 { |
3429 EPreventAdjust = 0x01, // Prevent Adjust, Commit, Allocate and Decommit |
3372 /** Prevent Adjust, Commit, Allocate and Decommit */ |
|
3373 EPreventAdjust = 0x01, |
3430 }; |
3374 }; |
3431 public: |
3375 public: |
3432 inline TInt Open(const TFindChunk& aFind,TOwnerType aType=EOwnerProcess); |
3376 inline TInt Open(const TFindChunk& aFind,TOwnerType aType=EOwnerProcess); |
3433 IMPORT_C TInt CreateLocal(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess); |
3377 IMPORT_C TInt CreateLocal(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess); |
3434 IMPORT_C TInt CreateLocalCode(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess); |
3378 IMPORT_C TInt CreateLocalCode(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess); |
3454 IMPORT_C TInt Bottom() const; |
3398 IMPORT_C TInt Bottom() const; |
3455 IMPORT_C TInt Top() const; |
3399 IMPORT_C TInt Top() const; |
3456 IMPORT_C TInt MaxSize() const; |
3400 IMPORT_C TInt MaxSize() const; |
3457 inline TBool IsReadable() const; |
3401 inline TBool IsReadable() const; |
3458 inline TBool IsWritable() const; |
3402 inline TBool IsWritable() const; |
|
3403 IMPORT_C TBool IsPaged() const; |
3459 private: |
3404 private: |
3460 friend class UserHeap; |
3405 friend class UserHeap; |
3461 }; |
3406 }; |
3462 |
3407 |
3463 |
3408 |
3480 EVersion0, |
3425 EVersion0, |
3481 ESupportedVersions, |
3426 ESupportedVersions, |
3482 }; |
3427 }; |
3483 |
3428 |
3484 friend class RChunk; |
3429 friend class RChunk; |
|
3430 |
|
3431 /** |
|
3432 Attributes that specify whether the chunk to be created is data paged or not. |
|
3433 */ |
|
3434 enum TChunkPagingAtt |
|
3435 { |
|
3436 EUnspecified, /**< The chunk will use the creating process's paging attributes.*/ |
|
3437 EPaged, /**< The chunk will be data paged.*/ |
|
3438 EUnpaged, /**< The chunk will not be data paged.*/ |
|
3439 }; |
3485 |
3440 |
3486 IMPORT_C TChunkCreateInfo(); |
3441 IMPORT_C TChunkCreateInfo(); |
3487 IMPORT_C void SetNormal(TInt aInitialSize, TInt aMaxSize); |
3442 IMPORT_C void SetNormal(TInt aInitialSize, TInt aMaxSize); |
3488 IMPORT_C void SetCode(TInt aInitialSize, TInt aMaxSize); |
3443 IMPORT_C void SetCode(TInt aInitialSize, TInt aMaxSize); |
3489 IMPORT_C void SetDoubleEnded(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize); |
3444 IMPORT_C void SetDoubleEnded(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize); |
3490 IMPORT_C void SetDisconnected(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize); |
3445 IMPORT_C void SetDisconnected(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize); |
3491 IMPORT_C void SetOwner(TOwnerType aType); |
3446 IMPORT_C void SetOwner(TOwnerType aType); |
3492 IMPORT_C void SetGlobal(const TDesC& aName); |
3447 IMPORT_C void SetGlobal(const TDesC& aName); |
3493 IMPORT_C void SetClearByte(TUint8 aClearByte); |
3448 IMPORT_C void SetClearByte(TUint8 aClearByte); |
|
3449 IMPORT_C void SetPaging(const TChunkPagingAtt aPaging); |
|
3450 IMPORT_C void SetReadOnly(); |
3494 void SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName); |
3451 void SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName); |
3495 |
3452 |
|
3453 /** |
|
3454 For use by file server only. |
|
3455 @internalTechnology |
|
3456 */ |
|
3457 IMPORT_C void SetCache(TInt aMaxSize); |
3496 protected : |
3458 protected : |
3497 /** The version number of this TChunkCreateInfo. |
3459 /** The version number of this TChunkCreateInfo. |
3498 @internalComponent |
3460 @internalComponent |
3499 */ |
3461 */ |
3500 TUint iVersionNumber; |
3462 TUint iVersionNumber; |
3546 TUint8 iSpare1[3]; |
3508 TUint8 iSpare1[3]; |
3547 /** @internalComponent*/ |
3509 /** @internalComponent*/ |
3548 TUint iSpare2; |
3510 TUint iSpare2; |
3549 }; |
3511 }; |
3550 |
3512 |
|
3513 /** |
|
3514 This structure specifies the type and properties of the user heap to be created. It |
|
3515 is passed as a parameter to the UserHeap::Create() method. |
|
3516 |
|
3517 @publishedAll |
|
3518 @released |
|
3519 */ |
|
3520 struct TChunkHeapCreateInfo |
|
3521 { |
|
3522 public: |
|
3523 /** |
|
3524 Currently supported version numbers |
|
3525 @internalComponent |
|
3526 */ |
|
3527 enum TChunkHeapCreateVersions |
|
3528 { |
|
3529 EVersion0, |
|
3530 ESupportedVersions, |
|
3531 }; |
|
3532 |
|
3533 /** |
|
3534 Attributes that specify whether the chunk heap to be created is data paged or not. |
|
3535 */ |
|
3536 enum TChunkHeapPagingAtt |
|
3537 { |
|
3538 EUnspecified, /**< The chunk heap will use the creating process's paging attributes.*/ |
|
3539 EPaged, /**< The chunk heap will be data paged.*/ |
|
3540 EUnpaged, /**< The chunk heap will not be data paged.*/ |
|
3541 }; |
|
3542 |
|
3543 friend class UserHeap; |
|
3544 |
|
3545 IMPORT_C TChunkHeapCreateInfo(TInt aMinLength, TInt aMaxLength); |
|
3546 IMPORT_C void SetCreateChunk(const TDesC* aName); |
|
3547 IMPORT_C void SetUseChunk(const RChunk aChunk); |
|
3548 inline void SetSingleThread(TBool aSingleThread); |
|
3549 inline void SetAlignment(TInt aAlign); |
|
3550 inline void SetGrowBy(TInt aGrowBy); |
|
3551 inline void SetOffset(TInt aOffset); |
|
3552 inline void SetMode(TUint aMode); |
|
3553 inline void SetPaging(const TChunkHeapPagingAtt aPaging); |
|
3554 |
|
3555 protected: |
|
3556 /** The version number of this TChunkHeapCreateInfo. |
|
3557 @internalComponent |
|
3558 */ |
|
3559 TUint iVersionNumber; |
|
3560 /** The minimum size for the heap. |
|
3561 @internalConponent |
|
3562 */ |
|
3563 TInt iMinLength; |
|
3564 /** The maximum size for the heap. |
|
3565 @internalConponent |
|
3566 */ |
|
3567 TInt iMaxLength; |
|
3568 /** The alignment of the heap. |
|
3569 @internalComponent |
|
3570 */ |
|
3571 TInt iAlign; |
|
3572 /** The grow by value of the heap. |
|
3573 @internalComponent |
|
3574 */ |
|
3575 TInt iGrowBy; |
|
3576 /** The single thread value of the heap. |
|
3577 @internalComponent |
|
3578 */ |
|
3579 TBool iSingleThread; |
|
3580 /** The offset from the base of the chunk to the start of the heap. |
|
3581 @internalComponent |
|
3582 */ |
|
3583 TInt iOffset; |
|
3584 /** The paging attributes of the chunk. |
|
3585 @internalComponent |
|
3586 */ |
|
3587 TChunkHeapPagingAtt iPaging; |
|
3588 /** The mode flags for the heap. |
|
3589 @internalComponent |
|
3590 */ |
|
3591 TUint iMode; |
|
3592 /** The name of the chunk to be created for the heap. |
|
3593 @internalComponent |
|
3594 */ |
|
3595 TDesC* iName; |
|
3596 /** The chunk to use for the heap. |
|
3597 @internalComponent |
|
3598 */ |
|
3599 RChunk iChunk; |
|
3600 /**@internalComponent*/ |
|
3601 TInt iSpare[5]; |
|
3602 }; |
3551 |
3603 |
3552 struct SStdEpocThreadCreateInfo; |
3604 struct SStdEpocThreadCreateInfo; |
3553 /** |
3605 /** |
3554 @publishedAll |
3606 @publishedAll |
3555 @released |
3607 @released |
3561 @see RChunk |
3613 @see RChunk |
3562 */ |
3614 */ |
3563 class UserHeap |
3615 class UserHeap |
3564 { |
3616 { |
3565 public: |
3617 public: |
3566 enum TChunkHeapCreateMode {EChunkHeapSwitchTo=1, EChunkHeapDuplicate=2}; |
3618 /** |
|
3619 Flags to control the heap creation. |
|
3620 */ |
|
3621 enum TChunkHeapCreateMode |
|
3622 { |
|
3623 /** On successful creation of the heap this switches the calling thread to |
|
3624 use the new heap. |
|
3625 */ |
|
3626 EChunkHeapSwitchTo = 0x1, |
|
3627 /** On successful creation of the heap this causes the handle to the heap |
|
3628 to be duplicated. |
|
3629 */ |
|
3630 EChunkHeapDuplicate = 0x2, |
|
3631 |
|
3632 /** @internalComponent*/ |
|
3633 EChunkHeapMask = EChunkHeapSwitchTo | EChunkHeapDuplicate, |
|
3634 }; |
3567 IMPORT_C static RHeap* FixedHeap(TAny* aBase, TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue); |
3635 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); |
3636 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); |
3637 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); |
3638 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); |
|
3639 IMPORT_C static RHeap* ChunkHeap(const TChunkHeapCreateInfo& aCreateInfo); |
3571 IMPORT_C static TInt SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); |
3640 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); |
3641 IMPORT_C static TInt CreateThreadHeap(SStdEpocThreadCreateInfo& aInfo, RHeap*& aHeap, TInt aAlign=0, TBool aSingleThread=EFalse); |
3573 }; |
3642 }; |
3574 |
3643 |
3575 |
3644 |
3617 }; |
3686 }; |
3618 |
3687 |
3619 |
3688 |
3620 |
3689 |
3621 |
3690 |
|
3691 /** |
|
3692 This structure specifies the type and properties of the thread to be created. It |
|
3693 is passed as a parameter to the RThread::Create() method. |
|
3694 |
|
3695 @publishedAll |
|
3696 @released |
|
3697 */ |
|
3698 struct TThreadCreateInfo |
|
3699 { |
|
3700 public : |
|
3701 /** |
|
3702 Currently supported version numbers |
|
3703 @internalComponent |
|
3704 */ |
|
3705 enum TThreadCreateVersions |
|
3706 { |
|
3707 EVersion0, |
|
3708 ESupportedVersions, |
|
3709 }; |
|
3710 |
|
3711 /** |
|
3712 Attributes that specify whether the stack and heap of the thread to be created |
|
3713 are data paged or not. |
|
3714 */ |
|
3715 enum TThreadPagingAtt |
|
3716 { |
|
3717 EUnspecified, /**< The thread will use the creating process's paging attributes.*/ |
|
3718 EPaged, /**< The thread will data page its stack and heap.*/ |
|
3719 EUnpaged, /**< The thread will not data page its stack and heap.*/ |
|
3720 }; |
|
3721 |
|
3722 friend class RThread; |
|
3723 |
|
3724 IMPORT_C TThreadCreateInfo( const TDesC &aName, TThreadFunction aFunction, |
|
3725 TInt aStackSize, TAny* aPtr); |
|
3726 IMPORT_C void SetCreateHeap(TInt aHeapMinSize, TInt aHeapMaxSize); |
|
3727 IMPORT_C void SetUseHeap(const RAllocator* aHeap); |
|
3728 IMPORT_C void SetOwner(const TOwnerType aOwner); |
|
3729 IMPORT_C void SetPaging(const TThreadPagingAtt aPaging); |
|
3730 |
|
3731 protected: |
|
3732 /** The version number of this TChunkCreateInfo. |
|
3733 @internalComponent |
|
3734 */ |
|
3735 TUint iVersionNumber; |
|
3736 /** The Name to be given to the thread to be created |
|
3737 @internalComponent |
|
3738 */ |
|
3739 const TDesC* iName; |
|
3740 /** The function this thread will execute. |
|
3741 @internalComponent |
|
3742 */ |
|
3743 TThreadFunction iFunction; |
|
3744 /** The size of the stack of the thread to be created. |
|
3745 @internalComponent |
|
3746 */ |
|
3747 TInt iStackSize; |
|
3748 /** The parameter to be passed to the function of the thread to be created. |
|
3749 @internalComponent |
|
3750 */ |
|
3751 TAny* iParameter; |
|
3752 /** The owner of the thread to be created. |
|
3753 @internalComponent |
|
3754 */ |
|
3755 TOwnerType iOwner; |
|
3756 /** The heap for the thread to be created to use. |
|
3757 NULL if a new heap is to be created. |
|
3758 @internalComponent |
|
3759 */ |
|
3760 RAllocator* iHeap; |
|
3761 /** Minimum size of any heap to be created for the thread. |
|
3762 @internalComponent*/ |
|
3763 TInt iHeapMinSize; |
|
3764 /** Maximum size of any heap to be created for the thread. |
|
3765 @internalComponent |
|
3766 */ |
|
3767 TInt iHeapMaxSize; |
|
3768 /** The attributes of the thread |
|
3769 @internalComponent |
|
3770 */ |
|
3771 TUint iAttributes; |
|
3772 /**@internalComponent*/ |
|
3773 TUint32 iSpare[6]; |
|
3774 }; |
|
3775 |
3622 class RProcess; |
3776 class RProcess; |
3623 |
3777 |
3624 |
3778 |
3625 /** |
3779 /** |
3626 @publishedAll |
3780 @publishedAll |
3634 { |
3788 { |
3635 public: |
3789 public: |
3636 inline RThread(); |
3790 inline RThread(); |
3637 IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize, TAny *aPtr, TOwnerType aType=EOwnerProcess); |
3791 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); |
3792 IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, RAllocator* aHeap, TAny* aPtr, TOwnerType aType=EOwnerProcess); |
|
3793 IMPORT_C TInt Create(const TThreadCreateInfo& aCreateInfo); |
3639 IMPORT_C TInt Open(const TDesC& aFullName, TOwnerType aType=EOwnerProcess); |
3794 IMPORT_C TInt Open(const TDesC& aFullName, TOwnerType aType=EOwnerProcess); |
3640 IMPORT_C TInt Open(TThreadId aID, TOwnerType aType=EOwnerProcess); |
3795 IMPORT_C TInt Open(TThreadId aID, TOwnerType aType=EOwnerProcess); |
3641 IMPORT_C TThreadId Id() const; |
3796 IMPORT_C TThreadId Id() const; |
3642 IMPORT_C void Resume() const; |
3797 IMPORT_C void Resume() const; |
3643 IMPORT_C void Suspend() const; |
3798 IMPORT_C void Suspend() const; |
3687 this could be used; |
3842 this could be used; |
3688 |
3843 |
3689 @code |
3844 @code |
3690 RThread& thread; |
3845 RThread& thread; |
3691 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId); |
3846 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId); |
3692 TInt error = mySidPolicy().CheckPolicy(thread); |
3847 TBool pass = mySidPolicy().CheckPolicy(thread); |
3693 @endcode |
3848 @endcode |
3694 |
3849 |
3695 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3850 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3696 configured by the system wide Platform Security configuration. I.e. are |
3851 configured by the system wide Platform Security configuration. I.e. are |
3697 capable of emitting diagnostic messages when a check fails and/or the |
3852 capable of emitting diagnostic messages when a check fails and/or the |
3721 this could be used; |
3876 this could be used; |
3722 |
3877 |
3723 @code |
3878 @code |
3724 RThread& thread; |
3879 RThread& thread; |
3725 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId); |
3880 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId); |
3726 TInt error = myVidPolicy().CheckPolicy(thread); |
3881 TBool pass = myVidPolicy().CheckPolicy(thread); |
3727 @endcode |
3882 @endcode |
3728 |
3883 |
3729 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3884 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3730 configured by the system wide Platform Security configuration. I.e. are |
3885 configured by the system wide Platform Security configuration. I.e. are |
3731 capable of emitting diagnostic messages when a check fails and/or the |
3886 capable of emitting diagnostic messages when a check fails and/or the |
3876 IMPORT_C TFileName FileName() const; |
4031 IMPORT_C TFileName FileName() const; |
3877 IMPORT_C TExitType ExitType() const; |
4032 IMPORT_C TExitType ExitType() const; |
3878 IMPORT_C TInt ExitReason() const; |
4033 IMPORT_C TInt ExitReason() const; |
3879 IMPORT_C TExitCategoryName ExitCategory() const; |
4034 IMPORT_C TExitCategoryName ExitCategory() const; |
3880 IMPORT_C TProcessPriority Priority() const; |
4035 IMPORT_C TProcessPriority Priority() const; |
3881 IMPORT_C void SetPriority(TProcessPriority aPriority) const; |
4036 IMPORT_C TInt SetPriority(TProcessPriority aPriority) const; |
3882 IMPORT_C TBool JustInTime() const; |
4037 IMPORT_C TBool JustInTime() const; |
3883 IMPORT_C void SetJustInTime(TBool aBoolean) const; |
4038 IMPORT_C void SetJustInTime(TBool aBoolean) const; |
3884 IMPORT_C void Logon(TRequestStatus& aStatus) const; |
4039 IMPORT_C void Logon(TRequestStatus& aStatus) const; |
3885 IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const; |
4040 IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const; |
3886 IMPORT_C TInt GetMemoryInfo(TModuleMemoryInfo& aInfo) const; |
4041 IMPORT_C TInt GetMemoryInfo(TModuleMemoryInfo& aInfo) const; |
3887 inline TInt Open(const TFindProcess& aFind,TOwnerType aType=EOwnerProcess); |
4042 inline TInt Open(const TFindProcess& aFind,TOwnerType aType=EOwnerProcess); |
3888 IMPORT_C void Rendezvous(TRequestStatus& aStatus) const; |
4043 IMPORT_C void Rendezvous(TRequestStatus& aStatus) const; |
3889 IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const; |
4044 IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const; |
3890 IMPORT_C static void Rendezvous(TInt aReason); |
4045 IMPORT_C static void Rendezvous(TInt aReason); |
|
4046 IMPORT_C TBool DefaultDataPaged() const; |
3891 |
4047 |
3892 /** |
4048 /** |
3893 Return the Secure ID of the process. |
4049 Return the Secure ID of the process. |
3894 |
4050 |
3895 If an intended use of this method is to check that the Secure ID is |
4051 If an intended use of this method is to check that the Secure ID is |
3904 this could be used; |
4060 this could be used; |
3905 |
4061 |
3906 @code |
4062 @code |
3907 RProcess& process; |
4063 RProcess& process; |
3908 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId); |
4064 static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId); |
3909 TInt error = mySidPolicy().CheckPolicy(process); |
4065 TBool pass = mySidPolicy().CheckPolicy(process); |
3910 @endcode |
4066 @endcode |
3911 |
4067 |
3912 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
4068 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3913 configured by the system wide Platform Security configuration. I.e. are |
4069 configured by the system wide Platform Security configuration. I.e. are |
3914 capable of emitting diagnostic messages when a check fails and/or the |
4070 capable of emitting diagnostic messages when a check fails and/or the |
3938 this could be used; |
4094 this could be used; |
3939 |
4095 |
3940 @code |
4096 @code |
3941 RProcess& process; |
4097 RProcess& process; |
3942 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId); |
4098 static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId); |
3943 TInt error = myVidPolicy().CheckPolicy(process); |
4099 TBool pass = myVidPolicy().CheckPolicy(process); |
3944 @endcode |
4100 @endcode |
3945 |
4101 |
3946 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
4102 This has the benefit that the TSecurityPolicy::CheckPolicy methods are |
3947 configured by the system wide Platform Security configuration. I.e. are |
4103 configured by the system wide Platform Security configuration. I.e. are |
3948 capable of emitting diagnostic messages when a check fails and/or the |
4104 capable of emitting diagnostic messages when a check fails and/or the |
4052 @internalAll |
4208 @internalAll |
4053 @deprecated No replacement |
4209 @deprecated No replacement |
4054 */ |
4210 */ |
4055 IMPORT_C TInt DataCaging(TInt aState); // __DATA_CAGING__ __SECURE_API__ remove this |
4211 IMPORT_C TInt DataCaging(TInt aState); // __DATA_CAGING__ __SECURE_API__ remove this |
4056 |
4212 |
4057 /** |
4213 |
4058 |
|
4059 CR0885 |
|
4060 |
|
4061 */ |
|
4062 IMPORT_C TInt CreateWithStackOverride(const TDesC& aFileName,const TDesC& aCommand, const TUidType &aUidType, TInt aMinStackSize, TOwnerType aType); |
4214 IMPORT_C TInt CreateWithStackOverride(const TDesC& aFileName,const TDesC& aCommand, const TUidType &aUidType, TInt aMinStackSize, TOwnerType aType); |
4063 |
4215 |
4064 IMPORT_C static TAny* ExeExportData(void); |
4216 IMPORT_C static TAny* ExeExportData(void); |
4065 |
4217 |
4066 private: |
4218 private: |
4085 class RServer2 : public RHandleBase |
4237 class RServer2 : public RHandleBase |
4086 { |
4238 { |
4087 public: |
4239 public: |
4088 IMPORT_C TInt CreateGlobal(const TDesC& aName); |
4240 IMPORT_C TInt CreateGlobal(const TDesC& aName); |
4089 IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode); |
4241 IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode); |
|
4242 IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode, TInt aRole, TInt aOpts); |
4090 IMPORT_C void Receive(RMessage2& aMessage,TRequestStatus& aStatus); |
4243 IMPORT_C void Receive(RMessage2& aMessage,TRequestStatus& aStatus); |
4091 IMPORT_C void Receive(RMessage2& aMessage); |
4244 IMPORT_C void Receive(RMessage2& aMessage); |
4092 IMPORT_C void Cancel(); |
4245 IMPORT_C void Cancel(); |
4093 }; |
4246 }; |
4094 |
4247 |
4383 private: |
4536 private: |
4384 TPtr8 iButtonVal; |
4537 TPtr8 iButtonVal; |
4385 HBufC16* iCombinedBuffer; |
4538 HBufC16* iCombinedBuffer; |
4386 }; |
4539 }; |
4387 |
4540 |
4388 |
|
4389 |
|
4390 |
|
4391 |
|
4392 |
|
4393 |
|
4394 |
|
4395 /** |
|
4396 @internalAll |
|
4397 */ |
|
4398 const TInt KMediaPasswordNotifyUid(0x10004c00); |
|
4399 |
|
4400 /** |
|
4401 @internalAll |
|
4402 */ |
|
4403 enum TMediaPswdNotifyExitMode {EMPEMUnlock, EMPEMCancel, EMPEMUnlockAndStore}; |
|
4404 |
|
4405 /** |
|
4406 @internalAll |
|
4407 */ |
|
4408 struct TMediaPswdNotifyBase |
|
4409 { |
|
4410 enum TCardType {ECTMmcPassword} iCT; |
|
4411 TVersion iVersion; |
|
4412 }; |
|
4413 |
|
4414 /** |
|
4415 @internalAll |
|
4416 */ |
|
4417 struct TMediaPswdSendNotifyInfoV1 : public TMediaPswdNotifyBase |
|
4418 { |
|
4419 // empty. |
|
4420 }; |
|
4421 |
|
4422 /** |
|
4423 @internalAll |
|
4424 */ |
|
4425 struct TMediaPswdSendNotifyInfoV1Debug : public TMediaPswdSendNotifyInfoV1 |
|
4426 { |
|
4427 TInt iSleepPeriod; // us, -ve means maximum range |
|
4428 TMediaPswdNotifyExitMode iEM; |
|
4429 TText8 iPW[KMaxMediaPassword]; |
|
4430 }; |
|
4431 |
|
4432 /** |
|
4433 @internalAll |
|
4434 */ |
|
4435 struct TMediaPswdReplyNotifyInfoV1 : public TMediaPswdNotifyBase |
|
4436 { |
|
4437 TText8 iPW[KMaxMediaPassword]; |
|
4438 TMediaPswdNotifyExitMode iEM; |
|
4439 }; |
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 /** |
4541 /** |
4445 @publishedAll |
4542 @publishedAll |
4446 @released |
4543 @released |
4447 |
4544 |
4448 Abstract class that defines a handler to work with the TRAP mechanism. |
4545 Abstract class that defines a handler to work with the TRAP mechanism. |
4567 // Cleanup support |
4664 // Cleanup support |
4568 IMPORT_C static void Leave(TInt aReason); |
4665 IMPORT_C static void Leave(TInt aReason); |
4569 IMPORT_C static void LeaveNoMemory(); |
4666 IMPORT_C static void LeaveNoMemory(); |
4570 IMPORT_C static TInt LeaveIfError(TInt aReason); |
4667 IMPORT_C static TInt LeaveIfError(TInt aReason); |
4571 IMPORT_C static TAny* LeaveIfNull(TAny* aPtr); |
4668 IMPORT_C static TAny* LeaveIfNull(TAny* aPtr); |
|
4669 inline static const TAny* LeaveIfNull(const TAny* aPtr); |
4572 IMPORT_C static TTrapHandler* SetTrapHandler(TTrapHandler* aHandler); |
4670 IMPORT_C static TTrapHandler* SetTrapHandler(TTrapHandler* aHandler); |
4573 IMPORT_C static TTrapHandler* TrapHandler(); |
4671 IMPORT_C static TTrapHandler* TrapHandler(); |
4574 IMPORT_C static TTrapHandler* MarkCleanupStack(); /**< @internalComponent */ |
4672 IMPORT_C static TTrapHandler* MarkCleanupStack(); /**< @internalComponent */ |
4575 IMPORT_C static void UnMarkCleanupStack(TTrapHandler* aHandler); /**< @internalComponent */ |
4673 IMPORT_C static void UnMarkCleanupStack(TTrapHandler* aHandler); /**< @internalComponent */ |
4576 IMPORT_C static void LeaveEnd(); /**< @internalComponent */ |
4674 IMPORT_C static void LeaveEnd(); /**< @internalComponent */ |
4637 // Algorithms |
4735 // Algorithms |
4638 IMPORT_C static TInt BinarySearch(TInt aCount,const TKey& aKey,TInt& aPos); |
4736 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); |
4737 IMPORT_C static TInt QuickSort(TInt aCount,const TKey& aKey,const TSwap& aSwap); |
4640 // Language-dependent character functions |
4738 // Language-dependent character functions |
4641 IMPORT_C static TLanguage Language(); |
4739 IMPORT_C static TLanguage Language(); |
|
4740 IMPORT_C static TRegionCode RegionCode(); |
4642 IMPORT_C static TUint Collate(TUint aChar); |
4741 IMPORT_C static TUint Collate(TUint aChar); |
4643 IMPORT_C static TUint Fold(TUint aChar); |
4742 IMPORT_C static TUint Fold(TUint aChar); |
4644 IMPORT_C static TUint LowerCase(TUint aChar); |
4743 IMPORT_C static TUint LowerCase(TUint aChar); |
4645 IMPORT_C static TUint UpperCase(TUint aChar); |
4744 IMPORT_C static TUint UpperCase(TUint aChar); |
4646 IMPORT_C static TUint Fold(TUint aChar,TInt aFlags); |
4745 IMPORT_C static TUint Fold(TUint aChar,TInt aFlags); |
4837 - ERealtimeStateOff - no action. |
4936 - ERealtimeStateOff - no action. |
4838 - ERealtimeStateOn - the the thread will be panicked with KERN-EXEC 61 (EIllegalFunctionForRealtimeThread). |
4937 - 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 |
4938 - 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. |
4939 then tracing will be emitted as if the thread state was ERealtimeStateOn. |
4841 @publishedPartner |
4940 @publishedPartner |
4842 @prototype |
4941 @released |
4843 */ |
4942 */ |
4844 enum TRealtimeState |
4943 enum TRealtimeState |
4845 { |
4944 { |
4846 ERealtimeStateOff, /**< Thread is not realtime */ |
4945 ERealtimeStateOff, /**< Thread is not realtime */ |
4847 ERealtimeStateOn, /**< Thread is realtime */ |
4946 ERealtimeStateOn, /**< Thread is realtime */ |