os/kernelhwsrv/kernel/eka/include/e32std.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32\include\e32std.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __E32STD_H__
sl@0
    19
#define __E32STD_H__
sl@0
    20
sl@0
    21
#ifdef __KERNEL_MODE__
sl@0
    22
#error !! Including e32std.h in kernel code !!
sl@0
    23
#endif
sl@0
    24
sl@0
    25
#include <e32cmn.h>
sl@0
    26
sl@0
    27
/**
sl@0
    28
@publishedAll
sl@0
    29
@released
sl@0
    30
*/
sl@0
    31
class TFunctor
sl@0
    32
	{
sl@0
    33
public:
sl@0
    34
	IMPORT_C virtual void operator()() =0;
sl@0
    35
	};
sl@0
    36
sl@0
    37
/**
sl@0
    38
@publishedAll
sl@0
    39
@released
sl@0
    40
sl@0
    41
Encapsulates a general call-back function.
sl@0
    42
sl@0
    43
The class encapsulates:
sl@0
    44
sl@0
    45
1. a pointer to a function which takes an argument of type TAny* and returns 
sl@0
    46
   a TInt.
sl@0
    47
sl@0
    48
2. a pointer which is passed to the function every time it is called.
sl@0
    49
   The pointer can point to any object. It can also be NULL.
sl@0
    50
sl@0
    51
The callback function can be a static function of a class,
sl@0
    52
e.g. TInt X::Foo(TAny *) or it can be a function which is not a member of
sl@0
    53
any class, e.g. TInt Foo(TAny *).
sl@0
    54
sl@0
    55
When used with the CIdle and the CPeriodic classes, the callback function
sl@0
    56
is intended to be called repeatedly; the encapsulated pointer is passed on
sl@0
    57
each call. Typically, the pointer refers to an object which records the state
sl@0
    58
of the task across each call. When used with CIdle, the callback function
sl@0
    59
should also return a true (non-zero) value if it is intended to be called
sl@0
    60
again, otherwise it should return a false (zero) value.
sl@0
    61
sl@0
    62
@see CIdle
sl@0
    63
@see CPeriodic
sl@0
    64
*/
sl@0
    65
class TCallBack
sl@0
    66
	{
sl@0
    67
public:
sl@0
    68
	inline TCallBack();
sl@0
    69
	inline TCallBack(TInt (*aFunction)(TAny* aPtr));
sl@0
    70
	inline TCallBack(TInt (*aFunction)(TAny* aPtr),TAny* aPtr);
sl@0
    71
	inline TInt CallBack() const;
sl@0
    72
public:
sl@0
    73
	
sl@0
    74
	/**
sl@0
    75
	A pointer to the callback function.
sl@0
    76
	*/
sl@0
    77
	TInt (*iFunction)(TAny* aPtr);
sl@0
    78
	
sl@0
    79
	
sl@0
    80
	/**
sl@0
    81
	A pointer that is passed to the callback function when
sl@0
    82
	the function is called.
sl@0
    83
	*/
sl@0
    84
	TAny* iPtr;
sl@0
    85
	};
sl@0
    86
sl@0
    87
sl@0
    88
sl@0
    89
sl@0
    90
/**
sl@0
    91
@publishedAll
sl@0
    92
@released
sl@0
    93
sl@0
    94
An object embedded within a class T so that objects of type T can form part 
sl@0
    95
of a singly linked list.
sl@0
    96
sl@0
    97
A link object encapsulates a pointer to the next link object in the list.
sl@0
    98
sl@0
    99
@see TSglQue
sl@0
   100
*/
sl@0
   101
class TSglQueLink
sl@0
   102
	{
sl@0
   103
#if defined _DEBUG
sl@0
   104
public:
sl@0
   105
	inline TSglQueLink() : iNext(NULL)
sl@0
   106
	/**
sl@0
   107
	An explicitly coded default constructor that is only defined for DEBUG builds.
sl@0
   108
	
sl@0
   109
	It sets the pointer to the next link object to NULL.
sl@0
   110
	
sl@0
   111
	@see iNext
sl@0
   112
	*/
sl@0
   113
	{}
sl@0
   114
#endif
sl@0
   115
private:
sl@0
   116
	IMPORT_C void Enque(TSglQueLink* aLink);
sl@0
   117
public:
sl@0
   118
	/**
sl@0
   119
	A pointer to the next link object in the list.
sl@0
   120
	*/
sl@0
   121
	TSglQueLink* iNext;
sl@0
   122
	friend class TSglQueBase;
sl@0
   123
	};
sl@0
   124
sl@0
   125
sl@0
   126
sl@0
   127
sl@0
   128
/**
sl@0
   129
@publishedAll
sl@0
   130
@released
sl@0
   131
sl@0
   132
A base class that provides implementation for the link object of a doubly
sl@0
   133
linked list.
sl@0
   134
sl@0
   135
It also encapsulates pointers both to the next and the previous link 
sl@0
   136
objects in the doubly linked list.
sl@0
   137
sl@0
   138
The class is abstract and is not intended to be instantiated.
sl@0
   139
sl@0
   140
@see TDblQueLink
sl@0
   141
*/
sl@0
   142
class TDblQueLinkBase
sl@0
   143
	{
sl@0
   144
public:
sl@0
   145
	inline TDblQueLinkBase() : iNext(NULL)
sl@0
   146
	/**
sl@0
   147
	Default constructor.
sl@0
   148
	
sl@0
   149
	It sets the pointer to the next link object to NULL.
sl@0
   150
	
sl@0
   151
	@see iNext
sl@0
   152
	*/
sl@0
   153
	{}
sl@0
   154
	IMPORT_C void Enque(TDblQueLinkBase* aLink);
sl@0
   155
	IMPORT_C void AddBefore(TDblQueLinkBase* aLink);
sl@0
   156
public:
sl@0
   157
	/**
sl@0
   158
	A pointer to the next link object in the list.
sl@0
   159
	*/
sl@0
   160
	TDblQueLinkBase* iNext;
sl@0
   161
	
sl@0
   162
	/**
sl@0
   163
	A pointer to the previous link object in the list.
sl@0
   164
	*/
sl@0
   165
	TDblQueLinkBase* iPrev;
sl@0
   166
	};
sl@0
   167
sl@0
   168
sl@0
   169
sl@0
   170
sl@0
   171
/**
sl@0
   172
@publishedAll
sl@0
   173
@released
sl@0
   174
sl@0
   175
An object embedded within a class T so that objects of type T can form part 
sl@0
   176
of a doubly linked list.
sl@0
   177
*/
sl@0
   178
class TDblQueLink : public TDblQueLinkBase
sl@0
   179
	{
sl@0
   180
public:
sl@0
   181
	IMPORT_C void Deque();
sl@0
   182
	};
sl@0
   183
sl@0
   184
sl@0
   185
sl@0
   186
sl@0
   187
/**
sl@0
   188
@publishedAll
sl@0
   189
@released
sl@0
   190
sl@0
   191
An object embedded within a class T so that objects of type T can form part
sl@0
   192
of an ordered doubly linked list.
sl@0
   193
sl@0
   194
Objects are added to the doubly linked list in descending priority order.
sl@0
   195
*/
sl@0
   196
class TPriQueLink : public TDblQueLink
sl@0
   197
	{
sl@0
   198
public:
sl@0
   199
	/**
sl@0
   200
	The priority value.
sl@0
   201
sl@0
   202
    Objects are added to the doubly linked list in descending order of this value.
sl@0
   203
	*/
sl@0
   204
	TInt iPriority;
sl@0
   205
	};
sl@0
   206
sl@0
   207
sl@0
   208
sl@0
   209
sl@0
   210
/**
sl@0
   211
@publishedAll
sl@0
   212
@released
sl@0
   213
sl@0
   214
An object embedded within a class T so that objects of type T can form part 
sl@0
   215
of a delta doubly linked list.
sl@0
   216
*/
sl@0
   217
class TDeltaQueLink : public TDblQueLinkBase
sl@0
   218
	{
sl@0
   219
public:
sl@0
   220
	/**
sl@0
   221
	The delta value.
sl@0
   222
	*/
sl@0
   223
	TInt iDelta;
sl@0
   224
	};
sl@0
   225
sl@0
   226
sl@0
   227
sl@0
   228
sl@0
   229
/**
sl@0
   230
@publishedAll
sl@0
   231
@released
sl@0
   232
sl@0
   233
An object embedded within a class T so that objects of type T can form part 
sl@0
   234
of a doubly linked list sorted by tick count.
sl@0
   235
*/
sl@0
   236
class TTickCountQueLink : public TDblQueLink
sl@0
   237
	{
sl@0
   238
public:
sl@0
   239
	/**
sl@0
   240
	The tick count.
sl@0
   241
	*/
sl@0
   242
	TUint iTickCount;
sl@0
   243
	};
sl@0
   244
sl@0
   245
sl@0
   246
sl@0
   247
sl@0
   248
/**
sl@0
   249
@publishedAll
sl@0
   250
@released
sl@0
   251
sl@0
   252
A base class that provides implementation for the singly linked list header. 
sl@0
   253
sl@0
   254
It also encapsulates the offset value of a link object.
sl@0
   255
sl@0
   256
The class is abstract and is not intended to be instantiated.
sl@0
   257
sl@0
   258
@see TSglQue
sl@0
   259
*/
sl@0
   260
class TSglQueBase
sl@0
   261
	{
sl@0
   262
public:
sl@0
   263
	IMPORT_C TBool IsEmpty() const;
sl@0
   264
	IMPORT_C void SetOffset(TInt aOffset);
sl@0
   265
	IMPORT_C void Reset();
sl@0
   266
protected:
sl@0
   267
	IMPORT_C TSglQueBase();
sl@0
   268
	IMPORT_C TSglQueBase(TInt aOffset);
sl@0
   269
	IMPORT_C void DoAddFirst(TAny* aPtr);
sl@0
   270
	IMPORT_C void DoAddLast(TAny* aPtr);
sl@0
   271
	IMPORT_C void DoRemove(TAny* aPtr);
sl@0
   272
protected:
sl@0
   273
	/**
sl@0
   274
	A pointer to the first element in the list.
sl@0
   275
	*/
sl@0
   276
	TSglQueLink* iHead;
sl@0
   277
	
sl@0
   278
	/**
sl@0
   279
	A pointer to the last element in the list.
sl@0
   280
	*/
sl@0
   281
	TSglQueLink* iLast;
sl@0
   282
	
sl@0
   283
	/**
sl@0
   284
	The offset of a component link object within elements that form the list.
sl@0
   285
	*/
sl@0
   286
	TInt iOffset;
sl@0
   287
private:
sl@0
   288
	TSglQueBase(const TSglQueBase& aQue);
sl@0
   289
	TSglQueBase &operator=(const TSglQueBase& aQue);
sl@0
   290
	friend class TSglQueIterBase;
sl@0
   291
	};
sl@0
   292
sl@0
   293
sl@0
   294
sl@0
   295
sl@0
   296
/**
sl@0
   297
@publishedAll
sl@0
   298
@released
sl@0
   299
sl@0
   300
A base class that provides implementation for the doubly linked list header. 
sl@0
   301
sl@0
   302
It also encapsulates the offset value of a link object.
sl@0
   303
sl@0
   304
The class is abstract and is not intended to be instantiated.
sl@0
   305
sl@0
   306
@see TDblQue
sl@0
   307
*/
sl@0
   308
class TDblQueBase
sl@0
   309
	{
sl@0
   310
public:
sl@0
   311
	IMPORT_C TBool IsEmpty() const;
sl@0
   312
	IMPORT_C void SetOffset(TInt aOffset);
sl@0
   313
	IMPORT_C void Reset();
sl@0
   314
protected:
sl@0
   315
	IMPORT_C TDblQueBase();
sl@0
   316
	IMPORT_C TDblQueBase(TInt aOffset);
sl@0
   317
	IMPORT_C void DoAddFirst(TAny* aPtr);
sl@0
   318
	IMPORT_C void DoAddLast(TAny* aPtr);
sl@0
   319
	IMPORT_C void DoAddPriority(TAny* aPtr);
sl@0
   320
	IMPORT_C void __DbgTestEmpty() const;
sl@0
   321
protected:
sl@0
   322
	/**
sl@0
   323
	The head, or anchor point of the queue.
sl@0
   324
	*/
sl@0
   325
	TDblQueLink iHead;
sl@0
   326
	
sl@0
   327
	/**
sl@0
   328
	The offset of a component link object within elements that form the list.
sl@0
   329
	*/
sl@0
   330
	TInt iOffset;
sl@0
   331
private:
sl@0
   332
	TDblQueBase(const TDblQueBase& aQue);
sl@0
   333
	TDblQueBase& operator=(const TDblQueBase& aQue);
sl@0
   334
	friend class TDblQueIterBase;
sl@0
   335
	};
sl@0
   336
sl@0
   337
sl@0
   338
sl@0
   339
sl@0
   340
/**
sl@0
   341
@publishedAll
sl@0
   342
@released
sl@0
   343
sl@0
   344
A base class that provides implementation for the TDeltaQue template class.
sl@0
   345
sl@0
   346
The class is abstract and is not intended to be instantiated.
sl@0
   347
sl@0
   348
@see TDeltaQue
sl@0
   349
*/
sl@0
   350
class TDeltaQueBase : public TDblQueBase
sl@0
   351
	{
sl@0
   352
public:
sl@0
   353
	IMPORT_C TBool CountDown();
sl@0
   354
	IMPORT_C TBool CountDown(TInt aValue);
sl@0
   355
	IMPORT_C TBool FirstDelta(TInt& aValue);
sl@0
   356
	IMPORT_C void Reset();
sl@0
   357
protected:
sl@0
   358
	IMPORT_C TDeltaQueBase();
sl@0
   359
	IMPORT_C TDeltaQueBase(TInt aOffset);
sl@0
   360
	IMPORT_C void DoAddDelta(TAny* aPtr,TInt aDelta);
sl@0
   361
	IMPORT_C void DoRemove(TAny* aPtr);
sl@0
   362
	IMPORT_C TAny* DoRemoveFirst();
sl@0
   363
protected:
sl@0
   364
	/**
sl@0
   365
	Pointer to the delta value in the first link element.
sl@0
   366
	*/
sl@0
   367
	TInt* iFirstDelta;
sl@0
   368
	};
sl@0
   369
sl@0
   370
sl@0
   371
sl@0
   372
sl@0
   373
/**
sl@0
   374
@publishedAll
sl@0
   375
@released
sl@0
   376
sl@0
   377
A templated class that provides the behaviour for managing a singly linked 
sl@0
   378
list.
sl@0
   379
sl@0
   380
It also acts as the head of the list, maintaining the pointers into the list.
sl@0
   381
sl@0
   382
The template parameter defines the type of element that forms the singly linked 
sl@0
   383
list and is the class that acts as host to the link object.
sl@0
   384
sl@0
   385
@see TSglQueLink
sl@0
   386
*/
sl@0
   387
template <class T>
sl@0
   388
class TSglQue : public TSglQueBase
sl@0
   389
	{
sl@0
   390
public:
sl@0
   391
	inline TSglQue();
sl@0
   392
	inline explicit TSglQue(TInt aOffset);
sl@0
   393
	inline void AddFirst(T& aRef);
sl@0
   394
	inline void AddLast(T& aRef);
sl@0
   395
	inline TBool IsFirst(const T* aPtr) const;
sl@0
   396
	inline TBool IsLast(const T* aPtr) const;
sl@0
   397
	inline T* First() const;
sl@0
   398
	inline T* Last() const;
sl@0
   399
	inline void Remove(T& aRef);
sl@0
   400
	};
sl@0
   401
sl@0
   402
sl@0
   403
sl@0
   404
sl@0
   405
/**
sl@0
   406
@publishedAll
sl@0
   407
@released
sl@0
   408
sl@0
   409
A templated class that provides the behaviour for managing a doubly linked 
sl@0
   410
list. 
sl@0
   411
sl@0
   412
It also acts as the head of the list, maintaining the pointers into the list.
sl@0
   413
sl@0
   414
The template parameter defines the type of element that forms the doubly linked 
sl@0
   415
list and is the class that acts as host to the link object.
sl@0
   416
sl@0
   417
@see TDblQueLink
sl@0
   418
*/
sl@0
   419
template <class T>
sl@0
   420
class TDblQue : public TDblQueBase
sl@0
   421
	{
sl@0
   422
public:
sl@0
   423
	inline TDblQue();
sl@0
   424
	inline explicit TDblQue(TInt aOffset);
sl@0
   425
	inline void AddFirst(T& aRef);
sl@0
   426
	inline void AddLast(T& aRef);
sl@0
   427
	inline TBool IsHead(const T* aPtr) const;
sl@0
   428
	inline TBool IsFirst(const T* aPtr) const;
sl@0
   429
	inline TBool IsLast(const T* aPtr) const;
sl@0
   430
	inline T* First() const;
sl@0
   431
	inline T* Last() const;
sl@0
   432
	};
sl@0
   433
sl@0
   434
sl@0
   435
sl@0
   436
sl@0
   437
/**
sl@0
   438
@publishedAll
sl@0
   439
@released
sl@0
   440
sl@0
   441
A templated class that provides the behaviour for managing a doubly linked
sl@0
   442
list in which the elements are added in descending priority order.
sl@0
   443
sl@0
   444
Priority is defined by the value of the TPriQueLink::iPriority member of
sl@0
   445
the link element.
sl@0
   446
sl@0
   447
The template parameter defines the type of element that forms the doubly linked
sl@0
   448
list and is the class that acts as host to the link object.
sl@0
   449
sl@0
   450
@see TPriQueLink
sl@0
   451
@see TPriQueLink::iPriority
sl@0
   452
*/
sl@0
   453
template <class T>
sl@0
   454
class TPriQue : public TDblQueBase
sl@0
   455
	{
sl@0
   456
public:
sl@0
   457
	inline TPriQue();
sl@0
   458
	inline explicit TPriQue(TInt aOffset);
sl@0
   459
	inline void Add(T& aRef);
sl@0
   460
	inline TBool IsHead(const T* aPtr) const;
sl@0
   461
	inline TBool IsFirst(const T* aPtr) const;
sl@0
   462
	inline TBool IsLast(const T* aPtr) const;
sl@0
   463
	inline T* First() const;
sl@0
   464
	inline T* Last() const;
sl@0
   465
	};
sl@0
   466
sl@0
   467
sl@0
   468
sl@0
   469
sl@0
   470
/**
sl@0
   471
@publishedAll
sl@0
   472
@released
sl@0
   473
sl@0
   474
A templated class that provides the behaviour for managing a doubly linked 
sl@0
   475
list in which elements represent values which are increments, or deltas, on 
sl@0
   476
the value represented by a preceding element.
sl@0
   477
sl@0
   478
The list is ordered so that the head of the queue represents a nominal zero 
sl@0
   479
point.
sl@0
   480
sl@0
   481
The delta value of a new element represents its 'distance' from the nominal 
sl@0
   482
zero point. The new element is added into the list, and the delta values of 
sl@0
   483
adjacent elements (and of the new element, if necessary) are adjusted, so 
sl@0
   484
that the sum of all deltas, up to and including the new element, is the same 
sl@0
   485
as the new element's intended 'distance' from the nominal zero point.
sl@0
   486
sl@0
   487
A common use for a list of this type is as a queue of timed events, where 
sl@0
   488
the delta values represent the intervals between the events.
sl@0
   489
sl@0
   490
The delta value is defined by the value of the TDeltaQueLink::iDelta member 
sl@0
   491
of the link element.
sl@0
   492
sl@0
   493
The template parameter defines the type of element that forms the doubly linked 
sl@0
   494
list and is the class that acts as host to the link object.
sl@0
   495
sl@0
   496
@see TDeltaQueLink
sl@0
   497
@see TDeltaQueLink::iDelta
sl@0
   498
*/
sl@0
   499
template <class T>
sl@0
   500
class TDeltaQue : public TDeltaQueBase
sl@0
   501
	{
sl@0
   502
public:
sl@0
   503
	inline TDeltaQue();
sl@0
   504
	inline explicit TDeltaQue(TInt aOffset);
sl@0
   505
	inline void Add(T& aRef,TInt aDelta);
sl@0
   506
	inline void Remove(T& aRef);
sl@0
   507
	inline T* RemoveFirst();
sl@0
   508
	};
sl@0
   509
sl@0
   510
sl@0
   511
sl@0
   512
sl@0
   513
// Forward declaration
sl@0
   514
class TTickCountQueLink;
sl@0
   515
sl@0
   516
/**
sl@0
   517
@internalComponent
sl@0
   518
@released
sl@0
   519
sl@0
   520
A class that provides the behaviour for managing a doubly linked list
sl@0
   521
in which elements are added in order of the time until their tick count.
sl@0
   522
sl@0
   523
A common use for a list of this type is as a queue of timed events, where 
sl@0
   524
the tick counts are the expiry times of the events.
sl@0
   525
sl@0
   526
The tick count is defined by the value of the TTickCountQueLink::iTickCount
sl@0
   527
member of the link element.
sl@0
   528
sl@0
   529
@see TTickCountQueLink
sl@0
   530
@see TTickCountQueLink::iTickCount
sl@0
   531
*/
sl@0
   532
class TTickCountQue : public TDblQueBase
sl@0
   533
	{
sl@0
   534
public:
sl@0
   535
	TTickCountQue();
sl@0
   536
	void Add(TTickCountQueLink& aRef);
sl@0
   537
	TTickCountQueLink* First() const;
sl@0
   538
	TTickCountQueLink* RemoveFirst();
sl@0
   539
	TTickCountQueLink* RemoveFirst(TUint aTickCount);
sl@0
   540
	};
sl@0
   541
sl@0
   542
sl@0
   543
sl@0
   544
sl@0
   545
/**
sl@0
   546
@publishedAll
sl@0
   547
@released
sl@0
   548
sl@0
   549
A base class that provides implementation for the singly linked list iterator. 
sl@0
   550
sl@0
   551
It also encapsulates a pointer to the current link link list element.
sl@0
   552
sl@0
   553
The class is abstract and is not intended to be instantiated.
sl@0
   554
*/
sl@0
   555
class TSglQueIterBase
sl@0
   556
	{
sl@0
   557
public:
sl@0
   558
	IMPORT_C void SetToFirst();
sl@0
   559
protected:
sl@0
   560
	IMPORT_C TSglQueIterBase(TSglQueBase& aQue);
sl@0
   561
	IMPORT_C TAny* DoPostInc();
sl@0
   562
	IMPORT_C TAny* DoCurrent();
sl@0
   563
	IMPORT_C void DoSet(TAny* aLink);
sl@0
   564
protected:
sl@0
   565
	TInt iOffset;
sl@0
   566
	TSglQueLink* iHead;
sl@0
   567
	TSglQueLink* iNext;
sl@0
   568
	};
sl@0
   569
sl@0
   570
sl@0
   571
sl@0
   572
sl@0
   573
/**
sl@0
   574
@publishedAll
sl@0
   575
@released
sl@0
   576
sl@0
   577
A templated class that provides the behaviour for iterating through a set of 
sl@0
   578
singly linked list elements.
sl@0
   579
sl@0
   580
The template parameter defines the type of element that forms the singly linked 
sl@0
   581
list. The class defined in the template parameter contains the link object.
sl@0
   582
*/
sl@0
   583
template <class T>
sl@0
   584
class TSglQueIter : public TSglQueIterBase
sl@0
   585
	{
sl@0
   586
public:
sl@0
   587
	inline TSglQueIter(TSglQueBase& aQue);
sl@0
   588
	inline void Set(T& aLink);
sl@0
   589
	inline operator T*();
sl@0
   590
	inline T* operator++(TInt);
sl@0
   591
	};
sl@0
   592
sl@0
   593
sl@0
   594
sl@0
   595
sl@0
   596
/**
sl@0
   597
@publishedAll
sl@0
   598
@released
sl@0
   599
sl@0
   600
A base class that provides implementation for the doubly linked list iterator.
sl@0
   601
sl@0
   602
It also encapsulates a pointer to the current link list element.
sl@0
   603
sl@0
   604
The class is abstract and is not intended to be instantiated.
sl@0
   605
*/
sl@0
   606
class TDblQueIterBase
sl@0
   607
	{
sl@0
   608
public:
sl@0
   609
	IMPORT_C void SetToFirst();
sl@0
   610
	IMPORT_C void SetToLast();
sl@0
   611
protected:
sl@0
   612
	IMPORT_C TDblQueIterBase(TDblQueBase& aQue);
sl@0
   613
	IMPORT_C TAny* DoPostInc();
sl@0
   614
	IMPORT_C TAny* DoPostDec();
sl@0
   615
	IMPORT_C TAny* DoCurrent();
sl@0
   616
	IMPORT_C void DoSet(TAny* aLink);
sl@0
   617
protected:
sl@0
   618
	/**
sl@0
   619
	The offset of a component link object within elements that form the list.
sl@0
   620
	*/
sl@0
   621
	TInt iOffset;
sl@0
   622
	
sl@0
   623
	/**
sl@0
   624
	Pointer to the anchor for the list.
sl@0
   625
	*/
sl@0
   626
	TDblQueLinkBase* iHead;
sl@0
   627
	
sl@0
   628
	/**
sl@0
   629
	Pointer to the current element.
sl@0
   630
	*/
sl@0
   631
	TDblQueLinkBase* iNext;
sl@0
   632
	};
sl@0
   633
sl@0
   634
sl@0
   635
sl@0
   636
sl@0
   637
/**
sl@0
   638
@publishedAll
sl@0
   639
@released
sl@0
   640
sl@0
   641
A templated class that provides the behaviour for iterating through a set of 
sl@0
   642
doubly linked list elements.
sl@0
   643
sl@0
   644
The template parameter defines the type of element that forms the doubly linked 
sl@0
   645
list. The class defined in the template parameter contains the link object.
sl@0
   646
*/
sl@0
   647
template <class T>
sl@0
   648
class TDblQueIter : public TDblQueIterBase
sl@0
   649
	{
sl@0
   650
public:
sl@0
   651
	inline TDblQueIter(TDblQueBase& aQue);
sl@0
   652
	inline void Set(T& aLink);
sl@0
   653
	inline operator T*();
sl@0
   654
	inline T* operator++(TInt);
sl@0
   655
	inline T* operator--(TInt);
sl@0
   656
	};
sl@0
   657
sl@0
   658
sl@0
   659
sl@0
   660
sl@0
   661
/**
sl@0
   662
@publishedAll
sl@0
   663
@released
sl@0
   664
sl@0
   665
Governs the type of comparison to be made between descriptor keys or between 
sl@0
   666
text keys.
sl@0
   667
sl@0
   668
@see TKeyArrayFix
sl@0
   669
@see TKeyArrayVar
sl@0
   670
@see TKeyArrayPak
sl@0
   671
*/
sl@0
   672
enum TKeyCmpText
sl@0
   673
	{
sl@0
   674
	/**
sl@0
   675
	For a Unicode build, this is the same as ECmpNormal16.
sl@0
   676
	For a non-Unicode build, this is the same as ECmpNormal8.
sl@0
   677
	
sl@0
   678
	Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText) 
sl@0
   679
	allows the compiler to chose the correct variant according to the build.
sl@0
   680
	*/
sl@0
   681
	ECmpNormal,
sl@0
   682
	
sl@0
   683
	
sl@0
   684
	/**
sl@0
   685
	For descriptor keys, the key is assumed to be the 8 bit variant, derived
sl@0
   686
	from TDesc8. A simple comparison is done between the content of the
sl@0
   687
	descriptors; the data is not folded and collation rules are not applied for
sl@0
   688
	the purpose of the comparison.
sl@0
   689
	
sl@0
   690
	For text keys, the key is assumed to be the 8 bit variant, of type TText8. 
sl@0
   691
	A normal comparison is done between the text data; the data is not folded 
sl@0
   692
	and collation rules are not applied for the purpose of the comparison.
sl@0
   693
	*/
sl@0
   694
	ECmpNormal8,
sl@0
   695
	
sl@0
   696
	
sl@0
   697
	/**
sl@0
   698
	For descriptor keys, the key is assumed to be the 16 bit variant, derived
sl@0
   699
	from TDesc16. A simple comparison is done between the content of the
sl@0
   700
	descriptors; the data is not folded and collation rules are not applied for
sl@0
   701
	the purpose of the comparison.
sl@0
   702
	
sl@0
   703
	For text keys, the key is assumed to be the 16 bit variant, of type
sl@0
   704
	TText16. A normal comparison is done between the text data; the data is
sl@0
   705
	not folded 	and collation rules are not applied for the purpose of the
sl@0
   706
	comparison.
sl@0
   707
	*/
sl@0
   708
	ECmpNormal16,
sl@0
   709
	
sl@0
   710
	
sl@0
   711
	/**
sl@0
   712
	For a Unicode build, this is the same as EcmpFolded16.
sl@0
   713
    For a non-Unicode build, this is the same as EcmpFolded8.
sl@0
   714
sl@0
   715
    Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText)
sl@0
   716
    allows the compiler to chose the correct variant according to the build. 
sl@0
   717
	*/
sl@0
   718
	ECmpFolded,
sl@0
   719
	
sl@0
   720
	
sl@0
   721
	/**
sl@0
   722
	For descriptor keys, the key is assumed to be the 8 bit variant,
sl@0
   723
	derived from TDesc8. The descriptor contents are folded for the purpose
sl@0
   724
	of the comparison.
sl@0
   725
sl@0
   726
    For text keys, the key is assumed to be the 8 bit variant, of type
sl@0
   727
    TText8. The text data is folded for the purpose of the comparison.
sl@0
   728
	*/
sl@0
   729
	ECmpFolded8,
sl@0
   730
	
sl@0
   731
	
sl@0
   732
	/**
sl@0
   733
	For descriptor keys, the key is assumed to be the 16 bit variant,
sl@0
   734
	derived from TDesc16. The descriptor contents are folded for the purpose
sl@0
   735
	of the comparison.
sl@0
   736
sl@0
   737
    For text keys, the key is assumed to be the 16 bit variant, of type
sl@0
   738
    TText16. The text data is folded for the purpose of the comparison.
sl@0
   739
	*/
sl@0
   740
	ECmpFolded16,
sl@0
   741
	
sl@0
   742
	
sl@0
   743
	/**
sl@0
   744
	For a Unicode build, this is the same as EcmpCollated16.
sl@0
   745
    For a non-Unicode build, this is the same as EcmpCollated8.
sl@0
   746
sl@0
   747
    Using the build independent names (i.e. TPtrC, TPtr, TBufC, TBuf or TText)
sl@0
   748
    allows the compiler to chose the correct variant according to the build.
sl@0
   749
	*/
sl@0
   750
	ECmpCollated,
sl@0
   751
	
sl@0
   752
	
sl@0
   753
	/**
sl@0
   754
	For descriptor keys, the key is assumed to be the 8 bit variant,
sl@0
   755
	derived from TDesc8. Collation rules are applied for the purpose of
sl@0
   756
	the comparison.
sl@0
   757
sl@0
   758
    For text keys, the key is assumed to be the 8 bit variant, of type 
sl@0
   759
    TText8. Collation rules are applied for the purpose of the comparison.
sl@0
   760
	*/
sl@0
   761
	ECmpCollated8,
sl@0
   762
	
sl@0
   763
	
sl@0
   764
	/**
sl@0
   765
	For descriptor keys, the key is assumed to be the 16 bit variant,
sl@0
   766
	derived from TDesc16. Collation rules are applied for the purpose of
sl@0
   767
	the comparison.
sl@0
   768
sl@0
   769
    For text keys, the key is assumed to be the 16 bit variant,
sl@0
   770
    of type TText16. Collation rules are applied for the purpose of
sl@0
   771
    the comparison.
sl@0
   772
	*/
sl@0
   773
	ECmpCollated16
sl@0
   774
	};
sl@0
   775
sl@0
   776
sl@0
   777
sl@0
   778
sl@0
   779
/**
sl@0
   780
@publishedAll
sl@0
   781
@released
sl@0
   782
sl@0
   783
Governs the type of comparison to be made between numeric keys.
sl@0
   784
sl@0
   785
@see TKeyArrayFix
sl@0
   786
@see TKeyArrayVar
sl@0
   787
@see TKeyArrayPak
sl@0
   788
*/
sl@0
   789
enum TKeyCmpNumeric
sl@0
   790
	{
sl@0
   791
	/**
sl@0
   792
	The key is assumed to be of type TInt8.
sl@0
   793
	*/
sl@0
   794
	ECmpTInt8=((ECmpCollated16+1)<<1),
sl@0
   795
	
sl@0
   796
	
sl@0
   797
	/**
sl@0
   798
	The key is assumed to be of type TInt16.
sl@0
   799
	*/
sl@0
   800
	ECmpTInt16,
sl@0
   801
	
sl@0
   802
	
sl@0
   803
	/**
sl@0
   804
	The key is assumed to be of type TInt32.
sl@0
   805
	*/
sl@0
   806
	ECmpTInt32,
sl@0
   807
	
sl@0
   808
	
sl@0
   809
	/**
sl@0
   810
	The key is assumed to be of type TInt.
sl@0
   811
	*/
sl@0
   812
	ECmpTInt,
sl@0
   813
	
sl@0
   814
	
sl@0
   815
	/**
sl@0
   816
	The key is assumed to be of type TUint8.
sl@0
   817
	*/
sl@0
   818
	ECmpTUint8,
sl@0
   819
	
sl@0
   820
	
sl@0
   821
	/**
sl@0
   822
	The key is assumed to be of type TUint16.
sl@0
   823
	*/
sl@0
   824
	ECmpTUint16,
sl@0
   825
	
sl@0
   826
	
sl@0
   827
	/**
sl@0
   828
	The key is assumed to be of type TUint32.
sl@0
   829
	*/
sl@0
   830
	ECmpTUint32,
sl@0
   831
	
sl@0
   832
	
sl@0
   833
	/**
sl@0
   834
	The key is assumed to be of type TUint.
sl@0
   835
	*/
sl@0
   836
	ECmpTUint,
sl@0
   837
	
sl@0
   838
	
sl@0
   839
	/**
sl@0
   840
	The key is assumed to be of type TInt64.
sl@0
   841
	*/
sl@0
   842
	ECmpTInt64
sl@0
   843
	};
sl@0
   844
sl@0
   845
sl@0
   846
sl@0
   847
sl@0
   848
/**
sl@0
   849
@publishedAll
sl@0
   850
@released
sl@0
   851
sl@0
   852
Defines the characteristics of a key used to access the elements of an array.
sl@0
   853
sl@0
   854
The class is abstract and cannot be instantiated. A derived class must be 
sl@0
   855
defined and implemented.
sl@0
   856
sl@0
   857
The classes TKeyArrayFix, TKeyArrayVar and TKeyArrayPak, derived from TKey, 
sl@0
   858
are already supplied to implement keys for the fixed length element, variable 
sl@0
   859
length element and packed arrays.
sl@0
   860
sl@0
   861
A derived class would normally be written to define the characteristics of 
sl@0
   862
a key for a non standard array.
sl@0
   863
sl@0
   864
@see TKeyArrayFix
sl@0
   865
@see TKeyArrayVar
sl@0
   866
@see TKeyArrayPak
sl@0
   867
*/
sl@0
   868
class TKey
sl@0
   869
	{
sl@0
   870
public:
sl@0
   871
	inline void SetPtr(const TAny* aPtr);
sl@0
   872
	IMPORT_C virtual TInt Compare(TInt aLeft,TInt aRight) const;
sl@0
   873
	IMPORT_C virtual TAny* At(TInt anIndex) const;
sl@0
   874
protected:
sl@0
   875
	IMPORT_C TKey();
sl@0
   876
	IMPORT_C TKey(TInt aOffset,TKeyCmpText aType);
sl@0
   877
	IMPORT_C TKey(TInt aOffset,TKeyCmpText aType,TInt aLength);
sl@0
   878
	IMPORT_C TKey(TInt aOffset,TKeyCmpNumeric aType);
sl@0
   879
protected:
sl@0
   880
	TInt iKeyOffset;
sl@0
   881
	TInt iKeyLength;
sl@0
   882
	TInt iCmpType;
sl@0
   883
	const TAny* iPtr;
sl@0
   884
	};
sl@0
   885
sl@0
   886
/**
sl@0
   887
@publishedAll
sl@0
   888
@released
sl@0
   889
sl@0
   890
Defines the basic behaviour for swapping two elements of an array.
sl@0
   891
sl@0
   892
The class is abstract. A derived class must be defined and implemented to 
sl@0
   893
use the functionality.
sl@0
   894
sl@0
   895
A derived class can define how to swap two elements of an array. In practice, 
sl@0
   896
this means providing an implementation for the virtual function Swap().
sl@0
   897
sl@0
   898
To support this, the derived class is also likely to need a pointer to the 
sl@0
   899
array itself and suitable constructors and/or other member functions to set 
sl@0
   900
such a pointer.
sl@0
   901
*/
sl@0
   902
class TSwap
sl@0
   903
	{
sl@0
   904
public:
sl@0
   905
	IMPORT_C TSwap();
sl@0
   906
	IMPORT_C virtual void Swap(TInt aLeft,TInt aRight) const;
sl@0
   907
	};
sl@0
   908
sl@0
   909
sl@0
   910
sl@0
   911
sl@0
   912
/**
sl@0
   913
@publishedAll
sl@0
   914
@released
sl@0
   915
sl@0
   916
Folds a specified character and provides functions to fold additional
sl@0
   917
characters after construction of the object.
sl@0
   918
sl@0
   919
Folding converts the character to a form which can be used in tolerant
sl@0
   920
comparisons without control over the operations performed. Tolerant comparisons
sl@0
   921
are those which ignore character differences like case and accents. 
sl@0
   922
sl@0
   923
Note that folding is locale-independent behaviour. It is also important to 
sl@0
   924
note that there can be no guarantee that folding is in any way culturally 
sl@0
   925
appropriate, and should not be used for matching characters in
sl@0
   926
natural language.
sl@0
   927
sl@0
   928
@see User::Fold
sl@0
   929
*/
sl@0
   930
class TCharF : public TChar
sl@0
   931
	{
sl@0
   932
public:
sl@0
   933
	inline TCharF(TUint aChar);
sl@0
   934
	inline TCharF(const TChar& aChar);
sl@0
   935
	inline TCharF& operator=(TUint aChar);
sl@0
   936
	inline TCharF& operator=(const TChar& aChar);
sl@0
   937
	};
sl@0
   938
sl@0
   939
sl@0
   940
sl@0
   941
sl@0
   942
/**
sl@0
   943
@publishedAll
sl@0
   944
@released
sl@0
   945
sl@0
   946
Converts a specified character to lower case and provides functions to convert 
sl@0
   947
additional characters after construction of the object.
sl@0
   948
*/
sl@0
   949
class TCharLC : public TChar
sl@0
   950
	{
sl@0
   951
public:
sl@0
   952
	inline TCharLC(TUint aChar);
sl@0
   953
	inline TCharLC(const TChar& aChar);
sl@0
   954
	inline TCharLC& operator=(TUint aChar);
sl@0
   955
	inline TCharLC& operator=(const TChar& aChar);
sl@0
   956
	};
sl@0
   957
sl@0
   958
sl@0
   959
sl@0
   960
sl@0
   961
/**
sl@0
   962
@publishedAll
sl@0
   963
@released
sl@0
   964
sl@0
   965
Converts a specified character to upper case and provides functions to convert 
sl@0
   966
additional characters after construction of the object.
sl@0
   967
*/
sl@0
   968
class TCharUC : public TChar
sl@0
   969
	{
sl@0
   970
public:
sl@0
   971
	inline TCharUC(TUint aChar);
sl@0
   972
	inline TCharUC(const TChar& aChar);
sl@0
   973
	inline TCharUC& operator=(TUint aChar);
sl@0
   974
	inline TCharUC& operator=(const TChar& aChar);
sl@0
   975
	};
sl@0
   976
sl@0
   977
sl@0
   978
sl@0
   979
/**
sl@0
   980
@publishedAll
sl@0
   981
@released
sl@0
   982
sl@0
   983
Defines the character representation of a real number type such
sl@0
   984
as a TReal or a TRealX.
sl@0
   985
sl@0
   986
An object of this type is used by functions that convert real values to
sl@0
   987
character format, for example, the descriptor functions:
sl@0
   988
Num(), AppendNum() and Format().
sl@0
   989
sl@0
   990
There are three constructors for constructing a suitable object.
sl@0
   991
The data members of the class, however, are public and can be
sl@0
   992
explicitly set after construction.
sl@0
   993
*/
sl@0
   994
class TRealFormat
sl@0
   995
	{
sl@0
   996
public:
sl@0
   997
	IMPORT_C TRealFormat();
sl@0
   998
	IMPORT_C TRealFormat(TInt aWidth);
sl@0
   999
	IMPORT_C TRealFormat(TInt aWidth,TInt aDecimalPlaces);
sl@0
  1000
public:
sl@0
  1001
    /**
sl@0
  1002
    Governs the format of the character representation of the real number.
sl@0
  1003
sl@0
  1004
    This is set to one of the defined format types.
sl@0
  1005
sl@0
  1006
    One or more of the defined format flags can subsequently be ORed into this member.
sl@0
  1007
    
sl@0
  1008
    @see KRealFormatFixed
sl@0
  1009
    @see KRealFormatExponent
sl@0
  1010
    @see KRealFormatGeneral
sl@0
  1011
    @see KRealFormatNoExponent
sl@0
  1012
    @see KRealFormatCalculator
sl@0
  1013
    @see KExtraSpaceForSign
sl@0
  1014
    @see KAllowThreeDigitExp
sl@0
  1015
    @see KDoNotUseTriads
sl@0
  1016
    @see KGeneralLimit
sl@0
  1017
    @see KUseSigFigs
sl@0
  1018
    */
sl@0
  1019
	TInt iType;
sl@0
  1020
	
sl@0
  1021
	
sl@0
  1022
	/**
sl@0
  1023
	Defines the maximum number of characters required to represent the number.
sl@0
  1024
	*/
sl@0
  1025
	TInt iWidth;
sl@0
  1026
	
sl@0
  1027
	
sl@0
  1028
	/**
sl@0
  1029
	Defines either the number of characters to be used to represent the decimal
sl@0
  1030
	portion of the number, or the maximum number of significant digits in
sl@0
  1031
	the character representation of the number.
sl@0
  1032
sl@0
  1033
    The interpretation depends on the chosen format as defined by iType.
sl@0
  1034
    
sl@0
  1035
	@see TRealFormat::iType
sl@0
  1036
	*/
sl@0
  1037
	TInt iPlaces;
sl@0
  1038
	
sl@0
  1039
	
sl@0
  1040
	/**
sl@0
  1041
	Defines the character to be used to separate the integer portion of
sl@0
  1042
	a number representation from its decimal portion.
sl@0
  1043
sl@0
  1044
    In general, the character used for this purpose is a matter of local
sl@0
  1045
    convention. The TLocale::DecimalSeparator() function can supply the
sl@0
  1046
    desired character.
sl@0
  1047
sl@0
  1048
    @see TLocale
sl@0
  1049
	*/
sl@0
  1050
	TChar iPoint;
sl@0
  1051
	
sl@0
  1052
	
sl@0
  1053
	/**
sl@0
  1054
	Defines the character to be used to delimit groups of three digits in
sl@0
  1055
	the integer part of the number.
sl@0
  1056
sl@0
  1057
    In general, the character used for this purpose is a matter of local
sl@0
  1058
    convention. The TLocale::ThousandsSeparator() function can supply the
sl@0
  1059
    desired character.
sl@0
  1060
sl@0
  1061
    @see TLocale
sl@0
  1062
	*/
sl@0
  1063
	TChar iTriad;
sl@0
  1064
	
sl@0
  1065
	
sl@0
  1066
	/**
sl@0
  1067
	Defines the threshold number of digits above which triad separation is to
sl@0
  1068
	occur. A value of zero disables triad separation and no triad separation
sl@0
  1069
	character (i.e. the character held in iTriad) is inserted into the
sl@0
  1070
	resulting character representation regardless of the number of characters.
sl@0
  1071
sl@0
  1072
    For example, a value of 1 causes the number 1000 to be represented by the
sl@0
  1073
    characters "1,000" whereas a value of 4 causes the same number to be
sl@0
  1074
    represented by the characters "1000" (This assumes the ‘,’ triad separation
sl@0
  1075
    character).
sl@0
  1076
sl@0
  1077
    Note that no triad separation occurs if the flag KDoNotUseTriads is set in
sl@0
  1078
    the iType data member.
sl@0
  1079
sl@0
  1080
	@see TRealFormat::iTriad
sl@0
  1081
	@see KDoNotUseTriads
sl@0
  1082
	*/
sl@0
  1083
	TInt iTriLen;
sl@0
  1084
	};
sl@0
  1085
sl@0
  1086
sl@0
  1087
sl@0
  1088
sl@0
  1089
/**
sl@0
  1090
@publishedAll
sl@0
  1091
@released
sl@0
  1092
sl@0
  1093
Defines the extraction mark used by the TLex8 class to indicate the current 
sl@0
  1094
lexical element being analysed.
sl@0
  1095
sl@0
  1096
In practice, objects of this type are accessed through the TLexMark typedef.
sl@0
  1097
sl@0
  1098
@see TLexMark
sl@0
  1099
@see TLex8
sl@0
  1100
*/
sl@0
  1101
class TLexMark8
sl@0
  1102
	{
sl@0
  1103
public:
sl@0
  1104
	inline TLexMark8();
sl@0
  1105
private:
sl@0
  1106
	inline TLexMark8(const TUint8* aString);
sl@0
  1107
	const TUint8* iPtr;
sl@0
  1108
	friend class TLex8;
sl@0
  1109
	__DECLARE_TEST;
sl@0
  1110
	};
sl@0
  1111
sl@0
  1112
sl@0
  1113
sl@0
  1114
sl@0
  1115
class TRealX;
sl@0
  1116
/**
sl@0
  1117
@publishedAll
sl@0
  1118
@released
sl@0
  1119
sl@0
  1120
Provides general string-parsing functions suitable for numeric format
sl@0
  1121
conversions and syntactical-element parsing.
sl@0
  1122
sl@0
  1123
The class is the 8-bit variant for non-Unicode strings and 8-bit wide
sl@0
  1124
characters.
sl@0
  1125
sl@0
  1126
An instance of this class stores a string, maintaining an extraction mark 
sl@0
  1127
to indicate the current lexical element being analysed and a pointer to the 
sl@0
  1128
next character to be examined.
sl@0
  1129
sl@0
  1130
Objects of this type are normally accessed through the build independent type 
sl@0
  1131
TLex.
sl@0
  1132
sl@0
  1133
@see TLex
sl@0
  1134
*/
sl@0
  1135
class TLex8
sl@0
  1136
	{
sl@0
  1137
public:
sl@0
  1138
	IMPORT_C TLex8();
sl@0
  1139
	inline TLex8(const TUint8* aString);
sl@0
  1140
	inline TLex8(const TDesC8& aDes);
sl@0
  1141
	inline TLex8& operator=(const TUint8* aString);
sl@0
  1142
	inline TLex8& operator=(const TDesC8& aDes);
sl@0
  1143
	inline TBool Eos() const;
sl@0
  1144
	inline void Mark(TLexMark8& aMark) const;
sl@0
  1145
	inline void Mark();
sl@0
  1146
	IMPORT_C void Inc();
sl@0
  1147
	IMPORT_C void Inc(TInt aNumber);
sl@0
  1148
	IMPORT_C TChar Get();
sl@0
  1149
	IMPORT_C TChar Peek() const;
sl@0
  1150
	IMPORT_C void UnGet();
sl@0
  1151
	inline void UnGetToMark();
sl@0
  1152
	IMPORT_C void UnGetToMark(const TLexMark8 aMark);
sl@0
  1153
	IMPORT_C void SkipSpace();
sl@0
  1154
	inline void SkipAndMark(TInt aNumber);
sl@0
  1155
	IMPORT_C void SkipAndMark(TInt aNumber, TLexMark8& aMark);
sl@0
  1156
	inline void SkipSpaceAndMark();
sl@0
  1157
	IMPORT_C void SkipSpaceAndMark(TLexMark8& aMark);
sl@0
  1158
	IMPORT_C void SkipCharacters();
sl@0
  1159
	inline TInt TokenLength() const;
sl@0
  1160
	IMPORT_C TInt TokenLength(const TLexMark8 aMark) const;
sl@0
  1161
	IMPORT_C TPtrC8 MarkedToken() const;
sl@0
  1162
	IMPORT_C TPtrC8 MarkedToken(const TLexMark8 aMark) const;
sl@0
  1163
	IMPORT_C TPtrC8 NextToken();
sl@0
  1164
	IMPORT_C TPtrC8 Remainder() const;
sl@0
  1165
	IMPORT_C TPtrC8 RemainderFromMark() const;
sl@0
  1166
	IMPORT_C TPtrC8 RemainderFromMark(const TLexMark8 aMark) const;
sl@0
  1167
	IMPORT_C TInt Offset() const;
sl@0
  1168
	inline TInt MarkedOffset() const;
sl@0
  1169
	IMPORT_C TInt MarkedOffset(const TLexMark8 aMark) const;
sl@0
  1170
	IMPORT_C TInt Val(TInt8& aVal);
sl@0
  1171
	IMPORT_C TInt Val(TInt16& aVal);
sl@0
  1172
	IMPORT_C TInt Val(TInt32& aVal);
sl@0
  1173
	IMPORT_C TInt Val(TInt64& aVal);
sl@0
  1174
	inline TInt Val(TInt& aVal);
sl@0
  1175
	IMPORT_C TInt Val(TUint8& aVal,TRadix aRadix);
sl@0
  1176
	IMPORT_C TInt Val(TUint16& aVal,TRadix aRadix);
sl@0
  1177
	IMPORT_C TInt Val(TUint32& aVal,TRadix aRadix);
sl@0
  1178
	IMPORT_C TInt Val(TInt64& aVal, TRadix aRadix);
sl@0
  1179
	inline TInt Val(TUint& aVal,TRadix aRadix=EDecimal);
sl@0
  1180
	IMPORT_C TInt BoundedVal(TInt32& aVal,TInt aLimit);
sl@0
  1181
	IMPORT_C TInt BoundedVal(TInt64& aVal, const TInt64& aLimit);
sl@0
  1182
	IMPORT_C TInt BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit);
sl@0
  1183
	IMPORT_C TInt BoundedVal(TInt64& aVal, TRadix aRadix, const TInt64& aLimit);
sl@0
  1184
	IMPORT_C TInt Val(TReal32& aVal);
sl@0
  1185
	IMPORT_C TInt Val(TReal32& aVal,TChar aPoint);
sl@0
  1186
	IMPORT_C TInt Val(TReal64& aVal);
sl@0
  1187
	IMPORT_C TInt Val(TReal64& aVal,TChar aPoint);
sl@0
  1188
	inline void Assign(const TLex8& aLex);
sl@0
  1189
	IMPORT_C void Assign(const TUint8* aString);
sl@0
  1190
	IMPORT_C void Assign(const TDesC8& aDes);
sl@0
  1191
	TInt Val(TRealX& aVal);
sl@0
  1192
	TInt Val(TRealX& aVal, TChar aPoint);
sl@0
  1193
sl@0
  1194
	/** @deprecated Use BoundedVal(TInt32& aVal,TInt aLimit) */
sl@0
  1195
	inline TInt Val(TInt32& aVal,TInt aLimit) { return BoundedVal(aVal,aLimit); };
sl@0
  1196
sl@0
  1197
	/** @deprecated Use BoundedVal(TInt64& aVal,const TInt64& aLimit) */
sl@0
  1198
	inline TInt Val(TInt64& aVal,const TInt64& aLimit) { return BoundedVal(aVal,aLimit); };
sl@0
  1199
sl@0
  1200
	/** @deprecated Use BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit) */
sl@0
  1201
	inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
sl@0
  1202
sl@0
  1203
	/** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) */
sl@0
  1204
	inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
sl@0
  1205
private:
sl@0
  1206
	void Scndig(TInt& aSig, TInt& aExp, TUint64& aDl);
sl@0
  1207
	void ScndigAfterPoint(TInt& aSig, TUint64& aDl);
sl@0
  1208
	void ValidateMark(const TLexMark8 aMark) const;
sl@0
  1209
private:
sl@0
  1210
	const TUint8* iNext;
sl@0
  1211
	const TUint8* iBuf;
sl@0
  1212
	const TUint8* iEnd;
sl@0
  1213
	TLexMark8 iMark;
sl@0
  1214
	__DECLARE_TEST;
sl@0
  1215
	};
sl@0
  1216
sl@0
  1217
sl@0
  1218
sl@0
  1219
sl@0
  1220
/**
sl@0
  1221
@publishedAll
sl@0
  1222
@released
sl@0
  1223
sl@0
  1224
Defines the extraction mark used by the TLex16 class to indicate the current 
sl@0
  1225
lexical element being analysed.
sl@0
  1226
sl@0
  1227
In practice, objects of this type are accessed through the TLexMark typedef.
sl@0
  1228
sl@0
  1229
@see TLexMark
sl@0
  1230
@see TLex16
sl@0
  1231
*/
sl@0
  1232
class TLexMark16
sl@0
  1233
	{
sl@0
  1234
public:
sl@0
  1235
	inline TLexMark16();
sl@0
  1236
private:
sl@0
  1237
	inline TLexMark16(const TUint16* aString);
sl@0
  1238
	const TUint16* iPtr;
sl@0
  1239
	friend class TLex16;	
sl@0
  1240
	__DECLARE_TEST;
sl@0
  1241
	};
sl@0
  1242
sl@0
  1243
sl@0
  1244
sl@0
  1245
sl@0
  1246
/**
sl@0
  1247
@publishedAll
sl@0
  1248
@released
sl@0
  1249
sl@0
  1250
Provides general string-parsing functions suitable for numeric format
sl@0
  1251
conversions and syntactical-element parsing. 
sl@0
  1252
sl@0
  1253
The class is the 16-bit variant for Unicode strings and 16-bit wide
sl@0
  1254
characters.
sl@0
  1255
sl@0
  1256
An instance of this class stores a string, maintaining an extraction mark 
sl@0
  1257
to indicate the current lexical element being analysed and a pointer to the 
sl@0
  1258
next character to be examined.
sl@0
  1259
sl@0
  1260
Objects of this type are normally accessed through the build independent type 
sl@0
  1261
TLex.
sl@0
  1262
sl@0
  1263
@see TLex
sl@0
  1264
*/
sl@0
  1265
class TLex16
sl@0
  1266
	{
sl@0
  1267
public:
sl@0
  1268
	IMPORT_C TLex16();
sl@0
  1269
	inline TLex16(const TUint16* aString);
sl@0
  1270
	inline TLex16(const TDesC16& aDes);
sl@0
  1271
	inline TLex16& operator=(const TUint16* aString);
sl@0
  1272
	inline TLex16& operator=(const TDesC16& aDes);
sl@0
  1273
	inline TBool Eos() const;
sl@0
  1274
	inline void Mark();
sl@0
  1275
	inline void Mark(TLexMark16& aMark) const;
sl@0
  1276
	IMPORT_C void Inc();
sl@0
  1277
	IMPORT_C void Inc(TInt aNumber);
sl@0
  1278
	IMPORT_C TChar Get();
sl@0
  1279
	IMPORT_C TChar Peek() const;
sl@0
  1280
	IMPORT_C void UnGet();
sl@0
  1281
	inline void UnGetToMark();
sl@0
  1282
	IMPORT_C void UnGetToMark(const TLexMark16 aMark);
sl@0
  1283
	IMPORT_C void SkipSpace();
sl@0
  1284
	inline void SkipAndMark(TInt aNumber);
sl@0
  1285
	IMPORT_C void SkipAndMark(TInt aNumber, TLexMark16& aMark);
sl@0
  1286
	IMPORT_C void SkipSpaceAndMark(TLexMark16& aMark);
sl@0
  1287
	inline void SkipSpaceAndMark();
sl@0
  1288
	IMPORT_C void SkipCharacters();
sl@0
  1289
	inline TInt TokenLength() const;
sl@0
  1290
	IMPORT_C TInt TokenLength(const TLexMark16 aMark) const;
sl@0
  1291
	IMPORT_C TPtrC16 MarkedToken() const;
sl@0
  1292
	IMPORT_C TPtrC16 MarkedToken(const TLexMark16 aMark) const;
sl@0
  1293
	IMPORT_C TPtrC16 NextToken();
sl@0
  1294
	IMPORT_C TPtrC16 Remainder() const;
sl@0
  1295
	IMPORT_C TPtrC16 RemainderFromMark() const;
sl@0
  1296
	IMPORT_C TPtrC16 RemainderFromMark(const TLexMark16 aMark) const;
sl@0
  1297
	IMPORT_C TInt Offset() const;
sl@0
  1298
	inline TInt MarkedOffset() const;
sl@0
  1299
	IMPORT_C TInt MarkedOffset(const TLexMark16 aMark) const;
sl@0
  1300
	IMPORT_C TInt Val(TInt8& aVal);
sl@0
  1301
	IMPORT_C TInt Val(TInt16& aVal);
sl@0
  1302
	IMPORT_C TInt Val(TInt32& aVal);
sl@0
  1303
	IMPORT_C TInt Val(TInt64& aVal);
sl@0
  1304
	inline TInt Val(TInt& aVal);
sl@0
  1305
	IMPORT_C TInt Val(TUint8& aVal,TRadix aRadix);
sl@0
  1306
	IMPORT_C TInt Val(TUint16& aVal,TRadix aRadix);
sl@0
  1307
	IMPORT_C TInt Val(TUint32& aVal,TRadix aRadix);
sl@0
  1308
	IMPORT_C TInt Val(TInt64& aVal, TRadix aRadix);
sl@0
  1309
//	inline TInt Val(TInt64& aVal, TRadix aRadix) {return Val(aVal,aRadix);}
sl@0
  1310
	inline TInt Val(TUint& aVal,TRadix aRadix=EDecimal);
sl@0
  1311
	IMPORT_C TInt BoundedVal(TInt32& aVal,TInt aLimit);
sl@0
  1312
	IMPORT_C TInt BoundedVal(TInt64& aVal, const TInt64& aLimit);
sl@0
  1313
	IMPORT_C TInt BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit);
sl@0
  1314
	IMPORT_C TInt BoundedVal(TInt64& aVal, TRadix aRadix, const TInt64& aLimit);
sl@0
  1315
	IMPORT_C TInt Val(TReal32& aVal);
sl@0
  1316
	IMPORT_C TInt Val(TReal32& aVal,TChar aPoint);
sl@0
  1317
	IMPORT_C TInt Val(TReal64& aVal);
sl@0
  1318
	IMPORT_C TInt Val(TReal64& aVal,TChar aPoint);
sl@0
  1319
	inline void Assign(const TLex16& aLex);
sl@0
  1320
	IMPORT_C void Assign(const TUint16* aString);
sl@0
  1321
	IMPORT_C void Assign(const TDesC16& aDes);		
sl@0
  1322
	TInt Val(TRealX& aVal);
sl@0
  1323
	TInt Val(TRealX& aVal, TChar aPoint);
sl@0
  1324
sl@0
  1325
	/** @deprecated Use BoundedVal(TInt32& aVal,TInt aLimit) */
sl@0
  1326
	inline TInt Val(TInt32& aVal,TInt aLimit) { return BoundedVal(aVal,aLimit); };
sl@0
  1327
sl@0
  1328
	/** @deprecated Use BoundedVal(TInt64& aVal,const TInt64& aLimit) */
sl@0
  1329
	inline TInt Val(TInt64& aVal,const TInt64& aLimit) { return BoundedVal(aVal,aLimit); };
sl@0
  1330
sl@0
  1331
	/** @deprecated Use BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit) */
sl@0
  1332
	inline TInt Val(TUint32& aVal,TRadix aRadix,TUint aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
sl@0
  1333
sl@0
  1334
	/** @deprecated Use BoundedVal(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) */
sl@0
  1335
	inline TInt Val(TInt64& aVal,TRadix aRadix,const TInt64& aLimit) { return BoundedVal(aVal,aRadix,aLimit); };
sl@0
  1336
private:
sl@0
  1337
	void Scndig(TInt& aSig, TInt& aExp, TUint64& aDl);
sl@0
  1338
	void ValidateMark(const TLexMark16 aMark) const;
sl@0
  1339
private:
sl@0
  1340
	const TUint16* iNext;
sl@0
  1341
	const TUint16* iBuf;
sl@0
  1342
	const TUint16* iEnd;
sl@0
  1343
	TLexMark16 iMark;
sl@0
  1344
	__DECLARE_TEST;
sl@0
  1345
	};
sl@0
  1346
sl@0
  1347
sl@0
  1348
sl@0
  1349
sl@0
  1350
#if defined(_UNICODE)
sl@0
  1351
/**
sl@0
  1352
@publishedAll
sl@0
  1353
@released
sl@0
  1354
sl@0
  1355
Provides access to general string-parsing functions suitable for numeric format 
sl@0
  1356
conversions and syntactical-element parsing.
sl@0
  1357
sl@0
  1358
It maps directly to either a TLex16 for a Unicode build or a TLex8 for a non-Unicode 
sl@0
  1359
build.
sl@0
  1360
sl@0
  1361
The build independent type should always be used unless an explicit 16 bit 
sl@0
  1362
or 8 bit build variant is required.
sl@0
  1363
sl@0
  1364
@see TLex16
sl@0
  1365
@see TLex8
sl@0
  1366
*/
sl@0
  1367
typedef TLex16 TLex;
sl@0
  1368
sl@0
  1369
sl@0
  1370
sl@0
  1371
sl@0
  1372
/**
sl@0
  1373
@publishedAll
sl@0
  1374
@released
sl@0
  1375
sl@0
  1376
Defines the extraction mark used by the TLex classes to indicate the current 
sl@0
  1377
lexical element being analysed. 
sl@0
  1378
sl@0
  1379
It maps directly to either a TLexMark16 for a Unicode build or a TLexMark8 
sl@0
  1380
for a non-Unicode build.
sl@0
  1381
sl@0
  1382
The build independent type should always be used unless an explicit 16 bit 
sl@0
  1383
or 8 bit build variant is required.
sl@0
  1384
*/
sl@0
  1385
typedef TLexMark16 TLexMark;
sl@0
  1386
sl@0
  1387
sl@0
  1388
sl@0
  1389
sl@0
  1390
#else
sl@0
  1391
sl@0
  1392
sl@0
  1393
sl@0
  1394
/**
sl@0
  1395
@publishedAll
sl@0
  1396
@released
sl@0
  1397
sl@0
  1398
Provides access to general string-parsing functions suitable for numeric format 
sl@0
  1399
conversions and syntactical-element parsing.
sl@0
  1400
sl@0
  1401
It maps directly to either a TLex16 for a Unicode build or a TLex8 for a non-Unicode 
sl@0
  1402
build.
sl@0
  1403
sl@0
  1404
The build independent type should always be used unless an explicit 16 bit 
sl@0
  1405
or 8 bit build variant is required.
sl@0
  1406
sl@0
  1407
@see TLex16
sl@0
  1408
@see TLex8
sl@0
  1409
*/
sl@0
  1410
typedef TLex8 TLex;
sl@0
  1411
sl@0
  1412
sl@0
  1413
sl@0
  1414
sl@0
  1415
/**
sl@0
  1416
@publishedAll
sl@0
  1417
@released
sl@0
  1418
sl@0
  1419
Defines the extraction mark used by the TLex classes to indicate the current 
sl@0
  1420
lexical element being analysed. 
sl@0
  1421
sl@0
  1422
It maps directly to either a TLexMark16 for a Unicode build or a TLexMark8 
sl@0
  1423
for a non-Unicode build.
sl@0
  1424
sl@0
  1425
The build independent type should always be used unless an explicit 16 bit 
sl@0
  1426
or 8 bit build variant is required.
sl@0
  1427
*/
sl@0
  1428
typedef TLexMark8 TLexMark;
sl@0
  1429
#endif
sl@0
  1430
sl@0
  1431
sl@0
  1432
sl@0
  1433
sl@0
  1434
/**
sl@0
  1435
@publishedAll
sl@0
  1436
@released
sl@0
  1437
sl@0
  1438
Packages a Uid type together with a checksum.
sl@0
  1439
sl@0
  1440
@see TUidType
sl@0
  1441
*/
sl@0
  1442
class TCheckedUid
sl@0
  1443
	{
sl@0
  1444
public:
sl@0
  1445
	IMPORT_C TCheckedUid();
sl@0
  1446
	IMPORT_C TCheckedUid(const TUidType& aUidType);
sl@0
  1447
	IMPORT_C TCheckedUid(const TDesC8& aPtr);
sl@0
  1448
	IMPORT_C void Set(const TUidType& aUidType);
sl@0
  1449
	IMPORT_C void Set(const TDesC8& aPtr);
sl@0
  1450
	IMPORT_C TPtrC8 Des() const;
sl@0
  1451
	inline const TUidType& UidType() const;
sl@0
  1452
protected:
sl@0
  1453
	IMPORT_C TUint Check() const;
sl@0
  1454
private:
sl@0
  1455
	TUidType iType;
sl@0
  1456
	TUint iCheck;
sl@0
  1457
	};
sl@0
  1458
sl@0
  1459
sl@0
  1460
sl@0
  1461
sl@0
  1462
/**
sl@0
  1463
@publishedAll
sl@0
  1464
@released
sl@0
  1465
sl@0
  1466
A date and time object in which the individual components are accessible in
sl@0
  1467
human-readable form.
sl@0
  1468
sl@0
  1469
The individual components are: year, month, day, hour, minute,
sl@0
  1470
second and microsecond.
sl@0
  1471
sl@0
  1472
These components are stored as integers and all except the year are checked for
sl@0
  1473
validity when a TDateTime is constructed or assigned new values.
sl@0
  1474
sl@0
  1475
This class only supports getting and setting the entire date/time or any component 
sl@0
  1476
of it. It does not support adding or subtracting intervals to or from a time. 
sl@0
  1477
For functions which manipulate times, use class TTime.
sl@0
  1478
sl@0
  1479
@see TTime
sl@0
  1480
*/
sl@0
  1481
class TDateTime
sl@0
  1482
	{
sl@0
  1483
public:
sl@0
  1484
	inline TDateTime();
sl@0
  1485
	IMPORT_C TDateTime(TInt aYear,TMonth aMonth,TInt aDay,TInt aHour,TInt aMinute, TInt aSecond,TInt aMicroSecond);
sl@0
  1486
	IMPORT_C TInt Set(TInt aYear,TMonth aMonth,TInt aDay,TInt aHour,TInt aMinute, TInt aSecond,TInt aMicroSecond);
sl@0
  1487
	IMPORT_C TInt SetYear(TInt aYear);
sl@0
  1488
	IMPORT_C TInt SetYearLeapCheck(TInt aYear);
sl@0
  1489
	IMPORT_C TInt SetMonth(TMonth aMonth);
sl@0
  1490
	IMPORT_C TInt SetDay(TInt aDay);
sl@0
  1491
	IMPORT_C TInt SetHour(TInt aHour);
sl@0
  1492
	IMPORT_C TInt SetMinute(TInt aMinute);
sl@0
  1493
	IMPORT_C TInt SetSecond(TInt aSecond);
sl@0
  1494
	IMPORT_C TInt SetMicroSecond(TInt aMicroSecond);
sl@0
  1495
	inline TInt Year() const;
sl@0
  1496
	inline TMonth Month() const;
sl@0
  1497
	inline TInt Day() const;
sl@0
  1498
	inline TInt Hour() const;
sl@0
  1499
	inline TInt Minute() const;
sl@0
  1500
	inline TInt Second() const;
sl@0
  1501
	inline TInt MicroSecond() const;
sl@0
  1502
private:
sl@0
  1503
	TInt iYear;
sl@0
  1504
	TMonth iMonth;
sl@0
  1505
	TInt iDay;
sl@0
  1506
	TInt iHour;
sl@0
  1507
	TInt iMinute;
sl@0
  1508
	TInt iSecond;
sl@0
  1509
	TInt iMicroSecond;
sl@0
  1510
	};
sl@0
  1511
sl@0
  1512
sl@0
  1513
sl@0
  1514
sl@0
  1515
/**
sl@0
  1516
@publishedAll
sl@0
  1517
@released
sl@0
  1518
sl@0
  1519
Represents a time interval of a millionth of a second stored as
sl@0
  1520
a 64-bit integer. 
sl@0
  1521
sl@0
  1522
It supports the initialisation, setting and getting of an interval and provides
sl@0
  1523
standard comparison operations. Objects of this class can be added to and
sl@0
  1524
subtracted from TTime objects.
sl@0
  1525
sl@0
  1526
@see TTime
sl@0
  1527
*/
sl@0
  1528
class TTimeIntervalMicroSeconds
sl@0
  1529
	{
sl@0
  1530
public:
sl@0
  1531
	inline TTimeIntervalMicroSeconds();
sl@0
  1532
	inline TTimeIntervalMicroSeconds(const TInt64& aInterval);
sl@0
  1533
	inline TTimeIntervalMicroSeconds& operator=(const TInt64& aInterval);
sl@0
  1534
	inline TBool operator==(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1535
	inline TBool operator!=(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1536
	inline TBool operator>=(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1537
	inline TBool operator<=(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1538
	inline TBool operator>(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1539
	inline TBool operator<(const TTimeIntervalMicroSeconds& aInterval) const;
sl@0
  1540
	inline const TInt64& Int64() const;
sl@0
  1541
private:
sl@0
  1542
	TInt64 iInterval;
sl@0
  1543
	};
sl@0
  1544
sl@0
  1545
sl@0
  1546
sl@0
  1547
sl@0
  1548
/**
sl@0
  1549
@publishedAll
sl@0
  1550
@released
sl@0
  1551
sl@0
  1552
Provides a base class for all time interval classes using
sl@0
  1553
a 32-bit representation. 
sl@0
  1554
sl@0
  1555
It supports retrieving the interval and provides various operations for
sl@0
  1556
comparing intervals. Its concrete derived classes can be added to and
sl@0
  1557
subtracted from a TTime.
sl@0
  1558
sl@0
  1559
The comparison operators simply compare the integer representations of the 
sl@0
  1560
two intervals. They do not take account of different time interval units. 
sl@0
  1561
So, for example, when comparing for equality an interval of three hours with 
sl@0
  1562
an interval of three days, the result is true.
sl@0
  1563
sl@0
  1564
@see TTime
sl@0
  1565
*/
sl@0
  1566
class TTimeIntervalBase
sl@0
  1567
	{
sl@0
  1568
public:
sl@0
  1569
	inline TBool operator==(TTimeIntervalBase aInterval) const;
sl@0
  1570
	inline TBool operator!=(TTimeIntervalBase aInterval) const;
sl@0
  1571
	inline TBool operator>=(TTimeIntervalBase aInterval) const;
sl@0
  1572
	inline TBool operator<=(TTimeIntervalBase aInterval) const;
sl@0
  1573
	inline TBool operator>(TTimeIntervalBase aInterval) const;
sl@0
  1574
	inline TBool operator<(TTimeIntervalBase aInterval) const;
sl@0
  1575
	inline TInt Int() const;
sl@0
  1576
protected:
sl@0
  1577
	inline TTimeIntervalBase();
sl@0
  1578
	inline TTimeIntervalBase(TInt aInterval);
sl@0
  1579
protected:
sl@0
  1580
	TInt iInterval;
sl@0
  1581
	};
sl@0
  1582
sl@0
  1583
sl@0
  1584
sl@0
  1585
sl@0
  1586
/**
sl@0
  1587
@publishedAll
sl@0
  1588
@released
sl@0
  1589
sl@0
  1590
Represents a microsecond time interval stored in 32 rather than 64 bits.
sl@0
  1591
sl@0
  1592
Its range is +-2147483647, which is +-35 minutes, 47 seconds. Comparison and 
sl@0
  1593
interval retrieval functions are provided by the base class TTimeIntervalBase.
sl@0
  1594
*/
sl@0
  1595
class TTimeIntervalMicroSeconds32 : public TTimeIntervalBase
sl@0
  1596
	{
sl@0
  1597
public:
sl@0
  1598
	inline TTimeIntervalMicroSeconds32();
sl@0
  1599
	inline TTimeIntervalMicroSeconds32(TInt aInterval);
sl@0
  1600
	inline TTimeIntervalMicroSeconds32& operator=(TInt aInterval);
sl@0
  1601
	};
sl@0
  1602
sl@0
  1603
sl@0
  1604
sl@0
  1605
sl@0
  1606
/**
sl@0
  1607
@publishedAll
sl@0
  1608
@released
sl@0
  1609
sl@0
  1610
Represents a time interval in seconds.
sl@0
  1611
sl@0
  1612
Comparison and interval retrieval functions 
sl@0
  1613
are provided by the base class TTimeIntervalBase.
sl@0
  1614
sl@0
  1615
The range of values which it can represent is +-2147483647, which is equal to
sl@0
  1616
+-24855 days (approximately 68 years).
sl@0
  1617
*/
sl@0
  1618
class TTimeIntervalSeconds : public TTimeIntervalBase
sl@0
  1619
	{
sl@0
  1620
public:
sl@0
  1621
	inline TTimeIntervalSeconds();
sl@0
  1622
	inline TTimeIntervalSeconds(TInt aInterval);
sl@0
  1623
	inline TTimeIntervalSeconds& operator=(TInt aInterval);
sl@0
  1624
	};
sl@0
  1625
sl@0
  1626
sl@0
  1627
sl@0
  1628
sl@0
  1629
/**
sl@0
  1630
@publishedAll
sl@0
  1631
@released
sl@0
  1632
sl@0
  1633
Represents a time interval in minutes.
sl@0
  1634
sl@0
  1635
Comparison and interval retrieval functions 
sl@0
  1636
are provided by the base class TTimeIntervalBase.
sl@0
  1637
*/
sl@0
  1638
class TTimeIntervalMinutes : public TTimeIntervalBase
sl@0
  1639
	{
sl@0
  1640
public:
sl@0
  1641
	inline TTimeIntervalMinutes();
sl@0
  1642
	inline TTimeIntervalMinutes(TInt aInterval);
sl@0
  1643
	inline TTimeIntervalMinutes& operator=(TInt aInterval);
sl@0
  1644
	};
sl@0
  1645
sl@0
  1646
sl@0
  1647
sl@0
  1648
sl@0
  1649
/**
sl@0
  1650
@publishedAll
sl@0
  1651
@released
sl@0
  1652
sl@0
  1653
Represents a time interval in hours.
sl@0
  1654
sl@0
  1655
Comparison and interval retrieval functions 
sl@0
  1656
are provided by the base class TTimeIntervalBase.
sl@0
  1657
*/
sl@0
  1658
class TTimeIntervalHours : public TTimeIntervalBase
sl@0
  1659
	{
sl@0
  1660
public:
sl@0
  1661
	inline TTimeIntervalHours();
sl@0
  1662
	inline TTimeIntervalHours(TInt aInterval);
sl@0
  1663
	inline TTimeIntervalHours& operator=(TInt aInterval);
sl@0
  1664
	};
sl@0
  1665
sl@0
  1666
sl@0
  1667
sl@0
  1668
sl@0
  1669
/**
sl@0
  1670
@publishedAll
sl@0
  1671
@released
sl@0
  1672
sl@0
  1673
Represents a time interval in days.
sl@0
  1674
sl@0
  1675
Comparison and interval retrieval functions 
sl@0
  1676
are provided by the base class TTimeIntervalBase.
sl@0
  1677
*/
sl@0
  1678
class TTimeIntervalDays : public TTimeIntervalBase
sl@0
  1679
	{
sl@0
  1680
public:
sl@0
  1681
	inline TTimeIntervalDays();
sl@0
  1682
	inline TTimeIntervalDays(TInt aInterval);
sl@0
  1683
	inline TTimeIntervalDays& operator=(TInt aInterval);
sl@0
  1684
	};
sl@0
  1685
sl@0
  1686
sl@0
  1687
sl@0
  1688
sl@0
  1689
/**
sl@0
  1690
@publishedAll
sl@0
  1691
@released
sl@0
  1692
sl@0
  1693
Represents a time interval in months.
sl@0
  1694
sl@0
  1695
Comparison and interval retrieval functions 
sl@0
  1696
are provided by the base class TTimeIntervalBase.
sl@0
  1697
*/
sl@0
  1698
class TTimeIntervalMonths : public TTimeIntervalBase
sl@0
  1699
	{
sl@0
  1700
public:
sl@0
  1701
	inline TTimeIntervalMonths();
sl@0
  1702
	inline TTimeIntervalMonths(TInt aInterval);
sl@0
  1703
	inline TTimeIntervalMonths& operator=(TInt aInterval);
sl@0
  1704
	};
sl@0
  1705
sl@0
  1706
sl@0
  1707
sl@0
  1708
sl@0
  1709
/**
sl@0
  1710
@publishedAll
sl@0
  1711
@released
sl@0
  1712
sl@0
  1713
Represents a time interval in years.
sl@0
  1714
sl@0
  1715
Comparison and interval retrieval functions 
sl@0
  1716
are provided by the base class TTimeIntervalBase.
sl@0
  1717
*/
sl@0
  1718
class TTimeIntervalYears : public TTimeIntervalBase
sl@0
  1719
	{
sl@0
  1720
public:
sl@0
  1721
	inline TTimeIntervalYears();
sl@0
  1722
	inline TTimeIntervalYears(TInt aInterval);
sl@0
  1723
	inline TTimeIntervalYears& operator=(TInt aInterval);
sl@0
  1724
	};
sl@0
  1725
	
sl@0
  1726
	
sl@0
  1727
	
sl@0
  1728
/**
sl@0
  1729
@publishedAll
sl@0
  1730
@released
sl@0
  1731
sl@0
  1732
An enumeration one or both of whose enumerator values may be returned
sl@0
  1733
by TTime::Parse().
sl@0
  1734
sl@0
  1735
@see TTime::Parse
sl@0
  1736
*/
sl@0
  1737
enum {
sl@0
  1738
     /**
sl@0
  1739
     Indicates that a time is present.
sl@0
  1740
     
sl@0
  1741
     @see TTime::Parse
sl@0
  1742
     */
sl@0
  1743
     EParseTimePresent=0x1,
sl@0
  1744
     /**
sl@0
  1745
     Indicates that a date is present.
sl@0
  1746
     
sl@0
  1747
     @see TTime::Parse
sl@0
  1748
     */
sl@0
  1749
     EParseDatePresent=0x2
sl@0
  1750
     };
sl@0
  1751
sl@0
  1752
sl@0
  1753
sl@0
  1754
class TLocale;
sl@0
  1755
/**
sl@0
  1756
@publishedAll
sl@0
  1757
@released
sl@0
  1758
sl@0
  1759
Stores and manipulates the date and time. 
sl@0
  1760
sl@0
  1761
It represents a date and time as a number of microseconds since midnight, 
sl@0
  1762
January 1st, 1 AD nominal Gregorian. BC dates are represented by negative 
sl@0
  1763
TTime values. A TTime object may be constructed from a TInt64, a TDateTime 
sl@0
  1764
a string literal, or by default, which initialises the time to an arbitrary 
sl@0
  1765
value. To access human-readable time information, the TTime may be converted 
sl@0
  1766
from a TInt64 into a TDateTime, which represents the date and time as seven 
sl@0
  1767
numeric fields and provides functions to extract these fields. Alternatively, 
sl@0
  1768
to display the time as text, the time may be formatted and placed into a
sl@0
  1769
descriptor using a variety of formatting commands and which may or may not
sl@0
  1770
honour the system's locale settings. The conversion between time and text may
sl@0
  1771
be performed the other way around, so that a descriptor can be parsed and
sl@0
  1772
converted into a TTime value.
sl@0
  1773
sl@0
  1774
In addition to setting and getting the date and time and converting between 
sl@0
  1775
text and time, TTime provides functions to get intervals between times and 
sl@0
  1776
standard comparison and arithmetic operators which enable time intervals to 
sl@0
  1777
be added or subtracted to or from the time.
sl@0
  1778
sl@0
  1779
@see TInt64
sl@0
  1780
@see TDateTime
sl@0
  1781
*/
sl@0
  1782
class TTime
sl@0
  1783
	{
sl@0
  1784
public:
sl@0
  1785
	inline TTime();
sl@0
  1786
	inline TTime(const TInt64& aTime);
sl@0
  1787
	IMPORT_C TTime(const TDesC& aString);
sl@0
  1788
	IMPORT_C TTime(const TDateTime& aDateTime);
sl@0
  1789
	inline TTime& operator=(const TInt64& aTime);
sl@0
  1790
	IMPORT_C TTime& operator=(const TDateTime& aDateTime);
sl@0
  1791
	IMPORT_C void HomeTime();
sl@0
  1792
	IMPORT_C void UniversalTime();
sl@0
  1793
	IMPORT_C TInt Set(const TDesC& aString);
sl@0
  1794
	IMPORT_C TInt HomeTimeSecure();
sl@0
  1795
	IMPORT_C TInt UniversalTimeSecure();
sl@0
  1796
sl@0
  1797
	IMPORT_C TDateTime DateTime() const;
sl@0
  1798
	IMPORT_C TTimeIntervalMicroSeconds MicroSecondsFrom(TTime aTime) const;
sl@0
  1799
	IMPORT_C TInt SecondsFrom(TTime aTime,TTimeIntervalSeconds& aInterval) const;
sl@0
  1800
	IMPORT_C TInt MinutesFrom(TTime aTime,TTimeIntervalMinutes& aInterval) const;
sl@0
  1801
	IMPORT_C TInt HoursFrom(TTime aTime,TTimeIntervalHours& aInterval) const;
sl@0
  1802
	IMPORT_C TTimeIntervalDays DaysFrom(TTime aTime) const;
sl@0
  1803
	IMPORT_C TTimeIntervalMonths MonthsFrom(TTime aTime) const;
sl@0
  1804
	IMPORT_C TTimeIntervalYears YearsFrom(TTime aTime) const;
sl@0
  1805
sl@0
  1806
	IMPORT_C TInt DaysInMonth() const;
sl@0
  1807
	IMPORT_C TDay DayNoInWeek() const;
sl@0
  1808
	IMPORT_C TInt DayNoInMonth() const;
sl@0
  1809
	IMPORT_C TInt DayNoInYear() const;
sl@0
  1810
	IMPORT_C TInt DayNoInYear(TTime aStartDate) const;
sl@0
  1811
	IMPORT_C TInt WeekNoInYear() const;
sl@0
  1812
	IMPORT_C TInt WeekNoInYear(TTime aStartDate) const;
sl@0
  1813
	IMPORT_C TInt WeekNoInYear(TFirstWeekRule aRule) const;
sl@0
  1814
	IMPORT_C TInt WeekNoInYear(TTime aStartDate,TFirstWeekRule aRule) const;
sl@0
  1815
	IMPORT_C void FormatL(TDes& aDes,const TDesC& aFormat) const;
sl@0
  1816
	IMPORT_C void FormatL(TDes& aDes,const TDesC& aFormat,const TLocale& aLocale) const;
sl@0
  1817
	IMPORT_C void RoundUpToNextMinute();
sl@0
  1818
	IMPORT_C TInt Parse(const TDesC& aDes,TInt aCenturyOffset=0);
sl@0
  1819
sl@0
  1820
	IMPORT_C TTime operator+(TTimeIntervalYears aYear) const;
sl@0
  1821
	IMPORT_C TTime operator+(TTimeIntervalMonths aMonth) const;
sl@0
  1822
	IMPORT_C TTime operator+(TTimeIntervalDays aDay) const;
sl@0
  1823
	IMPORT_C TTime operator+(TTimeIntervalHours aHour) const;
sl@0
  1824
	IMPORT_C TTime operator+(TTimeIntervalMinutes aMinute) const;
sl@0
  1825
	IMPORT_C TTime operator+(TTimeIntervalSeconds aSecond) const;  	
sl@0
  1826
	IMPORT_C TTime operator+(TTimeIntervalMicroSeconds aMicroSecond) const;
sl@0
  1827
	IMPORT_C TTime operator+(TTimeIntervalMicroSeconds32 aMicroSecond) const;
sl@0
  1828
	IMPORT_C TTime operator-(TTimeIntervalYears aYear) const;
sl@0
  1829
	IMPORT_C TTime operator-(TTimeIntervalMonths aMonth) const;
sl@0
  1830
	IMPORT_C TTime operator-(TTimeIntervalDays aDay) const;
sl@0
  1831
	IMPORT_C TTime operator-(TTimeIntervalHours aHour) const;
sl@0
  1832
	IMPORT_C TTime operator-(TTimeIntervalMinutes aMinute) const;
sl@0
  1833
	IMPORT_C TTime operator-(TTimeIntervalSeconds aSecond) const;  	
sl@0
  1834
	IMPORT_C TTime operator-(TTimeIntervalMicroSeconds aMicroSecond) const;
sl@0
  1835
	IMPORT_C TTime operator-(TTimeIntervalMicroSeconds32 aMicroSecond) const;
sl@0
  1836
	IMPORT_C TTime& operator+=(TTimeIntervalYears aYear);
sl@0
  1837
	IMPORT_C TTime& operator+=(TTimeIntervalMonths aMonth);
sl@0
  1838
	IMPORT_C TTime& operator+=(TTimeIntervalDays aDay);
sl@0
  1839
	IMPORT_C TTime& operator+=(TTimeIntervalHours aHour);
sl@0
  1840
	IMPORT_C TTime& operator+=(TTimeIntervalMinutes aMinute);
sl@0
  1841
	IMPORT_C TTime& operator+=(TTimeIntervalSeconds aSecond);	
sl@0
  1842
	IMPORT_C TTime& operator+=(TTimeIntervalMicroSeconds aMicroSecond);
sl@0
  1843
	IMPORT_C TTime& operator+=(TTimeIntervalMicroSeconds32 aMicroSecond);
sl@0
  1844
	IMPORT_C TTime& operator-=(TTimeIntervalYears aYear);
sl@0
  1845
	IMPORT_C TTime& operator-=(TTimeIntervalMonths aMonth);
sl@0
  1846
	IMPORT_C TTime& operator-=(TTimeIntervalDays aDay);
sl@0
  1847
	IMPORT_C TTime& operator-=(TTimeIntervalHours aHour);
sl@0
  1848
	IMPORT_C TTime& operator-=(TTimeIntervalMinutes aMinute);
sl@0
  1849
	IMPORT_C TTime& operator-=(TTimeIntervalSeconds aSecond);	
sl@0
  1850
	IMPORT_C TTime& operator-=(TTimeIntervalMicroSeconds aMicroSecond);
sl@0
  1851
	IMPORT_C TTime& operator-=(TTimeIntervalMicroSeconds32 aMicroSecond);
sl@0
  1852
	inline TBool operator==(TTime aTime) const;
sl@0
  1853
	inline TBool operator!=(TTime aTime) const;
sl@0
  1854
	inline TBool operator>=(TTime aTime) const;
sl@0
  1855
	inline TBool operator<=(TTime aTime) const;
sl@0
  1856
	inline TBool operator>(TTime aTime) const;
sl@0
  1857
	inline TBool operator<(TTime aTime) const;
sl@0
  1858
	inline const TInt64& Int64() const;
sl@0
  1859
private:
sl@0
  1860
	static TTime Convert(const TDateTime& aDateTime);
sl@0
  1861
private:
sl@0
  1862
	TInt64 iTime;
sl@0
  1863
	__DECLARE_TEST;
sl@0
  1864
	};
sl@0
  1865
sl@0
  1866
sl@0
  1867
sl@0
  1868
sl@0
  1869
/**
sl@0
  1870
@publishedAll
sl@0
  1871
@released
sl@0
  1872
sl@0
  1873
A utility class whose functions may be used by the other date/time related 
sl@0
  1874
classes.
sl@0
  1875
*/
sl@0
  1876
class Time
sl@0
  1877
	{
sl@0
  1878
public:
sl@0
  1879
	IMPORT_C static TTime NullTTime();
sl@0
  1880
	IMPORT_C static TTime MaxTTime();
sl@0
  1881
	IMPORT_C static TTime MinTTime();
sl@0
  1882
	IMPORT_C static TInt DaysInMonth(TInt aYear, TMonth aMonth);
sl@0
  1883
	IMPORT_C static TBool IsLeapYear(TInt aYear);
sl@0
  1884
	IMPORT_C static TInt LeapYearsUpTo(TInt aYear);
sl@0
  1885
	};
sl@0
  1886
sl@0
  1887
sl@0
  1888
sl@0
  1889
sl@0
  1890
/**
sl@0
  1891
@publishedAll
sl@0
  1892
@released
sl@0
  1893
sl@0
  1894
Gets a copy of the current locale's full text name for a day of the week.
sl@0
  1895
sl@0
  1896
After construction or after a call to Set(), the copy of the text can be accessed 
sl@0
  1897
and manipulated using the standard descriptor member functions provided by 
sl@0
  1898
the base class.
sl@0
  1899
sl@0
  1900
@see KMaxDayName
sl@0
  1901
*/
sl@0
  1902
class TDayName : public TBuf<KMaxDayName>
sl@0
  1903
	{
sl@0
  1904
public:
sl@0
  1905
	IMPORT_C TDayName();
sl@0
  1906
	IMPORT_C TDayName(TDay aDay);
sl@0
  1907
	IMPORT_C void Set(TDay aDay);
sl@0
  1908
	};
sl@0
  1909
sl@0
  1910
sl@0
  1911
sl@0
  1912
sl@0
  1913
/**
sl@0
  1914
@publishedAll
sl@0
  1915
@released
sl@0
  1916
sl@0
  1917
Gets a copy of the current locale's abbreviated text name for a day of the 
sl@0
  1918
week.
sl@0
  1919
sl@0
  1920
After construction or after a call to Set(), the copy of the abbreviated text 
sl@0
  1921
can be accessed and manipulated using the standard descriptor member functions 
sl@0
  1922
provided by the base class.
sl@0
  1923
sl@0
  1924
The abbreviated day name cannot be assumed to be one character. In English, 
sl@0
  1925
it is 3 characters (Mon, Tue, Wed etc.), but the length can vary from locale 
sl@0
  1926
to locale, with a maximum length of KMaxDayNameAbb.
sl@0
  1927
sl@0
  1928
@see KMaxDayNameAbb
sl@0
  1929
*/
sl@0
  1930
class TDayNameAbb : public TBuf<KMaxDayNameAbb>
sl@0
  1931
	{
sl@0
  1932
public:
sl@0
  1933
	IMPORT_C TDayNameAbb();
sl@0
  1934
	IMPORT_C TDayNameAbb(TDay aDay);
sl@0
  1935
	IMPORT_C void Set(TDay aDay);
sl@0
  1936
	};
sl@0
  1937
sl@0
  1938
sl@0
  1939
sl@0
  1940
sl@0
  1941
/**
sl@0
  1942
@publishedAll
sl@0
  1943
@released
sl@0
  1944
sl@0
  1945
Gets a copy of the current locale's full text name for a month.
sl@0
  1946
sl@0
  1947
After construction or after a call to Set(), the copy of the text can be accessed 
sl@0
  1948
and manipulated using the standard descriptor member functions provided by 
sl@0
  1949
the base class.
sl@0
  1950
sl@0
  1951
@see KMaxMonthName
sl@0
  1952
*/
sl@0
  1953
class TMonthName : public TBuf<KMaxMonthName>
sl@0
  1954
	{
sl@0
  1955
public:
sl@0
  1956
	IMPORT_C TMonthName();
sl@0
  1957
	IMPORT_C TMonthName(TMonth aMonth);
sl@0
  1958
	IMPORT_C void Set(TMonth aMonth);
sl@0
  1959
	};
sl@0
  1960
sl@0
  1961
sl@0
  1962
sl@0
  1963
sl@0
  1964
/**
sl@0
  1965
@publishedAll
sl@0
  1966
@released
sl@0
  1967
sl@0
  1968
Gets a copy of the current locale's abbreviated text name for a month.
sl@0
  1969
sl@0
  1970
After construction or after a call to Set(), the copy of the abbreviated text 
sl@0
  1971
can be accessed and manipulated using the standard descriptor member functions 
sl@0
  1972
provided by the base class.
sl@0
  1973
sl@0
  1974
@see KMaxMonthNameAbb
sl@0
  1975
*/
sl@0
  1976
class TMonthNameAbb : public TBuf<KMaxMonthNameAbb>
sl@0
  1977
	{
sl@0
  1978
public:
sl@0
  1979
	IMPORT_C TMonthNameAbb();
sl@0
  1980
	IMPORT_C TMonthNameAbb(TMonth aMonth);
sl@0
  1981
	IMPORT_C void Set(TMonth aMonth);
sl@0
  1982
	};
sl@0
  1983
sl@0
  1984
sl@0
  1985
sl@0
  1986
sl@0
  1987
/**
sl@0
  1988
@publishedAll
sl@0
  1989
@released
sl@0
  1990
sl@0
  1991
Gets a copy of the current locale's date suffix text for a specific day in 
sl@0
  1992
the month.
sl@0
  1993
sl@0
  1994
The text is the set of characters which can be appended to dates of the month 
sl@0
  1995
(e.g. in English, st for 1st, nd for 2nd etc).
sl@0
  1996
sl@0
  1997
After construction or after a call to Set(), the copy of the suffix text can 
sl@0
  1998
be accessed and manipulated using the standard descriptor member functions 
sl@0
  1999
provided by the base class.
sl@0
  2000
*/
sl@0
  2001
class TDateSuffix : public TBuf<KMaxSuffix>
sl@0
  2002
	{
sl@0
  2003
public:
sl@0
  2004
	IMPORT_C TDateSuffix();
sl@0
  2005
	IMPORT_C TDateSuffix(TInt aDateSuffix);
sl@0
  2006
	IMPORT_C void Set(TInt aDateSuffix);
sl@0
  2007
	};
sl@0
  2008
sl@0
  2009
sl@0
  2010
sl@0
  2011
sl@0
  2012
/**
sl@0
  2013
@publishedAll
sl@0
  2014
@released
sl@0
  2015
sl@0
  2016
Current locale's am/pm text
sl@0
  2017
sl@0
  2018
This class retrieves a copy of the current locale's text identifying time 
sl@0
  2019
before and after noon. In English, this is am and pm.
sl@0
  2020
sl@0
  2021
After construction or after a call to Set(), the copy of the text can be accessed 
sl@0
  2022
and manipulated using the standard descriptor member functions provided by 
sl@0
  2023
the base class.
sl@0
  2024
*/
sl@0
  2025
class TAmPmName : public TBuf<KMaxAmPmName>
sl@0
  2026
	{
sl@0
  2027
public:
sl@0
  2028
	IMPORT_C TAmPmName();
sl@0
  2029
	IMPORT_C TAmPmName(TAmPm aSelector);
sl@0
  2030
	IMPORT_C void Set(TAmPm aSelector);
sl@0
  2031
	};
sl@0
  2032
sl@0
  2033
sl@0
  2034
sl@0
  2035
sl@0
  2036
/**
sl@0
  2037
@publishedAll
sl@0
  2038
@released
sl@0
  2039
sl@0
  2040
Gets a copy of the currency symbol(s) in use by the current locale.
sl@0
  2041
sl@0
  2042
After construction or after a call to TCurrencySymbol::Set(), the copy of 
sl@0
  2043
the currency symbol(s) can be accessed and manipulated using the standard 
sl@0
  2044
descriptor member functions provided by the base class.
sl@0
  2045
*/
sl@0
  2046
class TCurrencySymbol : public TBuf<KMaxCurrencySymbol>
sl@0
  2047
	{
sl@0
  2048
public:
sl@0
  2049
	IMPORT_C TCurrencySymbol();
sl@0
  2050
	IMPORT_C void Set();
sl@0
  2051
	};
sl@0
  2052
sl@0
  2053
sl@0
  2054
sl@0
  2055
sl@0
  2056
/**
sl@0
  2057
@publishedAll
sl@0
  2058
@released
sl@0
  2059
sl@0
  2060
Contains a format list that defines the short date format.
sl@0
  2061
sl@0
  2062
An instance of this class should be passed as the second argument
sl@0
  2063
to TTime::FormatL().
sl@0
  2064
The string does not include any time components. The content of the long 
sl@0
  2065
date format specification is taken from the system-wide settings.
sl@0
  2066
sl@0
  2067
For example, in the English locale, the short date format would be something
sl@0
  2068
like 14/1/2000.
sl@0
  2069
sl@0
  2070
This class is used as follows:
sl@0
  2071
sl@0
  2072
@code
sl@0
  2073
TTime now;
sl@0
  2074
now.HomeTime();
sl@0
  2075
TBuf<KMaxShortDateFormatSpec*2> buffer;
sl@0
  2076
now.FormatL(buffer,TShortDateFormatSpec());
sl@0
  2077
@endcode
sl@0
  2078
sl@0
  2079
@see KMaxShortDateFormatSpec
sl@0
  2080
@see TTime::FormatL
sl@0
  2081
*/
sl@0
  2082
class TShortDateFormatSpec : public TBuf<KMaxShortDateFormatSpec> // to be passed into TTime::FormatL
sl@0
  2083
	{
sl@0
  2084
public:
sl@0
  2085
	IMPORT_C TShortDateFormatSpec();
sl@0
  2086
	IMPORT_C void Set();
sl@0
  2087
	};
sl@0
  2088
sl@0
  2089
sl@0
  2090
sl@0
  2091
sl@0
  2092
/**
sl@0
  2093
@publishedAll
sl@0
  2094
@released
sl@0
  2095
sl@0
  2096
Contains a format list that defines the long date format.
sl@0
  2097
sl@0
  2098
An instance of this class should be passed as the second argument
sl@0
  2099
to TTime::FormatL(). 
sl@0
  2100
The string does not include any time components. The content of the long 
sl@0
  2101
date format specification is taken from the system-wide settings.
sl@0
  2102
sl@0
  2103
For example, in the English locale, the long date format would be
sl@0
  2104
something like 14th January 2000.
sl@0
  2105
sl@0
  2106
This class is used as follows:
sl@0
  2107
sl@0
  2108
@code
sl@0
  2109
TTime now;
sl@0
  2110
now.HomeTime();
sl@0
  2111
TBuf<KMaxLongDateFormatSpec*2> buffer;
sl@0
  2112
now.FormatL(buffer,TLongDateFormatSpec());
sl@0
  2113
@endcode
sl@0
  2114
sl@0
  2115
@see KMaxLongDateFormatSpec
sl@0
  2116
@see TTime::FormatL
sl@0
  2117
*/
sl@0
  2118
class TLongDateFormatSpec : public TBuf<KMaxLongDateFormatSpec> // to be passed into TTime::FormatL
sl@0
  2119
	{
sl@0
  2120
public:
sl@0
  2121
	IMPORT_C TLongDateFormatSpec();
sl@0
  2122
	IMPORT_C void Set();
sl@0
  2123
	};
sl@0
  2124
sl@0
  2125
sl@0
  2126
sl@0
  2127
sl@0
  2128
/**
sl@0
  2129
@publishedAll
sl@0
  2130
@released
sl@0
  2131
sl@0
  2132
Contains a format list that defines the time string format. 
sl@0
  2133
sl@0
  2134
An instance of this class should be passed as the second argument
sl@0
  2135
to TTime::FormatL().
sl@0
  2136
The string does not include any time components. The content of the time format 
sl@0
  2137
specification is taken from the system-wide settings.
sl@0
  2138
sl@0
  2139
This class is used as follows:
sl@0
  2140
sl@0
  2141
@code
sl@0
  2142
TTime now;
sl@0
  2143
now.HomeTime();
sl@0
  2144
TBuf<KMaxTimeFormatSpec*2> buffer;
sl@0
  2145
now.FormatL(buffer,TTimeFormatSpec());
sl@0
  2146
@endcode
sl@0
  2147
sl@0
  2148
@see KMaxTimeFormatSpec
sl@0
  2149
@see TTime::FormatL
sl@0
  2150
*/
sl@0
  2151
class TTimeFormatSpec : public TBuf<KMaxTimeFormatSpec> // to be passed into TTime::FormatL
sl@0
  2152
	{
sl@0
  2153
public:
sl@0
  2154
	IMPORT_C TTimeFormatSpec();
sl@0
  2155
	IMPORT_C void Set();
sl@0
  2156
	};
sl@0
  2157
sl@0
  2158
sl@0
  2159
sl@0
  2160
sl@0
  2161
/**
sl@0
  2162
@publishedAll
sl@0
  2163
@released
sl@0
  2164
sl@0
  2165
Sets and gets the system's locale settings.
sl@0
  2166
sl@0
  2167
Symbian OS maintains the locale information internally. On
sl@0
  2168
construction, this object is initialized with the system information
sl@0
  2169
for all locale items.
sl@0
  2170
*/
sl@0
  2171
class TLocale
sl@0
  2172
	{
sl@0
  2173
public:
sl@0
  2174
		
sl@0
  2175
    /**
sl@0
  2176
    Indicates how negative currency values are formatted.
sl@0
  2177
    */
sl@0
  2178
	enum TNegativeCurrencyFormat
sl@0
  2179
		{
sl@0
  2180
	    /**
sl@0
  2181
	    A minus sign is inserted before the currency symbol and value.
sl@0
  2182
	    */
sl@0
  2183
		ELeadingMinusSign,
sl@0
  2184
sl@0
  2185
		/**
sl@0
  2186
		The currency value and symbol are enclosed in brackets (no minus sign
sl@0
  2187
		is used).
sl@0
  2188
		*/
sl@0
  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
sl@0
  2190
			
sl@0
  2191
	    /**
sl@0
  2192
	    A minus sign is inserted after the currency symbol and value.
sl@0
  2193
        */
sl@0
  2194
		ETrailingMinusSign,
sl@0
  2195
		
sl@0
  2196
        /**
sl@0
  2197
        A minus sign is inserted between the currency symbol and the value.
sl@0
  2198
        */
sl@0
  2199
		EInterveningMinusSign
sl@0
  2200
		};
sl@0
  2201
		
sl@0
  2202
	/**
sl@0
  2203
	Flags for negative currency values formatting
sl@0
  2204
	*/
sl@0
  2205
	enum 
sl@0
  2206
		{
sl@0
  2207
		/** 
sl@0
  2208
		If this flag is set and the currency value being formatted is negative,
sl@0
  2209
		if there is a space between the currency symbol and the value,
sl@0
  2210
		that space is lost. 
sl@0
  2211
		*/
sl@0
  2212
		EFlagNegativeLoseSpace = 0x00000001,
sl@0
  2213
		
sl@0
  2214
		/**   
sl@0
  2215
		If this flag is set and the currency value being formatted is negative,
sl@0
  2216
		the position of the currency symbol is placed in the opposite direction 
sl@0
  2217
		from the position set for the positive currency value. 
sl@0
  2218
		*/
sl@0
  2219
		EFlagNegativeCurrencySymbolOpposite=0x00000002
sl@0
  2220
		};
sl@0
  2221
	/** Indicates how the device universal time is maintained */
sl@0
  2222
	enum TDeviceTimeState
sl@0
  2223
		{
sl@0
  2224
		/** Universal time is maintained by the device RTC and the user selection 
sl@0
  2225
		of the locale of the device indicating offset from GMT and daylight saving*/
sl@0
  2226
		EDeviceUserTime,
sl@0
  2227
sl@0
  2228
		/** Universal time and offset from GMT is supplied by the mobile network
sl@0
  2229
		and maintained by device RTC */
sl@0
  2230
		ENITZNetworkTimeSync
sl@0
  2231
		};
sl@0
  2232
public:
sl@0
  2233
	IMPORT_C TLocale();
sl@0
  2234
	inline TLocale(TInt);
sl@0
  2235
	IMPORT_C void Refresh();
sl@0
  2236
	IMPORT_C TInt Set() const;
sl@0
  2237
	IMPORT_C void FormatCurrency(TDes& aText, TInt aAmount);
sl@0
  2238
	IMPORT_C void FormatCurrency(TDes& aText, TInt64 aAmount);
sl@0
  2239
	IMPORT_C void FormatCurrency(TDes& aText, TDesOverflow& aOverflowHandler, TInt aAmount); 
sl@0
  2240
	IMPORT_C void FormatCurrency(TDes& aText, TDesOverflow& aOverflowHandler, TInt64 aAmount); 
sl@0
  2241
	
sl@0
  2242
	inline TInt CountryCode() const;
sl@0
  2243
	inline void SetCountryCode(TInt aCode);
sl@0
  2244
	inline TTimeIntervalSeconds UniversalTimeOffset() const;
sl@0
  2245
	inline TDateFormat DateFormat() const;
sl@0
  2246
	inline void SetDateFormat(TDateFormat aFormat);
sl@0
  2247
	inline TTimeFormat TimeFormat() const;
sl@0
  2248
	inline void SetTimeFormat(TTimeFormat aFormat);
sl@0
  2249
	inline TLocalePos CurrencySymbolPosition() const;
sl@0
  2250
	inline void SetCurrencySymbolPosition(TLocalePos aPos);
sl@0
  2251
	inline TBool CurrencySpaceBetween() const;
sl@0
  2252
	inline void SetCurrencySpaceBetween(TBool aSpace);
sl@0
  2253
	inline TInt CurrencyDecimalPlaces() const;
sl@0
  2254
	inline void SetCurrencyDecimalPlaces(TInt aPlaces);
sl@0
  2255
	inline TBool CurrencyNegativeInBrackets() const;        // These two functions are deprecated
sl@0
  2256
	inline void SetCurrencyNegativeInBrackets(TBool aBool); // They are here to maintain compatibility. Use the New functions -> NegativeCurrencyFormat setter/getter. 
sl@0
  2257
 	inline TBool CurrencyTriadsAllowed() const;  
sl@0
  2258
	inline void SetCurrencyTriadsAllowed(TBool aBool);
sl@0
  2259
	inline TChar ThousandsSeparator() const;
sl@0
  2260
	inline void SetThousandsSeparator(const TChar& aChar);
sl@0
  2261
	inline TChar DecimalSeparator() const;
sl@0
  2262
	inline void SetDecimalSeparator(const TChar& aChar);
sl@0
  2263
	inline TChar DateSeparator(TInt aIndex) const;
sl@0
  2264
	inline void SetDateSeparator(const TChar& aChar,TInt aIndex);
sl@0
  2265
	inline TChar TimeSeparator(TInt aIndex) const;
sl@0
  2266
	inline void SetTimeSeparator(const TChar& aChar,TInt aIndex);
sl@0
  2267
	inline TBool AmPmSpaceBetween() const;
sl@0
  2268
	inline void SetAmPmSpaceBetween(TBool aSpace);
sl@0
  2269
	inline TLocalePos AmPmSymbolPosition() const;
sl@0
  2270
	inline void SetAmPmSymbolPosition(TLocalePos aPos);
sl@0
  2271
	inline TUint DaylightSaving() const;
sl@0
  2272
	inline TBool QueryHomeHasDaylightSavingOn() const;
sl@0
  2273
	inline TDaylightSavingZone HomeDaylightSavingZone() const;
sl@0
  2274
	inline TUint WorkDays() const;
sl@0
  2275
	inline void SetWorkDays(TUint aMask);
sl@0
  2276
	inline TDay StartOfWeek() const;
sl@0
  2277
	inline void SetStartOfWeek(TDay aDay);
sl@0
  2278
	inline TClockFormat ClockFormat() const;
sl@0
  2279
	inline void SetClockFormat(TClockFormat aFormat);
sl@0
  2280
	inline TUnitsFormat UnitsGeneral() const;
sl@0
  2281
	inline void SetUnitsGeneral(TUnitsFormat aFormat);
sl@0
  2282
	inline TUnitsFormat UnitsDistanceShort() const;
sl@0
  2283
	inline void SetUnitsDistanceShort(TUnitsFormat aFormat);
sl@0
  2284
	inline TUnitsFormat UnitsDistanceLong() const;
sl@0
  2285
	inline void SetUnitsDistanceLong(TUnitsFormat aFormat);
sl@0
  2286
	inline TNegativeCurrencyFormat NegativeCurrencyFormat() const;
sl@0
  2287
	inline void SetNegativeCurrencyFormat(TNegativeCurrencyFormat aNegativeCurrencyFormat);
sl@0
  2288
	inline TBool NegativeLoseSpace() const;
sl@0
  2289
	inline void SetNegativeLoseSpace(TBool aBool);
sl@0
  2290
	inline TBool NegativeCurrencySymbolOpposite() const;
sl@0
  2291
	inline void SetNegativeCurrencySymbolOpposite(TBool aBool);
sl@0
  2292
	inline TLanguage LanguageDowngrade(TInt aIndex) const;	 // 0 <= aIndex < 3
sl@0
  2293
	inline void SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage);
sl@0
  2294
	inline TDigitType DigitType() const;
sl@0
  2295
	inline void SetDigitType(TDigitType aDigitType);
sl@0
  2296
	inline TDeviceTimeState DeviceTime() const;
sl@0
  2297
 	inline void SetDeviceTime(TDeviceTimeState aState);
sl@0
  2298
 	inline TInt RegionCode() const;
sl@0
  2299
sl@0
  2300
	void SetDefaults(); /**< @internalComponent */
sl@0
  2301
sl@0
  2302
private:
sl@0
  2303
	friend class TExtendedLocale;
sl@0
  2304
private:
sl@0
  2305
	TInt iCountryCode;
sl@0
  2306
	TTimeIntervalSeconds iUniversalTimeOffset;
sl@0
  2307
	TDateFormat iDateFormat;
sl@0
  2308
	TTimeFormat iTimeFormat;
sl@0
  2309
	TLocalePos iCurrencySymbolPosition;
sl@0
  2310
	TBool iCurrencySpaceBetween;
sl@0
  2311
	TInt iCurrencyDecimalPlaces;
sl@0
  2312
	TNegativeCurrencyFormat iNegativeCurrencyFormat; //	replaced TBool iCurrencyNegativeInBrackets
sl@0
  2313
	TBool iCurrencyTriadsAllowed;
sl@0
  2314
	TChar iThousandsSeparator;
sl@0
  2315
	TChar iDecimalSeparator;
sl@0
  2316
	TChar iDateSeparator[KMaxDateSeparators];
sl@0
  2317
	TChar iTimeSeparator[KMaxTimeSeparators];
sl@0
  2318
	TLocalePos iAmPmSymbolPosition;
sl@0
  2319
	TBool iAmPmSpaceBetween;
sl@0
  2320
	TUint iDaylightSaving;
sl@0
  2321
	TDaylightSavingZone iHomeDaylightSavingZone;
sl@0
  2322
	TUint iWorkDays;
sl@0
  2323
	TDay iStartOfWeek;
sl@0
  2324
	TClockFormat iClockFormat;
sl@0
  2325
	TUnitsFormat iUnitsGeneral;
sl@0
  2326
	TUnitsFormat iUnitsDistanceShort;
sl@0
  2327
	TUnitsFormat iUnitsDistanceLong;
sl@0
  2328
	TUint iExtraNegativeCurrencyFormatFlags;
sl@0
  2329
	TUint16 iLanguageDowngrade[3];
sl@0
  2330
	TUint16 iRegionCode;
sl@0
  2331
	TDigitType iDigitType;
sl@0
  2332
 	TDeviceTimeState iDeviceTimeState;
sl@0
  2333
 	TInt iSpare[0x1E];
sl@0
  2334
	};
sl@0
  2335
sl@0
  2336
/** 
sl@0
  2337
@publishedAll
sl@0
  2338
@released
sl@0
  2339
sl@0
  2340
TLocaleAspect
sl@0
  2341
sl@0
  2342
Enumeration used with TExtendedLocale::LoadLocaleAspect to select which
sl@0
  2343
locale information is to be replaced from the contents of the Locale
sl@0
  2344
DLL being loaded.
sl@0
  2345
sl@0
  2346
ELocaleLanguageSettings - Replaces everything that should change with
sl@0
  2347
                          language selection e.g. Month names, Day names,
sl@0
  2348
                          etc,
sl@0
  2349
sl@0
  2350
ELocaleLocaleSettings - Replaces the currently selected currency symbol,
sl@0
  2351
                        TLocale settings, and FAT utility functions
sl@0
  2352
sl@0
  2353
ELocaleTimeAndDateSettings - Replaces the current time and date display
sl@0
  2354
                             format settings.
sl@0
  2355
sl@0
  2356
ELocaleCollateSettings - Replaces the "system" preferred Charset
sl@0
  2357
                         (because that's where the collation table
sl@0
  2358
                         is!). The "Default" charset will remain
sl@0
  2359
                         unchanged until after the next power
sl@0
  2360
                         off/on cycle
sl@0
  2361
*/
sl@0
  2362
enum TLocaleAspect
sl@0
  2363
	{
sl@0
  2364
	ELocaleLanguageSettings = 0x01,
sl@0
  2365
	ELocaleCollateSetting = 0x02,
sl@0
  2366
	ELocaleLocaleSettings = 0x04,
sl@0
  2367
	ELocaleTimeDateSettings = 0x08,
sl@0
  2368
	};
sl@0
  2369
sl@0
  2370
/**
sl@0
  2371
@internalComponent
sl@0
  2372
*/
sl@0
  2373
struct SLocaleLanguage
sl@0
  2374
	{
sl@0
  2375
	TLanguage 		iLanguage;
sl@0
  2376
	const TText*	iDateSuffixTable;
sl@0
  2377
	const TText*	iDayTable;
sl@0
  2378
	const TText*	iDayAbbTable;
sl@0
  2379
	const TText*	iMonthTable;
sl@0
  2380
	const TText*	iMonthAbbTable;
sl@0
  2381
	const TText*	iAmPmTable;
sl@0
  2382
	const TText16* const*	iMsgTable;
sl@0
  2383
	};
sl@0
  2384
sl@0
  2385
/**
sl@0
  2386
@internalComponent
sl@0
  2387
*/
sl@0
  2388
struct SLocaleLocaleSettings
sl@0
  2389
	{
sl@0
  2390
	TText	iCurrencySymbol[KMaxCurrencySymbol+1];
sl@0
  2391
	TAny*	iLocaleExtraSettingsDllPtr;
sl@0
  2392
	};
sl@0
  2393
sl@0
  2394
/**
sl@0
  2395
@internalComponent
sl@0
  2396
*/
sl@0
  2397
struct SLocaleTimeDateFormat
sl@0
  2398
	{
sl@0
  2399
	TText	iShortDateFormatSpec[KMaxShortDateFormatSpec+1];
sl@0
  2400
	TText	iLongDateFormatSpec[KMaxLongDateFormatSpec+1];
sl@0
  2401
	TText	iTimeFormatSpec[KMaxTimeFormatSpec+1];
sl@0
  2402
	TAny*	iLocaleTimeDateFormatDllPtr;
sl@0
  2403
	};
sl@0
  2404
sl@0
  2405
struct LCharSet;
sl@0
  2406
sl@0
  2407
/**
sl@0
  2408
@publishedAll
sl@0
  2409
@released
sl@0
  2410
sl@0
  2411
Extended locale class
sl@0
  2412
sl@0
  2413
This class holds a collection of locale information. It contains a TLocale internally.
sl@0
  2414
It has methods to load a locale DLL and to set the system wide locale information.
sl@0
  2415
sl@0
  2416
*/
sl@0
  2417
class TExtendedLocale
sl@0
  2418
	{
sl@0
  2419
public:
sl@0
  2420
sl@0
  2421
	// Default constructor, create an empty instance
sl@0
  2422
	IMPORT_C TExtendedLocale();
sl@0
  2423
sl@0
  2424
	// Initialise to (or restore from!) current system wide locale
sl@0
  2425
	// settings
sl@0
  2426
	IMPORT_C void LoadSystemSettings();
sl@0
  2427
	
sl@0
  2428
	// Overwrite current system wide locale settings with the current
sl@0
  2429
	// contents of this TExtendedLocale
sl@0
  2430
	IMPORT_C TInt SaveSystemSettings();
sl@0
  2431
sl@0
  2432
	//load a complete locale data from a single locale dll
sl@0
  2433
	IMPORT_C TInt LoadLocale(const TDesC& aLocaleDllName);
sl@0
  2434
	
sl@0
  2435
	//load a complete locale data from three locale dlls, which are language lcoale dll, region locale dll, and collation locale dll.
sl@0
  2436
	IMPORT_C TInt LoadLocale(const TDesC& aLanguageLocaleDllName, const TDesC& aRegionLocaleDllName, const TDesC& aCollationLocaleDllName);	
sl@0
  2437
	
sl@0
  2438
	// Load an additional Locale DLL and over-ride a selected subset
sl@0
  2439
	// (currently ELocaleLanguageSettings to select an alternative set
sl@0
  2440
	// of language specific text strings, ELocaleCollateSetting to
sl@0
  2441
	// select a new system collation table,
sl@0
  2442
	// ELocaleOverRideMatchCollationTable to locally select an
sl@0
  2443
	// alternative collation order for matching text strings, or
sl@0
  2444
	// ELocaleOverRideSortCollationTable for ordering text strings)
sl@0
  2445
	// of settings with its contents
sl@0
  2446
	IMPORT_C TInt LoadLocaleAspect(TUint aAspectGroup, const TDesC& aLocaleDllName);
sl@0
  2447
	
sl@0
  2448
	//load a locale aspect from a locale dll. 
sl@0
  2449
	//Such as load language locale aspect from locale language dll; 
sl@0
  2450
	//load region locale aspect from locale region dll; 
sl@0
  2451
	//load collation locale aspect from locale collation dll. 
sl@0
  2452
	//There are in all three aspect, which are langauge, region, and collation.
sl@0
  2453
	IMPORT_C TInt LoadLocaleAspect(const TDesC& aLocaleDllName);
sl@0
  2454
sl@0
  2455
	// Set the currency Symbol
sl@0
  2456
	IMPORT_C TInt SetCurrencySymbol(const TDesC &aSymbol);
sl@0
  2457
sl@0
  2458
	// Get the name of the DLL holding the data for a particular set
sl@0
  2459
	// of Locale properties
sl@0
  2460
	IMPORT_C TInt GetLocaleDllName(TLocaleAspect aLocaleDataSet, TDes& aDllName);
sl@0
  2461
sl@0
  2462
	// Get the preferred collation method.
sl@0
  2463
	// Note that some Charsets may contain more than one Collation
sl@0
  2464
	// method (e.g "dictionary" v "phonebook" ordering) so an optional
sl@0
  2465
	// index parameter can be used to select between them
sl@0
  2466
	IMPORT_C TCollationMethod GetPreferredCollationMethod(TInt index = 0) ;
sl@0
  2467
	
sl@0
  2468
	//Get the Currency Symbol
sl@0
  2469
	IMPORT_C TPtrC GetCurrencySymbol();
sl@0
  2470
	
sl@0
  2471
	//Get the Long Date Format
sl@0
  2472
	IMPORT_C TPtrC GetLongDateFormatSpec();
sl@0
  2473
	
sl@0
  2474
	//Get the Short Date Format
sl@0
  2475
	IMPORT_C TPtrC GetShortDateFormatSpec();
sl@0
  2476
	
sl@0
  2477
	//Get the Time Format
sl@0
  2478
	IMPORT_C TPtrC GetTimeFormatSpec();
sl@0
  2479
sl@0
  2480
	// Retrieve a reference to the encapsulated TLocale
sl@0
  2481
	inline TLocale*	GetLocale();
sl@0
  2482
sl@0
  2483
private:
sl@0
  2484
sl@0
  2485
	TInt DoLoadLocale(const TDesC& aLocaleDllName, TLibraryFunction* aExportList);
sl@0
  2486
	void DoUpdateLanguageSettings(TLibraryFunction* aExportList);
sl@0
  2487
	void DoUpdateLocaleSettings(TLibraryFunction* aExportList);
sl@0
  2488
	void DoUpdateTimeDateFormat(TLibraryFunction* aExportList);
sl@0
  2489
	
sl@0
  2490
#ifdef SYMBIAN_DISTINCT_LOCALE_MODEL	
sl@0
  2491
	void DoUpdateLanguageSettingsV2(TLibraryFunction* aExportList);
sl@0
  2492
	void DoUpdateLocaleSettingsV2(TLibraryFunction* aExportList);		
sl@0
  2493
	TInt CheckLocaleDllName(const TDesC& aLocaleDllName, TInt& languageID);
sl@0
  2494
	void AddExtension(TDes& aFileName, TInt aExtension);	
sl@0
  2495
#endif
sl@0
  2496
sl@0
  2497
private:
sl@0
  2498
sl@0
  2499
	TLocale					iLocale;
sl@0
  2500
	SLocaleLanguage			iLanguageSettings;
sl@0
  2501
	SLocaleLocaleSettings	iLocaleExtraSettings;
sl@0
  2502
	SLocaleTimeDateFormat	iLocaleTimeDateFormat;
sl@0
  2503
	const LCharSet*			iDefaultCharSet;
sl@0
  2504
	const LCharSet*			iPreferredCharSet;
sl@0
  2505
	};
sl@0
  2506
sl@0
  2507
sl@0
  2508
sl@0
  2509
sl@0
  2510
/**
sl@0
  2511
@publishedAll
sl@0
  2512
@released
sl@0
  2513
sl@0
  2514
Geometric rectangle.
sl@0
  2515
sl@0
  2516
The class represents a rectangle whose sides are parallel with the axes of 
sl@0
  2517
the co-ordinate system. 
sl@0
  2518
sl@0
  2519
The co-ordinates of the top-left and bottom-right corners are used to set 
sl@0
  2520
the dimensions of the rectangle. The bottom right co-ordinate is outside the 
sl@0
  2521
rectangle. Thus TRect(TPoint(2,2),TSize(4,4)) is equal
sl@0
  2522
to TRect(TPoint(2,2),TPoint(6,6)), 
sl@0
  2523
and in both cases you get a 4x4 pixel rectangle on the screen.
sl@0
  2524
sl@0
  2525
Functions are provided to initialise and manipulate the rectangle and to extract 
sl@0
  2526
information about it.
sl@0
  2527
*/
sl@0
  2528
class TRect
sl@0
  2529
	{
sl@0
  2530
public:
sl@0
  2531
	enum TUninitialized { EUninitialized };
sl@0
  2532
	/**
sl@0
  2533
	Constructs a default rectangle.
sl@0
  2534
	
sl@0
  2535
	This initialises the co-ordinates of its top 
sl@0
  2536
	left and bottom right corners to (0,0).
sl@0
  2537
	*/
sl@0
  2538
	TRect(TUninitialized) {}
sl@0
  2539
	IMPORT_C TRect();
sl@0
  2540
	IMPORT_C TRect(TInt aAx,TInt aAy,TInt aBx,TInt aBy);
sl@0
  2541
	IMPORT_C TRect(const TPoint& aPointA,const TPoint& aPointB);
sl@0
  2542
	IMPORT_C TRect(const TPoint& aPoint,const TSize& aSize);
sl@0
  2543
	IMPORT_C TRect(const TSize& aSize);
sl@0
  2544
	IMPORT_C TBool operator==(const TRect& aRect) const;
sl@0
  2545
	IMPORT_C TBool operator!=(const TRect& aRect) const;
sl@0
  2546
	IMPORT_C void SetRect(TInt aAx,TInt aAy,TInt aBx,TInt aBy);
sl@0
  2547
	IMPORT_C void SetRect(const TPoint& aPointTL,const TPoint& aPointBR);
sl@0
  2548
	IMPORT_C void SetRect(const TPoint& aPoint,const TSize& aSize);
sl@0
  2549
	IMPORT_C void Move(TInt aDx,TInt aDy);
sl@0
  2550
	IMPORT_C void Move(const TPoint& aOffset);
sl@0
  2551
	IMPORT_C void Resize(TInt aDx,TInt aDy);
sl@0
  2552
	IMPORT_C void Resize(const TSize& aSize);
sl@0
  2553
	IMPORT_C void Shrink(TInt aDx,TInt aDy);
sl@0
  2554
	IMPORT_C void Shrink(const TSize& aSize);
sl@0
  2555
	IMPORT_C void Grow(TInt aDx,TInt aDy);
sl@0
  2556
	IMPORT_C void Grow(const TSize& aSize);
sl@0
  2557
	IMPORT_C void BoundingRect(const TRect& aRect);
sl@0
  2558
	IMPORT_C TBool IsEmpty() const;
sl@0
  2559
	IMPORT_C TBool Intersects(const TRect& aRect) const;
sl@0
  2560
	IMPORT_C void Intersection(const TRect& aRect);
sl@0
  2561
	IMPORT_C void Normalize();
sl@0
  2562
	IMPORT_C TBool Contains(const TPoint& aPoint) const;
sl@0
  2563
	IMPORT_C TSize Size() const;
sl@0
  2564
	IMPORT_C TInt Width() const;
sl@0
  2565
	IMPORT_C TInt Height() const;
sl@0
  2566
	IMPORT_C TBool IsNormalized() const;
sl@0
  2567
	IMPORT_C TPoint Center() const;
sl@0
  2568
	IMPORT_C void SetSize(const TSize& aSize);
sl@0
  2569
	IMPORT_C void SetWidth(TInt aWidth);
sl@0
  2570
	IMPORT_C void SetHeight(TInt aHeight);
sl@0
  2571
private:
sl@0
  2572
	void Adjust(TInt aDx,TInt aDy);
sl@0
  2573
public:
sl@0
  2574
	/**
sl@0
  2575
	The x and y co-ordinates of the top left hand corner of the rectangle.
sl@0
  2576
	*/
sl@0
  2577
	TPoint iTl;
sl@0
  2578
	
sl@0
  2579
	/**
sl@0
  2580
	The x and y co-ordinates of the bottom right hand corner of the rectangle.
sl@0
  2581
	*/
sl@0
  2582
	TPoint iBr;
sl@0
  2583
	};
sl@0
  2584
sl@0
  2585
sl@0
  2586
sl@0
  2587
sl@0
  2588
/**
sl@0
  2589
@publishedAll
sl@0
  2590
@released
sl@0
  2591
sl@0
  2592
Clipping region - abstract base class. 
sl@0
  2593
sl@0
  2594
This abstract base class represents a 2-dimensional area which is used by 
sl@0
  2595
Graphics, the graphics window server, and the text window server to define 
sl@0
  2596
regions of the display which need to be updated, or regions within which all 
sl@0
  2597
operations must occur. 
sl@0
  2598
sl@0
  2599
A TRegion is defined in terms of an array of TRects and the more complex the 
sl@0
  2600
region, the more TRects are required to represent it.
sl@0
  2601
sl@0
  2602
A clipping region initially has space allocated for five rectangles.
sl@0
  2603
If manipulations result in a region which requires more than this, an attempt
sl@0
  2604
is made to allocate more rectangles. If this cannot be done, an error flag
sl@0
  2605
is set, and all subsequent operations involving the region have no effect
sl@0
  2606
(except possibly to propagate the error flag to other regions).
sl@0
  2607
The CheckError() member function allows 
sl@0
  2608
the error flag to be tested; Clear() can be used to clear it.
sl@0
  2609
sl@0
  2610
The redraw logic of application programs may use the TRegion in various ways:
sl@0
  2611
sl@0
  2612
1. minimally, they pass it to the graphics context as the clipping region; when 
sl@0
  2613
   a graphics context is activated to a window, the clipping region is set up 
sl@0
  2614
   automatically
sl@0
  2615
sl@0
  2616
2. if they wish to avoid redrawing objects which are outside the general area 
sl@0
  2617
   of the region, they may use TRegion::BoundingRect() to return the rectangle 
sl@0
  2618
   which bounds the clipping region, and draw only primitives that lie within 
sl@0
  2619
   that rectangle
sl@0
  2620
sl@0
  2621
3. if they wish to exercise finer control, they may extract the individual rectangles 
sl@0
  2622
   that comprise the clipping region using Operator[]().
sl@0
  2623
sl@0
  2624
Application programs may also manipulate clipping regions in order to constrain 
sl@0
  2625
parts of their redrawing to narrower areas of the screen than the clipping 
sl@0
  2626
region offered by the window server. To do this, functions that allow clipping 
sl@0
  2627
region manipulation may be used; for example, adding or removing rectangles 
sl@0
  2628
or finding the intersection or union of two regions.
sl@0
  2629
*/
sl@0
  2630
class TRegion
sl@0
  2631
	{
sl@0
  2632
public:
sl@0
  2633
	inline TInt Count() const;
sl@0
  2634
	inline const TRect* RectangleList() const;
sl@0
  2635
	inline TBool CheckError() const;
sl@0
  2636
	IMPORT_C TBool IsEmpty() const;
sl@0
  2637
	IMPORT_C TRect BoundingRect() const;
sl@0
  2638
	IMPORT_C const TRect& operator[](TInt aIndex) const;
sl@0
  2639
	IMPORT_C void Copy(const TRegion& aRegion);
sl@0
  2640
	IMPORT_C void AddRect(const TRect& aRect);
sl@0
  2641
	IMPORT_C void SubRect(const TRect& aRect,TRegion* aSubtractedRegion=NULL);
sl@0
  2642
	IMPORT_C void Offset(TInt aXoffset,TInt aYoffset);
sl@0
  2643
	IMPORT_C void Offset(const TPoint& aOffset);
sl@0
  2644
	IMPORT_C void Union(const TRegion& aRegion);
sl@0
  2645
	IMPORT_C void Intersection(const TRegion& aRegion,const TRegion& aRegion2);
sl@0
  2646
	IMPORT_C void Intersect(const TRegion& aRegion);
sl@0
  2647
	IMPORT_C void SubRegion(const TRegion& aRegion,TRegion* aSubtractedRegion=NULL);
sl@0
  2648
	IMPORT_C void ClipRect(const TRect& aRect);
sl@0
  2649
	IMPORT_C void Clear();
sl@0
  2650
	IMPORT_C void Tidy();
sl@0
  2651
	IMPORT_C TInt Sort();
sl@0
  2652
	IMPORT_C TInt Sort(const TPoint& aOffset);
sl@0
  2653
	IMPORT_C void ForceError();
sl@0
  2654
	IMPORT_C TBool IsContainedBy(const TRect& aRect) const;
sl@0
  2655
	IMPORT_C TBool Contains(const TPoint& aPoint) const;
sl@0
  2656
	IMPORT_C TBool Intersects(const TRect& aRect) const;	
sl@0
  2657
protected:
sl@0
  2658
	IMPORT_C TRect* RectangleListW();
sl@0
  2659
	IMPORT_C TRegion(TInt aAllocedRects);
sl@0
  2660
	inline TRegion();
sl@0
  2661
	TBool SetListSize(TInt aCount);
sl@0
  2662
	void AppendRect(const TRect& aRect);
sl@0
  2663
	void DeleteRect(TRect* aRect);
sl@0
  2664
	void AppendRegion(TRegion& aRegion);
sl@0
  2665
	void MergeRect(const TRect& aRect, TBool aEnclosed);
sl@0
  2666
	void SubtractRegion(const TRegion &aRegion,TRegion *aSubtractedRegion=NULL);
sl@0
  2667
	void ShrinkRegion();
sl@0
  2668
	TRect* ExpandRegion(TInt aCount);
sl@0
  2669
protected:
sl@0
  2670
	TInt iCount;
sl@0
  2671
	TBool iError;
sl@0
  2672
	TInt iAllocedRects;
sl@0
  2673
protected:
sl@0
  2674
	enum {ERRegionBuf=0x40000000};
sl@0
  2675
	};
sl@0
  2676
sl@0
  2677
sl@0
  2678
sl@0
  2679
sl@0
  2680
/**
sl@0
  2681
@publishedAll
sl@0
  2682
@released
sl@0
  2683
sl@0
  2684
Expandable region.
sl@0
  2685
sl@0
  2686
This class provides for the construction and destruction of a TRegion, including 
sl@0
  2687
a granularity for expanding the region. A region;s granularity represents 
sl@0
  2688
the number of memory slots allocated when the object is created, and the number 
sl@0
  2689
of new memory slots allocated each time an RRegion is expanded beyond the 
sl@0
  2690
number of free slots. The default granularity is five.
sl@0
  2691
*/
sl@0
  2692
class RRegion : public TRegion
sl@0
  2693
	{
sl@0
  2694
private:
sl@0
  2695
	enum {EDefaultGranularity=5};
sl@0
  2696
protected:
sl@0
  2697
	IMPORT_C RRegion(TInt aBuf,TInt aGran);
sl@0
  2698
public:
sl@0
  2699
	IMPORT_C RRegion();
sl@0
  2700
	IMPORT_C RRegion(TInt aGran);
sl@0
  2701
	IMPORT_C RRegion(const RRegion& aRegion);
sl@0
  2702
	IMPORT_C RRegion(const TRect& aRect,TInt aGran=EDefaultGranularity);
sl@0
  2703
	IMPORT_C RRegion(TInt aCount,TRect* aRectangleList,TInt aGran=EDefaultGranularity);
sl@0
  2704
	IMPORT_C void Close();
sl@0
  2705
	IMPORT_C void Destroy();
sl@0
  2706
	inline TInt CheckSpare() const;
sl@0
  2707
private:
sl@0
  2708
	TInt iGranularity;
sl@0
  2709
	TRect* iRectangleList;
sl@0
  2710
	friend class TRegion;
sl@0
  2711
	};
sl@0
  2712
sl@0
  2713
sl@0
  2714
sl@0
  2715
sl@0
  2716
/**
sl@0
  2717
@publishedAll
sl@0
  2718
@released
sl@0
  2719
sl@0
  2720
Region with pre-allocated buffer. 
sl@0
  2721
sl@0
  2722
This class provides the functionality of an RRegion, but in addition, for 
sl@0
  2723
optimisation purposes, uses a buffer containing pre-allocated space for as 
sl@0
  2724
many rectangles as are specified in the granularity. 
sl@0
  2725
sl@0
  2726
When this buffer is full, cell allocation takes place as for an RRegion, and 
sl@0
  2727
the RRegionBuf effectively becomes an RRegion. In this case, the region does 
sl@0
  2728
not revert to using the buffer, even if the region were to shrink so that 
sl@0
  2729
the buffer could, once again, contain the region. When the region is no longer 
sl@0
  2730
required, call Close(), defined in the base class RRegion, to free up all 
sl@0
  2731
memory.
sl@0
  2732
*/
sl@0
  2733
template <TInt S>
sl@0
  2734
class RRegionBuf : public RRegion
sl@0
  2735
	{
sl@0
  2736
public:
sl@0
  2737
	inline RRegionBuf();
sl@0
  2738
	inline RRegionBuf(const RRegion& aRegion);
sl@0
  2739
	inline RRegionBuf(const RRegionBuf<S>& aRegion);
sl@0
  2740
	inline RRegionBuf(const TRect& aRect);
sl@0
  2741
private:
sl@0
  2742
	TInt8 iRectangleBuf[S*sizeof(TRect)];
sl@0
  2743
	};
sl@0
  2744
sl@0
  2745
sl@0
  2746
sl@0
  2747
sl@0
  2748
/**
sl@0
  2749
@publishedAll
sl@0
  2750
@released
sl@0
  2751
sl@0
  2752
A fixed size region.
sl@0
  2753
sl@0
  2754
The region consists of a fixed number of rectangles; this number is specified 
sl@0
  2755
in the templated argument. The region cannot be expanded to contain more than 
sl@0
  2756
this number of rectangles. If an attempt is made to do so, the region's 
sl@0
  2757
error flag is set, and the region is cleared.
sl@0
  2758
sl@0
  2759
Note that when adding a rectangle to a region, if that rectangle overlaps 
sl@0
  2760
an existing rectangle, the operation causes more than one rectangle to be 
sl@0
  2761
created.
sl@0
  2762
*/
sl@0
  2763
template <TInt S>
sl@0
  2764
class TRegionFix : public TRegion
sl@0
  2765
	{
sl@0
  2766
public:
sl@0
  2767
	inline TRegionFix();
sl@0
  2768
	inline TRegionFix(const TRect& aRect);
sl@0
  2769
	inline TRegionFix(const TRegionFix<S>& aRegion);
sl@0
  2770
private:
sl@0
  2771
	TInt8 iRectangleBuf[S*sizeof(TRect)];
sl@0
  2772
	};
sl@0
  2773
sl@0
  2774
sl@0
  2775
sl@0
  2776
sl@0
  2777
/**
sl@0
  2778
@publishedAll
sl@0
  2779
@released
sl@0
  2780
sl@0
  2781
Base class for searching for global kernel objects.
sl@0
  2782
sl@0
  2783
This is the base class for a number of classes which are used to find specific 
sl@0
  2784
types of global kernel object such as semaphores, threads and mutexes;
sl@0
  2785
TFindSemaphore, TFindThread and TFindMutex are typical examples of such
sl@0
  2786
derived classes.
sl@0
  2787
sl@0
  2788
The class implements the common behaviour, specifically, the storage of the 
sl@0
  2789
match pattern which is used to search for object names.
sl@0
  2790
sl@0
  2791
This class is not intended to be explicitly instantiated; it has public
sl@0
  2792
constructors but they are part of the class implementation and are described
sl@0
  2793
for information only.
sl@0
  2794
*/
sl@0
  2795
class TFindHandleBase : public TFindHandle
sl@0
  2796
	{
sl@0
  2797
public:
sl@0
  2798
	IMPORT_C TFindHandleBase();
sl@0
  2799
	IMPORT_C TFindHandleBase(const TDesC& aMatch);
sl@0
  2800
	IMPORT_C void Find(const TDesC& aMatch);
sl@0
  2801
protected:
sl@0
  2802
	TInt NextObject(TFullName& aResult,TInt aObjectType);
sl@0
  2803
private:
sl@0
  2804
	
sl@0
  2805
	/**
sl@0
  2806
	The full name of the last kernel side object found.
sl@0
  2807
	*/
sl@0
  2808
	TFullName iMatch;
sl@0
  2809
	};
sl@0
  2810
sl@0
  2811
sl@0
  2812
sl@0
  2813
sl@0
  2814
/**
sl@0
  2815
@publishedAll
sl@0
  2816
@released
sl@0
  2817
sl@0
  2818
Finds all global semaphores whose full names match a specified pattern.
sl@0
  2819
sl@0
  2820
The match pattern can be set into the TFindSemaphore object at construction; 
sl@0
  2821
it can also be changed at any time after construction by using the Find() 
sl@0
  2822
member function of the TFindHandleBase base class.
sl@0
  2823
sl@0
  2824
After construction, the Next() member function can be used repeatedly to find 
sl@0
  2825
successive global semaphores whose full names match the current pattern.
sl@0
  2826
sl@0
  2827
A successful call to Next() means that a matching global semaphore has been 
sl@0
  2828
found. To open a handle on this semaphore, call the RSemaphore::Open() function 
sl@0
  2829
and pass a reference to this TFindSemaphore.
sl@0
  2830
sl@0
  2831
Pattern matching is part of descriptor behaviour.
sl@0
  2832
sl@0
  2833
@see TFindHandleBase::Find
sl@0
  2834
@see TFindSemaphore::Next
sl@0
  2835
@see RSemaphore::Open
sl@0
  2836
@see TDesC16::Match
sl@0
  2837
@see TDesC8::Match
sl@0
  2838
*/
sl@0
  2839
class TFindSemaphore : public TFindHandleBase
sl@0
  2840
	{
sl@0
  2841
public:
sl@0
  2842
	inline TFindSemaphore();
sl@0
  2843
	inline TFindSemaphore(const TDesC& aMatch);
sl@0
  2844
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2845
	};
sl@0
  2846
sl@0
  2847
sl@0
  2848
sl@0
  2849
sl@0
  2850
/**
sl@0
  2851
@publishedAll
sl@0
  2852
@released
sl@0
  2853
sl@0
  2854
Finds all global mutexes whose full names match a specified pattern.
sl@0
  2855
sl@0
  2856
The match pattern can be set into the object at construction; it can also 
sl@0
  2857
be changed at any time after construction by using the Find() member function 
sl@0
  2858
of the base class.
sl@0
  2859
sl@0
  2860
After construction, the Next() member function may be used repeatedly to find 
sl@0
  2861
successive global mutexes whose full names match the current pattern.
sl@0
  2862
sl@0
  2863
A successful call to Next() means that a matching global mutex has been found. 
sl@0
  2864
To open a handle on this mutex, call the Open() member function of RMutex 
sl@0
  2865
and pass a reference to this TFindMutex object.
sl@0
  2866
sl@0
  2867
Pattern matching is part of descriptors behaviour.
sl@0
  2868
sl@0
  2869
@see TFindHandleBase::Find
sl@0
  2870
@see TFindMutex::Next
sl@0
  2871
@see RMutex::Open
sl@0
  2872
@see TDesC16::Match
sl@0
  2873
@see TDesC8::Match
sl@0
  2874
*/
sl@0
  2875
class TFindMutex : public TFindHandleBase
sl@0
  2876
	{
sl@0
  2877
public:
sl@0
  2878
	inline TFindMutex();
sl@0
  2879
	inline TFindMutex(const TDesC& aMatch);
sl@0
  2880
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2881
	};
sl@0
  2882
sl@0
  2883
sl@0
  2884
sl@0
  2885
sl@0
  2886
/**
sl@0
  2887
@publishedAll
sl@0
  2888
@released
sl@0
  2889
sl@0
  2890
Searches for all global chunks by pattern matching against the names of (Kernel 
sl@0
  2891
side) chunk objects.
sl@0
  2892
sl@0
  2893
The match pattern can be set into this object at construction; it can also 
sl@0
  2894
be changed at any time after construction by using TFindHandleBase::Find().
sl@0
  2895
sl@0
  2896
After construction, call TFindChunk::Next() repeatedly to find successive 
sl@0
  2897
chunks whose names match the current pattern. A successful call
sl@0
  2898
to TFindChunk::Next() means that a matching chunk has been found.
sl@0
  2899
sl@0
  2900
@see TFindHandleBase
sl@0
  2901
*/
sl@0
  2902
class TFindChunk : public TFindHandleBase
sl@0
  2903
	{
sl@0
  2904
public:
sl@0
  2905
	inline TFindChunk();
sl@0
  2906
	inline TFindChunk(const TDesC& aMatch);
sl@0
  2907
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2908
	};
sl@0
  2909
sl@0
  2910
sl@0
  2911
sl@0
  2912
sl@0
  2913
sl@0
  2914
/**
sl@0
  2915
@publishedAll
sl@0
  2916
@released
sl@0
  2917
sl@0
  2918
Searches for threads by pattern matching against the names
sl@0
  2919
of thread objects.
sl@0
  2920
sl@0
  2921
The match pattern can be set into this object at construction; it can also be
sl@0
  2922
changed at any time after construction by using TFindHandleBase::Find().
sl@0
  2923
sl@0
  2924
After construction, call TFindThread::Next() repeatedly to find successive
sl@0
  2925
threads whose names match the current pattern.
sl@0
  2926
A successful call to TFindThread::Next() means that a matching thread has
sl@0
  2927
been found. To open a handle on this thread, call RThread::Open() and pass
sl@0
  2928
a reference to this TFindThread.
sl@0
  2929
sl@0
  2930
@see RThread
sl@0
  2931
*/
sl@0
  2932
class TFindThread : public TFindHandleBase
sl@0
  2933
	{
sl@0
  2934
public:
sl@0
  2935
	inline TFindThread();
sl@0
  2936
	inline TFindThread(const TDesC& aMatch);
sl@0
  2937
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2938
	};
sl@0
  2939
sl@0
  2940
sl@0
  2941
sl@0
  2942
sl@0
  2943
/**
sl@0
  2944
@publishedAll
sl@0
  2945
@released
sl@0
  2946
sl@0
  2947
Searches for processes by pattern matching against the names
sl@0
  2948
of process objects.
sl@0
  2949
sl@0
  2950
The match pattern can be set into this object at construction; it can also be
sl@0
  2951
changed at any time after construction by using TFindHandleBase::Find().
sl@0
  2952
sl@0
  2953
After construction, call TFindProcess::Next() repeatedly to find successive
sl@0
  2954
processes whose names match the current pattern.
sl@0
  2955
A successful call to TFindProcess::Next() means that a matching process has
sl@0
  2956
been found. To open a handle on this process, call RProcess::Open() and pass
sl@0
  2957
a reference to this TFindProcess.
sl@0
  2958
sl@0
  2959
@see RProcess
sl@0
  2960
*/
sl@0
  2961
class TFindProcess : public TFindHandleBase
sl@0
  2962
	{
sl@0
  2963
public:
sl@0
  2964
	inline TFindProcess();
sl@0
  2965
	inline TFindProcess(const TDesC& aMatch);
sl@0
  2966
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2967
	};
sl@0
  2968
sl@0
  2969
sl@0
  2970
sl@0
  2971
/**
sl@0
  2972
@publishedAll
sl@0
  2973
@released
sl@0
  2974
sl@0
  2975
Searches for LDD factory objects by pattern matching against the names of 
sl@0
  2976
 LDD factory objects.
sl@0
  2977
sl@0
  2978
An LDD factory object is an instance of a DLogicalDevice derived class. 
sl@0
  2979
sl@0
  2980
The match pattern can be set into this object at construction; it can also 
sl@0
  2981
be changed at any time after construction by using TFindHandleBase::Find().
sl@0
  2982
sl@0
  2983
After construction, call TFindLogicalDevice::Next() repeatedly to find successive 
sl@0
  2984
LDD factory objects whose names match the current pattern. A successful call to 
sl@0
  2985
TFindLogicalDevice::Next() means that a matching LDD factory object has been found.
sl@0
  2986
sl@0
  2987
The name of an LDD factory object is set by its Install() member function as 
sl@0
  2988
part of the construction process.
sl@0
  2989
*/
sl@0
  2990
class TFindLogicalDevice : public TFindHandleBase
sl@0
  2991
	{
sl@0
  2992
public:
sl@0
  2993
	inline TFindLogicalDevice();
sl@0
  2994
	inline TFindLogicalDevice(const TDesC& aMatch);
sl@0
  2995
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  2996
	};
sl@0
  2997
sl@0
  2998
/**
sl@0
  2999
@publishedAll
sl@0
  3000
@released
sl@0
  3001
sl@0
  3002
Searches for PDD factory objects by pattern matching against the names of
sl@0
  3003
PDD factory objects.
sl@0
  3004
sl@0
  3005
A PDD factory object is an instance of a DPhysicalDevice derived class. 
sl@0
  3006
sl@0
  3007
The match pattern can be set into this object at construction; it can also be 
sl@0
  3008
changed at any time after construction by using TFindHandleBase::Find().
sl@0
  3009
sl@0
  3010
After construction, call TFindPhysicalDevice::Next() repeatedly to find successive 
sl@0
  3011
PDD factory objects whose names match the current pattern. A successful call to 
sl@0
  3012
TFindPhysicalDevice::Next() means that a matching PDD factory object has been found.
sl@0
  3013
sl@0
  3014
The name of a PDD factory object is set by its Install() member function as part 
sl@0
  3015
of the construction process.
sl@0
  3016
*/
sl@0
  3017
class TFindPhysicalDevice : public TFindHandleBase
sl@0
  3018
	{
sl@0
  3019
public:
sl@0
  3020
	inline TFindPhysicalDevice();
sl@0
  3021
	inline TFindPhysicalDevice(const TDesC& aMatch);
sl@0
  3022
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  3023
	};
sl@0
  3024
sl@0
  3025
sl@0
  3026
sl@0
  3027
sl@0
  3028
sl@0
  3029
/**
sl@0
  3030
@publishedAll
sl@0
  3031
@released
sl@0
  3032
sl@0
  3033
Searches for servers by pattern matching against the names of kernel side
sl@0
  3034
server objects.
sl@0
  3035
sl@0
  3036
The match pattern can be set into this object at construction; it can also
sl@0
  3037
be changed at any time after construction by using the TFindHandleBase::Find()
sl@0
  3038
base class.
sl@0
  3039
sl@0
  3040
After construction, call TFindServer::Next() repeatedly to find successive
sl@0
  3041
servers whose names match the current pattern.
sl@0
  3042
A successful call to TFindServer::Next() means that a matching server
sl@0
  3043
has been found.
sl@0
  3044
*/
sl@0
  3045
class TFindServer : public TFindHandleBase
sl@0
  3046
	{
sl@0
  3047
public:
sl@0
  3048
	inline TFindServer();
sl@0
  3049
	inline TFindServer(const TDesC& aMatch);
sl@0
  3050
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  3051
	};
sl@0
  3052
sl@0
  3053
sl@0
  3054
sl@0
  3055
sl@0
  3056
/**
sl@0
  3057
@publishedAll
sl@0
  3058
@released
sl@0
  3059
sl@0
  3060
Searches for DLLs whose full names match a specified pattern.
sl@0
  3061
sl@0
  3062
The match pattern is set at construction but can also be changed at any time
sl@0
  3063
after construction by using TFindHandleBase::Find().
sl@0
  3064
sl@0
  3065
After construction, use TFindLibrary::Next() to repeatedly find successive DLLs
sl@0
  3066
whose names match the current pattern. A successful call to
sl@0
  3067
TFindLibrary::Next() means that a matching DLL has been found.
sl@0
  3068
*/
sl@0
  3069
class TFindLibrary : public TFindHandleBase
sl@0
  3070
	{
sl@0
  3071
public:
sl@0
  3072
	inline TFindLibrary();
sl@0
  3073
	inline TFindLibrary(const TDesC& aMatch);
sl@0
  3074
	IMPORT_C TInt Next(TFullName& aResult);
sl@0
  3075
	};
sl@0
  3076
sl@0
  3077
sl@0
  3078
sl@0
  3079
/**
sl@0
  3080
@publishedAll
sl@0
  3081
@released
sl@0
  3082
sl@0
  3083
User side handle to an LDD factory object, an instance of a DLogicalDevice 
sl@0
  3084
derived class.
sl@0
  3085
sl@0
  3086
The LDD factory object is a Kernel side object which is constructed on the 
sl@0
  3087
Kernel heap when the logical device is opened using User::LoadLogicalDevice(). 
sl@0
  3088
The handle allows the User side to get information about the logical device.
sl@0
  3089
sl@0
  3090
To use the device, a thread must create and use an instance of an 
sl@0
  3091
RBusLogicalChannel derived class.
sl@0
  3092
sl@0
  3093
*/
sl@0
  3094
class RDevice : public RHandleBase
sl@0
  3095
	{
sl@0
  3096
public:
sl@0
  3097
	inline TInt Open(const TFindLogicalDevice& aFind,TOwnerType aType=EOwnerProcess);
sl@0
  3098
	IMPORT_C TInt Open(const TDesC& aName,TOwnerType aType=EOwnerProcess);
sl@0
  3099
	IMPORT_C void GetCaps(TDes8& aDes) const;
sl@0
  3100
	IMPORT_C TBool QueryVersionSupported(const TVersion& aVer) const;
sl@0
  3101
	IMPORT_C TBool IsAvailable(TInt aUnit, const TDesC* aPhysicalDevice, const TDesC8* anInfo) const;
sl@0
  3102
	};
sl@0
  3103
sl@0
  3104
/**
sl@0
  3105
@publishedAll
sl@0
  3106
@released
sl@0
  3107
sl@0
  3108
Asynchronous timer services. 
sl@0
  3109
sl@0
  3110
Five types of asynchronous request are supported by the class:
sl@0
  3111
sl@0
  3112
1. Requesting an event after a specified interval
sl@0
  3113
sl@0
  3114
2. Requesting an event at a specified system time
sl@0
  3115
sl@0
  3116
3. Requesting a timer event on a specific second fraction
sl@0
  3117
sl@0
  3118
4. Requesting an event if an interval elapses with no user activity.
sl@0
  3119
sl@0
  3120
5. Requesting an event after a specified interval, to a resolution of 1ms.
sl@0
  3121
   
sl@0
  3122
Each of these requests can be cancelled.
sl@0
  3123
sl@0
  3124
The timer exists from its creation, following a call to RTimer::CreateLocal(),
sl@0
  3125
until it is destroyed by a call to the Close() member function of the base
sl@0
  3126
class RHandleBase.
sl@0
  3127
sl@0
  3128
This class is ultimately implemented in terms of the nanokernel tick, and
sl@0
  3129
therefore the granularity of the generated events is limited to the period of
sl@0
  3130
this timer.  This is variant specific, but is usually 1 millisecond.
sl@0
  3131
sl@0
  3132
Note that the CTimer active object uses an RTimer.
sl@0
  3133
*/
sl@0
  3134
class RTimer : public RHandleBase
sl@0
  3135
	{
sl@0
  3136
public:
sl@0
  3137
	IMPORT_C TInt CreateLocal();
sl@0
  3138
	IMPORT_C void Cancel();
sl@0
  3139
	IMPORT_C void After(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
sl@0
  3140
	IMPORT_C void AfterTicks(TRequestStatus &aStatus, TInt aTicks);
sl@0
  3141
	IMPORT_C void At(TRequestStatus& aStatus,const TTime& aTime);
sl@0
  3142
	IMPORT_C void AtUTC(TRequestStatus& aStatus,const TTime& aUTCTime);
sl@0
  3143
	IMPORT_C void Lock(TRequestStatus& aStatus,TTimerLockSpec aLock);
sl@0
  3144
	IMPORT_C void Inactivity(TRequestStatus& aStatus, TTimeIntervalSeconds aSeconds);
sl@0
  3145
	IMPORT_C void HighRes(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
sl@0
  3146
	};
sl@0
  3147
sl@0
  3148
sl@0
  3149
sl@0
  3150
sl@0
  3151
/**
sl@0
  3152
@publishedAll
sl@0
  3153
@released
sl@0
  3154
sl@0
  3155
A handle to a dynamically loadable DLL.
sl@0
  3156
sl@0
  3157
The class is not intended for user derivation.
sl@0
  3158
*/
sl@0
  3159
class RLibrary : public RHandleBase
sl@0
  3160
	{
sl@0
  3161
public:
sl@0
  3162
	IMPORT_C void Close();
sl@0
  3163
	IMPORT_C TInt Load(const TDesC& aFileName, const TUidType& aType);
sl@0
  3164
	IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath=KNullDesC);
sl@0
  3165
	IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath, const TUidType& aType);
sl@0
  3166
	IMPORT_C TInt Load(const TDesC& aFileName, const TDesC& aPath, const TUidType& aType, TUint32 aModuleVersion);
sl@0
  3167
	IMPORT_C TInt LoadRomLibrary(const TDesC& aFileName, const TDesC& aPath);
sl@0
  3168
	IMPORT_C TLibraryFunction Lookup(TInt anOrdinal) const;
sl@0
  3169
	IMPORT_C TUidType Type() const;
sl@0
  3170
	IMPORT_C TFileName FileName() const;
sl@0
  3171
	IMPORT_C TInt GetRamSizes(TInt& aCodeSize, TInt& aConstDataSize);
sl@0
  3172
	IMPORT_C TInt Init(); /**< @internalTechnology */
sl@0
  3173
public:
sl@0
  3174
	/**
sl@0
  3175
	Class representing information about an executable binary, (DLL or EXE).
sl@0
  3176
	@internalTechnology
sl@0
  3177
	*/
sl@0
  3178
	struct TInfo
sl@0
  3179
		{
sl@0
  3180
		TUint32 iModuleVersion;			/**< Version number */
sl@0
  3181
		TUidType iUids;					/**< UIDs */
sl@0
  3182
		TSecurityInfo iSecurityInfo;	/**< Security Info */
sl@0
  3183
		};
sl@0
  3184
sl@0
  3185
	/**
sl@0
  3186
	Class representing information about an executable binary, (DLL or EXE), version 2.
sl@0
  3187
	@internalTechnology
sl@0
  3188
	*/
sl@0
  3189
	struct TInfoV2 : public TInfo
sl@0
  3190
		{
sl@0
  3191
		TUint8 iHardwareFloatingPoint;	/**< Which hardware floating point used, from TFloatingPointType */
sl@0
  3192
		enum TDebugAttributes
sl@0
  3193
		{
sl@0
  3194
			EDebugAllowed = 1<<0, ///< Flags set if executable may be debugged.
sl@0
  3195
			ETraceAllowed = 1<<1 ///< Flags set if executable may be traced.
sl@0
  3196
		};
sl@0
  3197
		TUint8 iDebugAttributes; ///< Bitmask of values from enum TDebugAttributes
sl@0
  3198
		TUint8 iSpare[6];
sl@0
  3199
		};
sl@0
  3200
sl@0
  3201
	/**
sl@0
  3202
	Type representing a TInfo struct packaged as a descriptor.
sl@0
  3203
	@internalTechnology
sl@0
  3204
	*/
sl@0
  3205
	typedef TPckgBuf<TInfo> TInfoBuf;
sl@0
  3206
sl@0
  3207
	/**
sl@0
  3208
	Type representing a TInfo struct packaged as a descriptor, version 2.
sl@0
  3209
	@internalTechnology
sl@0
  3210
	*/
sl@0
  3211
	typedef TPckgBuf<TInfoV2> TInfoBufV2;
sl@0
  3212
sl@0
  3213
	/**
sl@0
  3214
	@internalTechnology
sl@0
  3215
	*/
sl@0
  3216
	enum TRequiredImageHeaderSize
sl@0
  3217
		{
sl@0
  3218
#ifdef __WINS__
sl@0
  3219
		/**
sl@0
  3220
		Size of header data which should be passed to GetInfoFromHeader()
sl@0
  3221
		*/
sl@0
  3222
		KRequiredImageHeaderSize = KMaxTInt
sl@0
  3223
#else
sl@0
  3224
		KRequiredImageHeaderSize = 9*1024
sl@0
  3225
#endif
sl@0
  3226
		};
sl@0
  3227
sl@0
  3228
	IMPORT_C static TInt GetInfoFromHeader(const TDesC8& aHeader, TDes8& aInfoBuf);
sl@0
  3229
sl@0
  3230
	/**
sl@0
  3231
	@internalTechnology
sl@0
  3232
	@deprecated Use TInfo
sl@0
  3233
	*/
sl@0
  3234
	struct SInfo
sl@0
  3235
		{
sl@0
  3236
		TUint32 iModuleVersion;
sl@0
  3237
		TUidType iUids;
sl@0
  3238
		SSecurityInfo iS;
sl@0
  3239
		};
sl@0
  3240
sl@0
  3241
	/**
sl@0
  3242
	@internalTechnology
sl@0
  3243
	@deprecated Use TInfoBuf
sl@0
  3244
	*/
sl@0
  3245
	typedef TPckgBuf<SInfo> SInfoBuf;
sl@0
  3246
sl@0
  3247
	/**
sl@0
  3248
	@internalTechnology
sl@0
  3249
	*/
sl@0
  3250
	IMPORT_C static TInt GetInfo(const TDesC& aFileName, TDes8& aInfoBuf);
sl@0
  3251
private:
sl@0
  3252
	TInt InitL();
sl@0
  3253
	};
sl@0
  3254
sl@0
  3255
sl@0
  3256
sl@0
  3257
sl@0
  3258
/**
sl@0
  3259
@publishedAll
sl@0
  3260
@released
sl@0
  3261
sl@0
  3262
A handle to a critical section.
sl@0
  3263
sl@0
  3264
A critical section itself is a kernel object, and is implemented using
sl@0
  3265
a semaphore. The class RCriticalSection inherits privately from RSemaphore
sl@0
  3266
as a matter of implementation and this is, in effect, equivalent to using
sl@0
  3267
a semaphore.
sl@0
  3268
sl@0
  3269
The public functions of RSemaphore are not part of the public API of this 
sl@0
  3270
class.
sl@0
  3271
sl@0
  3272
As with all handles, they should be closed after use. This class provides 
sl@0
  3273
the necessary Close() function, which should be called when the handle is 
sl@0
  3274
no longer required.
sl@0
  3275
sl@0
  3276
@see RHandleBase::Close
sl@0
  3277
*/
sl@0
  3278
class RCriticalSection : private RSemaphore
sl@0
  3279
	{
sl@0
  3280
public:
sl@0
  3281
	IMPORT_C RCriticalSection();
sl@0
  3282
	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
sl@0
  3283
	IMPORT_C void Close();
sl@0
  3284
	IMPORT_C void Wait();
sl@0
  3285
	IMPORT_C void Signal();
sl@0
  3286
	inline TBool IsBlocked() const;
sl@0
  3287
private:
sl@0
  3288
	TInt iBlocked;
sl@0
  3289
	};
sl@0
  3290
sl@0
  3291
sl@0
  3292
sl@0
  3293
/**
sl@0
  3294
@publishedAll
sl@0
  3295
@released
sl@0
  3296
sl@0
  3297
A handle to a mutex.
sl@0
  3298
sl@0
  3299
The mutex itself is a kernel side object.
sl@0
  3300
sl@0
  3301
Handles should be closed after use. RHandleBase provides the necessary Close() 
sl@0
  3302
function which should be called when the handle is no longer required.
sl@0
  3303
sl@0
  3304
@see RHandleBase::Close
sl@0
  3305
*/
sl@0
  3306
class RMutex : public RHandleBase
sl@0
  3307
	{
sl@0
  3308
public:
sl@0
  3309
	inline TInt Open(const TFindMutex& aFind,TOwnerType aType=EOwnerProcess);
sl@0
  3310
	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
sl@0
  3311
	IMPORT_C TInt CreateGlobal(const TDesC& aName,TOwnerType aType=EOwnerProcess);
sl@0
  3312
	IMPORT_C TInt OpenGlobal(const TDesC& aName,TOwnerType aType=EOwnerProcess);
sl@0
  3313
	IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType=EOwnerProcess);
sl@0
  3314
	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
sl@0
  3315
	IMPORT_C void Wait();
sl@0
  3316
	IMPORT_C void Signal();
sl@0
  3317
	IMPORT_C TBool IsHeld();
sl@0
  3318
	};
sl@0
  3319
sl@0
  3320
sl@0
  3321
sl@0
  3322
/**
sl@0
  3323
@publishedAll
sl@0
  3324
@released
sl@0
  3325
sl@0
  3326
A handle to a condition variable.
sl@0
  3327
sl@0
  3328
The condition variable itself is a kernel side object.
sl@0
  3329
sl@0
  3330
Handles should be closed after use. RHandleBase provides the necessary Close() 
sl@0
  3331
function which should be called when the handle is no longer required.
sl@0
  3332
sl@0
  3333
@see RHandleBase::Close
sl@0
  3334
*/
sl@0
  3335
class RCondVar : public RHandleBase
sl@0
  3336
	{
sl@0
  3337
public:
sl@0
  3338
	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
sl@0
  3339
	IMPORT_C TInt CreateGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
sl@0
  3340
	IMPORT_C TInt OpenGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
sl@0
  3341
	IMPORT_C TInt Open(RMessagePtr2 aMessage, TInt aParam, TOwnerType aType=EOwnerProcess);
sl@0
  3342
	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
sl@0
  3343
	IMPORT_C TInt Wait(RMutex& aMutex);
sl@0
  3344
	IMPORT_C TInt TimedWait(RMutex& aMutex, TInt aTimeout);	// timeout in microseconds
sl@0
  3345
	IMPORT_C void Signal();
sl@0
  3346
	IMPORT_C void Broadcast();
sl@0
  3347
	};
sl@0
  3348
sl@0
  3349
sl@0
  3350
sl@0
  3351
class UserHeap;
sl@0
  3352
class TChunkCreate;
sl@0
  3353
struct TChunkCreateInfo;
sl@0
  3354
/**
sl@0
  3355
@publishedAll
sl@0
  3356
@released
sl@0
  3357
sl@0
  3358
A handle to a chunk.
sl@0
  3359
sl@0
  3360
The chunk itself is a kernel side object.
sl@0
  3361
*/
sl@0
  3362
class RChunk : public RHandleBase
sl@0
  3363
	{
sl@0
  3364
public:
sl@0
  3365
	/**	
sl@0
  3366
	Set of flags used by SetRestrictions().
sl@0
  3367
	
sl@0
  3368
	@see RChunk::SetRestrictions
sl@0
  3369
	*/
sl@0
  3370
	enum TRestrictions
sl@0
  3371
		{
sl@0
  3372
		/** Prevent Adjust, Commit, Allocate and Decommit */
sl@0
  3373
		EPreventAdjust = 0x01,
sl@0
  3374
		};
sl@0
  3375
public:
sl@0
  3376
	inline TInt Open(const TFindChunk& aFind,TOwnerType aType=EOwnerProcess);
sl@0
  3377
	IMPORT_C TInt CreateLocal(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3378
	IMPORT_C TInt CreateLocalCode(TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3379
	IMPORT_C TInt CreateGlobal(const TDesC& aName,TInt aSize,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3380
	IMPORT_C TInt CreateDoubleEndedLocal(TInt aInitialBottom, TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3381
	IMPORT_C TInt CreateDoubleEndedGlobal(const TDesC& aName,TInt aInitialBottom,TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3382
	IMPORT_C TInt CreateDisconnectedLocal(TInt aInitialBottom, TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3383
	IMPORT_C TInt CreateDisconnectedGlobal(const TDesC& aName,TInt aInitialBottom,TInt aInitialTop,TInt aMaxSize,TOwnerType aType=EOwnerProcess);
sl@0
  3384
	IMPORT_C TInt Create(TChunkCreateInfo& aCreateInfo);
sl@0
  3385
	IMPORT_C TInt SetRestrictions(TUint aFlags);
sl@0
  3386
	IMPORT_C TInt OpenGlobal(const TDesC& aName,TBool isReadOnly,TOwnerType aType=EOwnerProcess);
sl@0
  3387
	IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TBool isReadOnly,TOwnerType aType=EOwnerProcess);
sl@0
  3388
	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
sl@0
  3389
	IMPORT_C TInt Adjust(TInt aNewSize) const;
sl@0
  3390
	IMPORT_C TInt AdjustDoubleEnded(TInt aBottom, TInt aTop) const;
sl@0
  3391
	IMPORT_C TInt Commit(TInt anOffset, TInt aSize) const;
sl@0
  3392
	IMPORT_C TInt Allocate(TInt aSize) const;
sl@0
  3393
	IMPORT_C TInt Decommit(TInt anOffset, TInt aSize) const;
sl@0
  3394
	IMPORT_C TInt Unlock(TInt aOffset, TInt aSize);	/**< @internalTechnology */
sl@0
  3395
	IMPORT_C TInt Lock(TInt aOffset, TInt aSize);	/**< @internalTechnology */
sl@0
  3396
	IMPORT_C TUint8* Base() const;
sl@0
  3397
	IMPORT_C TInt Size() const;
sl@0
  3398
	IMPORT_C TInt Bottom() const;
sl@0
  3399
	IMPORT_C TInt Top() const;
sl@0
  3400
	IMPORT_C TInt MaxSize() const;
sl@0
  3401
	inline TBool IsReadable() const;
sl@0
  3402
	inline TBool IsWritable() const;
sl@0
  3403
	IMPORT_C TBool IsPaged() const;
sl@0
  3404
private:
sl@0
  3405
	friend class UserHeap;
sl@0
  3406
	};
sl@0
  3407
sl@0
  3408
sl@0
  3409
/**
sl@0
  3410
This structure specifies the type and properties of the chunk to be created.  It
sl@0
  3411
is passed as a parameter to the RChunk::Create() method.
sl@0
  3412
sl@0
  3413
@publishedAll
sl@0
  3414
@released
sl@0
  3415
*/
sl@0
  3416
struct TChunkCreateInfo
sl@0
  3417
	{
sl@0
  3418
public :
sl@0
  3419
	/**
sl@0
  3420
	Currently supported version numbers
sl@0
  3421
	@internalComponent
sl@0
  3422
	*/
sl@0
  3423
	enum TChunkCreateVersions
sl@0
  3424
		{
sl@0
  3425
		EVersion0,
sl@0
  3426
		ESupportedVersions,
sl@0
  3427
		};
sl@0
  3428
sl@0
  3429
	friend class RChunk;
sl@0
  3430
sl@0
  3431
	/**
sl@0
  3432
	Attributes that specify whether the chunk to be created	is data paged or not.
sl@0
  3433
	*/
sl@0
  3434
	enum TChunkPagingAtt
sl@0
  3435
		{
sl@0
  3436
		EUnspecified,	/**< The chunk will use the creating process's paging attributes.*/
sl@0
  3437
		EPaged,			/**< The chunk will be data paged.*/
sl@0
  3438
		EUnpaged,		/**< The chunk will not be data paged.*/
sl@0
  3439
		};
sl@0
  3440
sl@0
  3441
	IMPORT_C TChunkCreateInfo();
sl@0
  3442
	IMPORT_C void SetNormal(TInt aInitialSize, TInt aMaxSize);
sl@0
  3443
	IMPORT_C void SetCode(TInt aInitialSize, TInt aMaxSize);
sl@0
  3444
	IMPORT_C void SetDoubleEnded(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize);
sl@0
  3445
	IMPORT_C void SetDisconnected(TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize);
sl@0
  3446
	IMPORT_C void SetOwner(TOwnerType aType);
sl@0
  3447
	IMPORT_C void SetGlobal(const TDesC& aName);
sl@0
  3448
	IMPORT_C void SetClearByte(TUint8 aClearByte);
sl@0
  3449
	IMPORT_C void SetPaging(const TChunkPagingAtt aPaging);
sl@0
  3450
	IMPORT_C void SetReadOnly();
sl@0
  3451
	void SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName);
sl@0
  3452
sl@0
  3453
	/**
sl@0
  3454
	For use by file server only.
sl@0
  3455
	@internalTechnology
sl@0
  3456
	*/
sl@0
  3457
	IMPORT_C void SetCache(TInt aMaxSize);
sl@0
  3458
protected :
sl@0
  3459
	/** The version number of this TChunkCreateInfo.
sl@0
  3460
	@internalComponent
sl@0
  3461
	*/
sl@0
  3462
	TUint iVersionNumber;
sl@0
  3463
	/** The type of the chunk to be created.
sl@0
  3464
	@internalComponent
sl@0
  3465
	*/
sl@0
  3466
	TUint iType;
sl@0
  3467
	/** Specify if chunk is global or not.
sl@0
  3468
	@internalComponent
sl@0
  3469
	*/
sl@0
  3470
	TBool iGlobal;
sl@0
  3471
	/**	The maximum size in bytes of the chunk to be created.
sl@0
  3472
	@internalComponent
sl@0
  3473
	*/
sl@0
  3474
	TInt iMaxSize;
sl@0
  3475
	/** An enumeration whose enumerators define the ownership of this chunk 
sl@0
  3476
		handle. If not explicitly specified, EOwnerProcess is taken as default.
sl@0
  3477
	@internalComponent
sl@0
  3478
	*/
sl@0
  3479
	TOwnerType iOwnerType;
sl@0
  3480
	/**	A pointer to a descriptor containing the name to be assigned to  
sl@0
  3481
		global chunks. The length of the descriptor must be no greater than 
sl@0
  3482
		that allowed for a TKName type.  Must be NULL for local chunks.
sl@0
  3483
	@internalComponent
sl@0
  3484
	*/
sl@0
  3485
	const TDesC* iName;
sl@0
  3486
	/** The offset of the bottom of the region to commit to the chunk on 
sl@0
  3487
		creation from the base of the chunk's reserved region.
sl@0
  3488
		This is only used for double ended and disconnected chunks.
sl@0
  3489
	@internalComponent
sl@0
  3490
	*/
sl@0
  3491
	TInt iInitialBottom;
sl@0
  3492
	/** The offset of the top of the region to commit to the chunk on 
sl@0
  3493
		creation from the base of the chunk's reserved region.
sl@0
  3494
		This is only used for double ended and disconnected chunks.
sl@0
  3495
	@internalComponent
sl@0
  3496
	*/
sl@0
  3497
	TInt iInitialTop;
sl@0
  3498
	/**	Attributes to the chunk to be created should have.
sl@0
  3499
		Should be set from one or more the values in TChunkCreate::TChunkCreateAtt.
sl@0
  3500
	@internalComponent
sl@0
  3501
	*/
sl@0
  3502
	TUint iAttributes;
sl@0
  3503
	/** The byte to clear all the memory committed to the chunk to.
sl@0
  3504
	@internalComponent
sl@0
  3505
	*/
sl@0
  3506
	TUint8 iClearByte; 
sl@0
  3507
	/** @internalComponent*/
sl@0
  3508
	TUint8 iSpare1[3];
sl@0
  3509
	/** @internalComponent*/
sl@0
  3510
	TUint iSpare2;
sl@0
  3511
	};
sl@0
  3512
sl@0
  3513
/**
sl@0
  3514
This structure specifies the type and properties of the user heap to be created.  It
sl@0
  3515
is passed as a parameter to the UserHeap::Create() method.
sl@0
  3516
sl@0
  3517
@publishedAll
sl@0
  3518
@released
sl@0
  3519
*/
sl@0
  3520
struct TChunkHeapCreateInfo
sl@0
  3521
	{
sl@0
  3522
public:
sl@0
  3523
	/**
sl@0
  3524
	Currently supported version numbers
sl@0
  3525
	@internalComponent
sl@0
  3526
	*/
sl@0
  3527
	enum TChunkHeapCreateVersions
sl@0
  3528
		{
sl@0
  3529
		EVersion0,
sl@0
  3530
		ESupportedVersions,
sl@0
  3531
		};
sl@0
  3532
sl@0
  3533
	/**
sl@0
  3534
	Attributes that specify whether the chunk heap to be created is data paged or not.
sl@0
  3535
	*/
sl@0
  3536
	enum TChunkHeapPagingAtt
sl@0
  3537
		{
sl@0
  3538
		EUnspecified,	/**< The chunk heap will use the creating process's paging attributes.*/
sl@0
  3539
		EPaged,			/**< The chunk heap will be data paged.*/
sl@0
  3540
		EUnpaged,		/**< The chunk heap will not be data paged.*/
sl@0
  3541
		};
sl@0
  3542
sl@0
  3543
	friend class UserHeap;
sl@0
  3544
sl@0
  3545
	IMPORT_C TChunkHeapCreateInfo(TInt aMinLength, TInt aMaxLength);
sl@0
  3546
	IMPORT_C void SetCreateChunk(const TDesC* aName);
sl@0
  3547
	IMPORT_C void SetUseChunk(const RChunk aChunk);
sl@0
  3548
	inline void SetSingleThread(TBool aSingleThread);
sl@0
  3549
	inline void SetAlignment(TInt aAlign);
sl@0
  3550
	inline void SetGrowBy(TInt aGrowBy);
sl@0
  3551
	inline void SetOffset(TInt aOffset);
sl@0
  3552
	inline void SetMode(TUint aMode);
sl@0
  3553
	inline void SetPaging(const TChunkHeapPagingAtt aPaging);
sl@0
  3554
sl@0
  3555
protected:
sl@0
  3556
	/** The version number of this TChunkHeapCreateInfo.
sl@0
  3557
	@internalComponent
sl@0
  3558
	*/
sl@0
  3559
	TUint iVersionNumber;
sl@0
  3560
	/** The minimum size for the heap.
sl@0
  3561
	@internalConponent
sl@0
  3562
	*/
sl@0
  3563
	TInt iMinLength;
sl@0
  3564
	/** The maximum size for the heap.
sl@0
  3565
	@internalConponent
sl@0
  3566
	*/
sl@0
  3567
	TInt iMaxLength;
sl@0
  3568
	/** The alignment of the heap.
sl@0
  3569
	@internalComponent
sl@0
  3570
	*/
sl@0
  3571
	TInt iAlign;
sl@0
  3572
	/** The grow by value of the heap.
sl@0
  3573
	@internalComponent
sl@0
  3574
	*/
sl@0
  3575
	TInt iGrowBy;
sl@0
  3576
	/** The single thread value of the heap.
sl@0
  3577
	@internalComponent
sl@0
  3578
	*/
sl@0
  3579
	TBool iSingleThread;
sl@0
  3580
	/** The offset from the base of the chunk to the start of the heap.
sl@0
  3581
	@internalComponent
sl@0
  3582
	*/
sl@0
  3583
	TInt iOffset;
sl@0
  3584
	/** The paging attributes of the chunk.
sl@0
  3585
	@internalComponent
sl@0
  3586
	*/
sl@0
  3587
	TChunkHeapPagingAtt iPaging;
sl@0
  3588
	/** The mode flags for the heap.
sl@0
  3589
	@internalComponent
sl@0
  3590
	*/
sl@0
  3591
	TUint iMode;
sl@0
  3592
	/** The name of the chunk to be created for the heap.
sl@0
  3593
	@internalComponent
sl@0
  3594
	*/
sl@0
  3595
	TDesC* iName;
sl@0
  3596
	/** The chunk to use for the heap.
sl@0
  3597
	@internalComponent
sl@0
  3598
	*/
sl@0
  3599
	RChunk iChunk;
sl@0
  3600
	/**@internalComponent*/
sl@0
  3601
	TInt iSpare[5];
sl@0
  3602
	};
sl@0
  3603
sl@0
  3604
struct SStdEpocThreadCreateInfo;
sl@0
  3605
/**
sl@0
  3606
@publishedAll
sl@0
  3607
@released
sl@0
  3608
sl@0
  3609
A set of static functions for constructing fixed length heaps and local or 
sl@0
  3610
global heaps.
sl@0
  3611
sl@0
  3612
@see RHeap
sl@0
  3613
@see RChunk
sl@0
  3614
*/
sl@0
  3615
class UserHeap
sl@0
  3616
	{
sl@0
  3617
public:
sl@0
  3618
	/**
sl@0
  3619
	Flags to control the heap creation.
sl@0
  3620
	*/
sl@0
  3621
	enum TChunkHeapCreateMode
sl@0
  3622
		{
sl@0
  3623
		/** On successful creation of the heap this switches the calling thread to
sl@0
  3624
			use the new heap.
sl@0
  3625
		*/
sl@0
  3626
		EChunkHeapSwitchTo	= 0x1,
sl@0
  3627
		/** On successful creation of the heap this causes the handle to the heap
sl@0
  3628
			to be duplicated.
sl@0
  3629
		*/ 
sl@0
  3630
		EChunkHeapDuplicate	= 0x2,
sl@0
  3631
sl@0
  3632
		/** @internalComponent*/
sl@0
  3633
		EChunkHeapMask = EChunkHeapSwitchTo | EChunkHeapDuplicate,
sl@0
  3634
		};
sl@0
  3635
	IMPORT_C static RHeap* FixedHeap(TAny* aBase, TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue);
sl@0
  3636
	IMPORT_C static RHeap* ChunkHeap(const TDesC* aName, TInt aMinLength, TInt aMaxLength, TInt aGrowBy=1, TInt aAlign=0, TBool aSingleThread=EFalse);
sl@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);
sl@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);
sl@0
  3639
	IMPORT_C static RHeap* ChunkHeap(const TChunkHeapCreateInfo& aCreateInfo);
sl@0
  3640
	IMPORT_C static TInt SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo);
sl@0
  3641
	IMPORT_C static TInt CreateThreadHeap(SStdEpocThreadCreateInfo& aInfo, RHeap*& aHeap, TInt aAlign=0, TBool aSingleThread=EFalse);
sl@0
  3642
	};
sl@0
  3643
sl@0
  3644
sl@0
  3645
sl@0
  3646
sl@0
  3647
/**
sl@0
  3648
@publishedAll
sl@0
  3649
@released
sl@0
  3650
sl@0
  3651
Encapsulates the Id of a kernel object.
sl@0
  3652
*/
sl@0
  3653
class TObjectId
sl@0
  3654
	{
sl@0
  3655
public:
sl@0
  3656
	inline TObjectId();
sl@0
  3657
	inline TObjectId(TUint64 anId);
sl@0
  3658
	inline TUint64 Id() const;
sl@0
  3659
	inline operator TUint() const;
sl@0
  3660
	inline TBool operator==(TObjectId aId) const;
sl@0
  3661
	inline TBool operator!=(TObjectId aId) const;
sl@0
  3662
private:
sl@0
  3663
	TUint64 iId;
sl@0
  3664
	};
sl@0
  3665
sl@0
  3666
sl@0
  3667
sl@0
  3668
sl@0
  3669
/**
sl@0
  3670
@publishedAll
sl@0
  3671
@released
sl@0
  3672
sl@0
  3673
Encapsulates the Id of a thread.
sl@0
  3674
sl@0
  3675
An object of this type is not explicitly constructed in open code,
sl@0
  3676
but is returned by the Id() member function of a thread handle,
sl@0
  3677
an RThread type.
sl@0
  3678
sl@0
  3679
@see RThread
sl@0
  3680
*/
sl@0
  3681
class TThreadId : public TObjectId
sl@0
  3682
	{
sl@0
  3683
public:
sl@0
  3684
	inline TThreadId();
sl@0
  3685
	inline TThreadId(TUint64 anId);
sl@0
  3686
	};
sl@0
  3687
sl@0
  3688
sl@0
  3689
sl@0
  3690
sl@0
  3691
/**
sl@0
  3692
This structure specifies the type and properties of the thread to be created.  It
sl@0
  3693
is passed as a parameter to the RThread::Create() method.
sl@0
  3694
sl@0
  3695
@publishedAll
sl@0
  3696
@released
sl@0
  3697
*/
sl@0
  3698
struct TThreadCreateInfo
sl@0
  3699
	{
sl@0
  3700
public :
sl@0
  3701
	/**
sl@0
  3702
	Currently supported version numbers
sl@0
  3703
	@internalComponent
sl@0
  3704
	*/
sl@0
  3705
	enum TThreadCreateVersions
sl@0
  3706
		{
sl@0
  3707
		EVersion0,
sl@0
  3708
		ESupportedVersions,
sl@0
  3709
		};
sl@0
  3710
sl@0
  3711
	/**
sl@0
  3712
	Attributes that specify whether the stack and heap of the thread to be created
sl@0
  3713
	are data paged or not.
sl@0
  3714
	*/
sl@0
  3715
	enum TThreadPagingAtt
sl@0
  3716
		{
sl@0
  3717
		EUnspecified,	/**< The thread will use the creating process's paging attributes.*/
sl@0
  3718
		EPaged,			/**< The thread will data page its stack and heap.*/
sl@0
  3719
		EUnpaged,		/**< The thread will not data page its stack and heap.*/
sl@0
  3720
		};
sl@0
  3721
sl@0
  3722
	friend class RThread;
sl@0
  3723
sl@0
  3724
	IMPORT_C TThreadCreateInfo(	const TDesC &aName, TThreadFunction aFunction, 
sl@0
  3725
								TInt aStackSize, TAny* aPtr);
sl@0
  3726
	IMPORT_C void SetCreateHeap(TInt aHeapMinSize, TInt aHeapMaxSize);
sl@0
  3727
	IMPORT_C void SetUseHeap(const RAllocator* aHeap);
sl@0
  3728
	IMPORT_C void SetOwner(const TOwnerType aOwner);
sl@0
  3729
	IMPORT_C void SetPaging(const TThreadPagingAtt aPaging);
sl@0
  3730
sl@0
  3731
protected:
sl@0
  3732
	/**	The version number of this TChunkCreateInfo.
sl@0
  3733
		@internalComponent
sl@0
  3734
	*/
sl@0
  3735
	TUint iVersionNumber;
sl@0
  3736
	/**	The Name to be given to the thread to be created
sl@0
  3737
		@internalComponent
sl@0
  3738
	*/
sl@0
  3739
	const TDesC* iName;
sl@0
  3740
	/**	The function this thread will execute.
sl@0
  3741
		@internalComponent
sl@0
  3742
	*/
sl@0
  3743
	TThreadFunction iFunction;
sl@0
  3744
	/**	The size of the stack of the thread to be created.
sl@0
  3745
		@internalComponent
sl@0
  3746
	*/
sl@0
  3747
	TInt iStackSize;
sl@0
  3748
	/** The parameter to be passed to the function of the thread to be created.
sl@0
  3749
		@internalComponent
sl@0
  3750
	*/
sl@0
  3751
	TAny* iParameter;
sl@0
  3752
	/** The owner of the thread to be created.
sl@0
  3753
		@internalComponent
sl@0
  3754
	*/
sl@0
  3755
	TOwnerType iOwner;
sl@0
  3756
	/**	The heap for the thread to be created to use.
sl@0
  3757
		NULL if a new heap is to be created.
sl@0
  3758
		@internalComponent
sl@0
  3759
	*/
sl@0
  3760
	RAllocator* iHeap;
sl@0
  3761
	/**	Minimum size of any heap to be created for the thread.
sl@0
  3762
		@internalComponent*/
sl@0
  3763
	TInt iHeapMinSize;
sl@0
  3764
	/**	Maximum size of any heap to be created for the thread.
sl@0
  3765
		@internalComponent
sl@0
  3766
	*/
sl@0
  3767
	TInt iHeapMaxSize;
sl@0
  3768
	/** The attributes of the thread
sl@0
  3769
		@internalComponent
sl@0
  3770
	*/
sl@0
  3771
	TUint iAttributes;
sl@0
  3772
	/**@internalComponent*/
sl@0
  3773
	TUint32 iSpare[6];
sl@0
  3774
	};
sl@0
  3775
sl@0
  3776
class RProcess;
sl@0
  3777
sl@0
  3778
sl@0
  3779
/**
sl@0
  3780
@publishedAll
sl@0
  3781
@released
sl@0
  3782
sl@0
  3783
A handle to a thread.
sl@0
  3784
sl@0
  3785
The thread itself is a kernel object.
sl@0
  3786
*/
sl@0
  3787
class RThread : public RHandleBase
sl@0
  3788
	{
sl@0
  3789
public:
sl@0
  3790
	inline RThread();
sl@0
  3791
	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize, TAny *aPtr, TOwnerType aType=EOwnerProcess);
sl@0
  3792
	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aFunction, TInt aStackSize, RAllocator* aHeap, TAny* aPtr, TOwnerType aType=EOwnerProcess);
sl@0
  3793
	IMPORT_C TInt Create(const TThreadCreateInfo& aCreateInfo);
sl@0
  3794
	IMPORT_C TInt Open(const TDesC& aFullName, TOwnerType aType=EOwnerProcess);
sl@0
  3795
	IMPORT_C TInt Open(TThreadId aID, TOwnerType aType=EOwnerProcess);
sl@0
  3796
	IMPORT_C TThreadId Id() const;
sl@0
  3797
	IMPORT_C void Resume() const;
sl@0
  3798
	IMPORT_C void Suspend() const;
sl@0
  3799
	/**
sl@0
  3800
	@publishedAll
sl@0
  3801
	@deprecated Use User::RenameThread() instead
sl@0
  3802
	*/
sl@0
  3803
	inline static TInt RenameMe(const TDesC& aName);
sl@0
  3804
sl@0
  3805
	IMPORT_C void Kill(TInt aReason);
sl@0
  3806
	IMPORT_C void Terminate(TInt aReason);
sl@0
  3807
	IMPORT_C void Panic(const TDesC& aCategory,TInt aReason);
sl@0
  3808
	IMPORT_C TInt Process(RProcess& aProcess) const;
sl@0
  3809
	IMPORT_C TThreadPriority Priority() const;
sl@0
  3810
	IMPORT_C void SetPriority(TThreadPriority aPriority) const;
sl@0
  3811
	IMPORT_C TProcessPriority ProcessPriority() const;
sl@0
  3812
	IMPORT_C void SetProcessPriority(TProcessPriority aPriority) const;
sl@0
  3813
	IMPORT_C TInt RequestCount() const;
sl@0
  3814
	IMPORT_C TExitType ExitType() const;
sl@0
  3815
	IMPORT_C TInt ExitReason() const;
sl@0
  3816
	IMPORT_C TExitCategoryName ExitCategory() const;
sl@0
  3817
	IMPORT_C void RequestComplete(TRequestStatus*& aStatus,TInt aReason) const;
sl@0
  3818
	IMPORT_C void RequestSignal() const;
sl@0
  3819
	IMPORT_C void Logon(TRequestStatus& aStatus) const;
sl@0
  3820
	IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const;
sl@0
  3821
	IMPORT_C void HandleCount(TInt& aProcessHandleCount, TInt& aThreadHandleCount) const;
sl@0
  3822
	IMPORT_C void Context(TDes8& aDes) const;
sl@0
  3823
	IMPORT_C TInt StackInfo(TThreadStackInfo& aInfo) const;
sl@0
  3824
	IMPORT_C TInt GetCpuTime(TTimeIntervalMicroSeconds& aCpuTime) const;
sl@0
  3825
	inline TInt Open(const TFindThread& aFind,TOwnerType aType=EOwnerProcess);
sl@0
  3826
	IMPORT_C void Rendezvous(TRequestStatus& aStatus) const;
sl@0
  3827
	IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const;
sl@0
  3828
	IMPORT_C static void Rendezvous(TInt aReason);
sl@0
  3829
sl@0
  3830
	/**
sl@0
  3831
	Return the Secure ID of the process to which the thread belongs.
sl@0
  3832
sl@0
  3833
	If an intended use of this method is to check that the Secure ID is
sl@0
  3834
	a given value, then the use of a TSecurityPolicy object should be
sl@0
  3835
	considered. E.g. Instead of something like:
sl@0
  3836
sl@0
  3837
	@code
sl@0
  3838
		RThread& thread;
sl@0
  3839
		TInt error = thread.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;
sl@0
  3840
	@endcode
sl@0
  3841
sl@0
  3842
	this could be used;
sl@0
  3843
sl@0
  3844
	@code
sl@0
  3845
		RThread& thread;
sl@0
  3846
		static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
sl@0
  3847
		TBool pass = mySidPolicy().CheckPolicy(thread);
sl@0
  3848
	@endcode
sl@0
  3849
sl@0
  3850
	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
sl@0
  3851
	configured by the system wide Platform Security configuration. I.e. are
sl@0
  3852
	capable of emitting diagnostic messages when a check fails and/or the
sl@0
  3853
	check can be forced to always pass.
sl@0
  3854
sl@0
  3855
	@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
sl@0
  3856
	@see _LIT_SECURITY_POLICY_S0
sl@0
  3857
sl@0
  3858
	@return The Secure ID.
sl@0
  3859
	@publishedAll
sl@0
  3860
	@released
sl@0
  3861
	*/
sl@0
  3862
	IMPORT_C TSecureId SecureId() const;
sl@0
  3863
sl@0
  3864
	/**
sl@0
  3865
	Return the Vendor ID of the process to which the thread belongs.
sl@0
  3866
sl@0
  3867
	If an intended use of this method is to check that the Vendor ID is
sl@0
  3868
	a given value, then the use of a TSecurityPolicy object should be
sl@0
  3869
	considered. E.g. Instead of something like:
sl@0
  3870
sl@0
  3871
	@code
sl@0
  3872
		RThread& thread;
sl@0
  3873
		TInt error = thread.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;
sl@0
  3874
	@endcode
sl@0
  3875
sl@0
  3876
	this could be used;
sl@0
  3877
sl@0
  3878
	@code
sl@0
  3879
		RThread& thread;
sl@0
  3880
		static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
sl@0
  3881
		TBool pass = myVidPolicy().CheckPolicy(thread);
sl@0
  3882
	@endcode
sl@0
  3883
sl@0
  3884
	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
sl@0
  3885
	configured by the system wide Platform Security configuration. I.e. are
sl@0
  3886
	capable of emitting diagnostic messages when a check fails and/or the
sl@0
  3887
	check can be forced to always pass.
sl@0
  3888
sl@0
  3889
	@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
sl@0
  3890
	@see _LIT_SECURITY_POLICY_V0
sl@0
  3891
sl@0
  3892
	@return The Vendor ID.
sl@0
  3893
	@publishedAll
sl@0
  3894
    @released
sl@0
  3895
	*/
sl@0
  3896
	IMPORT_C TVendorId VendorId() const;
sl@0
  3897
sl@0
  3898
	/**
sl@0
  3899
	Check if the process to which the thread belongs has a given capability
sl@0
  3900
sl@0
  3901
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  3902
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  3903
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  3904
	check failed.
sl@0
  3905
sl@0
  3906
	@param aCapability The capability to test.
sl@0
  3907
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  3908
								that may be issued if the test finds the capability is not present.
sl@0
  3909
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  3910
								which enables it to be easily removed from the system.
sl@0
  3911
	@return ETrue if the process to which the thread belongs has the capability, EFalse otherwise.
sl@0
  3912
	@publishedAll
sl@0
  3913
    @released
sl@0
  3914
	*/
sl@0
  3915
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3916
	inline TBool HasCapability(TCapability aCapability, const char* aDiagnostic=0) const;
sl@0
  3917
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3918
	// Only available to NULL arguments
sl@0
  3919
	inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL) const;
sl@0
  3920
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  3921
	// For things using KSuppressPlatSecDiagnostic
sl@0
  3922
	inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
sl@0
  3923
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  3924
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3925
sl@0
  3926
	/**
sl@0
  3927
	Check if the process to which the thread belongs has both of the given capabilities
sl@0
  3928
sl@0
  3929
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  3930
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  3931
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  3932
	check failed.
sl@0
  3933
sl@0
  3934
	@param aCapability1 The first capability to test.
sl@0
  3935
	@param aCapability2 The second capability to test.
sl@0
  3936
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  3937
								that may be issued if the test finds a capability is not present.
sl@0
  3938
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  3939
								which enables it to be easily removed from the system.
sl@0
  3940
	@return ETrue if the process to which the thread belongs has both the capabilities, EFalse otherwise.
sl@0
  3941
	@publishedAll
sl@0
  3942
	@released
sl@0
  3943
	*/
sl@0
  3944
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3945
	inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0) const;
sl@0
  3946
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3947
	// Only available to NULL arguments
sl@0
  3948
	inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL) const;
sl@0
  3949
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  3950
	// For things using KSuppressPlatSecDiagnostic
sl@0
  3951
	inline TBool HasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
sl@0
  3952
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  3953
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  3954
sl@0
  3955
	/** Function only temporarily supported to aid migration to process emulation...
sl@0
  3956
sl@0
  3957
	@publishedAll
sl@0
  3958
	@deprecated Use process emulation instead
sl@0
  3959
	*/
sl@0
  3960
	inline TInt Create(const TDesC& aName,TThreadFunction aFunction,TInt aStackSize,TAny* aPtr,RLibrary* aLibrary,RHeap* aHeap, TInt aHeapMinSize,TInt aHeapMaxSize,TOwnerType aType);
sl@0
  3961
sl@0
  3962
private:
sl@0
  3963
	// Implementations of functions with diagnostics
sl@0
  3964
	IMPORT_C TBool DoHasCapability(TCapability aCapability, const char* aDiagnostic) const;
sl@0
  3965
	IMPORT_C TBool DoHasCapability(TCapability aCapability) const;
sl@0
  3966
	IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const;
sl@0
  3967
	IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2) const;
sl@0
  3968
	};
sl@0
  3969
sl@0
  3970
/**
sl@0
  3971
@publishedAll
sl@0
  3972
@deprecated
sl@0
  3973
*/
sl@0
  3974
inline TInt RThread::Create(const TDesC& /*aName*/,TThreadFunction /*aFunction*/,TInt /*aStackSize*/,TAny* /*aPtr*/,RLibrary* /*aLibrary*/,RHeap* /*aHeap*/, TInt /*aHeapMinSize*/,TInt /*aHeapMaxSize*/,TOwnerType /*aType*/)
sl@0
  3975
	{return KErrNotSupported; }
sl@0
  3976
sl@0
  3977
sl@0
  3978
sl@0
  3979
/**
sl@0
  3980
@publishedAll
sl@0
  3981
@released
sl@0
  3982
sl@0
  3983
Encapsulates the Id of a process.
sl@0
  3984
sl@0
  3985
An object of this type is not explicitly constructed in open code,
sl@0
  3986
but is returned by the Id() member function of a process handle,
sl@0
  3987
an RProcess type.
sl@0
  3988
sl@0
  3989
@see RProcess
sl@0
  3990
*/
sl@0
  3991
class TProcessId : public TObjectId
sl@0
  3992
	{
sl@0
  3993
public:
sl@0
  3994
	inline TProcessId();
sl@0
  3995
	inline TProcessId(TUint64 anId);
sl@0
  3996
	};
sl@0
  3997
sl@0
  3998
sl@0
  3999
sl@0
  4000
sl@0
  4001
class RSubSessionBase;
sl@0
  4002
sl@0
  4003
/** 
sl@0
  4004
@publishedAll
sl@0
  4005
@released
sl@0
  4006
sl@0
  4007
A handle to a process.
sl@0
  4008
sl@0
  4009
The process itself is a kernel object.
sl@0
  4010
*/
sl@0
  4011
class RProcess : public RHandleBase
sl@0
  4012
	{
sl@0
  4013
public:
sl@0
  4014
	inline RProcess();
sl@0
  4015
	IMPORT_C TInt Create(const TDesC& aFileName,const TDesC& aCommand,TOwnerType aType=EOwnerProcess);
sl@0
  4016
	IMPORT_C TInt Create(const TDesC& aFileName,const TDesC& aCommand,const TUidType &aUidType, TOwnerType aType=EOwnerProcess);
sl@0
  4017
	IMPORT_C TInt Open(const TDesC& aName,TOwnerType aType=EOwnerProcess);
sl@0
  4018
	IMPORT_C TInt Open(TProcessId aId,TOwnerType aType=EOwnerProcess);
sl@0
  4019
	IMPORT_C TUidType Type() const;
sl@0
  4020
	IMPORT_C TProcessId Id() const;
sl@0
  4021
	/**
sl@0
  4022
	@publishedAll
sl@0
  4023
	@deprecated Use User::RenameProcess() instead
sl@0
  4024
	*/
sl@0
  4025
	inline static TInt RenameMe(const TDesC& aName);
sl@0
  4026
sl@0
  4027
	IMPORT_C void Kill(TInt aReason);
sl@0
  4028
	IMPORT_C void Terminate(TInt aReason);
sl@0
  4029
	IMPORT_C void Panic(const TDesC& aCategory,TInt aReason);
sl@0
  4030
	IMPORT_C void Resume();
sl@0
  4031
	IMPORT_C TFileName FileName() const;
sl@0
  4032
	IMPORT_C TExitType ExitType() const;
sl@0
  4033
	IMPORT_C TInt ExitReason() const;
sl@0
  4034
	IMPORT_C TExitCategoryName ExitCategory() const;
sl@0
  4035
	IMPORT_C TProcessPriority Priority() const;
sl@0
  4036
	IMPORT_C TInt SetPriority(TProcessPriority aPriority) const;
sl@0
  4037
    IMPORT_C TBool JustInTime() const;
sl@0
  4038
    IMPORT_C void SetJustInTime(TBool aBoolean) const; 
sl@0
  4039
	IMPORT_C void Logon(TRequestStatus& aStatus) const;
sl@0
  4040
	IMPORT_C TInt LogonCancel(TRequestStatus& aStatus) const;
sl@0
  4041
	IMPORT_C TInt GetMemoryInfo(TModuleMemoryInfo& aInfo) const;
sl@0
  4042
	inline TInt Open(const TFindProcess& aFind,TOwnerType aType=EOwnerProcess);
sl@0
  4043
	IMPORT_C void Rendezvous(TRequestStatus& aStatus) const;
sl@0
  4044
	IMPORT_C TInt RendezvousCancel(TRequestStatus& aStatus) const;
sl@0
  4045
	IMPORT_C static void Rendezvous(TInt aReason);
sl@0
  4046
	IMPORT_C TBool DefaultDataPaged() const;
sl@0
  4047
sl@0
  4048
	/**
sl@0
  4049
	Return the Secure ID of the process.
sl@0
  4050
sl@0
  4051
	If an intended use of this method is to check that the Secure ID is
sl@0
  4052
	a given value, then the use of a TSecurityPolicy object should be
sl@0
  4053
	considered. E.g. Instead of something like:
sl@0
  4054
sl@0
  4055
	@code
sl@0
  4056
		RProcess& process;
sl@0
  4057
		TInt error = process.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;
sl@0
  4058
	@endcode
sl@0
  4059
sl@0
  4060
	this could be used;
sl@0
  4061
sl@0
  4062
	@code
sl@0
  4063
		RProcess& process;
sl@0
  4064
		static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
sl@0
  4065
		TBool pass = mySidPolicy().CheckPolicy(process);
sl@0
  4066
	@endcode
sl@0
  4067
sl@0
  4068
	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
sl@0
  4069
	configured by the system wide Platform Security configuration. I.e. are
sl@0
  4070
	capable of emitting diagnostic messages when a check fails and/or the
sl@0
  4071
	check can be forced to always pass.
sl@0
  4072
sl@0
  4073
	@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
sl@0
  4074
	@see _LIT_SECURITY_POLICY_S0
sl@0
  4075
sl@0
  4076
	@return The Secure ID.
sl@0
  4077
	@publishedAll
sl@0
  4078
	@released
sl@0
  4079
	*/
sl@0
  4080
	IMPORT_C TSecureId SecureId() const;
sl@0
  4081
sl@0
  4082
	/**
sl@0
  4083
	Return the Vendor ID of the process.
sl@0
  4084
sl@0
  4085
	If an intended use of this method is to check that the Vendor ID is
sl@0
  4086
	a given value, then the use of a TSecurityPolicy object should be
sl@0
  4087
	considered. E.g. Instead of something like:
sl@0
  4088
sl@0
  4089
	@code
sl@0
  4090
		RProcess& process;
sl@0
  4091
		TInt error = process.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;
sl@0
  4092
	@endcode
sl@0
  4093
sl@0
  4094
	this could be used;
sl@0
  4095
sl@0
  4096
	@code
sl@0
  4097
		RProcess& process;
sl@0
  4098
		static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
sl@0
  4099
		TBool pass = myVidPolicy().CheckPolicy(process);
sl@0
  4100
	@endcode
sl@0
  4101
sl@0
  4102
	This has the benefit that the TSecurityPolicy::CheckPolicy methods are
sl@0
  4103
	configured by the system wide Platform Security configuration. I.e. are
sl@0
  4104
	capable of emitting diagnostic messages when a check fails and/or the
sl@0
  4105
	check can be forced to always pass.
sl@0
  4106
sl@0
  4107
	@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
sl@0
  4108
	@see _LIT_SECURITY_POLICY_V0
sl@0
  4109
sl@0
  4110
	@return The Vendor ID.
sl@0
  4111
	@publishedAll
sl@0
  4112
    @released
sl@0
  4113
	*/
sl@0
  4114
	IMPORT_C TVendorId VendorId() const;
sl@0
  4115
sl@0
  4116
	/**
sl@0
  4117
	Check if the process has a given capability
sl@0
  4118
sl@0
  4119
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  4120
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  4121
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  4122
	check failed.
sl@0
  4123
sl@0
  4124
	@param aCapability The capability to test.
sl@0
  4125
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  4126
								that may be issued if the test finds the capability is not present.
sl@0
  4127
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  4128
								which enables it to be easily removed from the system.
sl@0
  4129
	@return ETrue if the process has the capability, EFalse otherwise.
sl@0
  4130
	@publishedAll
sl@0
  4131
	@released
sl@0
  4132
	*/
sl@0
  4133
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4134
	inline TBool HasCapability(TCapability aCapability, const char* aDiagnostic=0) const;
sl@0
  4135
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4136
	// Only available to NULL arguments
sl@0
  4137
	inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL) const;
sl@0
  4138
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  4139
	// For things using KSuppressPlatSecDiagnostic
sl@0
  4140
	inline TBool HasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
sl@0
  4141
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  4142
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4143
sl@0
  4144
	/**
sl@0
  4145
	Check if the process has both of the given capabilities
sl@0
  4146
sl@0
  4147
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  4148
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  4149
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  4150
	check failed.
sl@0
  4151
sl@0
  4152
	@param aCapability1 The first capability to test.
sl@0
  4153
	@param aCapability2 The second capability to test.
sl@0
  4154
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  4155
								that may be issued if the test finds a capability is not present.
sl@0
  4156
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  4157
								which enables it to be easily removed from the system.
sl@0
  4158
	@return ETrue if the process has both the capabilities, EFalse otherwise.
sl@0
  4159
	@publishedAll
sl@0
  4160
	@released
sl@0
  4161
	*/
sl@0
  4162
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4163
	inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0) const;
sl@0
  4164
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4165
	// Only available to NULL arguments
sl@0
  4166
	inline TBool HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL) const;
sl@0
  4167
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  4168
	// For things using KSuppressPlatSecDiagnostic
sl@0
  4169
	inline TBool HasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress) const;
sl@0
  4170
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  4171
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4172
sl@0
  4173
	IMPORT_C TInt SetParameter(TInt aIndex,  RHandleBase aHandle);
sl@0
  4174
	IMPORT_C TInt SetParameter(TInt aSlot, const RSubSessionBase& aSession);
sl@0
  4175
	IMPORT_C TInt SetParameter(TInt aSlot, const TDesC16& aDes);
sl@0
  4176
	IMPORT_C TInt SetParameter(TInt aSlot, const TDesC8& aDes);
sl@0
  4177
	IMPORT_C TInt SetParameter(TInt aSlot, TInt aData);
sl@0
  4178
	inline RProcess(TInt aHandle);
sl@0
  4179
sl@0
  4180
	/**
sl@0
  4181
	@deprecated Use RProcess::SecureId() instead
sl@0
  4182
	*/
sl@0
  4183
	inline TUid Identity() const { return SecureId(); }
sl@0
  4184
sl@0
  4185
	/**
sl@0
  4186
	Legacy Platform Security development and migration support
sl@0
  4187
	@internalAll
sl@0
  4188
	@deprecated No replacement
sl@0
  4189
	*/
sl@0
  4190
	enum TSecureApi { ESecureApiOff, ESecureApiOn, ESecureApiQuery }; // __SECURE_API__ remove this
sl@0
  4191
sl@0
  4192
	/**
sl@0
  4193
	Legacy Platform Security development and migration support
sl@0
  4194
	@internalAll
sl@0
  4195
	@deprecated No replacement
sl@0
  4196
	*/
sl@0
  4197
	IMPORT_C TInt SecureApi(TInt aState); // __SECURE_API__ remove this
sl@0
  4198
sl@0
  4199
	/**
sl@0
  4200
	Legacy Platform Security development and migration support
sl@0
  4201
	@internalAll
sl@0
  4202
	@deprecated No replacement
sl@0
  4203
	*/
sl@0
  4204
	enum TDataCaging { EDataCagingOff, EDataCagingOn, EDataCagingQuery}; // __DATA_CAGING__ __SECURE_API__ remove this
sl@0
  4205
sl@0
  4206
	/**
sl@0
  4207
	Legacy Platform Security development and migration support
sl@0
  4208
	@internalAll
sl@0
  4209
	@deprecated No replacement
sl@0
  4210
	*/
sl@0
  4211
	IMPORT_C TInt DataCaging(TInt aState); // __DATA_CAGING__ __SECURE_API__ remove this
sl@0
  4212
	
sl@0
  4213
sl@0
  4214
	IMPORT_C TInt CreateWithStackOverride(const TDesC& aFileName,const TDesC& aCommand, const TUidType &aUidType, TInt aMinStackSize, TOwnerType aType);
sl@0
  4215
sl@0
  4216
	IMPORT_C static TAny* ExeExportData(void);
sl@0
  4217
sl@0
  4218
private:
sl@0
  4219
	// Implementations of functions with diagnostics
sl@0
  4220
	IMPORT_C TBool DoHasCapability(TCapability aCapability, const char* aDiagnostic) const;
sl@0
  4221
	IMPORT_C TBool DoHasCapability(TCapability aCapability) const;
sl@0
  4222
	IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const;
sl@0
  4223
	IMPORT_C TBool DoHasCapability(TCapability aCapability1, TCapability aCapability2) const;
sl@0
  4224
	};
sl@0
  4225
sl@0
  4226
sl@0
  4227
sl@0
  4228
sl@0
  4229
sl@0
  4230
sl@0
  4231
sl@0
  4232
sl@0
  4233
sl@0
  4234
/**
sl@0
  4235
@internalTechnology
sl@0
  4236
*/
sl@0
  4237
class RServer2 : public RHandleBase
sl@0
  4238
	{
sl@0
  4239
public:
sl@0
  4240
	IMPORT_C TInt CreateGlobal(const TDesC& aName);
sl@0
  4241
	IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode);
sl@0
  4242
	IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aMode, TInt aRole, TInt aOpts);
sl@0
  4243
	IMPORT_C void Receive(RMessage2& aMessage,TRequestStatus& aStatus);
sl@0
  4244
	IMPORT_C void Receive(RMessage2& aMessage);
sl@0
  4245
	IMPORT_C void Cancel();
sl@0
  4246
	};
sl@0
  4247
sl@0
  4248
sl@0
  4249
sl@0
  4250
sl@0
  4251
/**
sl@0
  4252
@publishedAll
sl@0
  4253
@released
sl@0
  4254
sl@0
  4255
Client-side handle to a session with a server.
sl@0
  4256
sl@0
  4257
This is the client-side interface through which communication with the server
sl@0
  4258
is channelled.
sl@0
  4259
sl@0
  4260
Clients normally define and implement a derived class to provide
sl@0
  4261
a richer interface.
sl@0
  4262
*/
sl@0
  4263
class RSessionBase : public RHandleBase
sl@0
  4264
	{
sl@0
  4265
	friend class RSubSessionBase;
sl@0
  4266
public:
sl@0
  4267
    /**
sl@0
  4268
    Indicates whether or not threads in the process are automatically attached
sl@0
  4269
    to the session when passed as a parameter to the Share() function.
sl@0
  4270
    */
sl@0
  4271
	enum TAttachMode {EExplicitAttach,EAutoAttach};
sl@0
  4272
public:
sl@0
  4273
	/**
sl@0
  4274
	Creates a session that can be shared by other threads in the current
sl@0
  4275
    process.
sl@0
  4276
    
sl@0
  4277
    After calling this function the session object may be used by threads other
sl@0
  4278
    than than the one that created it.
sl@0
  4279
    
sl@0
  4280
    Note that this can only be done with servers that mark their sessions
sl@0
  4281
    as sharable.
sl@0
  4282
    
sl@0
  4283
    @return	KErrNone, if the session is successfully shared;
sl@0
  4284
	        KErrNoMmemory, if the attempt fails for lack of memory.
sl@0
  4285
sl@0
  4286
    @panic	KERN-EXEC 23 The session cannot be shared.
sl@0
  4287
    
sl@0
  4288
    @see CServer2
sl@0
  4289
    @see RSessionBase::ShareProtected()
sl@0
  4290
    @see CServer2::TServerType
sl@0
  4291
	*/
sl@0
  4292
	inline TInt ShareAuto()	{ return DoShare(EAutoAttach); }
sl@0
  4293
sl@0
  4294
sl@0
  4295
    /**
sl@0
  4296
    Creates a session handle that can be be passed via IPC to another process
sl@0
  4297
    as well as being shared by other threads in the current process.
sl@0
  4298
    
sl@0
  4299
    After calling this function the session object may be used by threads other
sl@0
  4300
    than than the one that created it.
sl@0
  4301
sl@0
  4302
    Note that this can only be done with servers that mark their sessions
sl@0
  4303
    as globally sharable.
sl@0
  4304
    
sl@0
  4305
    @return	KErrNone, if the session is successfully shared;
sl@0
  4306
	        KErrNoMmemory, if the attempt fails for lack of memory.
sl@0
  4307
   
sl@0
  4308
    @panic	KERN-EXEC 23 The session cannot be shared.
sl@0
  4309
    
sl@0
  4310
    @see CServer2
sl@0
  4311
    @see RSessionBase::ShareAuto()
sl@0
  4312
    @see CServer2::TServerType
sl@0
  4313
    */
sl@0
  4314
	inline TInt ShareProtected() { return DoShare(EAutoAttach|KCreateProtectedObject); }
sl@0
  4315
sl@0
  4316
sl@0
  4317
	IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType=EOwnerProcess);
sl@0
  4318
	IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,const TSecurityPolicy& aServerPolicy,TOwnerType aType=EOwnerProcess);
sl@0
  4319
	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
sl@0
  4320
	IMPORT_C TInt Open(TInt aArgumentIndex, const TSecurityPolicy& aServerPolicy, TOwnerType aType=EOwnerProcess);
sl@0
  4321
	inline TInt SetReturnedHandle(TInt aHandleOrError);
sl@0
  4322
	IMPORT_C TInt SetReturnedHandle(TInt aHandleOrError,const TSecurityPolicy& aServerPolicy);
sl@0
  4323
protected:
sl@0
  4324
	inline TInt CreateSession(const TDesC& aServer,const TVersion& aVersion);
sl@0
  4325
	IMPORT_C TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots);
sl@0
  4326
	IMPORT_C TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
sl@0
  4327
	inline TInt CreateSession(RServer2 aServer,const TVersion& aVersion);
sl@0
  4328
	IMPORT_C TInt CreateSession(RServer2 aServer,const TVersion& aVersion,TInt aAsyncMessageSlots);
sl@0
  4329
	IMPORT_C TInt CreateSession(RServer2 aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
sl@0
  4330
	inline static TInt SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle);
sl@0
  4331
sl@0
  4332
	/**
sl@0
  4333
	@deprecated Use CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TIpcSessionType aType,const TSecurityPolicy* aPolicy=0, TRequestStatus* aStatus=0);
sl@0
  4334
	*/
sl@0
  4335
	inline TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots,TRequestStatus* aStatus)
sl@0
  4336
		{ return CreateSession(aServer, aVersion, aAsyncMessageSlots, EIpcSession_Unsharable, (TSecurityPolicy*)0, aStatus); }
sl@0
  4337
	inline TInt Send(TInt aFunction,const TIpcArgs& aArgs) const;
sl@0
  4338
	inline void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
sl@0
  4339
	inline TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
sl@0
  4340
	inline TInt Send(TInt aFunction) const;
sl@0
  4341
	inline void SendReceive(TInt aFunction,TRequestStatus& aStatus) const;
sl@0
  4342
	inline TInt SendReceive(TInt aFunction) const;
sl@0
  4343
private:
sl@0
  4344
	IMPORT_C TInt DoSend(TInt aFunction,const TIpcArgs* aArgs) const;
sl@0
  4345
	IMPORT_C void DoSendReceive(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus& aStatus) const;
sl@0
  4346
	IMPORT_C TInt DoSendReceive(TInt aFunction,const TIpcArgs* aArgs) const;
sl@0
  4347
	TInt SendAsync(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus* aStatus) const;
sl@0
  4348
	TInt SendSync(TInt aFunction,const TIpcArgs* aArgs) const;
sl@0
  4349
	IMPORT_C TInt DoShare(TInt aAttachMode);
sl@0
  4350
	TInt DoConnect(const TVersion &aVersion,TRequestStatus* aStatus);
sl@0
  4351
	};
sl@0
  4352
sl@0
  4353
sl@0
  4354
sl@0
  4355
sl@0
  4356
/**
sl@0
  4357
@publishedAll
sl@0
  4358
@released
sl@0
  4359
sl@0
  4360
Client-side handle to a sub-session. 
sl@0
  4361
sl@0
  4362
It represents a client-side sub-session, and has a corresponding sub-session
sl@0
  4363
object on the server-side.
sl@0
  4364
sl@0
  4365
Clients normally define and implement a derived class to provide a richer
sl@0
  4366
interface. In particular, a derived class should:
sl@0
  4367
sl@0
  4368
1. provide a function to create a new sub-session with the server;
sl@0
  4369
   this should call CreateSubSession().
sl@0
  4370
sl@0
  4371
2. provide a function to close the current sub-session;
sl@0
  4372
   this should call CloseSubSession().
sl@0
  4373
sl@0
  4374
A session must already exist with a server before a client can establish
sl@0
  4375
any sub-sessions.
sl@0
  4376
*/
sl@0
  4377
class RSubSessionBase
sl@0
  4378
	{
sl@0
  4379
public:
sl@0
  4380
	inline TInt SubSessionHandle() const;
sl@0
  4381
protected:
sl@0
  4382
	inline RSubSessionBase();
sl@0
  4383
	IMPORT_C const RSessionBase Session() const;
sl@0
  4384
	inline TInt CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs);
sl@0
  4385
	inline TInt CreateSubSession(const RSessionBase& aSession,TInt aFunction);
sl@0
  4386
	IMPORT_C TInt CreateAutoCloseSubSession(RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs);
sl@0
  4387
	IMPORT_C void CloseSubSession(TInt aFunction);
sl@0
  4388
	inline TInt Send(TInt aFunction,const TIpcArgs& aArgs) const;
sl@0
  4389
	inline void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
sl@0
  4390
	inline TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
sl@0
  4391
	inline TInt Send(TInt aFunction) const;
sl@0
  4392
	inline void SendReceive(TInt aFunction,TRequestStatus& aStatus) const;
sl@0
  4393
	inline TInt SendReceive(TInt aFunction) const;
sl@0
  4394
private:
sl@0
  4395
	IMPORT_C TInt DoCreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs* aArgs);
sl@0
  4396
	IMPORT_C TInt DoSend(TInt aFunction,const TIpcArgs* aArgs) const;
sl@0
  4397
	IMPORT_C void DoSendReceive(TInt aFunction,const TIpcArgs* aArgs,TRequestStatus& aStatus) const;
sl@0
  4398
	IMPORT_C TInt DoSendReceive(TInt aFunction,const TIpcArgs* aArgs) const;
sl@0
  4399
	TInt DoCreateSubSession(RSessionBase& aSession,TInt aFunction,const TIpcArgs* aArgs, TBool aAutoClose);
sl@0
  4400
private:
sl@0
  4401
	RSessionBase iSession;
sl@0
  4402
	TInt iSubSessionHandle;
sl@0
  4403
	};
sl@0
  4404
sl@0
  4405
sl@0
  4406
sl@0
  4407
sl@0
  4408
/**
sl@0
  4409
@publishedAll
sl@0
  4410
@released
sl@0
  4411
sl@0
  4412
Base class that provides an implementation for the templated
sl@0
  4413
RRef class.
sl@0
  4414
sl@0
  4415
@see RRef
sl@0
  4416
*/
sl@0
  4417
class RRefBase
sl@0
  4418
	{
sl@0
  4419
public:
sl@0
  4420
	IMPORT_C void Free();
sl@0
  4421
protected:
sl@0
  4422
	inline RRefBase();
sl@0
  4423
	inline RRefBase(const RRefBase& aRef);
sl@0
  4424
	IMPORT_C void DoAlloc(const TAny* aPtr,TInt aSize);
sl@0
  4425
	IMPORT_C void DoAllocL(const TAny* aPtr,TInt aSize);
sl@0
  4426
	IMPORT_C void Copy(const RRefBase& aRef);
sl@0
  4427
private:
sl@0
  4428
	IMPORT_C void operator=(const RRefBase& aRef);
sl@0
  4429
protected:
sl@0
  4430
	TInt* iPtr;
sl@0
  4431
	};
sl@0
  4432
sl@0
  4433
sl@0
  4434
sl@0
  4435
sl@0
  4436
/**
sl@0
  4437
@publishedAll
sl@0
  4438
@released
sl@0
  4439
sl@0
  4440
Contains, or packages, a copy of an instance of another class.
sl@0
  4441
sl@0
  4442
The template parameter defines the type of the contained object.
sl@0
  4443
sl@0
  4444
The contained object is held in allocated memory, and can be accessed
sl@0
  4445
through the member selection and dereference operators.
sl@0
  4446
*/
sl@0
  4447
template <class T>
sl@0
  4448
class RRef : public RRefBase
sl@0
  4449
	{
sl@0
  4450
public:
sl@0
  4451
	inline RRef();
sl@0
  4452
	inline RRef(const RRef<T>& anObject);
sl@0
  4453
	inline void operator=(const RRef<T>& anObject);
sl@0
  4454
	inline T* operator->();
sl@0
  4455
	inline operator T*();
sl@0
  4456
	inline void Alloc(const T& anObject);
sl@0
  4457
	inline void Alloc(const T& anObject,TInt aSize);
sl@0
  4458
	inline void AllocL(const T& anObject);
sl@0
  4459
	inline void AllocL(const T& anObject,TInt aSize);
sl@0
  4460
	};
sl@0
  4461
sl@0
  4462
sl@0
  4463
sl@0
  4464
sl@0
  4465
/**
sl@0
  4466
@publishedAll
sl@0
  4467
@released
sl@0
  4468
sl@0
  4469
A handle to a change notifier. 
sl@0
  4470
sl@0
  4471
The change notifier itself is a kernel object.
sl@0
  4472
*/
sl@0
  4473
class RChangeNotifier : public RHandleBase
sl@0
  4474
	{
sl@0
  4475
public:
sl@0
  4476
	IMPORT_C TInt Create();
sl@0
  4477
	IMPORT_C TInt Logon(TRequestStatus& aStatus) const;
sl@0
  4478
	IMPORT_C TInt LogonCancel() const;
sl@0
  4479
	};
sl@0
  4480
sl@0
  4481
sl@0
  4482
sl@0
  4483
sl@0
  4484
/**
sl@0
  4485
@publishedAll
sl@0
  4486
@released
sl@0
  4487
sl@0
  4488
Handle to a thread death notifier. 
sl@0
  4489
sl@0
  4490
The notifier allows threads to be notified of the death of another thread. 
sl@0
  4491
sl@0
  4492
The thread-death notifier itself is a kernel object.
sl@0
  4493
*/
sl@0
  4494
class RUndertaker : public RHandleBase
sl@0
  4495
	{
sl@0
  4496
public:
sl@0
  4497
	IMPORT_C TInt Create();
sl@0
  4498
	IMPORT_C TInt Logon(TRequestStatus& aStatus,TInt& aThreadHandle) const;
sl@0
  4499
	IMPORT_C TInt LogonCancel() const;
sl@0
  4500
	};
sl@0
  4501
sl@0
  4502
sl@0
  4503
sl@0
  4504
sl@0
  4505
sl@0
  4506
class HBufC16;
sl@0
  4507
/**
sl@0
  4508
@publishedAll
sl@0
  4509
@released
sl@0
  4510
sl@0
  4511
A handle to a session with the extended notifier server that provides support
sl@0
  4512
for plug-in notifiers.
sl@0
  4513
sl@0
  4514
The interface allows engines or other low level components
sl@0
  4515
to communicate with the UI.
sl@0
  4516
*/
sl@0
  4517
class RNotifier : public RSessionBase
sl@0
  4518
	{
sl@0
  4519
public:
sl@0
  4520
	IMPORT_C RNotifier();
sl@0
  4521
	IMPORT_C TInt Connect();
sl@0
  4522
	IMPORT_C void Close();
sl@0
  4523
	IMPORT_C TInt StartNotifier(TUid aNotifierUid,const TDesC8& aBuffer);
sl@0
  4524
	IMPORT_C TInt StartNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4525
	IMPORT_C TInt StartNotifier(TUid aNotifierDllUid,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4526
	IMPORT_C TInt CancelNotifier(TUid aNotifierUid);
sl@0
  4527
	IMPORT_C TInt UpdateNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4528
	IMPORT_C void UpdateNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4529
	IMPORT_C void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4530
	IMPORT_C void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierDllUid,TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
sl@0
  4531
	IMPORT_C TInt UnloadNotifiers(TUid aNotifierUid);
sl@0
  4532
	IMPORT_C TInt LoadNotifiers(TUid aNotifierUid);
sl@0
  4533
	IMPORT_C void Notify(const TDesC& aLine1,const TDesC& aLine2,const TDesC& aBut1,const TDesC& aBut2,TInt& aButtonVal,TRequestStatus& aStatus);
sl@0
  4534
	IMPORT_C void NotifyCancel();
sl@0
  4535
	IMPORT_C TInt InfoPrint(const TDesC& aDes);
sl@0
  4536
private:
sl@0
  4537
	TPtr8 iButtonVal;
sl@0
  4538
	HBufC16* iCombinedBuffer;
sl@0
  4539
	};
sl@0
  4540
sl@0
  4541
/**
sl@0
  4542
@publishedAll
sl@0
  4543
@released
sl@0
  4544
sl@0
  4545
Abstract class that defines a handler to work with the TRAP mechanism.
sl@0
  4546
sl@0
  4547
Symbian OS provides a trap handler and this class does not normally need to be
sl@0
  4548
used or accessed directly by applications and third party code.
sl@0
  4549
*/
sl@0
  4550
class TTrapHandler
sl@0
  4551
	{
sl@0
  4552
public:
sl@0
  4553
	IMPORT_C TTrapHandler();
sl@0
  4554
	
sl@0
  4555
	/**
sl@0
  4556
	Called when a TRAP is invoked.
sl@0
  4557
	*/
sl@0
  4558
	IMPORT_C virtual void Trap()=0;
sl@0
  4559
	
sl@0
  4560
	/**
sl@0
  4561
	Called when a function exits a TRAP without leaving.
sl@0
  4562
    */
sl@0
  4563
	IMPORT_C virtual void UnTrap()=0;
sl@0
  4564
	
sl@0
  4565
	/**
sl@0
  4566
	Called when a function within a TRAP leaves.
sl@0
  4567
sl@0
  4568
    @param aValue The leave value.
sl@0
  4569
	*/
sl@0
  4570
	IMPORT_C virtual void Leave(TInt aValue)=0;
sl@0
  4571
	};
sl@0
  4572
sl@0
  4573
sl@0
  4574
sl@0
  4575
sl@0
  4576
struct TCollationMethod; // forward declaration
sl@0
  4577
sl@0
  4578
sl@0
  4579
sl@0
  4580
sl@0
  4581
/**
sl@0
  4582
@publishedAll
sl@0
  4583
@released
sl@0
  4584
sl@0
  4585
Contains a set of static functions which perform manipulation of
sl@0
  4586
data in memory.
sl@0
  4587
sl@0
  4588
The arguments passed to the functions of this class are pointers to memory 
sl@0
  4589
locations and length values. These functions are, therefore, not normally 
sl@0
  4590
used in open code but are suitable for implementing data manipulation for 
sl@0
  4591
other classes. Typically the interface provided by such classes is typesafe 
sl@0
  4592
and hides this direct memory to memory manipulation.
sl@0
  4593
*/
sl@0
  4594
class Mem
sl@0
  4595
	{
sl@0
  4596
public:
sl@0
  4597
	inline static TUint8* Copy(TAny* aTrg, const TAny* aSrc, TInt aLength);
sl@0
  4598
	inline static TUint8* Move(TAny* aTrg, const TAny* aSrc, TInt aLength);
sl@0
  4599
	inline static void Fill(TAny* aTrg, TInt aLength, TChar aChar);
sl@0
  4600
	inline static void FillZ(TAny* aTrg, TInt aLength);
sl@0
  4601
#ifndef __GCC32__
sl@0
  4602
	inline static TInt Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
sl@0
  4603
#else
sl@0
  4604
	IMPORT_C static TInt Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
sl@0
  4605
#endif
sl@0
  4606
sl@0
  4607
	IMPORT_C static TInt Compare(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
sl@0
  4608
	IMPORT_C static TInt CompareF(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
sl@0
  4609
	IMPORT_C static TInt CompareF(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
sl@0
  4610
	IMPORT_C static TInt CompareC(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL);
sl@0
  4611
	IMPORT_C static TInt CompareC(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL);
sl@0
  4612
	IMPORT_C static TInt CompareC(const TUint16* aLeft, TInt aLeftL, const TUint16* aRight, TInt aRightL,
sl@0
  4613
								  TInt aMaxLevel, const TCollationMethod* aCollationMethod);
sl@0
  4614
	IMPORT_C static TInt CollationMethods();
sl@0
  4615
	IMPORT_C static TUint CollationMethodId(TInt aIndex);
sl@0
  4616
	IMPORT_C static const TCollationMethod* CollationMethodByIndex(TInt aIndex);
sl@0
  4617
	IMPORT_C static const TCollationMethod* CollationMethodById(TUint aId);
sl@0
  4618
	IMPORT_C static const TCollationMethod* GetDefaultMatchingTable();
sl@0
  4619
	IMPORT_C static void Swap(TAny* aPtr1, TAny* aPtr2, TInt aLength);
sl@0
  4620
	IMPORT_C static void Crc(TUint16& aCrc, const TAny* aPtr, TInt aLength);
sl@0
  4621
	IMPORT_C static void Crc32(TUint32& aCrc, const TAny* aPtr, TInt aLength);
sl@0
  4622
	};
sl@0
  4623
sl@0
  4624
sl@0
  4625
sl@0
  4626
sl@0
  4627
sl@0
  4628
/**
sl@0
  4629
@publishedAll
sl@0
  4630
@released
sl@0
  4631
sl@0
  4632
Set of static user functions.
sl@0
  4633
sl@0
  4634
These functions are related to a number of System component APIs.
sl@0
  4635
sl@0
  4636
The majority of the functions are related to either the current thread, or 
sl@0
  4637
its heap. Examples in this category include User::Exit(), which causes the 
sl@0
  4638
thread to terminate, and User::Alloc(), which allocates memory from the current 
sl@0
  4639
thread's heap.
sl@0
  4640
sl@0
  4641
Some of these functions are equivalent to functions in the RThread or RHeap 
sl@0
  4642
classes. In these cases, the User function is a convenient way to access the 
sl@0
  4643
function without first having to get a handle to the current thread.
sl@0
  4644
sl@0
  4645
Functions are also provided to support debugging of memory leaks. These function 
sl@0
  4646
calls can be written explicitly or can be generated using a corresponding 
sl@0
  4647
macro - the advantage of using a macro is that the function call is only 
sl@0
  4648
generated for debug builds.
sl@0
  4649
sl@0
  4650
A final category of functions, which includes User::BinarySearch() and User::QuickSort(), 
sl@0
  4651
are just useful functions which have no other natural home.
sl@0
  4652
sl@0
  4653
@see RThread
sl@0
  4654
@see RHeap
sl@0
  4655
*/
sl@0
  4656
class User : public UserHeap
sl@0
  4657
    {
sl@0
  4658
public:
sl@0
  4659
    // Execution control
sl@0
  4660
	IMPORT_C static void InitProcess();			/**< @internalComponent */
sl@0
  4661
    IMPORT_C static void Exit(TInt aReason);
sl@0
  4662
    IMPORT_C static void Panic(const TDesC& aCategory,TInt aReason);
sl@0
  4663
    IMPORT_C static void HandleException(TAny* aInfo);	/**< @internalComponent */
sl@0
  4664
    // Cleanup support
sl@0
  4665
    IMPORT_C static void Leave(TInt aReason);
sl@0
  4666
    IMPORT_C static void LeaveNoMemory();
sl@0
  4667
    IMPORT_C static TInt LeaveIfError(TInt aReason);
sl@0
  4668
    IMPORT_C static TAny* LeaveIfNull(TAny* aPtr);
sl@0
  4669
    inline static const TAny* LeaveIfNull(const TAny* aPtr);
sl@0
  4670
    IMPORT_C static TTrapHandler* SetTrapHandler(TTrapHandler* aHandler);
sl@0
  4671
    IMPORT_C static TTrapHandler* TrapHandler();
sl@0
  4672
    IMPORT_C static TTrapHandler* MarkCleanupStack();   /**< @internalComponent */
sl@0
  4673
    IMPORT_C static void UnMarkCleanupStack(TTrapHandler* aHandler);   /**< @internalComponent */
sl@0
  4674
	IMPORT_C static void LeaveEnd();	/**< @internalComponent */
sl@0
  4675
    // Infoprint
sl@0
  4676
    IMPORT_C static TInt InfoPrint(const TDesC& aDes);
sl@0
  4677
    // Asynchronous service support
sl@0
  4678
    IMPORT_C static void RequestComplete(TRequestStatus*& aStatus,TInt aReason);
sl@0
  4679
    IMPORT_C static void WaitForAnyRequest();
sl@0
  4680
    IMPORT_C static void WaitForRequest(TRequestStatus& aStatus); 
sl@0
  4681
    IMPORT_C static void WaitForRequest(TRequestStatus& aStatus1,TRequestStatus& aStatus2);
sl@0
  4682
    IMPORT_C static void WaitForNRequest(TRequestStatus *aStatusArray[], TInt aNum);
sl@0
  4683
    // User heap management
sl@0
  4684
    IMPORT_C static TInt AllocLen(const TAny* aCell); 
sl@0
  4685
    IMPORT_C static TAny* Alloc(TInt aSize);
sl@0
  4686
    IMPORT_C static TAny* AllocL(TInt aSize); 
sl@0
  4687
    IMPORT_C static TAny* AllocLC(TInt aSize);
sl@0
  4688
    IMPORT_C static TAny* AllocZ(TInt aSize);
sl@0
  4689
    IMPORT_C static TAny* AllocZL(TInt aSize); 
sl@0
  4690
    IMPORT_C static TInt AllocSize(TInt& aTotalAllocSize); 
sl@0
  4691
    IMPORT_C static TInt Available(TInt& aBiggestBlock); 
sl@0
  4692
    IMPORT_C static TInt CountAllocCells();
sl@0
  4693
    IMPORT_C static TInt CountAllocCells(TInt& aFreeCount); 
sl@0
  4694
    IMPORT_C static void Free(TAny* aCell);
sl@0
  4695
    IMPORT_C static void FreeZ(TAny*& aCell); 
sl@0
  4696
    IMPORT_C static RAllocator& Allocator();
sl@0
  4697
    inline static RHeap& Heap();
sl@0
  4698
    IMPORT_C static TAny* ReAlloc(TAny* aCell, TInt aSize, TInt aMode=0);
sl@0
  4699
    IMPORT_C static TAny* ReAllocL(TAny* aCell, TInt aSize, TInt aMode=0);
sl@0
  4700
    IMPORT_C static RAllocator* SwitchAllocator(RAllocator* aAllocator);
sl@0
  4701
	inline static RHeap* SwitchHeap(RAllocator* aHeap);
sl@0
  4702
	IMPORT_C static TInt CompressAllHeaps();
sl@0
  4703
    // Synchronous timer services
sl@0
  4704
    IMPORT_C static void After(TTimeIntervalMicroSeconds32 aInterval);
sl@0
  4705
    IMPORT_C static TInt At(const TTime& aTime);
sl@0
  4706
    IMPORT_C static void AfterHighRes(TTimeIntervalMicroSeconds32 aInterval);
sl@0
  4707
    // Set time and deal with timezones
sl@0
  4708
    IMPORT_C static TInt SetHomeTime(const TTime& aTime);
sl@0
  4709
    IMPORT_C static TInt SetHomeTimeSecure(const TTime& aTime);
sl@0
  4710
	IMPORT_C static TInt SetUTCTime(const TTime& aUTCTime);
sl@0
  4711
	IMPORT_C static TInt SetUTCTimeSecure(const TTime& aUTCTime);
sl@0
  4712
	IMPORT_C static TTimeIntervalSeconds UTCOffset();
sl@0
  4713
	IMPORT_C static void SetUTCOffset(TTimeIntervalSeconds aOffset);
sl@0
  4714
	IMPORT_C static TInt SetUTCTimeAndOffset(const TTime& aUTCTime, TTimeIntervalSeconds aOffset);
sl@0
  4715
    // Set locale information
sl@0
  4716
    IMPORT_C static TInt SetCurrencySymbol(const TDesC& aSymbol);
sl@0
  4717
	// Set floating point mode
sl@0
  4718
	IMPORT_C static TInt SetFloatingPointMode(TFloatingPointMode aMode, TFloatingPointRoundingMode aRoundingMode=EFpRoundToNearest);
sl@0
  4719
	// Timers
sl@0
  4720
	IMPORT_C static TUint TickCount();
sl@0
  4721
	IMPORT_C static TUint32 NTickCount();
sl@0
  4722
	IMPORT_C static TTimerLockSpec LockPeriod();
sl@0
  4723
	IMPORT_C static TTimeIntervalSeconds InactivityTime();
sl@0
  4724
	IMPORT_C static void ResetInactivityTime();
sl@0
  4725
	IMPORT_C static TUint32 FastCounter();
sl@0
  4726
	// Atomic operations
sl@0
  4727
	IMPORT_C static TInt LockedInc(TInt& aValue);
sl@0
  4728
	IMPORT_C static TInt LockedDec(TInt& aValue);
sl@0
  4729
	IMPORT_C static TInt SafeInc(TInt& aValue);
sl@0
  4730
	IMPORT_C static TInt SafeDec(TInt& aValue);
sl@0
  4731
    // Beep
sl@0
  4732
    IMPORT_C static TInt Beep(TInt aFrequency,TTimeIntervalMicroSeconds32 aDuration); 
sl@0
  4733
    // Information
sl@0
  4734
    IMPORT_C static TInt IsRomAddress(TBool& aBool,TAny* aPtr);
sl@0
  4735
    // Algorithms
sl@0
  4736
    IMPORT_C static TInt BinarySearch(TInt aCount,const TKey& aKey,TInt& aPos);
sl@0
  4737
    IMPORT_C static TInt QuickSort(TInt aCount,const TKey& aKey,const TSwap& aSwap);
sl@0
  4738
    // Language-dependent character functions 
sl@0
  4739
    IMPORT_C static TLanguage Language();
sl@0
  4740
    IMPORT_C static TRegionCode RegionCode();
sl@0
  4741
    IMPORT_C static TUint Collate(TUint aChar); 
sl@0
  4742
    IMPORT_C static TUint Fold(TUint aChar); 
sl@0
  4743
    IMPORT_C static TUint LowerCase(TUint aChar); 
sl@0
  4744
    IMPORT_C static TUint UpperCase(TUint aChar); 
sl@0
  4745
	IMPORT_C static TUint Fold(TUint aChar,TInt aFlags);
sl@0
  4746
	IMPORT_C static TUint TitleCase(TUint aChar);
sl@0
  4747
    // C-style string length
sl@0
  4748
    IMPORT_C static TInt StringLength(const TUint8* aString); 
sl@0
  4749
    IMPORT_C static TInt StringLength(const TUint16* aString);
sl@0
  4750
    // Device management
sl@0
  4751
    IMPORT_C static TInt FreeLogicalDevice(const TDesC& aDeviceName); 
sl@0
  4752
	IMPORT_C static TInt FreePhysicalDevice(const TDesC& aDriverName); 
sl@0
  4753
    IMPORT_C static TInt LoadLogicalDevice(const TDesC& aFileName); 
sl@0
  4754
    IMPORT_C static TInt LoadPhysicalDevice(const TDesC& aFileName); 
sl@0
  4755
    // Version information
sl@0
  4756
    IMPORT_C static TBool QueryVersionSupported(const TVersion& aCurrent,const TVersion& aRequested);
sl@0
  4757
    IMPORT_C static TVersion Version();
sl@0
  4758
    // Machine configuration
sl@0
  4759
    IMPORT_C static TInt SetMachineConfiguration(const TDesC8& aConfig);
sl@0
  4760
    IMPORT_C static TInt MachineConfiguration(TDes8& aConfig,TInt& aSize);
sl@0
  4761
    // Debugging support
sl@0
  4762
    IMPORT_C static void SetDebugMask(TUint32 aVal);
sl@0
  4763
    IMPORT_C static void SetDebugMask(TUint32 aVal, TUint aIndex);
sl@0
  4764
    IMPORT_C static void SetJustInTime(const TBool aBoolean); 
sl@0
  4765
    IMPORT_C static void Check();
sl@0
  4766
    IMPORT_C static void Invariant();
sl@0
  4767
    IMPORT_C static TBool JustInTime();
sl@0
  4768
    IMPORT_C static void __DbgMarkStart(TBool aKernel);
sl@0
  4769
    IMPORT_C static void __DbgMarkCheck(TBool aKernel, TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum);
sl@0
  4770
    IMPORT_C static TUint32 __DbgMarkEnd(TBool aKernel, TInt aCount);
sl@0
  4771
    IMPORT_C static void __DbgSetAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TInt aRate);
sl@0
  4772
    IMPORT_C static void __DbgSetBurstAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TUint aRate, TUint aBurst);
sl@0
  4773
	IMPORT_C static TUint __DbgCheckFailure(TBool aKernel);
sl@0
  4774
	IMPORT_C static void PanicUnexpectedLeave(); /**< @internalComponent */
sl@0
  4775
    // Name Validation
sl@0
  4776
    IMPORT_C static TInt ValidateName(const TDesC& aName);
sl@0
  4777
	// Instruction Memory Barrier
sl@0
  4778
	IMPORT_C static void IMB_Range(TAny* aStart, TAny* aEnd);
sl@0
  4779
	//
sl@0
  4780
	IMPORT_C static TInt CommandLineLength();
sl@0
  4781
	IMPORT_C static void CommandLine(TDes &aCommand);
sl@0
  4782
	IMPORT_C static TExceptionHandler ExceptionHandler();
sl@0
  4783
	IMPORT_C static TInt SetExceptionHandler(TExceptionHandler aHandler,TUint32 aMask);
sl@0
  4784
	IMPORT_C static void ModifyExceptionMask(TUint32 aClearMask, TUint32 aSetMask);
sl@0
  4785
	IMPORT_C static TInt RaiseException(TExcType aType);
sl@0
  4786
	IMPORT_C static TBool IsExceptionHandled(TExcType aType);
sl@0
  4787
sl@0
  4788
	/**
sl@0
  4789
	A set of values that defines the effect that terminating a thread 
sl@0
  4790
	has, either on its owning process or on the whole system.
sl@0
  4791
	
sl@0
  4792
	A thread is said to be critical if its owning process or the entire system
sl@0
  4793
	terminates when the thread itself terminates. 
sl@0
  4794
	
sl@0
  4795
	You pass one of these values to the functions:
sl@0
  4796
	- User::SetCritical()
sl@0
  4797
	- User::SetProcessCritical()
sl@0
  4798
	
sl@0
  4799
	The meaning of a value when passed to one function is different to
sl@0
  4800
	its meaning when passed the other function. See the description of each
sl@0
  4801
	individual value.
sl@0
  4802
			
sl@0
  4803
	@see User::SetCritical()
sl@0
  4804
	@see User::SetProcessCritical()
sl@0
  4805
	*/
sl@0
  4806
	enum TCritical {
sl@0
  4807
	
sl@0
  4808
	
sl@0
  4809
	               /**
sl@0
  4810
                   This value can be passed to both:
sl@0
  4811
                   - User::SetCritical(), which means that the current thread
sl@0
  4812
                   is no longer critical, i.e. termination of the current
sl@0
  4813
                   thread will no longer cause termination of the current thread's
sl@0
  4814
                   owning process (i.e. the current process) or a reboot of the system.
sl@0
  4815
                   - User::SetProcessCritical(), which means that threads
sl@0
  4816
                   subsequently created in the current thread's owning
sl@0
  4817
                   process (i.e. the current process) will no longer cause termination of that
sl@0
  4818
                   process or a reboot of the system. Note, however, that existing
sl@0
  4819
                   threads are NOT affected when you call this function.
sl@0
  4820
                   
sl@0
  4821
                   @see User::SetCritical()
sl@0
  4822
                   @see User::SetProcessCritical()
sl@0
  4823
                   */
sl@0
  4824
                   ENotCritical, 
sl@0
  4825
                   
sl@0
  4826
                                      
sl@0
  4827
                   /**
sl@0
  4828
                   This value can only be passed to User::SetCritical() and
sl@0
  4829
                   affects the current thread only.
sl@0
  4830
                   
sl@0
  4831
                   It means that the owning process (i.e.the current process)
sl@0
  4832
                   terminates if:
sl@0
  4833
                   - the current thread is terminated.
sl@0
  4834
                   - the current thread panics.
sl@0
  4835
                   
sl@0
  4836
                   @see User::SetCritical()
sl@0
  4837
                   */	
sl@0
  4838
	               EProcessCritical,
sl@0
  4839
sl@0
  4840
	               
sl@0
  4841
	               /**
sl@0
  4842
                   This value can only be passed to User::SetCritical() and
sl@0
  4843
                   affects the current thread only.
sl@0
  4844
                   
sl@0
  4845
                   It means that the owning process (i.e.the current process)
sl@0
  4846
                   terminates if the current thread terminates for any reason.
sl@0
  4847
                   
sl@0
  4848
                   @see User::SetCritical()
sl@0
  4849
                   */
sl@0
  4850
	               EProcessPermanent,
sl@0
  4851
	               
sl@0
  4852
	               
sl@0
  4853
	               /**
sl@0
  4854
	               This value can only be passed to User::SetProcessCritical() and
sl@0
  4855
                   affects any new threads created in the current process.
sl@0
  4856
	               
sl@0
  4857
	               It means that the current process terminates if:
sl@0
  4858
	               - any new thread subsequently created in the current process is terminated.
sl@0
  4859
	               - any new thread subsequently created in the current process panics.
sl@0
  4860
	               .
sl@0
  4861
	               Note, however, that existing threads in the current process
sl@0
  4862
	               are NOT affected when you call User::SetProcessCritical()
sl@0
  4863
	               with this value.
sl@0
  4864
	               	               
sl@0
  4865
	               @see EProcessCritical
sl@0
  4866
                   @see User::SetProcessCritical()
sl@0
  4867
	               */
sl@0
  4868
	               EAllThreadsCritical,
sl@0
  4869
	                	                
sl@0
  4870
	                
sl@0
  4871
	               /**
sl@0
  4872
	               This value can be passed to both: User::SetCritical() and
sl@0
  4873
	               User::SetProcessCritical().
sl@0
  4874
                   
sl@0
  4875
                   When passed to User::SetCritical(), it means that
sl@0
  4876
                   the entire system is rebooted if:
sl@0
  4877
                   - the current thread is terminated.
sl@0
  4878
                   - the current thread panics.
sl@0
  4879
                   
sl@0
  4880
                   When passed to User::SetProcessCritical(), it means that
sl@0
  4881
                   the entire system is rebooted if:
sl@0
  4882
                   - any new thread subsequently created in the current process is terminated.
sl@0
  4883
                   - any new thread subsequently created in the current process panics.
sl@0
  4884
                   - the process itself is terminated
sl@0
  4885
                   - the process itself panics
sl@0
  4886
	               
sl@0
  4887
	               Note:
sl@0
  4888
                   -# existing threads in the current process are NOT affected when you
sl@0
  4889
                   call User::SetProcessCritical() with this value.
sl@0
  4890
                   -# Only a process with 'Protected Server' capability can set a
sl@0
  4891
                   thread to system-critical.
sl@0
  4892
                   
sl@0
  4893
                   @see User::SetCritical()
sl@0
  4894
                   @see User::SetProcessCritical()
sl@0
  4895
	               */
sl@0
  4896
	               ESystemCritical,
sl@0
  4897
	               
sl@0
  4898
	               
sl@0
  4899
	               /**
sl@0
  4900
	               This value can be passed to both: User::SetCritical()
sl@0
  4901
	               and User::SetProcessCritical().
sl@0
  4902
                   
sl@0
  4903
                   When passed to User::SetCritical(), it means that
sl@0
  4904
                   the entire system is rebooted if the current thread
sl@0
  4905
                   exits for any reason.
sl@0
  4906
                   
sl@0
  4907
                   When passed to User::SetProcessCritical(), it means that
sl@0
  4908
                   the entire system is rebooted if any new thread 
sl@0
  4909
                   subsequently created in the current process exits
sl@0
  4910
                   for any reason, or if the process itself exits for any reason.
sl@0
  4911
	               
sl@0
  4912
	               Note:
sl@0
  4913
                   -# existing threads in the current process are NOT affected when you
sl@0
  4914
                   call User::SetProcessCritical() with this value.
sl@0
  4915
                   -# Only a process with 'Protected Server' capability can set a
sl@0
  4916
                   thread to system-permanent.
sl@0
  4917
                   
sl@0
  4918
                   @see User::SetCritical()
sl@0
  4919
                   @see User::SetProcessCritical()
sl@0
  4920
	               */
sl@0
  4921
	               ESystemPermanent
sl@0
  4922
	               };
sl@0
  4923
	IMPORT_C static TCritical Critical();
sl@0
  4924
	IMPORT_C static TCritical Critical(RThread aThread);
sl@0
  4925
	IMPORT_C static TInt SetCritical(TCritical aCritical);
sl@0
  4926
	IMPORT_C static TCritical ProcessCritical();
sl@0
  4927
	IMPORT_C static TCritical ProcessCritical(RProcess aProcess);
sl@0
  4928
	IMPORT_C static TInt SetProcessCritical(TCritical aCritical);
sl@0
  4929
	IMPORT_C static TBool PriorityControl();
sl@0
  4930
	IMPORT_C static void SetPriorityControl(TBool aEnable);
sl@0
  4931
sl@0
  4932
	/**
sl@0
  4933
	A threads realtime state.
sl@0
  4934
	Some non-realtime behaviour can be detected by the kernel. When it does so,
sl@0
  4935
	action is taken depending on the thread state:
sl@0
  4936
	-	ERealtimeStateOff - no action.
sl@0
  4937
	-	ERealtimeStateOn - the the thread will be panicked with KERN-EXEC 61 (EIllegalFunctionForRealtimeThread).
sl@0
  4938
	-	ERealtimeStateWarn - no action. However, if the kernel trace flag KREALTIME is enabled
sl@0
  4939
							 then tracing will be emitted as if the thread state was ERealtimeStateOn.
sl@0
  4940
	@publishedPartner
sl@0
  4941
	@released
sl@0
  4942
	*/
sl@0
  4943
	enum TRealtimeState
sl@0
  4944
		{
sl@0
  4945
		ERealtimeStateOff,	/**< Thread is not realtime */
sl@0
  4946
		ERealtimeStateOn,	/**< Thread is realtime */
sl@0
  4947
		ERealtimeStateWarn	/**< Thread is realtime but doesn't want this enforced */
sl@0
  4948
		};
sl@0
  4949
sl@0
  4950
	/**
sl@0
  4951
	Set the current threads realtime state.
sl@0
  4952
	@see TRealtimeState
sl@0
  4953
	@param aState The state
sl@0
  4954
	@return KErrNone if successful. KErrArgument if aState is invalid.
sl@0
  4955
	@publishedPartner
sl@0
  4956
	@released
sl@0
  4957
	*/
sl@0
  4958
	IMPORT_C static TInt SetRealtimeState(TRealtimeState aState);
sl@0
  4959
sl@0
  4960
	/**
sl@0
  4961
	Return the Secure ID of the process that created the current process.
sl@0
  4962
	@return The Secure ID.
sl@0
  4963
	@publishedAll
sl@0
  4964
	@released
sl@0
  4965
	*/
sl@0
  4966
	IMPORT_C static TSecureId CreatorSecureId();
sl@0
  4967
sl@0
  4968
	/**
sl@0
  4969
	Return the Vendor ID of the process that created the current process.
sl@0
  4970
	@return The Vendor ID.
sl@0
  4971
	@publishedAll
sl@0
  4972
	@released
sl@0
  4973
	*/
sl@0
  4974
	IMPORT_C static TVendorId CreatorVendorId();
sl@0
  4975
sl@0
  4976
	/**
sl@0
  4977
	Check if the process that created the current process has a given capability
sl@0
  4978
sl@0
  4979
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  4980
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  4981
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  4982
	check failed.
sl@0
  4983
sl@0
  4984
	@param aCapability The capability to test.
sl@0
  4985
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  4986
								that may be issued if the test finds the capability is not present.
sl@0
  4987
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  4988
								which enables it to be easily removed from the system.
sl@0
  4989
	@return ETrue if the creator process has the capability, EFalse otherwise.
sl@0
  4990
	@publishedAll
sl@0
  4991
	@released
sl@0
  4992
	*/
sl@0
  4993
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4994
	inline static TBool CreatorHasCapability(TCapability aCapability, const char* aDiagnostic=0);
sl@0
  4995
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  4996
	// Only available to NULL arguments
sl@0
  4997
	inline static TBool CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic=NULL);
sl@0
  4998
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  4999
	// For things using KSuppressPlatSecDiagnostic
sl@0
  5000
	inline static TBool CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress);
sl@0
  5001
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  5002
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  5003
sl@0
  5004
	/**
sl@0
  5005
	Check if the process that created the current process has both of the given capabilities
sl@0
  5006
sl@0
  5007
	When a check fails the action taken is determined by the system wide Platform Security
sl@0
  5008
	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
sl@0
  5009
	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
sl@0
  5010
	check failed.
sl@0
  5011
sl@0
  5012
	@param aCapability1 The first capability to test.
sl@0
  5013
	@param aCapability2 The second capability to test.
sl@0
  5014
	@param aDiagnostic A string that will be emitted along with any diagnostic message
sl@0
  5015
								that may be issued if the test finds a capability is not present.
sl@0
  5016
								This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
sl@0
  5017
								which enables it to be easily removed from the system.
sl@0
  5018
	@return ETrue if the creator process has both the capabilities, EFalse otherwise.
sl@0
  5019
	@publishedAll
sl@0
  5020
	@released
sl@0
  5021
	*/
sl@0
  5022
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  5023
	inline static TBool CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic=0);
sl@0
  5024
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  5025
	// Only available to NULL arguments
sl@0
  5026
	inline static TBool CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull aDiagnostic=NULL);
sl@0
  5027
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  5028
	// For things using KSuppressPlatSecDiagnostic
sl@0
  5029
	inline static TBool CreatorHasCapability(TCapability aCapability, TCapability aCapability2, OnlyCreateWithNull aDiagnostic, OnlyCreateWithNull aSuppress);
sl@0
  5030
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
sl@0
  5031
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
sl@0
  5032
sl@0
  5033
	IMPORT_C static TInt ParameterLength(TInt aSlot);
sl@0
  5034
	IMPORT_C static TInt GetTIntParameter(TInt aSlot, TInt& aData);
sl@0
  5035
	IMPORT_C static TInt GetDesParameter(TInt aSlot, TDes8& aDes);
sl@0
  5036
	IMPORT_C static TInt GetDesParameter(TInt aSlot, TDes16& aDes);
sl@0
  5037
	IMPORT_C static TInt RenameThread(const TDesC &aName);
sl@0
  5038
	IMPORT_C static TInt RenameProcess(const TDesC &aName);
sl@0
  5039
	/*
sl@0
  5040
	User::Identity() has been deprecated and is available for backward
sl@0
  5041
	compatibility purposes only.
sl@0
  5042
sl@0
  5043
	Use RProcess().SecureId() instead.
sl@0
  5044
    
sl@0
  5045
	@deprecated
sl@0
  5046
	*/
sl@0
  5047
	inline static TUid Identity() { return RProcess().SecureId(); }
sl@0
  5048
sl@0
  5049
	/*
sl@0
  5050
	User::CreatorIdentity() has been deprecated and is available for backward
sl@0
  5051
	compatibility purposes only.
sl@0
  5052
sl@0
  5053
	Use CreatorSecureId() instead.
sl@0
  5054
	
sl@0
  5055
	@deprecated
sl@0
  5056
	*/
sl@0
  5057
	static inline TUid CreatorIdentity() { return CreatorSecureId(); }
sl@0
  5058
sl@0
  5059
	IMPORT_C static void NotifyOnIdle(TRequestStatus& aStatus);			/**< @internalTechnology */
sl@0
  5060
	IMPORT_C static void CancelMiscNotifier(TRequestStatus& aStatus);	/**< @internalTechnology */
sl@0
  5061
private:
sl@0
  5062
	// Implementations of functions with diagnostics
sl@0
  5063
	IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability, const char* aDiagnostic);
sl@0
  5064
	IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability);
sl@0
  5065
	IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic);
sl@0
  5066
	IMPORT_C static TBool DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2);
sl@0
  5067
	};
sl@0
  5068
sl@0
  5069
sl@0
  5070
sl@0
  5071
sl@0
  5072
class ExecHandler;
sl@0
  5073
sl@0
  5074
/**
sl@0
  5075
@internalComponent
sl@0
  5076
@removed
sl@0
  5077
*/
sl@0
  5078
typedef void (*TTlsCleanupHandler)(TAny*);		//don't use
sl@0
  5079
sl@0
  5080
/**
sl@0
  5081
@publishedAll
sl@0
  5082
@released
sl@0
  5083
sl@0
  5084
A collection of static functions involved in managing access to
sl@0
  5085
thread-local storage. 
sl@0
  5086
sl@0
  5087
Thread-local storage is a single machine word of static writable memory.
sl@0
  5088
The scope of this machine word is the thread, which means that there is one
sl@0
  5089
word per thread. The word is only accessible to code running in a DLL.
sl@0
  5090
sl@0
  5091
In practice, this word is almost always used to hold a pointer to allocated
sl@0
  5092
memory; this makes that memory available to all DLL code running on behalf
sl@0
  5093
of the same thread.
sl@0
  5094
sl@0
  5095
Note that DLL code running on behalf of one thread does not see the same word when
sl@0
  5096
running on behalf of another thread. 
sl@0
  5097
sl@0
  5098
The class in not intended for user derivation.
sl@0
  5099
*/
sl@0
  5100
class Dll
sl@0
  5101
	{
sl@0
  5102
public:
sl@0
  5103
	static TInt SetTls(TAny* aPtr);
sl@0
  5104
	static TAny* Tls();
sl@0
  5105
	static void FreeTls();
sl@0
  5106
	static void FileName(TFileName &aFileName);
sl@0
  5107
	};
sl@0
  5108
sl@0
  5109
sl@0
  5110
sl@0
  5111
//SL:
sl@0
  5112
//#ifndef __TOOLS__
sl@0
  5113
/**
sl@0
  5114
@publishedAll
sl@0
  5115
@released
sl@0
  5116
sl@0
  5117
A thin wrapper class for C++ arrays allowing automatic checking of index values 
sl@0
  5118
to ensure that all accesses are legal. 
sl@0
  5119
sl@0
  5120
The class also supports the deletion of objects.
sl@0
  5121
sl@0
  5122
The class is templated, based on a class type and an integer value. The class 
sl@0
  5123
type defines the type of object contained in the array; the integer value 
sl@0
  5124
defines the size (dimension) of the array.
sl@0
  5125
sl@0
  5126
A wrapper object can be:
sl@0
  5127
sl@0
  5128
1. embedded in objects allocated on the heap.
sl@0
  5129
sl@0
  5130
2. used on the program stack.
sl@0
  5131
*/
sl@0
  5132
template <class T,TInt S> 
sl@0
  5133
class TFixedArray
sl@0
  5134
	{
sl@0
  5135
	typedef TFixedArray<T,S> ThisClass;
sl@0
  5136
public:
sl@0
  5137
	inline TFixedArray();
sl@0
  5138
	inline TFixedArray(const T* aList, TInt aLength);
sl@0
  5139
	//
sl@0
  5140
	inline void Copy(const T* aList, TInt aLength);
sl@0
  5141
	inline void Reset();		// zero fill
sl@0
  5142
	inline void DeleteAll();
sl@0
  5143
	//
sl@0
  5144
	inline TInt Count() const;
sl@0
  5145
	inline TInt Length() const;
sl@0
  5146
	// Accessors - debug range checking
sl@0
  5147
	inline T& operator[](TInt aIndex);
sl@0
  5148
	inline const T& operator[] (TInt aIndex) const;
sl@0
  5149
	// Accessors - always range checking
sl@0
  5150
	inline T& At(TInt aIndex);
sl@0
  5151
	inline const T& At(TInt aIndex) const;
sl@0
  5152
	// Provides pointers to the beginning and end of the array
sl@0
  5153
	inline T* Begin();
sl@0
  5154
	inline T* End();
sl@0
  5155
	inline const T* Begin() const;
sl@0
  5156
	inline const T* End() const;
sl@0
  5157
	//
sl@0
  5158
	inline TArray<T> Array() const;
sl@0
  5159
protected:
sl@0
  5160
	inline static TBool InRange(TInt aIndex);
sl@0
  5161
	inline static TInt CountFunctionR(const CBase* aThis);
sl@0
  5162
	inline static const TAny* AtFunctionR(const CBase* aThis,TInt aIndex);
sl@0
  5163
protected:
sl@0
  5164
	T iRep[S];
sl@0
  5165
	};
sl@0
  5166
sl@0
  5167
sl@0
  5168
sl@0
  5169
sl@0
  5170
/**
sl@0
  5171
@publishedAll
sl@0
  5172
@released
sl@0
  5173
*/
sl@0
  5174
#define DECLARE_ROM_ARRAY( AName, AData, AType ) \
sl@0
  5175
   	const TFixedArray<AType,(sizeof(AData)/sizeof((AData)[0]))>& \
sl@0
  5176
            AName = *(reinterpret_cast<const TFixedArray<AType, \
sl@0
  5177
                           (sizeof(AData)/sizeof((AData)[0]))>* > (AData))
sl@0
  5178
//#endif
sl@0
  5179
sl@0
  5180
// Global leaving operator new
sl@0
  5181
/**
sl@0
  5182
@publishedAll
sl@0
  5183
@released
sl@0
  5184
*/
sl@0
  5185
inline TAny* operator new(TUint aSize, TLeave);
sl@0
  5186
/**
sl@0
  5187
@publishedAll
sl@0
  5188
@released
sl@0
  5189
*/
sl@0
  5190
inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize);
sl@0
  5191
#if !defined(__VC32__) || defined (__MSVCDOTNET__)
sl@0
  5192
/**
sl@0
  5193
@publishedAll
sl@0
  5194
@released
sl@0
  5195
*/
sl@0
  5196
inline TAny* operator new[](TUint aSize, TLeave);
sl@0
  5197
#endif
sl@0
  5198
sl@0
  5199
sl@0
  5200
#ifdef __LEAVE_EQUALS_THROW__
sl@0
  5201
/** Macro to assert in all builds that code does not leave
sl@0
  5202
sl@0
  5203
@param	_s	C++ statements to be executed which should not leave
sl@0
  5204
@panic	USER 194 if the code being checked does leave
sl@0
  5205
sl@0
  5206
@publishedAll
sl@0
  5207
@released
sl@0
  5208
*/
sl@0
  5209
#define	__ASSERT_ALWAYS_NO_LEAVE(_s)	\
sl@0
  5210
	{														\
sl@0
  5211
	try	{													\
sl@0
  5212
		TTrapHandler* ____t = User::MarkCleanupStack();		\
sl@0
  5213
		_s;													\
sl@0
  5214
		User::UnMarkCleanupStack(____t);					\
sl@0
  5215
		}													\
sl@0
  5216
	catch (XLeaveException& /*l*/)							\
sl@0
  5217
		{													\
sl@0
  5218
		User::PanicUnexpectedLeave();						\
sl@0
  5219
		}													\
sl@0
  5220
	catch (...)												\
sl@0
  5221
		{													\
sl@0
  5222
		User::Invariant();									\
sl@0
  5223
		}													\
sl@0
  5224
	}
sl@0
  5225
sl@0
  5226
#else
sl@0
  5227
/** Macro to assert in all builds that code does not leave
sl@0
  5228
sl@0
  5229
@param	_s	C++ statements to be executed which should not leave
sl@0
  5230
@panic	USER 194 if the code being checked does leave
sl@0
  5231
sl@0
  5232
@publishedAll
sl@0
  5233
@released
sl@0
  5234
*/
sl@0
  5235
#define	__ASSERT_ALWAYS_NO_LEAVE(_s)	\
sl@0
  5236
	{									\
sl@0
  5237
	TInt _r;							\
sl@0
  5238
	TTrap _t;							\
sl@0
  5239
	if (_t.Trap(_r) == 0)				\
sl@0
  5240
		{								\
sl@0
  5241
		_s;								\
sl@0
  5242
		TTrap::UnTrap();				\
sl@0
  5243
		}								\
sl@0
  5244
	else								\
sl@0
  5245
		User::PanicUnexpectedLeave();	\
sl@0
  5246
	}
sl@0
  5247
#endif
sl@0
  5248
sl@0
  5249
/** Macro to assert in debug builds that code does not leave
sl@0
  5250
sl@0
  5251
@param	_s	C++ statements to be executed which should not leave
sl@0
  5252
@panic	USER 194 if the code being checked does leave
sl@0
  5253
sl@0
  5254
@publishedAll
sl@0
  5255
@released
sl@0
  5256
*/
sl@0
  5257
#ifdef _DEBUG
sl@0
  5258
#define	__ASSERT_DEBUG_NO_LEAVE(_s)		__ASSERT_ALWAYS_NO_LEAVE(_s)
sl@0
  5259
#else
sl@0
  5260
#define	__ASSERT_DEBUG_NO_LEAVE(_s)		{ _s; }
sl@0
  5261
#endif
sl@0
  5262
sl@0
  5263
sl@0
  5264
sl@0
  5265
// Inline methods
sl@0
  5266
#include <e32std.inl>
sl@0
  5267
sl@0
  5268
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
  5269
#include <e32std_private.h>
sl@0
  5270
#endif
sl@0
  5271
sl@0
  5272
#endif
sl@0
  5273