epoc32/include/w32std.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// Standard window server header file
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __W32STD_H__
williamr@2
    19
#define __W32STD_H__
williamr@2
    20
williamr@2
    21
#ifndef __FNTSTORE_H__
williamr@2
    22
#include <fntstore.h>
williamr@2
    23
#endif
williamr@2
    24
#ifndef __BITDEV_H__
williamr@2
    25
#include <bitdev.h>
williamr@2
    26
#endif
williamr@2
    27
#ifndef __BITSTD_H__
williamr@2
    28
#include <bitstd.h>
williamr@2
    29
#endif
williamr@4
    30
#include <e32keys.h>
williamr@4
    31
#include <textcursor.h>
williamr@4
    32
#include <pointerevent.h>
williamr@4
    33
#include <advancedpointerevent.h>
williamr@4
    34
#include <sizemode.h>
williamr@4
    35
williamr@4
    36
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
    37
#include <graphics/windowserverconstants.h>
williamr@4
    38
#include <graphics/pointereventdata.h>
williamr@4
    39
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@2
    40
williamr@2
    41
_LIT(KWSERVThreadName,"Wserv");
williamr@2
    42
williamr@2
    43
class RWindowBase;
williamr@2
    44
class RWindow;
williamr@2
    45
class RWsBuffer;
williamr@2
    46
class MWsObjectProvider;
williamr@4
    47
class RWsDrawableSource;
williamr@4
    48
class TSizeMode;
williamr@2
    49
williamr@2
    50
/** Screen mode enforcement flags.
williamr@2
    51
williamr@2
    52
Screen mode enforcement ensures that windows must meet certain requirements
williamr@2
    53
if they are to be displayed. When the screen mode changes, window groups that
williamr@2
    54
are incorrectly set up, according to these requirements, are locked out. The
williamr@2
    55
windows are notified of the change, and will be displayed if they are updated
williamr@2
    56
(according to the current enforcement requirement) to match the new screen
williamr@2
    57
mode.
williamr@2
    58
williamr@2
    59
@publishedAll
williamr@2
    60
@released
williamr@2
    61
@see CWsScreenDevice::ScreenModeEnforcement()
williamr@2
    62
@see CWsScreenDevice::SetScreenModeEnforcement() */
williamr@2
    63
enum TScreenModeEnforcement
williamr@2
    64
	{
williamr@2
    65
	/** No enforcement.
williamr@2
    66
williamr@2
    67
	All windows that are the children of window groups will be displayed, irrespective
williamr@2
    68
	of the screen mode.
williamr@2
    69
williamr@2
    70
	This is not properly supported and is provided for testing purposes. */
williamr@2
    71
	ESizeEnforcementNone,
williamr@2
    72
	/** Pixels and rotation enforcement.
williamr@2
    73
williamr@2
    74
	Group windows must be set up for the correct rotation and be working in the
williamr@2
    75
	correct size in pixels to be displayed. */
williamr@2
    76
	ESizeEnforcementPixelsAndRotation,
williamr@2
    77
	/** Pixels and Twips enforcement.
williamr@2
    78
williamr@2
    79
	Group windows must have the correct rotation and be working in the correct
williamr@2
    80
	size in pixels and twips to be displayed.
williamr@2
    81
williamr@2
    82
	This setting might be used if the display pixels are not square, and would
williamr@2
    83
	distort fonts when rotated. */
williamr@2
    84
	ESizeEnforcementPixelsTwipsAndRotation,
williamr@2
    85
	};
williamr@2
    86
williamr@2
    87
struct TPixelsAndRotation
williamr@2
    88
/** Pixels and rotation struct.
williamr@2
    89
williamr@2
    90
This is used to define a particular screen mode's screen size in pixels,
williamr@2
    91
and its rotation.
williamr@2
    92
williamr@2
    93
@publishedAll
williamr@2
    94
@released
williamr@2
    95
@see CWsScreenDevice::GetScreenModeSizeAndRotation() */
williamr@2
    96
	{
williamr@2
    97
	/** The screen size, for a given screen mode, in pixels. */
williamr@2
    98
	TSize iPixelSize;
williamr@2
    99
	/** The current screen orientation. */
williamr@2
   100
	CFbsBitGc::TGraphicsOrientation iRotation;
williamr@2
   101
	};
williamr@2
   102
williamr@2
   103
struct TPixelsTwipsAndRotation
williamr@2
   104
/** Pixels, twips and rotation struct.
williamr@2
   105
williamr@2
   106
This is used to define a particular screen mode's screen size in twips
williamr@2
   107
and pixels, and its rotation.
williamr@2
   108
williamr@2
   109
@publishedAll
williamr@2
   110
@released
williamr@2
   111
@see CWsScreenDevice::GetScreenModeSizeAndRotation() */
williamr@2
   112
	{
williamr@2
   113
	/** The screen size, for a given screen mode, in pixels. */
williamr@2
   114
	TSize iPixelSize;
williamr@2
   115
	/** The screen size, for a given screen mode, in twips. */
williamr@2
   116
	TSize iTwipsSize;
williamr@2
   117
	/** The screen rotation. */
williamr@2
   118
	CFbsBitGc::TGraphicsOrientation iRotation;
williamr@2
   119
	};
williamr@2
   120
williamr@2
   121
/** Log message text length.
williamr@2
   122
williamr@2
   123
This defines the length of the log text message buffer TLogMessageText,
williamr@2
   124
which is used in RWsSession::LogMessage().
williamr@2
   125
williamr@2
   126
@publishedAll
williamr@2
   127
@released */
williamr@2
   128
enum {
williamr@2
   129
	/** The length of the log message text buffer in characters. */
williamr@2
   130
	KLogMessageLength=0x80
williamr@2
   131
	};
williamr@2
   132
williamr@2
   133
/** Log message text buffer.
williamr@2
   134
williamr@2
   135
This is used in RWsSession::LogMessage().
williamr@2
   136
williamr@2
   137
@publishedAll
williamr@2
   138
@released */
williamr@2
   139
typedef TBuf<KLogMessageLength> TLogMessageText;
williamr@2
   140
williamr@2
   141
/** Password window group priority.
williamr@2
   142
williamr@2
   143
This priority is assigned to the password window group when the window server is displaying the password window.
williamr@2
   144
This is the highest priority, which ensures that the machine password window is in front of all other windows -
williamr@2
   145
hence password tests cannot be bypassed.
williamr@2
   146
williamr@2
   147
@publishedAll
williamr@2
   148
@deprecated */
williamr@2
   149
enum
williamr@2
   150
	{
williamr@2
   151
	 /** Password window group priority. */
williamr@2
   152
	KPasswordWindowGroupPriority=1000
williamr@2
   153
	};
williamr@2
   154
williamr@2
   155
/** Switch ordinal position to owning window.
williamr@2
   156
williamr@2
   157
This enum can be specified as the 2nd parameter to RWsSession::SetWindowGroupOrdinalPosition()
williamr@2
   158
or as the 1st parameter to RWindowTreeNode::SetOrdinalPosition() (if this is being called on an
williamr@2
   159
RWindowGroup).
williamr@2
   160
williamr@2
   161
When called with this value, the functions don't change the ordinal position of the group window
williamr@2
   162
in question, but rather bring to the front the window that would come to the front if that group
williamr@2
   163
window were to die with keyboard focus.
williamr@2
   164
williamr@2
   165
@publishedAll
williamr@2
   166
@released
williamr@2
   167
@see RWsSession::SetWindowGroupOrdinalPosition()
williamr@2
   168
@see RWindowTreeNode::SetOrdinalPosition() */
williamr@2
   169
enum {
williamr@2
   170
	/** Switch ordinal position to owning window. */
williamr@2
   171
	KOrdinalPositionSwitchToOwningWindow=0x80000000
williamr@2
   172
	};
williamr@2
   173
williamr@2
   174
/** Window corner types.
williamr@2
   175
williamr@2
   176
Corners may be specified square or stepped, with varying numbers of pixels
williamr@2
   177
removed to make the stepping. Picturing a corner as the top left corner of
williamr@2
   178
a window, the numbers denote the number of pixels removed from the top row
williamr@2
   179
to give corners.
williamr@2
   180
williamr@2
   181
@publishedAll
williamr@2
   182
@released
williamr@2
   183
@see TCornerFlags
williamr@2
   184
@see RWindowBase::SetCornerType() */
williamr@2
   185
enum TCornerType
williamr@2
   186
// Bottom 16 bits available for corner type
williamr@2
   187
	{
williamr@2
   188
	/** Square corner. */
williamr@2
   189
	EWindowCornerSquare,
williamr@2
   190
	/** Corner pixel removed. */
williamr@2
   191
	EWindowCorner1,
williamr@2
   192
	/** Two pixel step.
williamr@2
   193
williamr@2
   194
	3 pixels are removed: the corner pixel and a single pixel from each side. */
williamr@2
   195
	EWindowCorner2,
williamr@2
   196
	/** Three pixel step.
williamr@2
   197
williamr@2
   198
	5 pixels are removed: the corner pixel, the two pixels next to it and the
williamr@2
   199
	2 pixels above or below it. */
williamr@2
   200
	EWindowCorner3,
williamr@2
   201
	/** Five pixel step.
williamr@2
   202
williamr@2
   203
	12 pixels are removed: the corner pixel, the four pixels next to it, the
williamr@2
   204
	four pixels above or below it, the pixel which was diagonal to the corner
williamr@2
   205
	pixel, and the pixels to both sides of that pixel. */
williamr@2
   206
	EWindowCorner5,
williamr@2
   207
	EWindowCornerRegion,		// Private
williamr@2
   208
	/** Corner type mask.
williamr@2
   209
williamr@2
   210
	This value is used by the window server, and may be used by developers, to
williamr@2
   211
	separate TCornerType and TCornerFlags values from a TInt which contains both
williamr@2
   212
	types. */
williamr@2
   213
	ECornerTypeMask=0xFFFF
williamr@2
   214
	};
williamr@2
   215
williamr@2
   216
/** Corner flags.
williamr@2
   217
williamr@2
   218
These are used by RWindowBase::SetCornerType() to set which corners of a window
williamr@2
   219
are not to have corner types applied to them.
williamr@2
   220
williamr@2
   221
@publishedAll
williamr@2
   222
@released
williamr@2
   223
@see TCornerType */
williamr@2
   224
enum TCornerFlags
williamr@2
   225
// Top 16 bits available for corner flags
williamr@2
   226
	{
williamr@2
   227
	/** Do not apply corner shape to top left corner. */
williamr@2
   228
	EWindowCornerNotTL=0x10000,
williamr@2
   229
	/** Do not apply corner shape to top right corner. */
williamr@2
   230
	EWindowCornerNotTR=0x20000,
williamr@2
   231
	/** Do not apply corner shape to bottom left corner. */
williamr@2
   232
	EWindowCornerNotBL=0x40000,
williamr@2
   233
	/** Do not apply corner shape to bottom right corner. */
williamr@2
   234
	EWindowCornerNotBR=0x80000,
williamr@2
   235
	};
williamr@2
   236
williamr@2
   237
/** Window backup type flags.
williamr@2
   238
williamr@2
   239
@publishedAll
williamr@2
   240
@released
williamr@2
   241
@see RWindowBase::EnableBackup() */
williamr@2
   242
enum TWindowBackupType
williamr@2
   243
	{
williamr@2
   244
	/** Backup the area behind the current window only.
williamr@2
   245
williamr@2
   246
	This is the default behaviour for the RWindowBase::EnableBackup() function. */
williamr@2
   247
	EWindowBackupAreaBehind=0x0001,
williamr@2
   248
	/** Backup the entire screen.
williamr@2
   249
williamr@2
   250
	This is provided for windows that require the rest
williamr@2
   251
	of the screen to fade when they are displayed. When the rest of the screen
williamr@2
   252
	should become unfaded, the window server redraws the whole screen from the
williamr@2
   253
	backed up bitmap. */
williamr@2
   254
	EWindowBackupFullScreen=0x0002,
williamr@2
   255
	};
williamr@2
   256
williamr@2
   257
/** Types of standard events.
williamr@2
   258
williamr@2
   259
These are events that the window server passes to its clients, as opposed
williamr@2
   260
to events that the base passes to the window server.
williamr@2
   261
williamr@2
   262
@publishedAll
williamr@2
   263
@released
williamr@2
   264
@see CClickMaker */
williamr@2
   265
enum TEventCode
williamr@2
   266
	{
williamr@2
   267
	/** Null event.
williamr@2
   268
williamr@2
   269
	This can be sent, but should be ignored by clients. */
williamr@2
   270
	EEventNull,
williamr@2
   271
	/** Key event.
williamr@2
   272
williamr@2
   273
	This is the event that is sent when a character has been received from the
williamr@2
   274
	keyboard.
williamr@2
   275
williamr@2
   276
	If an EEventKey event is associated with an EEventKeyDown or EEventKeyUp
williamr@2
   277
	event (typically EEventKeyDown), the EEventKey event occurs after the
williamr@2
   278
	EEventKeyDown/EEventKeyUp event.
williamr@2
   279
williamr@2
   280
	In practice, the only keys potentially likely to have their EEventKey event
williamr@2
   281
	generated on the up rather than the down are modifier keys. */
williamr@2
   282
	EEventKey,
williamr@2
   283
	/** Key up event.
williamr@2
   284
williamr@2
   285
	If an EEventKey event is associated with an EEventKeyUp event (which is
williamr@2
   286
	rarely the case), the EEventKey event occurs after the EEventKeyUp event. */
williamr@2
   287
	EEventKeyUp,
williamr@2
   288
	/** Key down event.
williamr@2
   289
williamr@2
   290
	If an EEventKey event is associated with an EEventKeyDown event (which
williamr@2
   291
	is typically the case), the EEventKey event occurs after the EEventKeyDown event. */
williamr@2
   292
	EEventKeyDown,
williamr@2
   293
	/** Modifier changed event.
williamr@2
   294
williamr@2
   295
	This is an event generated by the window server when
williamr@2
   296
	the state of one of the modifier keys changes.
williamr@2
   297
	It is not reported unless explicitly requested by a window.
williamr@2
   298
williamr@2
   299
	@see RWindowTreeNode::EnableModifierChangedEvents(). */
williamr@2
   300
	EEventModifiersChanged,
williamr@2
   301
	/** Pointer event.
williamr@2
   302
williamr@2
   303
	This event is sent when the user presses or releases a pointer button (or
williamr@2
   304
	the equivalent action, depending on the type of pointing device), drags the
williamr@4
   305
	pointer, moves it or uses the pointer to switch on the device. */
williamr@2
   306
	EEventPointer,			//5
williamr@2
   307
	/** Pointer enter event.
williamr@2
   308
williamr@2
   309
	This occurs when the user moves the pointer into a window with a pointer button
williamr@2
   310
	pressed (or equivalent action depending on the type of pointing device). If
williamr@2
   311
	move events are being generated, this event also occurs when the user moves
williamr@2
   312
	the pointer into the window. */
williamr@2
   313
	EEventPointerEnter,
williamr@2
   314
	/** Pointer exit event.
williamr@2
   315
williamr@2
   316
	Occurs when the user moves the pointer out of a window with a pointer button
williamr@2
   317
	pressed (or equivalent action depending on the type of pointing device). If
williamr@2
   318
	move events are being generated, this event also occurs when the user moves
williamr@2
   319
	the pointer out of the window. */
williamr@2
   320
	EEventPointerExit,
williamr@2
   321
	/** Pointer move buffer ready event.
williamr@2
   322
williamr@2
   323
	Occurs when the pointer move buffer is ready to be retrieved by the client. */
williamr@2
   324
	EEventPointerBufferReady,
williamr@2
   325
	/** Occurs as a duplicate of each pointer event if a window sets pointer capture
williamr@2
   326
	with the TCaptureFlagDragDrop flag set. */
williamr@2
   327
	EEventDragDrop,
williamr@2
   328
	/** Focus lost event.
williamr@2
   329
williamr@2
   330
	Occurs when a window group loses keyboard focus. */
williamr@2
   331
	EEventFocusLost,		//10
williamr@2
   332
	/** Focus gained event.
williamr@2
   333
williamr@2
   334
	Occurs when a window group gains keyboard focus. */
williamr@2
   335
	EEventFocusGained,
williamr@2
   336
	/** On event.
williamr@2
   337
williamr@2
   338
	This event type is not reported unless explicitly requested by a window.
williamr@2
   339
williamr@2
   340
	@see RWindowTreeNode::EnableOnEvents(). */
williamr@2
   341
	EEventSwitchOn,
williamr@2
   342
	/** Password event.
williamr@2
   343
williamr@2
   344
	Occurs when the window server enters password mode. It is sent to the group
williamr@2
   345
	window of the currently active password window.
williamr@2
   346
williamr@2
   347
	This is the window server mode where the user is required to enter a password
williamr@2
   348
	before any further actions can be performed.
williamr@2
   349
williamr@2
   350
	@deprecated	*/
williamr@2
   351
	EEventPassword,
williamr@2
   352
	/** Window group changed event. This occurs whenever a window group is destroyed,
williamr@2
   353
	and whenever a window group's name changes
williamr@2
   354
williamr@2
   355
	This event type is not reported unless explicitly requested by a window.
williamr@2
   356
williamr@2
   357
	@see RWindowTreeNode::EnableGroupChangeEvents(). */
williamr@2
   358
	EEventWindowGroupsChanged,
williamr@2
   359
	/** Error event.
williamr@2
   360
williamr@2
   361
	Occurs when an error occurs. See TWsErrorMessage::TErrorCategory for the types
williamr@2
   362
	of errors.
williamr@2
   363
williamr@2
   364
	This event type is not reported unless explicitly requested by a window.
williamr@2
   365
williamr@2
   366
	@see RWindowTreeNode::EnableErrorMessages(). */
williamr@2
   367
	EEventErrorMessage,		//15
williamr@2
   368
	/** Message ready event.
williamr@2
   369
williamr@2
   370
	Occurs when a session sends a message to this window group using RWsSession::SendMessageToWindowGroup(). */
williamr@2
   371
	EEventMessageReady,
williamr@2
   372
	EEventMarkInvalid,	// For internal use only
williamr@2
   373
	/** Off event.
williamr@2
   374
williamr@2
   375
	This is issued when an off event is received by the window server from the
williamr@2
   376
	base.
williamr@2
   377
williamr@2
   378
	If for some reason the event can't be delivered, or there is no-one to deliver
williamr@2
   379
	it to, then a call to the base is made to power down the processor.
williamr@2
   380
williamr@2
   381
	This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
williamr@2
   382
	EEventSwitchOff,
williamr@2
   383
	/** Event issued to off-event requesting windows when the off key is pressed. */
williamr@2
   384
	EEventKeySwitchOff,
williamr@2
   385
	/** Screen size mode change event.
williamr@2
   386
williamr@2
   387
	This is issued when the screen size mode has changed, for instance when
williamr@2
   388
	the cover on a phone that supports screen flipping is opened or closed. */
williamr@2
   389
	EEventScreenDeviceChanged, //20
williamr@2
   390
	/** Event sent whenever the window group with focus changes.
williamr@2
   391
williamr@2
   392
	Requested by RWindowTreeNode::EnableFocusChangeEvents(). */
williamr@2
   393
	EEventFocusGroupChanged,
williamr@2
   394
	/** Case opened event.
williamr@2
   395
williamr@2
   396
	This event is sent to those windows that have requested EEventSwitchOn
williamr@2
   397
	events. Unlike with EEventSwitchOn events, the screen will not be switched
williamr@2
   398
	on first. */
williamr@2
   399
	EEventCaseOpened,
williamr@2
   400
	/** Case closed event.
williamr@2
   401
williamr@2
   402
	This event is sent to those windows that have requested EEventSwitchOff
williamr@2
   403
	events.
williamr@2
   404
williamr@2
   405
	Unlike EEventSwitchOff events, which make a call to the base to power down
williamr@2
   406
	the processor if for some reason the event can't be delivered (or there is
williamr@2
   407
	no-one to deliver it to), failure to deliver case closed events has no repercussions. */
williamr@2
   408
	EEventCaseClosed,
williamr@2
   409
	/** Window group list change event.
williamr@2
   410
williamr@2
   411
	The window group list is a list of all window groups and their z-order. This
williamr@2
   412
	event indicates any change in the window group list: additions, removals and
williamr@2
   413
	reorderings.
williamr@2
   414
williamr@2
   415
	Notification of this event is requested by calling RWindowTreeNode::EnableGroupListChangeEvents(). */
williamr@2
   416
	EEventWindowGroupListChanged,
williamr@2
   417
	/** The visibility of a window has changed
williamr@2
   418
williamr@2
   419
	This is sent to windows when they change from visible to invisible, or visa versa, usually due
williamr@2
   420
	to another window obscuring them.
williamr@2
   421
williamr@2
   422
	Notification of this event is requested by calling RWindowTreeNode::EnableVisibilityChangeEvents(). */
williamr@2
   423
	EEventWindowVisibilityChanged,
williamr@2
   424
#ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
williamr@2
   425
	/** Restart event.
williamr@2
   426
	
williamr@2
   427
	This is issued when an restart event is received by the window server from the 
williamr@2
   428
	base. This event is also an off event, because it might power-cycle the device.
williamr@2
   429
	
williamr@2
   430
	If for some reason the event can't be delivered, or there is no-one to deliver 
williamr@2
   431
	it to, then a call to the base is made to power down the processor.
williamr@2
   432
	
williamr@2
   433
	This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
williamr@2
   434
	EEventRestartSystem,
williamr@2
   435
#endif
williamr@4
   436
	/** The display state or configuration has changed
williamr@4
   437
	
williamr@4
   438
	Either change of the current resolution list (state change) or current resolution/background
williamr@4
   439
	(mode change) will trigger this event.
williamr@4
   440
	
williamr@4
   441
	Notification of this event is requested by calling MDisplayControl::EnableDisplayChangeEvents() 
williamr@4
   442
	 */
williamr@4
   443
	EEventDisplayChanged = EEventWindowVisibilityChanged+2,
williamr@2
   444
	//Codes for events only passed into Key Click DLL's
williamr@2
   445
	/** Repeating key event.
williamr@2
   446
williamr@2
   447
	This is only sent to a key click plug-in DLL (if one is present) to indicate
williamr@2
   448
	a repeating key event.
williamr@2
   449
williamr@2
   450
	@see CClickMaker */
williamr@2
   451
	EEventKeyRepeat=100,
williamr@2
   452
	EEventGroupWindowOpen,
williamr@2
   453
	EEventGroupWindowClose,
williamr@2
   454
	EEventWindowClose,
williamr@2
   455
	//Codes for events only passed into anim dlls
williamr@2
   456
	/** Direct screen access begin
williamr@2
   457
	This is only sent to anim dlls (if they register to be notified). It indicates that
williamr@2
   458
	the number of direct screen access sessions has increased from zero to one.*/
williamr@2
   459
	EEventDirectScreenAccessBegin=200,
williamr@2
   460
	/** Direct screen access end
williamr@2
   461
	This is only sent to anim dlls (if they register to be notified). It indicates that
williamr@2
   462
	the number of direct screen access sessions has decreased from one to zero.*/
williamr@2
   463
	EEventDirectScreenAccessEnd,
williamr@2
   464
	/** Event to signal the starting or stopping of the wserv heartbeat timer
williamr@2
   465
	This is only sent to anim dlls (if they register to be notified). */
williamr@2
   466
	EEventHeartbeatTimerStateChange,
williamr@2
   467
williamr@2
   468
	//The range 900-999 is reserved for UI Framework events
williamr@2
   469
	/** 900-909 WSERV protects with PowerMgmt */
williamr@2
   470
	EEventPowerMgmt = 900,
williamr@2
   471
	EEventReserved = 910,
williamr@2
   472
williamr@2
   473
	//Event codes from EEventUser upwards may be used for non-wserv events.
williamr@2
   474
	//No event codes below this should be defined except by the window server
williamr@2
   475
williamr@2
   476
	/** User defined event.
williamr@2
   477
williamr@2
   478
	The client can use this and all higher values to define their own
williamr@2
   479
	events. These events can be sent between windows of the same client or windows
williamr@2
   480
	of different clients.
williamr@2
   481
williamr@2
   482
	@see RWs::SendEventToWindowGroup(). */
williamr@2
   483
	EEventUser=1000,
williamr@2
   484
williamr@2
   485
	};
williamr@2
   486
williamr@2
   487
williamr@2
   488
/** Window server hot keys.
williamr@2
   489
williamr@2
   490
@publishedAll
williamr@2
   491
@released
williamr@2
   492
@see RWsSession::SetHotKey() */
williamr@2
   493
enum THotKey
williamr@2
   494
	{
williamr@2
   495
	/** Enables logging of all messages to and from the window server.
williamr@2
   496
williamr@2
   497
	Note that the required type of logging must have been specified in the wsini.ini
williamr@2
   498
	file (using the LOG keyword), and the appropriate logging DLL must be available.
williamr@2
   499
williamr@2
   500
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>E */
williamr@2
   501
	EHotKeyEnableLogging,
williamr@2
   502
	/** Always disables window server logging, if active. Does nothing otherwise.
williamr@2
   503
williamr@2
   504
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>D */
williamr@2
   505
	EHotKeyDisableLogging,
williamr@2
   506
	/** Dumps a list of all windows to the log. (If logging is disabled, it is temporarily
williamr@2
   507
	enabled in order to do this.)
williamr@2
   508
williamr@2
   509
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>W */
williamr@2
   510
	EHotKeyStateDump,
williamr@2
   511
	/** Kills the foreground application.
williamr@2
   512
williamr@2
   513
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>K */
williamr@2
   514
	EHotKeyOfDeath,
williamr@2
   515
	/** Shuts down the window server.
williamr@2
   516
williamr@2
   517
	Be cautious! This may mean resetting the machine to re-start the window server.
williamr@2
   518
williamr@2
   519
	Default key mapping: release (not available), debug (\<Ctrl\>\<Alt\>\<Shift\>X). */
williamr@2
   520
	EHotKeyShutDown,
williamr@2
   521
	/** Dumps a list of cells allocated on the window server's heap to the log. (If
williamr@2
   522
	logging is disabled, it is temporarily enabled in order to do this.)
williamr@2
   523
williamr@2
   524
	Note that logging requires that the type of logging has been set up in the
williamr@2
   525
	wsini.ini file, and that the appropriate logging DLL is available.
williamr@2
   526
williamr@2
   527
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>H */
williamr@2
   528
	EHotKeyHeapDump,
williamr@2
   529
	/** Increases the LCD contrast.
williamr@2
   530
williamr@2
   531
	Default key mapping: EKeyIncContrast. Note that this value is from an enum
williamr@2
   532
	in e32keys.h. The contrast wraps around when it reaches the maximum. */
williamr@2
   533
	EHotKeyIncContrast,
williamr@2
   534
	/** Decreases the LCD contrast.
williamr@2
   535
williamr@2
   536
	Default key mapping: EKeyDecContrast. Note that this value is from an enum
williamr@2
   537
	in e32keys.h. The contrast wraps around when it reaches the minimum. */
williamr@2
   538
	EHotKeyDecContrast,
williamr@2
   539
	/** Switches the machine off.
williamr@2
   540
williamr@2
   541
	Default key mapping: EKeyOff. Note that this value is from an enum in e32keys.h. */
williamr@2
   542
	EHotKeyOff,
williamr@2
   543
	/** Switches the backlight on.
williamr@2
   544
williamr@2
   545
	Default key mapping: EKeyBacklightOn. Note that this value is from an enum
williamr@2
   546
	in e32keys.h. */
williamr@2
   547
	EHotKeyBacklightOn,
williamr@2
   548
	/** Switches the backlight off.
williamr@2
   549
williamr@2
   550
	Default key mapping: EKeyBacklightOff. Note that this value is from an enum
williamr@2
   551
	in e32keys.h. */
williamr@2
   552
	EHotKeyBacklightOff,
williamr@2
   553
	/** Toggles the backlight.
williamr@2
   554
williamr@2
   555
	Default key mapping: EKeyBacklightToggle. Note that this value is from an
williamr@2
   556
	enum in e32keys.h. */
williamr@2
   557
	EHotKeyBacklightToggle,
williamr@2
   558
	/** Switches to screen size 0.
williamr@2
   559
williamr@2
   560
	This, and the following 3 keys are used to switch screen sizes on real hardware,
williamr@2
   561
	for instance when the cover is closed on a phone that supports screen flipping. */
williamr@2
   562
	EHotKeyScreenDimension0,
williamr@2
   563
	/** Switches to screen size 1.
williamr@2
   564
williamr@2
   565
	This might be generated when the cover is opened on a phone that supports screen
williamr@2
   566
	flipping. */
williamr@2
   567
	EHotKeyScreenDimension1,
williamr@2
   568
	/** Switches to screen size 2. */
williamr@2
   569
	EHotKeyScreenDimension2,
williamr@2
   570
	/** Switches to screen size 3. */
williamr@2
   571
	EHotKeyScreenDimension3,
williamr@2
   572
	/** Cycles the display though its possible sizes.
williamr@2
   573
williamr@2
   574
	This is used only for debugging.
williamr@2
   575
williamr@2
   576
	A device may have several screen sizes, each with a default orientation. For
williamr@2
   577
	example a phone that supports screen flipping will have different display
williamr@2
   578
	sizes when the cover is opened and closed.
williamr@2
   579
williamr@2
   580
	Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> U. Release : none. */
williamr@2
   581
	EHotKeyCycleDisplaySize,
williamr@2
   582
	/** Cycles the screen orientation through the specified rotations for the particular
williamr@2
   583
	size mode you are in.
williamr@2
   584
williamr@2
   585
	For example, phones that support screen flipping may
williamr@2
   586
	use this feature for changing between right and left handed use.
williamr@2
   587
williamr@2
   588
	For rectangular display modes you can only specify 2 orientations, 180 degrees
williamr@2
   589
	apart. For square modes you can specify 4 rotations (90 degrees) or however
williamr@2
   590
	many you want.
williamr@2
   591
williamr@2
   592
	Specification of the list of rotations takes place in the WSINI.INI file.
williamr@2
   593
williamr@2
   594
	Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> O. Release : none. */
williamr@2
   595
	EHotKeyCycleOrientation,
williamr@2
   596
	/** Increases the screen's brightness.
williamr@2
   597
williamr@2
   598
	The brightness wraps around to the minimum
williamr@2
   599
	value after it has reached the maximum. */
williamr@2
   600
	EHotKeyIncBrightness,
williamr@2
   601
	/** Decreases the screen's brightness.
williamr@2
   602
williamr@2
   603
	The brightness wraps around to the maximum value after it has reached the minimum. */
williamr@2
   604
	EHotKeyDecBrightness,
williamr@2
   605
williamr@2
   606
	/** Cycle focus screen from one to another in multiple screen environment. Start
williamr@2
   607
	from current focused screen, switch to next the screen, and wraps around when it
williamr@2
   608
	reaches the last screen.
williamr@2
   609
williamr@2
   610
	Default key mapping: \<Ctrl\>\<Alt\>\<Shift\> I. */
williamr@2
   611
	EHotKeyCycleFocusScreen,
williamr@2
   612
williamr@2
   613
	/** Value for first hot key.
williamr@2
   614
williamr@2
   615
	Used with EHotKeyLastKeyType to make it easy to write a for loop that steps
williamr@2
   616
	through all the different key values. */
williamr@2
   617
	EHotKeyFirstKeyType=EHotKeyEnableLogging,		//Must always be set to the first one
williamr@2
   618
	/** Value for last hot key.
williamr@2
   619
williamr@2
   620
	Used with EHotKeyFirstKeyType to make it easy to write a for loop that steps
williamr@2
   621
	through all the different key values. */
williamr@2
   622
	EHotKeyLastKeyType=EHotKeyCycleFocusScreen,		//Must always be set to the last one
williamr@2
   623
	};
williamr@2
   624
williamr@2
   625
williamr@2
   626
/** Password mode flags.
williamr@2
   627
williamr@2
   628
@publishedAll
williamr@2
   629
@deprecated */
williamr@2
   630
enum TPasswordMode
williamr@2
   631
	{
williamr@2
   632
	/** Releases ownership of password handling.
williamr@2
   633
williamr@2
   634
	This allows another window to become the password window. A client will be
williamr@2
   635
	panicked with code 46 if it sets this mode when it is not the current password
williamr@2
   636
	window. */
williamr@2
   637
	EPasswordCancel,
williamr@2
   638
	/** No password handling is performed by this window, but no other window
williamr@2
   639
	can become the password window. */
williamr@2
   640
	EPasswordNone,
williamr@2
   641
	/** Password mode is enabled only once a day.
williamr@2
   642
williamr@2
   643
	When enabled, password mode requires the user to enter a password
williamr@2
   644
	before any further actions can be performed. */
williamr@2
   645
	EPasswordOnceADay,
williamr@2
   646
	/** Password mode is enabled every time the machine is switched on. */
williamr@2
   647
	EPasswordAlways,
williamr@2
   648
	/** Equivalent to setting the password mode to EPasswordAlways and triggering an
williamr@2
   649
	instant password check. */
williamr@2
   650
	EPasswordAlwaysTriggerNow,
williamr@2
   651
	/** Equivalent to setting the password mode to EPasswordOnceADay and triggering
williamr@2
   652
	an instant password check. */
williamr@2
   653
	EPasswordOnceADayTriggerNow,
williamr@2
   654
	};
williamr@4
   655
enum TPriorities {
williamr@4
   656
           /**
williamr@4
   657
           Defines the value EAllPriorities.
williamr@4
   658
           */
williamr@4
   659
           EAllPriorities=KMinTInt,
williamr@4
   660
           };
williamr@2
   661
williamr@2
   662
/** Sprite flags.
williamr@2
   663
williamr@2
   664
These can be combined using a bit-wise OR operation.
williamr@2
   665
williamr@2
   666
@publishedAll
williamr@2
   667
@released
williamr@2
   668
@see RWsPointerCursor::Construct()
williamr@2
   669
@see RWsSprite::Construct() */
williamr@2
   670
enum TSpriteFlags
williamr@2
   671
	{
williamr@2
   672
	/** Flash sprite on and off.
williamr@2
   673
williamr@2
   674
	All flashing is done on the same timer, including the text cursor. */
williamr@2
   675
	ESpriteFlash=0x1,
williamr@4
   676
	/** This flag no longer has any effect.
williamr@4
   677
	
williamr@4
   678
	If you want a sprite to appear on top of all windows, you can create a floating sprite
williamr@4
   679
	by specifying a RWindowGroup as parent to the sprite.  */
williamr@2
   680
	ESpriteNoChildClip=0x2,
williamr@2
   681
	/** The sprite's appearance will not change when it is on a shadowed part of the
williamr@2
   682
	screen.
williamr@2
   683
williamr@2
   684
	(Typically this is used for sprites attached to window groups so that
williamr@2
   685
	they are perceived to be floating above the windows). */
williamr@4
   686
	ESpriteNoShadows=0x4
williamr@2
   687
	};
williamr@2
   688
williamr@2
   689
struct TSpriteMember
williamr@2
   690
/** Sprite member.
williamr@2
   691
williamr@2
   692
This structure is used to define the parameters of a sprite member, which
williamr@2
   693
can be added to a sprite or pointer cursor.
williamr@2
   694
@publishedAll
williamr@2
   695
@released */
williamr@2
   696
	{
williamr@2
   697
	/** The bitmap to be displayed in the sprite or pointer cursor during the time
williamr@2
   698
	interval specified by iInterval.
williamr@2
   699
williamr@2
   700
	If NULL, the sprite or pointer cursor will be invisible for the time specified
williamr@2
   701
	by iInterval. */
williamr@2
   702
	CFbsBitmap *iBitmap;
williamr@2
   703
	/** The bitmap mask.
williamr@2
   704
williamr@2
   705
	This defines which areas of iBitmap are drawn to the screen.
williamr@2
   706
	It enables the bitmap to have a non-rectangular shape on the screen. Areas
williamr@2
   707
	which are not drawn to, retain the appearance of the window underneath the
williamr@2
   708
	sprite or cursor.
williamr@2
   709
williamr@2
   710
	The bits in iBitmap are AND'ed with those in iMaskBitmap before being drawn
williamr@2
   711
	to the screen. In practice, the mask bitmap is normally white in those areas
williamr@2
   712
	drawn to by iBitmap, and black in all other areas.
williamr@2
   713
williamr@2
   714
	Note:
williamr@2
   715
williamr@2
   716
	This bitmap should be in the same mode as iBitmap, otherwise the masking
williamr@2
   717
	out operation becomes inefficient. */
williamr@2
   718
	CFbsBitmap *iMaskBitmap;
williamr@2
   719
	/** EFalse if the mask bitmap is not to be inverted (the default) or ETrue if it
williamr@2
   720
	is to be inverted. */
williamr@2
   721
	TBool iInvertMask;
williamr@2
   722
	/** Specifies the drawing mode to use when drawing iBitmap if the mask is NULL. */
williamr@2
   723
	CGraphicsContext::TDrawMode iDrawMode;
williamr@2
   724
	/** Offset from the sprite's central position.
williamr@2
   725
williamr@2
   726
	Specifies an offset between the origin of iBitmap and the sprite or pointer
williamr@2
   727
	cursor's origin. (The origin is the top left corner of the bitmap.) */
williamr@2
   728
	TPoint iOffset;
williamr@2
   729
	/** Time interval for which iBitmap is displayed.
williamr@2
   730
williamr@2
   731
	Note that if only one sprite member is added to a sprite or pointer cursor,
williamr@2
   732
	it will be displayed continuously, regardless of the value of iInterval. */
williamr@2
   733
	TTimeIntervalMicroSeconds32 iInterval;
williamr@2
   734
	};
williamr@2
   735
williamr@2
   736
/** Event reporting control.
williamr@2
   737
williamr@2
   738
This enumeration defines flags which can be used to control how events are
williamr@2
   739
reported.
williamr@2
   740
williamr@2
   741
@publishedAll
williamr@2
   742
@released
williamr@2
   743
@see RWindowTreeNode::EnableOnEvents()
williamr@2
   744
@see RWindowTreeNode::EnableModifierChangedEvents()
williamr@2
   745
@see RWindowTreeNode::EnableErrorMessages() */
williamr@2
   746
enum TEventControl
williamr@2
   747
	{
williamr@2
   748
	/** Requested events are sent in all circumstances. */
williamr@2
   749
	EEventControlAlways,
williamr@2
   750
	/** Events are delivered only when the requesting window's window group has keyboard
williamr@2
   751
	focus. */
williamr@2
   752
	EEventControlOnlyWithKeyboardFocus,
williamr@2
   753
	/** Events are delivered only when the requesting window or any of its children
williamr@2
   754
	are visible on the screen. */
williamr@2
   755
	EEventControlOnlyWhenVisible
williamr@2
   756
	};
williamr@2
   757
williamr@2
   758
/** Pointer event filter types.
williamr@2
   759
williamr@2
   760
These flags are used by RWindowBase::PointerFilter() to define which pointer
williamr@2
   761
events are filtered out by the window server and not sent to the client session.
williamr@2
   762
They also allow the window server to simulate a move event prior to each pen
williamr@2
   763
down event.
williamr@2
   764
williamr@2
   765
@publishedAll
williamr@2
   766
@released
williamr@2
   767
@see RWindowBase::PointerFilter() */
williamr@2
   768
enum TPointerFilter
williamr@2
   769
	{
williamr@2
   770
	//Basic Types
williamr@2
   771
	/** Filters out both pointer enter and pointer exit events for this window. */
williamr@2
   772
	EPointerFilterEnterExit=0x1,
williamr@2
   773
	/** Filters out pointer-move events for this window. */
williamr@2
   774
	EPointerFilterMove=0x2,
williamr@2
   775
	/** Filters out pointer-drag events for this window. */
williamr@2
   776
	EPointerFilterDrag=0x4,
williamr@2
   777
	/** Simulates a pointer move event before each pen down event.
williamr@2
   778
williamr@2
   779
	This makes the pen appear more like a mouse, with simulated movement between
williamr@2
   780
	two pointer events. You can only get these events while you are in pen mode. */
williamr@2
   781
	EPointerGenerateSimulatedMove=0x8,
williamr@2
   782
	//Combinations of the above
williamr@2
   783
	/** Filters move and drag-pointer events from the event stream and simulates the
williamr@2
   784
	move event before each pen down event.
williamr@2
   785
williamr@2
   786
	This enum is useful when you want to get simulated move events. Use it as shown
williamr@2
   787
	below to turn on simulated moves:
williamr@2
   788
williamr@2
   789
	@code
williamr@2
   790
	win->PointerFilter(EPointerMoveEvents, EPointerGenerateSimulateMoves)
williamr@2
   791
	@endcode
williamr@2
   792
	@see RWindowBase::PointerFilter() */
williamr@2
   793
	EPointerMoveEvents=EPointerFilterMove|EPointerGenerateSimulatedMove,
williamr@2
   794
	};
williamr@2
   795
williamr@2
   796
struct TKeyEvent
williamr@2
   797
/** Key event details.
williamr@2
   798
williamr@2
   799
When processing a TKeyEvent, the TStdScanCode in iScanCode should usually
williamr@2
   800
be ignored in favour of the TKeyCode in iCode. Using iScanCode would bypass
williamr@2
   801
the keyboard mapping and any FEP that happens to be installed. The exceptions
williamr@2
   802
to this general rule are games where the positions of the keys are more important
williamr@2
   803
than their translations, and FEPs that are implementing keyboard maps themselves.
williamr@2
   804
In these cases, if the iCode is used rather than iScanCode to determine the
williamr@2
   805
key pressed, there will be two unfortunate consequences. Firstly, the low-level
williamr@2
   806
keyboard mapping might re-arrange the mapping that you are trying to impose.
williamr@2
   807
Secondly, you will subvert the CTRL+number method of entering Unicode literals.
williamr@2
   808
williamr@2
   809
@publishedAll
williamr@2
   810
@released */
williamr@2
   811
	{
williamr@2
   812
	/** The character code generated for an EEventKey, or 0 for a down or up event.
williamr@2
   813
williamr@2
   814
	Key codes for special keys are defined in TKeyCode. */
williamr@2
   815
	TUint iCode;
williamr@2
   816
	/** The scan code of the key that caused the event.
williamr@2
   817
williamr@2
   818
	Standard scan codes are defined in TStdScanCode. */
williamr@2
   819
	TInt iScanCode;
williamr@2
   820
	/** State of modifier keys and pointing device. Modifier keys are defined in TEventModifier. */
williamr@2
   821
	TUint iModifiers;
williamr@2
   822
	/** Count of auto repeats generated.
williamr@2
   823
williamr@2
   824
	0 means an event without repeats. 1 or more means "this many auto repeat events".
williamr@2
   825
	It is normal to ignore this value and treat it as a single event. */
williamr@2
   826
	TInt iRepeats;
williamr@2
   827
	};
williamr@2
   828
williamr@2
   829
struct TModifiersChangedEvent
williamr@2
   830
/** Details of changed modifier keys.
williamr@2
   831
williamr@2
   832
@publishedAll
williamr@2
   833
@released
williamr@2
   834
@see TWsEvent::ModifiersChanged() */
williamr@2
   835
	{
williamr@2
   836
	/** Contains a set bit for any modifier which has changed. Modifiers are defined
williamr@2
   837
	in TEventModifier. */
williamr@2
   838
	TUint iChangedModifiers;
williamr@2
   839
	/** Current state of all modifiers, combined using a bitwise-OR. Modifiers are
williamr@2
   840
	defined in TEventModifier. */
williamr@2
   841
	TUint iModifiers;
williamr@2
   842
	};
williamr@2
   843
williamr@2
   844
struct TWsVisibilityChangedEvent
williamr@2
   845
/** Visibility changed events.
williamr@2
   846
williamr@2
   847
These events are generated in response to a window being obscured, or being fully or partially
williamr@2
   848
revealed after being obscured.
williamr@2
   849
@publishedAll
williamr@2
   850
@released
williamr@2
   851
@see RWindowTreeNode::EnableVisibilityChangeEvents() */
williamr@2
   852
		{
williamr@2
   853
	enum
williamr@2
   854
		{
williamr@2
   855
		/** Some or all of the window is visible, either directly or through a transparent window.
williamr@2
   856
		@deprecated Use EPartiallyVisible instead. */
williamr@2
   857
		ECanBeSeen = 0x01,
williamr@2
   858
		/** None of the window is visible, either directly or through a transparent window.
williamr@2
   859
		@deprecated Use ENotVisible instead. */
williamr@2
   860
		ECantBeSeen = 0x02,
williamr@2
   861
		};
williamr@2
   862
	enum
williamr@2
   863
		{
williamr@2
   864
		/** Some (or all) of the window is visible, either directly or through a transparent window. */
williamr@2
   865
		EPartiallyVisible = 0x01,
williamr@2
   866
		/** None of the window is visible, either directly or through a transparent window. */
williamr@2
   867
		ENotVisible = 0x02,
williamr@2
   868
		/** All of the window is directly visible. */
williamr@2
   869
		EFullyVisible = 0x04,
williamr@2
   870
		};
williamr@2
   871
	/** A combination of one or more visibility event flags. */
williamr@2
   872
	TUint iFlags;
williamr@2
   873
	};
williamr@2
   874
williamr@4
   875
struct TWsDisplayChangedEvent
williamr@4
   876
/** Display changed events.
williamr@4
   877
williamr@4
   878
These events are generated by attaching, detaching the display device, changing the resolution list or change
williamr@4
   879
current resolution or backgound (change the current configuration).
williamr@4
   880
@publishedAll
williamr@4
   881
@released
williamr@4
   882
@see MDisplayControl::EnableDisplayChangeEvents() */
williamr@4
   883
	{
williamr@4
   884
	/**
williamr@4
   885
	 Number of display that has changed, causing this event. This is
williamr@4
   886
	 also known as the screen number, and is zero-based.
williamr@4
   887
	
williamr@4
   888
	 @see CWsScreenDevice::Construct(TInt)
williamr@4
   889
	 */
williamr@4
   890
	TInt iDisplayNumber;
williamr@4
   891
	/**
williamr@4
   892
	 Opaque value that changes when the current display configuration
williamr@4
   893
	 has changed.
williamr@4
   894
	 
williamr@4
   895
	 Compare values in subsequent events to determine whether the
williamr@4
   896
	 current resolution has changed since the last event.
williamr@4
   897
	 */
williamr@4
   898
	TInt iConfigurationChangeId;
williamr@4
   899
	/**
williamr@4
   900
	 Opaque value that changes when the resolution list has changed.
williamr@4
   901
	 
williamr@4
   902
	 Compare values in subsequent events to determine whether the list
williamr@4
   903
	 of available resolutions has changed since the last event.
williamr@4
   904
	 
williamr@4
   905
	 @see MDisplayControlBase::GetResolutions
williamr@4
   906
	 */
williamr@4
   907
	TInt iResolutionListChangeId;	
williamr@4
   908
	};
williamr@4
   909
williamr@2
   910
struct TWsErrorMessage
williamr@2
   911
/** Error event details.
williamr@2
   912
williamr@2
   913
@publishedAll
williamr@2
   914
@released
williamr@2
   915
@see RWindowTreeNode::EnableErrorMessages() */
williamr@2
   916
	{
williamr@2
   917
	/** Error event types */
williamr@2
   918
	enum TErrorCategory
williamr@2
   919
		{
williamr@2
   920
		/** An error that occurs while the window server is calculating a drawing region
williamr@2
   921
		for a particular window.
williamr@2
   922
williamr@2
   923
		When the window server can't calculate a drawing region due to lack of memory
williamr@2
   924
		it goes into a mode where it draws the whole of a window. Any window that
williamr@2
   925
		is covering this window is also told to redraw. */
williamr@2
   926
		EDrawingRegion,
williamr@2
   927
		/** An error occured while trying to turn the backlight on or off.
williamr@2
   928
williamr@2
   929
		This would usually only happen when the batteries are low. */
williamr@2
   930
		EBackLight,
williamr@2
   931
		/** An error occured while trying to enable logging. */
williamr@2
   932
		ELogging,
williamr@2
   933
		/** An error that occured while trying to change the contrast. */
williamr@2
   934
		EContrast,
williamr@2
   935
		};
williamr@2
   936
	/** The error category. */
williamr@2
   937
	TErrorCategory iErrorCategory;
williamr@2
   938
	/** The error code */
williamr@2
   939
	TUint iError;
williamr@2
   940
	};
williamr@2
   941
williamr@2
   942
class TWsRedrawEvent
williamr@2
   943
/** Window server redraw event.
williamr@2
   944
williamr@2
   945
All redraw events generated by the window server are delivered to the client
williamr@2
   946
in an object of this type. The class provides a handle to the window which
williamr@2
   947
generated the redraw event, and the rectangle which should be redrawn.
williamr@2
   948
williamr@2
   949
@publishedAll
williamr@2
   950
@released
williamr@2
   951
@see RWsSession::GetRedraw() */
williamr@2
   952
	{
williamr@2
   953
public:
williamr@2
   954
	inline TUint Handle() const;
williamr@2
   955
	inline TRect Rect() const;
williamr@2
   956
public:
williamr@2
   957
	void SetHandle(TUint aHandle);
williamr@2
   958
	void SetRect(TRect aRect);
williamr@2
   959
protected:
williamr@4
   960
	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
   961
	TRect iRect;	/**< Rectangle to redraw.  WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@2
   962
	};
williamr@2
   963
williamr@2
   964
class TWsPriorityKeyEvent
williamr@2
   965
/** Priority key events.
williamr@2
   966
williamr@2
   967
These events are configured using RWindowGroup::AddPriorityKey(), and obtained
williamr@2
   968
by the client using the functions RWsSession::PriorityKeyReady() and RWsSession::GetPriorityKey().
williamr@2
   969
williamr@2
   970
@publishedAll
williamr@2
   971
@released */
williamr@2
   972
	{
williamr@2
   973
public:
williamr@2
   974
	inline TKeyEvent *Key() const;
williamr@2
   975
	inline TUint Handle() const;
williamr@2
   976
	inline void SetHandle(TUint aHandle);
williamr@2
   977
protected:
williamr@4
   978
	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
   979
	TUint8 iEventData[sizeof(TKeyEvent)];	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@2
   980
	};
williamr@2
   981
williamr@2
   982
class TWsEvent
williamr@2
   983
/** Window server event.
williamr@2
   984
williamr@2
   985
All events generated by the window server, except redraw events and priority
williamr@2
   986
key events, are delivered to the client in a TWsEvent. The client obtains
williamr@2
   987
the TWsEvent by calling RWsSession::GetEvent(). The type of data contained
williamr@2
   988
in the TWsEvent depends on the type of event. The client can inquire the event
williamr@2
   989
type using Type(), and then retrieve the appropriate type of data.
williamr@2
   990
williamr@2
   991
@publishedAll
williamr@2
   992
@released */
williamr@2
   993
	{
williamr@2
   994
public:
williamr@2
   995
	/** Event data size. */
williamr@2
   996
	enum
williamr@2
   997
		{
williamr@4
   998
		/**
williamr@2
   999
		This is the maximum number of bytes of data that can be returned by EventData().
williamr@4
  1000
		Note: this value is 32 bytes.*/
williamr@4
  1001
		EWsEventDataSize=sizeof(TAdvancedPointerEvent)
williamr@2
  1002
		};
williamr@2
  1003
public:
williamr@4
  1004
	inline TWsEvent();
williamr@4
  1005
	inline TAdvancedPointerEvent* Pointer() const;
williamr@2
  1006
	inline TKeyEvent* Key() const;
williamr@2
  1007
	inline TModifiersChangedEvent* ModifiersChanged() const;
williamr@2
  1008
	inline TWsVisibilityChangedEvent* VisibilityChanged();
williamr@2
  1009
	inline const TWsVisibilityChangedEvent* VisibilityChanged() const;
williamr@4
  1010
	inline TWsDisplayChangedEvent* DisplayChanged();
williamr@4
  1011
	inline const TWsDisplayChangedEvent* DisplayChanged() const;
williamr@2
  1012
	inline TWsErrorMessage* ErrorMessage() const;
williamr@2
  1013
	inline TUint8* EventData() const;
williamr@2
  1014
	inline TInt Type() const;
williamr@2
  1015
	inline TUint Handle() const;
williamr@2
  1016
	inline TTime Time() const;
williamr@2
  1017
	inline void SetType(TInt aType);
williamr@2
  1018
	inline void SetHandle(TUint aHandle);
williamr@2
  1019
	inline void SetTimeNow();
williamr@2
  1020
	inline TInt* Int() const;
williamr@4
  1021
	IMPORT_C void InitAdvancedPointerEvent(TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, TUint8 aPointerNumber);
williamr@4
  1022
	IMPORT_C void SetPointerNumber(TUint8 aPointerNumber);
williamr@4
  1023
	IMPORT_C void SetPointerZ(TInt aZ);
williamr@2
  1024
protected:
williamr@4
  1025
	TInt iType;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
  1026
	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
  1027
	TTime iTime;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
  1028
	TUint8 iEventData[EWsEventDataSize];	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */	
williamr@2
  1029
	};
williamr@2
  1030
williamr@2
  1031
williamr@2
  1032
class RWsPointerCursor;
williamr@2
  1033
williamr@2
  1034
/** Pointer cursor mode flags.
williamr@2
  1035
williamr@2
  1036
These flags define the current cursor mode, and hence which sprite to use
williamr@2
  1037
for the pointer cursor.
williamr@2
  1038
williamr@2
  1039
@publishedAll
williamr@2
  1040
@released
williamr@2
  1041
@see RWsSession::SetPointerCursorMode()
williamr@2
  1042
@see RWsSession::PointerCursorMode() */
williamr@2
  1043
enum TPointerCursorMode
williamr@2
  1044
	{
williamr@2
  1045
	/** Don't have a pointer cursor. */
williamr@2
  1046
	EPointerCursorNone,
williamr@2
  1047
	/** The default system pointer cursor is used whenever there is a pointer cursor. */
williamr@2
  1048
	EPointerCursorFixed,
williamr@2
  1049
	/** The default system pointer cursor is used unless the window the pointer cursor
williamr@2
  1050
	is above specifies one, in which case that cursor is used. */
williamr@2
  1051
	EPointerCursorNormal,
williamr@2
  1052
	/** There is no pointer cursor unless the pointer is above a window that has specified
williamr@2
  1053
	one. */
williamr@2
  1054
	EPointerCursorWindow,
williamr@2
  1055
	/** First pointer cursor mode.
williamr@2
  1056
williamr@2
  1057
	This is used in test code for iterating though available modes. */
williamr@2
  1058
	EPointerCursorFirstMode=EPointerCursorNone,
williamr@2
  1059
	/** The final pointer cursor mode.
williamr@2
  1060
williamr@2
  1061
	This is used in test code for iterating though available modes. It will be
williamr@2
  1062
	updated if more modes are added. */
williamr@2
  1063
	EPointerCursorLastMode=EPointerCursorWindow,
williamr@2
  1064
	};
williamr@2
  1065
williamr@2
  1066
/** Flags which customise a long key press capture request made by a window group.
williamr@2
  1067
williamr@2
  1068
These flags are passed to RWindowGroup::CaptureLongKey().
williamr@2
  1069
williamr@2
  1070
Two things can be configured using this enum: the normal key event that is
williamr@2
  1071
generated immediately, and the long key event that is generated after a short
williamr@2
  1072
time interval. The normal key event can be sent immediately (on key down)
williamr@2
  1073
to the application with keyboard focus, or, if the key is not held down long
williamr@2
  1074
enough to generate a long key event, when the key is released. The long key
williamr@2
  1075
event can be customised to generate a single key event only, or to auto repeat.
williamr@2
  1076
williamr@2
  1077
@publishedAll
williamr@2
  1078
@released
williamr@2
  1079
@see RWindowGroup::CaptureLongKey() */
williamr@2
  1080
enum TLongCaptureFlags
williamr@2
  1081
	{
williamr@2
  1082
	/** If specified, the normal ("short") key event is sent immediately (on key down)
williamr@2
  1083
	to the application with keyboard focus. If not specified, the normal key event
williamr@2
  1084
	is sent when the key is released (if the key is not held down long enough
williamr@2
  1085
	to generate a long key event). */
williamr@2
  1086
	ELongCaptureShortEventImmediately=0x01,
williamr@2
  1087
	/** If specified, causes the long key press to automatically repeat. If not specified,
williamr@2
  1088
	the long key press will generate a single key event only. */
williamr@2
  1089
	ELongCaptureRepeatEvents=0x02,
williamr@2
  1090
	/** Equivalent to ELongCaptureShortEventImmediately being set and the other flags
williamr@2
  1091
	unset. */
williamr@2
  1092
	ELongCaptureNormal=ELongCaptureShortEventImmediately,
williamr@2
  1093
	/** Equivalent to the first two values being unset. */
williamr@2
  1094
	ELongCaptureWaitShort=0,
williamr@2
  1095
	};
williamr@2
  1096
williamr@2
  1097
williamr@2
  1098
class TIpcArgs;
williamr@2
  1099
class TReadDescriptorType;
williamr@2
  1100
class TWriteDescriptorType;
williamr@2
  1101
class CWindowGc;
williamr@4
  1102
class RWsSession;
williamr@2
  1103
williamr@2
  1104
class TWsGraphicId
williamr@2
  1105
/** Identifies an abstract artwork
williamr@2
  1106
williamr@2
  1107
This is a piece of artwork that might be owned and authored by another process.
williamr@2
  1108
A client can draw a piece of artwork, but that doesn't confer the ability to
williamr@2
  1109
access the pixel representation of that artwork directly.
williamr@2
  1110
williamr@2
  1111
@publishedAll
williamr@2
  1112
@released */
williamr@2
  1113
	{
williamr@2
  1114
public:
williamr@2
  1115
	enum TUninitialized
williamr@2
  1116
		{
williamr@2
  1117
		EUninitialized
williamr@2
  1118
		};
williamr@2
  1119
	TWsGraphicId(TUninitialized): iFlags(0) {}
williamr@2
  1120
	IMPORT_C TWsGraphicId(TUid aUid);
williamr@2
  1121
	IMPORT_C TWsGraphicId(TInt aId);
williamr@2
  1122
	IMPORT_C TWsGraphicId(const TWsGraphicId& aCopy);
williamr@2
  1123
	IMPORT_C TUid Uid() const;
williamr@2
  1124
	IMPORT_C TBool IsUid() const;
williamr@2
  1125
	IMPORT_C void Set(TUid aUid);
williamr@2
  1126
	IMPORT_C TInt Id() const;
williamr@2
  1127
	IMPORT_C TBool IsId() const;
williamr@2
  1128
	IMPORT_C void Set(TInt aId);
williamr@2
  1129
	IMPORT_C TInt Compare(const TWsGraphicId& aOther) const;
williamr@2
  1130
private:
williamr@2
  1131
	friend class CWsGraphic;
williamr@2
  1132
	TUint iFlags;
williamr@2
  1133
	TInt iId;
williamr@2
  1134
	TInt iWsGraphicIdSpare[2];
williamr@2
  1135
	};
williamr@2
  1136
williamr@2
  1137
class CWsGraphic: public CBase
williamr@2
  1138
/** Client representation of a window-server-side piece of artwork owned by this Client
williamr@2
  1139
williamr@2
  1140
@publishedAll
williamr@2
  1141
@released
williamr@2
  1142
*/
williamr@2
  1143
	{
williamr@2
  1144
protected:
williamr@2
  1145
	IMPORT_C CWsGraphic();
williamr@2
  1146
public:
williamr@2
  1147
	IMPORT_C ~CWsGraphic();
williamr@2
  1148
protected:
williamr@2
  1149
	// 2nd phase construction
williamr@2
  1150
	IMPORT_C void BaseConstructL(TUid aUid,TUid aType,const TDesC8& aData);
williamr@2
  1151
	IMPORT_C void BaseConstructL(TUid aType,const TDesC8& aData);
williamr@2
  1152
	IMPORT_C void BaseConstructL(const TWsGraphicId& aReplace,TUid aType,const TDesC8& aData);
williamr@2
  1153
	// sharing between clients
williamr@2
  1154
	IMPORT_C virtual TInt ShareGlobally();
williamr@2
  1155
	IMPORT_C virtual TInt Share(TSecureId aClientId);
williamr@2
  1156
	IMPORT_C virtual TInt UnShare(TSecureId aClientId);
williamr@2
  1157
	IMPORT_C virtual TInt UnShareGlobally();
williamr@2
  1158
public:
williamr@2
  1159
	IMPORT_C const TWsGraphicId& Id() const;
williamr@2
  1160
	IMPORT_C TBool IsActive() const;
williamr@2
  1161
	IMPORT_C void Destroy();
williamr@2
  1162
protected:
williamr@2
  1163
	IMPORT_C void SendMessage(const TDesC8& aData) const;
williamr@2
  1164
	IMPORT_C TInt SendSynchronMessage(const TDesC8& aData) const;
williamr@2
  1165
	IMPORT_C TInt Flush() const;
williamr@2
  1166
	IMPORT_C void SetGraphicExtension(MWsObjectProvider* aExt);
williamr@4
  1167
	IMPORT_C RWsSession& Session();
williamr@4
  1168
	
williamr@2
  1169
private:
williamr@2
  1170
	// events from wserv, to be implemented by derived classes
williamr@2
  1171
	/**
williamr@2
  1172
	Handles message from this graphic artwork peer on the server.
williamr@2
  1173
	@param aData Message from peer CWsGraphicDrawer.
williamr@2
  1174
	*/
williamr@2
  1175
	virtual void HandleMessage(const TDesC8& aData) = 0;
williamr@2
  1176
	
williamr@2
  1177
	/**
williamr@2
  1178
	Handles custom operation when this graphic artwork is replaced. When this method
williamr@2
  1179
	is invoked, the replaced peer CWsGraphicDrawer on the server has been destroyed.	
williamr@2
  1180
	*/
williamr@2
  1181
	virtual void OnReplace() = 0;
williamr@2
  1182
	IMPORT_C virtual void OnClientClose();
williamr@2
  1183
private:
williamr@2
  1184
	void BaseConstructL();
williamr@2
  1185
	IMPORT_C virtual TInt CWsGraphic_Reserved1();
williamr@2
  1186
	IMPORT_C virtual TInt CWsGraphic_Reserved2();
williamr@2
  1187
	IMPORT_C virtual TInt CWsGraphic_Reserved3();
williamr@2
  1188
public:
williamr@2
  1189
	class CManager;
williamr@2
  1190
private:
williamr@2
  1191
	friend class CManager;
williamr@2
  1192
	class CPimpl;
williamr@2
  1193
	friend class CPimpl;
williamr@2
  1194
	CPimpl* iPimpl;
williamr@2
  1195
	TInt iWsGraphicSpare[2];
williamr@2
  1196
};
williamr@2
  1197
williamr@2
  1198
class MWsClientClass
williamr@2
  1199
/** Base class for all classes whose objects are clients of the window server.
williamr@2
  1200
williamr@2
  1201
@publishedAll
williamr@2
  1202
@released */
williamr@2
  1203
	{
williamr@2
  1204
public:
williamr@2
  1205
	MWsClientClass();
williamr@2
  1206
	MWsClientClass(RWsBuffer *aBuffer);
williamr@2
  1207
	inline TInt WsHandle() const;
williamr@2
  1208
protected:
williamr@2
  1209
	void Write(const TAny *aData, TInt aLength,const TAny *aData2, TInt aLength2,TUint aOpcode) const;
williamr@2
  1210
	void Write(const TAny *aBuf, TInt aBufLen,TUint aOpcode) const;
williamr@2
  1211
	void Write(TUint aOpcode) const;
williamr@2
  1212
	void WriteInt(TInt aInt, TUint aOpcode) const;
williamr@2
  1213
	void WriteRect(const TRect &aRect, TUint aOpcode) const;
williamr@2
  1214
	void WritePoint(const TPoint &aPoint, TUint aOpcode) const;
williamr@2
  1215
	void WriteSize(const TSize &aSize, TUint aOpcode) const;
williamr@2
  1216
	TInt WriteReply(TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
williamr@2
  1217
	TInt WriteReplyInt(TInt aInt, TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
williamr@2
  1218
	TInt WriteReply(const TAny *aBuf, TInt aBufLen,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
williamr@2
  1219
	TInt WriteReply(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
williamr@2
  1220
	TInt WriteReplyP(const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
williamr@2
  1221
	TInt WriteReplyIntP(TInt aInt, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
williamr@2
  1222
	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
williamr@2
  1223
	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
williamr@2
  1224
	TInt WriteReplyByProvidingRemoteReadAccess(const TAny* aBuf, TInt aBufLen,const TReadDescriptorType& aRemoteReadBuffer,TUint aOpcode) const;
williamr@2
  1225
	void AddToBitmapArray(const TInt aBitmapHandle)const;
williamr@2
  1226
	void AsyncRequest(TRequestStatus& aStatus, TUint aOpcode) const;
williamr@4
  1227
williamr@4
  1228
    TBool WindowSizeCacheEnabled() const;
williamr@4
  1229
    void MarkWindowSizeCacheDirty();
williamr@4
  1230
    void RefreshWindowSizeCache(const TSize& aNewSize) const;
williamr@4
  1231
    TInt CachedWindowSize(TSize& aSize) const;
williamr@4
  1232
    void DestroyWindowSizeCacheEntry();
williamr@4
  1233
	
williamr@2
  1234
protected:
williamr@4
  1235
	TInt32 iWsHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@4
  1236
	RWsBuffer *iBuffer;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
williamr@2
  1237
	};
williamr@2
  1238
williamr@2
  1239
williamr@2
  1240
class RWindowTreeNode;
williamr@2
  1241
class CWsScreenDevice;
williamr@2
  1242
class CWsBitmap;
williamr@2
  1243
class RAnimDll;
williamr@2
  1244
class RWsSpriteBase;
williamr@2
  1245
class RDirectScreenAccess;
williamr@2
  1246
class RSoundPlugIn;
williamr@2
  1247
williamr@2
  1248
williamr@2
  1249
class RWsSession : public MWsClientClass, public RSessionBase
williamr@2
  1250
/** Window server session.
williamr@2
  1251
williamr@2
  1252
The session between the client and the window server can be used to mediate
williamr@2
  1253
asynchronous events, for client interface control and for system control.
williamr@2
  1254
A description of each of these capabilities is given below.
williamr@2
  1255
williamr@2
  1256
Mediating asynchronous events:
williamr@2
  1257
williamr@2
  1258
Primarily, the session mediates asynchronous events to the user. Three event
williamr@2
  1259
streams are available: the standard event stream which all applications must
williamr@2
  1260
use; the redraw event stream which must be used by all applications except
williamr@2
  1261
those which exclusively use backed-up windows; and the priority key event
williamr@2
  1262
stream which may be used for abort keys and the like for specialist applications.
williamr@2
  1263
williamr@2
  1264
All these events are mediated as standard asynchronous services. Typical window
williamr@2
  1265
server client programs encapsulate each service they require in an active
williamr@2
  1266
object whose RunL() identifies the event and calls the appropriate member
williamr@2
  1267
function of a class associated with an application framework, or a window.
williamr@2
  1268
williamr@2
  1269
Client interface control:
williamr@2
  1270
williamr@2
  1271
The client's interface with the window server has several aspects, each of
williamr@2
  1272
which is controlled through the window server session.
williamr@2
  1273
williamr@2
  1274
Flushing defines how requests to the window server are handled.
williamr@2
  1275
williamr@2
  1276
System control:
williamr@2
  1277
williamr@2
  1278
Many system-wide settings may be controlled through the window server session.
williamr@2
  1279
Typically, these functions are only used by the system shell and its associated
williamr@2
  1280
sessions/applications. They include: auto-repeat and double-click, querying
williamr@2
  1281
all window groups in the system, setting the default shadow vector, setting
williamr@2
  1282
the system pointer cursors, counting resources used by the window server
williamr@2
  1283
(this is only useful for debugging checks), getting and setting the state of
williamr@4
  1284
the modifier keys (for instance Shift and Ctrl), setting the window server
williamr@4
  1285
background colour, getting and setting thresholds for window server generated
williamr@4
  1286
pointer events.
williamr@2
  1287
williamr@2
  1288
@publishedAll
williamr@2
  1289
@released */
williamr@2
  1290
	{
williamr@2
  1291
	friend class RWsBuffer;
williamr@2
  1292
	friend class RWindowTreeNode;
williamr@2
  1293
	friend class CWsScreenDevice;
williamr@2
  1294
	friend class CWsBitmap;
williamr@2
  1295
	friend class RAnimDll;
williamr@2
  1296
	friend class RWsSpriteBase;
williamr@2
  1297
	friend class RDirectScreenAccess;
williamr@2
  1298
	friend class RSoundPlugIn;
williamr@2
  1299
	friend class CWsGraphic;
williamr@4
  1300
	friend class RWsDrawableSource;
williamr@2
  1301
public:
williamr@2
  1302
	/** Compute mode flags.
williamr@2
  1303
williamr@2
  1304
	When a window group takes focus or loses it, the window server can boost its
williamr@2
  1305
	client's thread or process priority to provide a better response to the user.
williamr@2
  1306
	How it alters the priority is determined by the current compute mode of the
williamr@2
  1307
	client.
williamr@2
  1308
williamr@2
  1309
	@see ComputeMode() */
williamr@2
  1310
	enum TComputeMode
williamr@2
  1311
		{
williamr@2
  1312
		/** Client priority is permanently set to its current level. It is not altered
williamr@2
  1313
		or set by the windowing system if the focus changes.
williamr@2
  1314
williamr@2
  1315
		Thus if ComputeMode() is called with this flag when a client is in the foreground,
williamr@2
  1316
		it will subsequently have foreground priority even if it is in the background. */
williamr@2
  1317
		EPriorityControlDisabled,
williamr@2
  1318
		/** Client process's priority is always set to EPriorityBackground. */
williamr@2
  1319
		EPriorityControlComputeOn,
williamr@2
  1320
		/** Client process's priority is set to EPriorityForeground when the window group
williamr@2
  1321
		takes focus, and set to EPriorityBackground when it loses focus.
williamr@2
  1322
williamr@2
  1323
		This is the default behaviour. */
williamr@2
  1324
		EPriorityControlComputeOff
williamr@2
  1325
		};
williamr@2
  1326
	enum {ESystemInfoArraySize=16};
williamr@2
  1327
	/** Window server logging commands passed to LogCommand().
williamr@2
  1328
williamr@2
  1329
	@see RWsSession::LogCommand() */
williamr@2
  1330
	enum TLoggingCommand
williamr@2
  1331
		{
williamr@2
  1332
		/** Enables logging. */
williamr@2
  1333
		ELoggingEnable,
williamr@2
  1334
		/** Disables logging. */
williamr@2
  1335
		ELoggingDisable,
williamr@2
  1336
		/** Logs the current status of all the windows in the tree, even if logging is
williamr@2
  1337
		not currently enabled. */
williamr@2
  1338
		ELoggingStatusDump,		//Window Tree Dump
williamr@2
  1339
		/** Logs information about the window server's heap size and usage, even if logging
williamr@2
  1340
		is not currently enabled. */
williamr@2
  1341
		ELoggingHeapDump,
williamr@2
  1342
		};
williamr@2
  1343
williamr@2
  1344
	struct TWindowGroupChainInfo
williamr@2
  1345
		{
williamr@2
  1346
		/*Stores id and Parent id window group
williamr@2
  1347
williamr@2
  1348
		This is used to define chained window groups's id and it's parent id.
williamr@2
  1349
		An array of these structures is returned by some of the varients of the function WindowGroupList.
williamr@2
  1350
		@publishedAll
williamr@2
  1351
		@released */
williamr@2
  1352
		TInt iId;
williamr@2
  1353
		TInt iParentId;
williamr@2
  1354
		};
williamr@2
  1355
williamr@2
  1356
	struct SSystemInfo
williamr@4
  1357
	/** WARNING: Struct for internal use ONLY.  Compatibility is not guaranteed in future releases. */ 
williamr@2
  1358
		{
williamr@2
  1359
		TInt iInfo[ESystemInfoArraySize];
williamr@2
  1360
		};
williamr@2
  1361
	/** The vertical alignment of a custom text cursor sprite.
williamr@2
  1362
williamr@2
  1363
	One of these values must be set, see SetCustomTextCursor(). This value also
williamr@2
  1364
	determines which part of each sprite member bitmap is clipped when the cursor's
williamr@2
  1365
	TTextCursor::EFlagClipVertical flag is set. */
williamr@2
  1366
	enum TCustomTextCursorAlignment
williamr@2
  1367
		{
williamr@2
  1368
		/** The y-origin of each sprite member bitmap is aligned with the top of the line. */
williamr@2
  1369
		ECustomTextCursorAlignTop,
williamr@2
  1370
		/** The y-origin of each sprite member bitmap is aligned with the baseline of the
williamr@2
  1371
		line. */
williamr@2
  1372
		ECustomTextCursorAlignBaseline,
williamr@2
  1373
		/** The y-origin of each sprite member bitmap is aligned with the bottom of the
williamr@2
  1374
		line. */
williamr@2
  1375
		ECustomTextCursorAlignBottom
williamr@2
  1376
		};
williamr@2
  1377
//
williamr@2
  1378
public:
williamr@2
  1379
	IMPORT_C RWsSession();
williamr@2
  1380
	IMPORT_C TInt Connect();
williamr@2
  1381
	IMPORT_C TInt Connect(RFs& aFileServer);
williamr@2
  1382
	IMPORT_C void Close();
williamr@4
  1383
	IMPORT_C TVersion Version() const;
williamr@2
  1384
williamr@2
  1385
	IMPORT_C TInt SetHotKey(THotKey aType, TUint aKeyCode, TUint aModifierMask, TUint aModifier);
williamr@2
  1386
	IMPORT_C TInt ClearHotKeys(THotKey aType);
williamr@2
  1387
	IMPORT_C TInt RestoreDefaultHotKey(THotKey aType);
williamr@2
  1388
//
williamr@2
  1389
	IMPORT_C void EventReady(TRequestStatus *aStat);
williamr@2
  1390
	IMPORT_C void EventReadyCancel();
williamr@4
  1391
	IMPORT_C void GetEvent(TWsEvent &aEvent) const;
williamr@2
  1392
	IMPORT_C void PurgePointerEvents();
williamr@2
  1393
//
williamr@2
  1394
	IMPORT_C void RedrawReady(TRequestStatus *aStat);
williamr@2
  1395
	IMPORT_C void RedrawReadyCancel();
williamr@2
  1396
	IMPORT_C void GetRedraw(TWsRedrawEvent &aEvent);
williamr@2
  1397
//
williamr@2
  1398
	IMPORT_C void PriorityKeyReady(TRequestStatus *aStat);
williamr@2
  1399
	IMPORT_C void PriorityKeyReadyCancel();
williamr@4
  1400
	IMPORT_C void GetPriorityKey(TWsPriorityKeyEvent &aEvent) const;
williamr@2
  1401
//
williamr@2
  1402
	IMPORT_C void Flush();
williamr@2
  1403
	IMPORT_C TBool SetAutoFlush(TBool aState);
williamr@2
  1404
	IMPORT_C TInt SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
williamr@4
  1405
	IMPORT_C void GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime) const;
williamr@4
  1406
	IMPORT_C void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance) const;
williamr@2
  1407
	IMPORT_C TInt SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance);
williamr@2
  1408
//
williamr@2
  1409
	IMPORT_C TInt NumWindowGroups() const;
williamr@4
  1410
	IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt> *aWindowList) const;
williamr@4
  1411
	IMPORT_C TInt WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList) const;
williamr@2
  1412
	IMPORT_C TInt NumWindowGroups(TInt aPriority) const;
williamr@4
  1413
	IMPORT_C TInt WindowGroupList(TInt aPriority, CArrayFixFlat<TInt> *aWindowList) const;
williamr@4
  1414
	IMPORT_C TInt WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList) const;
williamr@4
  1415
	IMPORT_C TInt GetFocusWindowGroup() const;
williamr@4
  1416
	IMPORT_C TInt GetDefaultOwningWindow() const;
williamr@2
  1417
	IMPORT_C TInt SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition);
williamr@4
  1418
	IMPORT_C TInt GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId) const;
williamr@4
  1419
	IMPORT_C TInt GetWindowGroupHandle(TInt aIdentifier) const;
williamr@4
  1420
	IMPORT_C TInt GetWindowGroupOrdinalPriority(TInt aIdentifier) const;
williamr@2
  1421
	IMPORT_C TInt SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent);
williamr@2
  1422
	IMPORT_C TInt SendEventToAllWindowGroups(const TWsEvent &aEvent);
williamr@2
  1423
	IMPORT_C TInt SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent);
williamr@2
  1424
	IMPORT_C TInt SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent);
williamr@4
  1425
	IMPORT_C TInt GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName) const;
williamr@4
  1426
	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset=0) const;
williamr@4
  1427
	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId) const;
williamr@2
  1428
	IMPORT_C TInt SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams);
williamr@2
  1429
	IMPORT_C TInt SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams);
williamr@2
  1430
	IMPORT_C TInt SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams);
williamr@4
  1431
	IMPORT_C TInt FetchMessage(TUid &aUid, TPtr8 &aParams, const TWsEvent& aMessageEvent) const;
williamr@2
  1432
//
williamr@2
  1433
	IMPORT_C void SetShadowVector(const TPoint &aVector);
williamr@2
  1434
	IMPORT_C TPoint ShadowVector() const;
williamr@2
  1435
//
williamr@2
  1436
	IMPORT_C void SetBackgroundColor(TRgb aColor);
williamr@2
  1437
	IMPORT_C TRgb GetBackgroundColor() const;
williamr@2
  1438
//
williamr@4
  1439
	IMPORT_C TInt RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
williamr@4
  1440
	IMPORT_C void UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
williamr@4
  1441
	IMPORT_C TInt PreferredSurfaceConfigurationSize() const;
williamr@2
  1442
//
williamr@2
  1443
	IMPORT_C TInt SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber);
williamr@2
  1444
	IMPORT_C void ClearSystemPointerCursor(TInt aCursorNumber);
williamr@2
  1445
	IMPORT_C TInt ClaimSystemPointerCursorList();
williamr@2
  1446
	IMPORT_C void FreeSystemPointerCursorList();
williamr@2
  1447
//
williamr@2
  1448
	IMPORT_C TInt SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment);
williamr@2
  1449
//
williamr@4
  1450
	IMPORT_C TInt ResourceCount() const;
williamr@2
  1451
	IMPORT_C void PasswordEntered();
williamr@2
  1452
	IMPORT_C void ComputeMode(TComputeMode aMode);
williamr@2
  1453
//
williamr@2
  1454
	IMPORT_C TInt HeapCount() const;
williamr@2
  1455
	IMPORT_C TInt DebugInfo(TInt aFunction, TInt aParam=0) const;
williamr@2
  1456
	IMPORT_C TInt DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
williamr@2
  1457
	IMPORT_C void HeapSetFail(TInt aTAllocFail,TInt aValue);
williamr@4
  1458
	IMPORT_C void HeapSetBurstFail(TInt aTAllocFail,TInt aRate,TInt aBurst);
williamr@2
  1459
	IMPORT_C TInt SetModifierState(TEventModifier aModifier,TModifierState aState);
williamr@2
  1460
	IMPORT_C TInt GetModifierState() const;
williamr@2
  1461
//
williamr@2
  1462
	IMPORT_C TInt RequestOffEvents(TBool aOn,RWindowTreeNode *aWin=NULL);
williamr@2
  1463
	IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const;
williamr@2
  1464
	IMPORT_C TInt GetColorModeList(CArrayFixFlat<TInt> *aModeList) const;
williamr@2
  1465
//
williamr@2
  1466
	IMPORT_C void SetPointerCursorArea(const TRect& aArea);
williamr@2
  1467
	IMPORT_C void SetPointerCursorArea(TInt aScreenSizeMode,const TRect& aArea);
williamr@2
  1468
	IMPORT_C TRect PointerCursorArea() const;
williamr@2
  1469
	IMPORT_C TRect PointerCursorArea(TInt aScreenSizeMode) const;
williamr@2
  1470
	IMPORT_C void SetPointerCursorMode(TPointerCursorMode aMode);
williamr@2
  1471
	IMPORT_C TInt SetClientCursorMode(TPointerCursorMode aMode);
williamr@2
  1472
	IMPORT_C TPointerCursorMode PointerCursorMode() const;
williamr@2
  1473
	IMPORT_C void SetDefaultSystemPointerCursor(TInt aCursorNumber);
williamr@2
  1474
	IMPORT_C void ClearDefaultSystemPointerCursor();
williamr@2
  1475
	IMPORT_C TInt SetPointerCursorPosition(const TPoint& aPosition);
williamr@2
  1476
	IMPORT_C TPoint PointerCursorPosition() const;
williamr@2
  1477
williamr@2
  1478
	IMPORT_C void SetDefaultFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
williamr@2
  1479
	IMPORT_C void PrepareForSwitchOff();
williamr@2
  1480
	IMPORT_C void SetBufferSizeL(TInt aBufSize);
williamr@2
  1481
	IMPORT_C void SetMaxBufferSizeL(TInt aMaxBufSize);
williamr@2
  1482
	IMPORT_C TInt SetSystemFaded(TBool aFaded);
williamr@2
  1483
	IMPORT_C TInt SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap);
williamr@2
  1484
williamr@2
  1485
// Functions for multiple screens
williamr@2
  1486
	IMPORT_C TInt SetFocusScreen(TInt aScreenNumber);
williamr@4
  1487
	IMPORT_C TInt GetFocusScreen() const;
williamr@2
  1488
	IMPORT_C void ClearAllRedrawStores();
williamr@4
  1489
	IMPORT_C TInt NumWindowGroups(TInt aScreenNumber,TInt aPriority) const;
williamr@4
  1490
	IMPORT_C TInt NumberOfScreens() const;
williamr@4
  1491
	IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority=EAllPriorities) const;
williamr@4
  1492
	IMPORT_C TInt GetFocusWindowGroup(TInt aScreenNumber) const;
williamr@4
  1493
	IMPORT_C TInt GetDefaultOwningWindow(TInt aScreenNumber) const;
williamr@4
  1494
	IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt aScreenNumber,TInt& aColor,TInt& aGray) const;
williamr@4
  1495
	IMPORT_C TInt GetColorModeList(TInt aScreenNumber,CArrayFixFlat<TInt>* aModeList) const;
williamr@2
  1496
#if defined(__WINS__)
williamr@2
  1497
// Function for WINS behaviour only
williamr@2
  1498
	IMPORT_C void SetRemoveKeyCode(TBool aRemove);
williamr@4
  1499
	IMPORT_C void SimulateXyInputType(TInt aInputType);		//Only for testing WSERV
williamr@2
  1500
#endif
williamr@2
  1501
//
williamr@2
  1502
	IMPORT_C void SimulateRawEvent(TRawEvent aEvent);
williamr@2
  1503
	IMPORT_C void SimulateKeyEvent(TKeyEvent aEvent);
williamr@2
  1504
	IMPORT_C void LogCommand(TLoggingCommand aCommand);
williamr@2
  1505
	IMPORT_C void LogMessage(const TLogMessageText &aMessage);
williamr@4
  1506
williamr@2
  1507
// Functions for test code use only
williamr@2
  1508
	IMPORT_C void SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo);
williamr@2
  1509
	IMPORT_C void TestWrite(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
williamr@2
  1510
	IMPORT_C void TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
williamr@2
  1511
	IMPORT_C void TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *aData,TInt aLength,TDes8 *aReplyPackage);
williamr@2
  1512
	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer);
williamr@2
  1513
	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer);
williamr@2
  1514
	
williamr@2
  1515
	IMPORT_C TInt Finish();
williamr@2
  1516
	IMPORT_C void SyncMsgBuf();
williamr@4
  1517
williamr@4
  1518
// Getters and setters for pointer event's thresholds
williamr@4
  1519
	IMPORT_C TInt SetCloseProximityThresholds(TInt aEnterCloseProximityThreshold, TInt aExitCloseProximityThreshold);
williamr@4
  1520
	IMPORT_C TInt GetEnterCloseProximityThreshold() const;
williamr@4
  1521
	IMPORT_C TInt GetExitCloseProximityThreshold() const;
williamr@4
  1522
	IMPORT_C TInt SetHighPressureThresholds(TInt aEnterHighPressureThreshold, TInt aExitHighPressureThreshold);
williamr@4
  1523
	IMPORT_C TInt GetEnterHighPressureThreshold() const;
williamr@4
  1524
	IMPORT_C TInt GetExitHighPressureThreshold() const;
williamr@4
  1525
//
williamr@4
  1526
    IMPORT_C void EnableWindowSizeCacheL();
williamr@4
  1527
	
williamr@2
  1528
// functions not exported, used by CWsGraphic
williamr@2
  1529
	void GraphicMessageReady(TRequestStatus *aStat);
williamr@4
  1530
	void GetGraphicMessage(TDes8& aData) const;
williamr@2
  1531
	void GraphicMessageCancel();
williamr@2
  1532
	void GraphicAbortMessage(TInt aError);
williamr@2
  1533
	TInt GraphicFetchHeaderMessage();
williamr@2
  1534
private:
williamr@4
  1535
	TInt doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode) const;
williamr@4
  1536
	TInt doWindowGroupList(TInt aScreenNumber, TInt aPriority, CArrayFixFlat<TInt>* aWindowListId, TInt aNumOpcode, TInt aListOpcode) const;
williamr@2
  1537
	TInt doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers);
williamr@2
  1538
	void doReadEvent(TRequestStatus *aStat, TInt aOpcode);
williamr@2
  1539
williamr@2
  1540
private:
williamr@2
  1541
	void connectL();
williamr@2
  1542
	TInt DoFlush(const TIpcArgs& aIpcArgs);
williamr@2
  1543
	TInt DoSyncMsgBuf(const TIpcArgs& aIpcArgs);
williamr@2
  1544
	void DirectAcessActivation(TBool aIsNowActive);
williamr@2
  1545
	};
williamr@2
  1546
williamr@2
  1547
class RWindowGroup;
williamr@2
  1548
class RWsSprite;
williamr@2
  1549
williamr@2
  1550
williamr@2
  1551
class RWindowTreeNode : public MWsClientClass
williamr@2
  1552
/** A handle to a node in the server-side window tree.
williamr@2
  1553
williamr@2
  1554
This handle class is used as the base for both window groups and the windows
williamr@2
  1555
within them; it is not intended for user derivation, and may not be directly
williamr@2
  1556
constructed: use one of the standard derived classes instead.
williamr@2
  1557
williamr@2
  1558
@publishedAll
williamr@2
  1559
@released */
williamr@2
  1560
	{
williamr@2
  1561
	friend class RWindowGroup;
williamr@2
  1562
	friend class RWindowBase;
williamr@2
  1563
	friend class CWindowGc;
williamr@2
  1564
	friend class RAnimDll;
williamr@2
  1565
	friend class RWsSprite;
williamr@2
  1566
public:
williamr@2
  1567
	/** Fade control flags.
williamr@2
  1568
williamr@2
  1569
	These flags define whether fading is applied to all child windows when SetFaded()
williamr@2
  1570
	is called on a window. */
williamr@2
  1571
	enum TFadeControl
williamr@2
  1572
		{
williamr@2
  1573
		/** Include all child windows when fading/un-fading. */
williamr@2
  1574
		EFadeIncludeChildren=ETrue,
williamr@2
  1575
		/** Fade only the parent window.
williamr@2
  1576
williamr@2
  1577
		Note that a panic will occur if this value is used when SetFaded() is called
williamr@2
  1578
		on a window group. */
williamr@2
  1579
		EFadeWindowOnly=EFalse,
williamr@2
  1580
		};
williamr@2
  1581
protected:
williamr@2
  1582
	RWindowTreeNode();
williamr@2
  1583
	RWindowTreeNode(RWsSession &aWs);
williamr@2
  1584
public:
williamr@2
  1585
	IMPORT_C void Close();
williamr@2
  1586
	IMPORT_C void Destroy();
williamr@2
  1587
	IMPORT_C TUint32 ClientHandle() const;
williamr@2
  1588
	IMPORT_C TUint32 Parent() const;
williamr@2
  1589
	IMPORT_C TUint32 PrevSibling() const;
williamr@2
  1590
	IMPORT_C TUint32 NextSibling() const;
williamr@2
  1591
	IMPORT_C TUint32 Child() const;
williamr@2
  1592
	IMPORT_C TInt OrdinalPriority() const;
williamr@2
  1593
	IMPORT_C TInt OrdinalPosition() const;
williamr@2
  1594
	IMPORT_C TInt FullOrdinalPosition() const;
williamr@2
  1595
	IMPORT_C void SetOrdinalPosition(TInt aPos);
williamr@2
  1596
	IMPORT_C void SetOrdinalPosition(TInt aPos,TInt aOrdinalPriority);
williamr@4
  1597
	IMPORT_C TInt ScreenNumber() const;	
williamr@4
  1598
	IMPORT_C TInt WindowGroupId() const;
williamr@2
  1599
	IMPORT_C TInt SetPointerCursor(TInt aCursorNumber);
williamr@2
  1600
	IMPORT_C void SetCustomPointerCursor(const RWsPointerCursor &aPointerCursor);
williamr@2
  1601
	IMPORT_C TInt EnableOnEvents(TEventControl aCircumstances=EEventControlOnlyWithKeyboardFocus);
williamr@2
  1602
	IMPORT_C void DisableOnEvents();
williamr@2
  1603
	IMPORT_C TInt EnableGroupChangeEvents();
williamr@2
  1604
	IMPORT_C void DisableGroupChangeEvents();
williamr@2
  1605
	IMPORT_C TInt EnableFocusChangeEvents();
williamr@2
  1606
	IMPORT_C void DisableFocusChangeEvents();
williamr@2
  1607
	IMPORT_C TInt EnableGroupListChangeEvents();
williamr@2
  1608
	IMPORT_C void DisableGroupListChangeEvents();
williamr@2
  1609
	IMPORT_C TInt EnableVisibilityChangeEvents();
williamr@2
  1610
	IMPORT_C void DisableVisibilityChangeEvents();
williamr@2
  1611
	IMPORT_C TInt EnableErrorMessages(TEventControl aCircumstances);
williamr@2
  1612
	IMPORT_C void DisableErrorMessages();
williamr@2
  1613
	IMPORT_C TInt EnableModifierChangedEvents(TUint aModifierMask, TEventControl aCircumstances);
williamr@2
  1614
	IMPORT_C void DisableModifierChangedEvents();
williamr@2
  1615
	IMPORT_C void SetNonFading(TBool aNonFading);
williamr@2
  1616
	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren);
williamr@2
  1617
	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren,TUint8 aBlackMap,TUint8 aWhiteMap);
williamr@2
  1618
	IMPORT_C void ClearPointerCursor();
williamr@4
  1619
	IMPORT_C RWsSession* Session() const;
williamr@2
  1620
protected:
williamr@2
  1621
	__DECLARE_TEST;
williamr@2
  1622
	};
williamr@2
  1623
williamr@2
  1624
williamr@2
  1625
class TSurfaceId;
williamr@2
  1626
class TSurfaceConfiguration;
williamr@2
  1627
williamr@2
  1628
class RWindowBase : public RWindowTreeNode
williamr@2
  1629
/** Client-side handle to a server-side window.
williamr@2
  1630
williamr@2
  1631
The server-side windows of handles derived from this class can be displayed
williamr@2
  1632
on the device's screen, and associated with pointer events.
williamr@2
  1633
williamr@2
  1634
This class is not for user derivation; however derived classes form part of
williamr@2
  1635
the Window Server API.
williamr@2
  1636
williamr@2
  1637
@publishedAll
williamr@2
  1638
@released */
williamr@2
  1639
	{
williamr@2
  1640
public:
williamr@2
  1641
	/** Capture behaviour flags.
williamr@2
  1642
williamr@2
  1643
	@see SetPointerCapture()
williamr@2
  1644
	@see EEventDragDrop */
williamr@2
  1645
	enum TCaptureFlags
williamr@2
  1646
		{
williamr@2
  1647
// Flags, these can be combined to customise pointer capture
williamr@2
  1648
		/** If set, capture is enabled, disabled otherwise. */
williamr@2
  1649
		TCaptureFlagEnabled=0x01,
williamr@2
  1650
		/** If set, drag-drop events are sent to the window in which the pointer was lifted.
williamr@2
  1651
		Drag-drop is a tap-drag-lift sequence. */
williamr@2
  1652
		TCaptureFlagDragDrop=0x02,
williamr@2
  1653
		/** Capture events from windows belonging to any group, not just the group of the
williamr@2
  1654
		window on which the flag was set */
williamr@2
  1655
		TCaptureFlagAllGroups=0x04,
williamr@2
  1656
// States, made up of a set of flags
williamr@2
  1657
		/** Equivalent to disabling all the above flags. */
williamr@2
  1658
		TCaptureDisabled=0,
williamr@2
  1659
		/** Equivalent to TCaptureFlagEnabled. */
williamr@2
  1660
		TCaptureEnabled=TCaptureFlagEnabled,
williamr@2
  1661
		/** Equivalent to the OR of the first three flags. */
williamr@2
  1662
		TCaptureDragDrop=TCaptureFlagEnabled|TCaptureFlagDragDrop|TCaptureFlagAllGroups,
williamr@2
  1663
		};
williamr@2
  1664
protected:
williamr@2
  1665
	RWindowBase();
williamr@2
  1666
	RWindowBase(RWsSession &aWs);
williamr@2
  1667
public:
williamr@2
  1668
	IMPORT_C void Activate();
williamr@2
  1669
	IMPORT_C void SetPosition(const TPoint &point);
williamr@2
  1670
	IMPORT_C TInt SetSizeErr(const TSize &size);
williamr@2
  1671
	IMPORT_C TInt SetExtentErr(const TPoint &point,const TSize &size);
williamr@2
  1672
	IMPORT_C TSize Size() const;
williamr@2
  1673
	IMPORT_C TPoint InquireOffset(const RWindowTreeNode &aWindow) const;
williamr@2
  1674
	IMPORT_C void PointerFilter(TUint32 aFilterMask, TUint32 aFilter);
williamr@2
  1675
	IMPORT_C void SetPointerGrab(TBool aState);
williamr@2
  1676
	IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
williamr@4
  1677
	IMPORT_C TInt ClaimPointerGrab(const TUint8 aPointerNumber, const TBool aSendUpEvent=ETrue);
williamr@2
  1678
	IMPORT_C void SetPointerCapture(TInt aFlags);
williamr@2
  1679
	IMPORT_C void SetPointerCapturePriority(TInt aPriority);
williamr@2
  1680
	IMPORT_C TInt GetPointerCapturePriority() const;
williamr@2
  1681
	IMPORT_C void SetVisible(TBool aState);
williamr@2
  1682
	IMPORT_C void SetShadowHeight(TInt aHeight);
williamr@2
  1683
	IMPORT_C void SetShadowDisabled(TBool aState);
williamr@2
  1684
	IMPORT_C TPoint Position() const;
williamr@2
  1685
	IMPORT_C TPoint AbsPosition() const;
williamr@2
  1686
	IMPORT_C TInt SetCornerType(TCornerType aCornerType, TInt aCornerFlags=0);
williamr@2
  1687
	IMPORT_C TInt SetShape(const TRegion &aRegion);
williamr@2
  1688
	IMPORT_C TInt SetRequiredDisplayMode(TDisplayMode aMode);
williamr@4
  1689
	IMPORT_C TDisplayMode DisplayMode() const;
williamr@2
  1690
	IMPORT_C void EnableBackup(TUint aBackupType=EWindowBackupAreaBehind);
williamr@2
  1691
	IMPORT_C void RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect);
williamr@2
  1692
	IMPORT_C void CancelPointerRepeatEventRequest();
williamr@4
  1693
	IMPORT_C TInt RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect, const TUint8 aPointerNumber);	//< @prototype
williamr@4
  1694
	IMPORT_C TInt CancelPointerRepeatEventRequest(const TUint8 aPointerNumber);	//< @prototype
williamr@2
  1695
	IMPORT_C TInt AllocPointerMoveBuffer(TInt aMaxPoints, TUint aFlags);
williamr@2
  1696
	IMPORT_C void FreePointerMoveBuffer();
williamr@2
  1697
	IMPORT_C void EnablePointerMoveBuffer();
williamr@2
  1698
	IMPORT_C void DisablePointerMoveBuffer();
williamr@4
  1699
	IMPORT_C TInt RetrievePointerMoveBuffer(TDes8 &aBuf) const;
williamr@2
  1700
	IMPORT_C void DiscardPointerMoveBuffer();
williamr@2
  1701
	IMPORT_C TInt AddKeyRect(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
williamr@2
  1702
	IMPORT_C void RemoveAllKeyRects();
williamr@2
  1703
	IMPORT_C TInt PasswordWindow(TPasswordMode aPasswordMode);
williamr@2
  1704
	IMPORT_C void FadeBehind(TBool aFade);
williamr@4
  1705
	IMPORT_C TBool IsFaded() const;
williamr@4
  1706
	IMPORT_C TBool IsNonFading() const;
williamr@2
  1707
	IMPORT_C TInt MoveToGroup(TInt aIdentifier);
williamr@4
  1708
	IMPORT_C TInt SetBackgroundSurface(const TSurfaceId& aSurface);
williamr@4
  1709
	IMPORT_C TInt SetBackgroundSurface(const TSurfaceConfiguration& aConfiguration, TBool aTriggerRedraw);
williamr@4
  1710
	IMPORT_C void RemoveBackgroundSurface(TBool aTriggerRedraw);
williamr@4
  1711
	IMPORT_C TInt GetBackgroundSurface(TSurfaceConfiguration& aConfiguration) const;
williamr@4
  1712
	IMPORT_C void SetSurfaceTransparency(TBool aSurfaceTransparency);
williamr@4
  1713
	IMPORT_C TRgb KeyColor() const;
williamr@4
  1714
	IMPORT_C void EnableAdvancedPointers();
williamr@2
  1715
protected:
williamr@2
  1716
	TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
williamr@2
  1717
	};
williamr@2
  1718
williamr@2
  1719
williamr@2
  1720
class RBlankWindow : public RWindowBase
williamr@2
  1721
/** Blank window.
williamr@2
  1722
williamr@2
  1723
A blank window may have its extent and colour changed, but nothing else may
williamr@2
  1724
be drawn to it. Blank windows provide no functionality that is not provided
williamr@2
  1725
by the RWindow class. However, they are useful when the application requires
williamr@2
  1726
a window that cannot be drawn to, for example a container window.
williamr@2
  1727
williamr@2
  1728
@publishedAll
williamr@2
  1729
@released */
williamr@2
  1730
	{
williamr@2
  1731
public:
williamr@2
  1732
	IMPORT_C RBlankWindow();
williamr@2
  1733
	IMPORT_C RBlankWindow(RWsSession &aWs);
williamr@2
  1734
	IMPORT_C TInt Construct(const RWindowTreeNode &parent, TUint32 aHandle);
williamr@2
  1735
	IMPORT_C void SetColor(TRgb aColor);
williamr@2
  1736
	IMPORT_C void SetColor();
williamr@2
  1737
	IMPORT_C void SetSize(const TSize &size);
williamr@2
  1738
	IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
williamr@2
  1739
	};
williamr@2
  1740
williamr@2
  1741
williamr@2
  1742
class RDrawableWindow : public RWindowBase
williamr@2
  1743
/** Handle to a drawable window.
williamr@2
  1744
williamr@2
  1745
This class cannot be constructed directly.
williamr@2
  1746
The two concrete derived classes, RWindow and RBackedUpWindow, allow
williamr@2
  1747
drawing but use different protocols because RWindow relies on the client to
williamr@2
  1748
redraw invalid areas.
williamr@2
  1749
williamr@2
  1750
@publishedAll
williamr@2
  1751
@released */
williamr@2
  1752
	{
williamr@2
  1753
protected:
williamr@2
  1754
	RDrawableWindow();
williamr@2
  1755
	RDrawableWindow(RWsSession &aWs);
williamr@2
  1756
public:
williamr@2
  1757
	IMPORT_C void Scroll(const TPoint &aOffset);
williamr@2
  1758
	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
williamr@2
  1759
	IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
williamr@2
  1760
	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
williamr@4
  1761
	IMPORT_C TRect GetDrawRect() const;
williamr@2
  1762
protected:
williamr@2
  1763
	void SetDrawRect(const TRect &aRect);
williamr@2
  1764
private:
williamr@2
  1765
	void doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode);
williamr@2
  1766
williamr@2
  1767
	TRect iDrawRect;
williamr@2
  1768
	};
williamr@2
  1769
williamr@2
  1770
/** Transparency policies
williamr@2
  1771
williamr@2
  1772
These policies are to control the behaviour of a transparent window.
williamr@2
  1773
@publishedAll
williamr@2
  1774
@released
williamr@2
  1775
@see RWindow::SetTransparencyPolicy() */
williamr@2
  1776
enum TWsTransparencyPolicy {
williamr@2
  1777
	/** Default behaviour. */
williamr@2
  1778
	ETransparencyDefault,
williamr@2
  1779
	/** Freeze the content of underneath the transparent window to prevent redraw everytime
williamr@2
  1780
	the overlying window changes. */
williamr@2
  1781
	ETransparencyFreezeUnder,
williamr@2
  1782
	};
williamr@2
  1783
williamr@2
  1784
class RWindow : public RDrawableWindow
williamr@2
  1785
/** Handle to a standard window.
williamr@2
  1786
williamr@2
  1787
An RWindow is a handle to a server-side window which can be displayed and
williamr@2
  1788
drawn to, and whose redraws are performed by the application.
williamr@2
  1789
williamr@2
  1790
@publishedAll
williamr@2
  1791
@released */
williamr@2
  1792
	{
williamr@2
  1793
public:
williamr@2
  1794
	IMPORT_C RWindow();
williamr@2
  1795
	IMPORT_C RWindow(RWsSession &aWs);
williamr@2
  1796
	IMPORT_C TInt Construct(const RWindowTreeNode &parent,TUint32 aHandle);
williamr@2
  1797
	IMPORT_C void BeginRedraw();
williamr@2
  1798
	IMPORT_C void BeginRedraw(const TRect &aRect);
williamr@2
  1799
	IMPORT_C void EndRedraw();
williamr@2
  1800
	IMPORT_C void Invalidate();
williamr@2
  1801
	IMPORT_C void Invalidate(const TRect &aRect);
williamr@4
  1802
	IMPORT_C void GetInvalidRegion(RRegion &aRegion) const;
williamr@2
  1803
	IMPORT_C void SetBackgroundColor(TRgb aColor);
williamr@2
  1804
	IMPORT_C void SetBackgroundColor();
williamr@2
  1805
	IMPORT_C void SetSize(const TSize &size);
williamr@2
  1806
	IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
williamr@2
  1807
	IMPORT_C void HandleTransparencyUpdate();
williamr@2
  1808
	IMPORT_C TInt SetTransparencyFactor(const TRgb& aTransparencyFactor);
williamr@2
  1809
	IMPORT_C TInt SetTransparencyBitmap(const CFbsBitmap& aTransparencyBitmap);
williamr@2
  1810
	IMPORT_C TInt SetTransparencyWsBitmap(const CWsBitmap& aTransparencyBitmap);
williamr@2
  1811
	IMPORT_C void SetNonTransparent();
williamr@2
  1812
	IMPORT_C void EnableRedrawStore(TBool aEnabled);
williamr@2
  1813
	IMPORT_C TInt SetTransparencyAlphaChannel();
williamr@2
  1814
	IMPORT_C TInt SetTransparentRegion(const TRegion& aRegion);
williamr@2
  1815
	IMPORT_C TInt SetTransparencyPolicy(TWsTransparencyPolicy aPolicy);
williamr@4
  1816
	IMPORT_C TBool IsRedrawStoreEnabled() const;
williamr@2
  1817
	IMPORT_C void EnableOSB(TBool);
williamr@2
  1818
	IMPORT_C void ClearRedrawStore();
williamr@2
  1819
	};
williamr@2
  1820
williamr@2
  1821
williamr@2
  1822
class RBackedUpWindow : public RDrawableWindow
williamr@2
  1823
/** Client-side handle to a drawable window with a backup bitmap.
williamr@2
  1824
williamr@2
  1825
A backed-up window is associated with a backup bitmap which retains the contents
williamr@2
  1826
of the window. When an area of the window is invalidated, the window server
williamr@2
  1827
uses the bitmap directly to update the window without requiring an application
williamr@2
  1828
redraw. The backup bitmap is owned by the font and bitmap server and resides
williamr@2
  1829
on the font and bitmap server's shared heap, which is accessible to all client
williamr@2
  1830
programs: functions are provided to allow the client application to access
williamr@2
  1831
this bitmap directly and perform updates to the window under application control.
williamr@2
  1832
williamr@2
  1833
@publishedAll
williamr@4
  1834
@deprecated
williamr@4
  1835
*/
williamr@2
  1836
	{
williamr@2
  1837
public:
williamr@2
  1838
	IMPORT_C RBackedUpWindow();
williamr@2
  1839
	IMPORT_C RBackedUpWindow(RWsSession &aWs);
williamr@2
  1840
	IMPORT_C TInt Construct(const RWindowTreeNode &parent,TDisplayMode aDisplayMode, TUint32 aHandle);
williamr@4
  1841
	IMPORT_C TInt BitmapHandle() const;
williamr@2
  1842
	IMPORT_C void UpdateScreen();
williamr@2
  1843
	IMPORT_C void UpdateScreen(const TRegion &aRegion);
williamr@2
  1844
	IMPORT_C void UpdateBackupBitmap();
williamr@2
  1845
	IMPORT_C void MaintainBackup();
williamr@2
  1846
	};
williamr@2
  1847
williamr@2
  1848
williamr@2
  1849
class RWindowGroup : public RWindowTreeNode
williamr@2
  1850
/** Client-side handle to a server-side window group.
williamr@2
  1851
williamr@2
  1852
@publishedAll
williamr@2
  1853
@released */
williamr@2
  1854
	{
williamr@2
  1855
public:
williamr@2
  1856
	IMPORT_C RWindowGroup();
williamr@2
  1857
	IMPORT_C RWindowGroup(RWsSession &aWs);
williamr@2
  1858
	IMPORT_C TInt Construct(TUint32 aClientHandle);
williamr@4
  1859
	IMPORT_C TInt Construct(TUint32 aClientHandle,CWsScreenDevice* aScreenDevice);
williamr@4
  1860
	IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable,CWsScreenDevice* aScreenDevice);
williamr@2
  1861
	IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable);
williamr@2
  1862
	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle);
williamr@2
  1863
	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
williamr@2
  1864
	IMPORT_C void AllowProcessToCreateChildWindowGroups(TUid aProcessSID);
williamr@2
  1865
	IMPORT_C void EnableReceiptOfFocus(TBool aState);
williamr@2
  1866
	IMPORT_C void AutoForeground(TBool aState);
williamr@2
  1867
	IMPORT_C void SetOrdinalPriorityAdjust(TInt aAdjust);
williamr@2
  1868
	IMPORT_C TInt SetOrdinalPositionErr(TInt aPos,TInt aOrdinalPriority);
williamr@2
  1869
	IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
williamr@2
  1870
	IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt aPriority);
williamr@2
  1871
	IMPORT_C void CancelCaptureKey(TInt32 aCaptureKey);
williamr@2
  1872
	IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier);
williamr@2
  1873
	IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier, TInt aPriority);
williamr@2
  1874
	IMPORT_C void CancelCaptureKeyUpAndDowns(TInt32 aCaptureKey);
williamr@2
  1875
	IMPORT_C TInt32 CaptureLongKey(TUint aInputKeyCode,TUint aOutputKeyCode,TUint aModifierMask,TUint aModifier
williamr@2
  1876
																										,TInt aPriority,TUint aFlags);
williamr@2
  1877
	IMPORT_C TInt32 CaptureLongKey(TTimeIntervalMicroSeconds32 aRepeatTime,TUint aInputKeyCode,TUint aOutputKeyCode
williamr@2
  1878
																	,TUint aModifierMask,TUint aModifier,TInt aPriority,TUint aFlags);
williamr@2
  1879
	IMPORT_C void CancelCaptureLongKey(TInt32 aCaptureKey);
williamr@2
  1880
	IMPORT_C TInt AddPriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
williamr@2
  1881
	IMPORT_C void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
williamr@2
  1882
	IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor);
williamr@2
  1883
	IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor, const TRect &aClipRect);
williamr@2
  1884
	IMPORT_C void CancelTextCursor();
williamr@2
  1885
	IMPORT_C void SetOwningWindowGroup(TInt aIdentifier);
williamr@2
  1886
	IMPORT_C void DefaultOwningWindow();
williamr@2
  1887
	IMPORT_C TInt SetName(const TDesC &aName);
williamr@2
  1888
	IMPORT_C TInt Name(TDes &aWindowName) const;
williamr@2
  1889
	IMPORT_C TInt Identifier() const;
williamr@2
  1890
	IMPORT_C void DisableKeyClick(TBool aState);
williamr@2
  1891
	IMPORT_C TInt EnableScreenChangeEvents();
williamr@2
  1892
	IMPORT_C void DisableScreenChangeEvents();
williamr@2
  1893
	IMPORT_C void SimulatePointerEvent(TRawEvent aEvent);
williamr@4
  1894
	IMPORT_C void SimulateAdvancedPointerEvent(TRawEvent aEvent);
williamr@2
  1895
	IMPORT_C TInt ClearChildGroup();
williamr@2
  1896
	IMPORT_C TInt SetChildGroup(TInt aId);
williamr@2
  1897
private:
williamr@2
  1898
	TInt32 doCaptureKey(TUint aKey, TUint aModifierMask, TUint aModifiers, TInt aPriority, TInt aOpcode);
williamr@2
  1899
	void doCancelCaptureKey(TInt32 aCaptureKeyHandle, TInt aOpcode);
williamr@4
  1900
	TInt Construct(TInt aIdOfParentWindowGroup, TUint32 aClientHandle, TBool aIsFocusable, CWsScreenDevice* aScreenDevice);
williamr@2
  1901
	};
williamr@2
  1902
williamr@2
  1903
williamr@2
  1904
class CWsBitmap : public CFbsBitmap, public MWsClientClass
williamr@2
  1905
/** Window server bitmap.
williamr@2
  1906
williamr@2
  1907
This is a bitmap to which the window server already has a handle. Functions
williamr@2
  1908
which take a window server bitmap are faster than equivalent functions which
williamr@2
  1909
take a CFbsBitmap.
williamr@2
  1910
williamr@2
  1911
@publishedAll
williamr@2
  1912
@released */
williamr@2
  1913
	{
williamr@2
  1914
public:
williamr@2
  1915
	IMPORT_C CWsBitmap();
williamr@2
  1916
	IMPORT_C CWsBitmap(RWsSession &aWs);
williamr@2
  1917
	IMPORT_C ~CWsBitmap();
williamr@2
  1918
	IMPORT_C TInt Create(const TSize& aSizeInPixels,TDisplayMode aDispMode);
williamr@2
  1919
	IMPORT_C TInt Duplicate(TInt aHandle);
williamr@2
  1920
	IMPORT_C TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded=ETrue);
williamr@2
  1921
	IMPORT_C void InternalizeL(RReadStream& aStream);
williamr@2
  1922
	IMPORT_C void Reset();
williamr@2
  1923
private:
williamr@2
  1924
	TInt createWsBitmap(TInt aErr);
williamr@2
  1925
	};
williamr@2
  1926
williamr@2
  1927
class RWsGraphicMsgBuf;
williamr@2
  1928
williamr@2
  1929
class TWsGraphicMsgFixedBase
williamr@2
  1930
/** Base class for fixed-size messages to be attached to CWindowGc::DrawWsGraphic commands
williamr@2
  1931
@publishedAll
williamr@2
  1932
@released
williamr@2
  1933
*/	{
williamr@2
  1934
public:
williamr@2
  1935
	IMPORT_C TPtrC8 Pckg() const;
williamr@2
  1936
	IMPORT_C TUid TypeId() const;
williamr@2
  1937
	IMPORT_C TInt Size() const;
williamr@2
  1938
protected:
williamr@2
  1939
	IMPORT_C TWsGraphicMsgFixedBase(TUid aTypeId,TInt aSizeOfDerived);
williamr@2
  1940
private:
williamr@2
  1941
	const TUid iTypeId;
williamr@2
  1942
	const TInt iSize;
williamr@2
  1943
	};
williamr@2
  1944
williamr@2
  1945
class RWsGraphicMsgBuf: private RBuf8
williamr@2
  1946
/** Utility class for building data buffers to be attached to CWindowGc::DrawWsGraphic commands
williamr@2
  1947
Useful when there is more than one piece of data to be attached to the draw command
williamr@2
  1948
@publishedAll
williamr@2
  1949
@released */
williamr@2
  1950
	{
williamr@2
  1951
public:
williamr@2
  1952
	IMPORT_C RWsGraphicMsgBuf();
williamr@2
  1953
	using RBuf8::Close;
williamr@2
  1954
	using RBuf8::CleanupClosePushL;
williamr@2
  1955
	IMPORT_C TInt Append(TUid aTypeId,const TDesC8& aData);
williamr@2
  1956
	IMPORT_C TInt Append(TUid aTypeId,const TDesC16& aData);
williamr@2
  1957
	IMPORT_C TInt Append(TUid aTypeId,TInt aLen,TPtr8& aPtr);
williamr@2
  1958
	IMPORT_C TInt Append(const TWsGraphicMsgFixedBase& aMsg);
williamr@2
  1959
	IMPORT_C void Remove(TInt aIndex);
williamr@2
  1960
	IMPORT_C TInt Count() const;
williamr@2
  1961
	IMPORT_C TUid TypeId(TInt aIndex) const;
williamr@2
  1962
	IMPORT_C TPtrC8 Data(TInt aIndex) const;
williamr@2
  1963
	IMPORT_C TPtr8 Data(TInt aIndex);
williamr@2
  1964
	IMPORT_C void GetFixedMsg(TWsGraphicMsgFixedBase& aMsg,TInt aIndex) const;
williamr@2
  1965
	IMPORT_C const TDesC8& Pckg() const;
williamr@2
  1966
private:
williamr@2
  1967
	TInt ExpandForAppend(TInt aDataLen);
williamr@2
  1968
	void WriteHeader(TUid aUid,TInt aLen);
williamr@2
  1969
	TInt IntAt(TInt aOfs) const;
williamr@2
  1970
private:
williamr@2
  1971
	TInt iRMsgBufSpare[2];
williamr@2
  1972
	};
williamr@2
  1973
williamr@2
  1974
williamr@2
  1975
class CWindowGc : public CBitmapContext, public MWsClientClass
williamr@2
  1976
/** Window graphics context.
williamr@2
  1977
williamr@2
  1978
Most window graphics context drawing functions map to equivalent CFbsBitGc
williamr@2
  1979
functions. They are implemented on the screen with any co-ordinates being
williamr@2
  1980
relative to the top left corner of the window. However extra clipping is applied.
williamr@2
  1981
The drawing will always be clipped to the visible part of the window. In addition
williamr@2
  1982
it will be clipped to the non-invalid part if you are not doing a redraw and
williamr@2
  1983
to the region being validated if you are doing a redraw.
williamr@2
  1984
williamr@2
  1985
Note:
williamr@2
  1986
williamr@2
  1987
In general, server side functions which encounter conditions which would normally
williamr@2
  1988
cause a leave, do not leave but instead return an error value indicating the
williamr@2
  1989
leave condition. In this way the leave can be handled on the appropriate side
williamr@2
  1990
of the client/server boundary. For example, a client can choose to wrap server
williamr@2
  1991
calls with User::LeaveIfError(), which causes a leave with the specified
williamr@2
  1992
error.
williamr@2
  1993
williamr@2
  1994
The above advice is true of many functions in this class, and in its derived
williamr@2
  1995
classes.
williamr@2
  1996
williamr@2
  1997
@publishedAll
williamr@2
  1998
@released
williamr@2
  1999
@see CGraphicsContext */
williamr@2
  2000
	{
williamr@2
  2001
	friend class CWsScreenDevice;
williamr@2
  2002
public:
williamr@4
  2003
	/** Defines possible clockwise rotation values.
williamr@4
  2004
	
williamr@4
  2005
	WARNING: Enum for internal and partner use ONLY.  Compatibility is not guaranteed in future releases.
williamr@4
  2006
williamr@4
  2007
	@prototype
williamr@4
  2008
	*/
williamr@4
  2009
	enum TGraphicsRotation
williamr@4
  2010
		{
williamr@4
  2011
		/** No rotation. */
williamr@4
  2012
		EGraphicsRotationNone,
williamr@4
  2013
		/** A 90 degree rotation. */
williamr@4
  2014
		EGraphicsRotation90,
williamr@4
  2015
		/** A 180 degree rotation. */
williamr@4
  2016
		EGraphicsRotation180,
williamr@4
  2017
		/** A 270 degree rotation. */
williamr@4
  2018
		EGraphicsRotation270
williamr@4
  2019
		};	
williamr@4
  2020
williamr@2
  2021
	IMPORT_C CWindowGc(CWsScreenDevice *aDevice);
williamr@2
  2022
	IMPORT_C virtual ~CWindowGc();
williamr@2
  2023
	IMPORT_C virtual TInt Construct();
williamr@2
  2024
	IMPORT_C virtual void Activate(RDrawableWindow &aDevice);
williamr@2
  2025
	IMPORT_C virtual void Deactivate();
williamr@2
  2026
//====================FROM CGraphicsContext.H===============================
williamr@2
  2027
	IMPORT_C virtual CGraphicsDevice* Device() const;
williamr@2
  2028
	IMPORT_C virtual void SetOrigin(const TPoint &aPoint=TPoint(0,0));
williamr@2
  2029
	IMPORT_C virtual void SetDrawMode(TDrawMode aDrawingMode);
williamr@2
  2030
	IMPORT_C virtual void SetClippingRect(const TRect& aRect);
williamr@2
  2031
	IMPORT_C virtual void CancelClippingRect();
williamr@2
  2032
	IMPORT_C virtual void Reset();
williamr@2
  2033
williamr@2
  2034
	IMPORT_C virtual void UseFont(const CFont *aFont);
williamr@2
  2035
	IMPORT_C virtual void DiscardFont();
williamr@2
  2036
	IMPORT_C virtual void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
williamr@2
  2037
	IMPORT_C virtual void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
williamr@2
  2038
// Used to do justified text properly
williamr@2
  2039
	IMPORT_C virtual void SetWordJustification(TInt aExcessWidth,TInt aNumGaps);
williamr@2
  2040
// Used primarily to get accurate WYSIWYG
williamr@2
  2041
	IMPORT_C virtual void SetCharJustification(TInt aExcessWidth,TInt aNumChars);
williamr@2
  2042
williamr@2
  2043
	IMPORT_C virtual void SetPenColor(const TRgb &aColor);
williamr@2
  2044
	IMPORT_C virtual void SetPenStyle(TPenStyle aPenStyle);
williamr@2
  2045
	IMPORT_C virtual void SetPenSize(const TSize& aSize);
williamr@2
  2046
williamr@2
  2047
	IMPORT_C virtual void SetBrushColor(const TRgb &aColor);
williamr@2
  2048
	IMPORT_C virtual void SetBrushStyle(TBrushStyle aBrushStyle);
williamr@2
  2049
	IMPORT_C virtual void SetBrushOrigin(const TPoint &aOrigin);
williamr@2
  2050
	IMPORT_C virtual void UseBrushPattern(const CFbsBitmap *aDevice);
williamr@2
  2051
	IMPORT_C virtual void DiscardBrushPattern();
williamr@2
  2052
//
williamr@2
  2053
// Move the internal position, as used by DrawLineTo & DrawLineBy, and set by MoveTo,
williamr@2
  2054
// MoveBy, DrawLine, DrawLineTo, DrawLineBy and DrawPolyline
williamr@2
  2055
	IMPORT_C virtual void MoveTo(const TPoint &aPoint);
williamr@2
  2056
	IMPORT_C virtual void MoveBy(const TPoint &aPoint);
williamr@2
  2057
	IMPORT_C virtual void Plot(const TPoint &aPoint);
williamr@2
  2058
//
williamr@2
  2059
//  Line drawing subject to pen color, width and style and draw mode
williamr@2
  2060
	IMPORT_C virtual void DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
williamr@2
  2061
	IMPORT_C virtual void DrawLine(const TPoint &aPoint1,const TPoint &aPoint2);
williamr@2
  2062
	IMPORT_C virtual void DrawLineTo(const TPoint &aPoint);
williamr@2
  2063
	IMPORT_C virtual void DrawLineBy(const TPoint &aPoint);
williamr@2
  2064
	IMPORT_C virtual void DrawPolyLine(const CArrayFix<TPoint> *aPointList);
williamr@2
  2065
	IMPORT_C virtual void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints);
williamr@2
  2066
//
williamr@2
  2067
// Filled outlines
williamr@2
  2068
// Outlines subject to pen color, width and style and draw mode
williamr@2
  2069
// (set pen to ENullPen for no outline)
williamr@2
  2070
// Fill subject to brush style (color, hash or pattern) and origin and
williamr@2
  2071
// drawing mode (set brush to ENullBrush for no fill)
williamr@2
  2072
	IMPORT_C virtual void DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
williamr@2
  2073
	IMPORT_C virtual void DrawEllipse(const TRect &aRect);
williamr@2
  2074
	IMPORT_C virtual void DrawRect(const TRect &aRect);
williamr@2
  2075
	IMPORT_C virtual void DrawRoundRect(const TRect &aRect,const TSize &aEllipse);
williamr@2
  2076
	IMPORT_C virtual TInt DrawPolygon(const CArrayFix<TPoint> *aPointList,TFillRule aFillRule=EAlternate);
williamr@2
  2077
	IMPORT_C virtual TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate);
williamr@2
  2078
//
williamr@2
  2079
// Uses the bitmap's Twips size and does a "stretch" blit in general
williamr@2
  2080
	IMPORT_C virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice);
williamr@2
  2081
	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice);
williamr@2
  2082
	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect);
williamr@2
  2083
	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask);
williamr@2
  2084
	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CWsBitmap* aBitmap, const TRect& aSourceRect, const CWsBitmap* aMaskBitmap, TBool aInvertMask);
williamr@4
  2085
williamr@4
  2086
// Required as not all DrawText and DrawTextVertical functions are implemented in CWindowGc
williamr@4
  2087
	using CBitmapContext::DrawText;
williamr@4
  2088
	using CBitmapContext::DrawTextVertical;
williamr@2
  2089
//
williamr@2
  2090
// Text drawing subject to drawing mode
williamr@2
  2091
// Subject to used font, pen color, drawing mode,
williamr@2
  2092
// word and char justification
williamr@2
  2093
	IMPORT_C virtual void DrawText(const TDesC &aBuf,const TPoint &aPos);
williamr@2
  2094
//
williamr@2
  2095
// Subject to same as above plus brush for background
williamr@2
  2096
// (set brush to ENullBrush for no effect on background)
williamr@2
  2097
	IMPORT_C virtual void DrawText(const TDesC &aBuf,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
williamr@2
  2098
//================Extra functions from CBitmapContext==============
williamr@2
  2099
	IMPORT_C virtual void Clear();
williamr@2
  2100
	IMPORT_C virtual void Clear(const TRect &aRect);
williamr@2
  2101
	IMPORT_C virtual void CopyRect(const TPoint &anOffset,const TRect &aRect);
williamr@2
  2102
	IMPORT_C virtual void BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap);
williamr@2
  2103
	IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CFbsBitmap *aBitmap, const TRect &aSource);
williamr@2
  2104
	IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
williamr@2
  2105
	IMPORT_C virtual void BitBlt(const TPoint &aPoint, const CWsBitmap *aBitmap);
williamr@2
  2106
	IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CWsBitmap *aBitmap, const TRect &aSource);
williamr@2
  2107
	IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CWsBitmap *aBitmap,const TRect& aSourceRect,const CWsBitmap *aMaskBitmap,TBool aInvertMask);
williamr@2
  2108
	IMPORT_C virtual void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs=2,TBool aMapForwards=ETrue);
williamr@2
  2109
williamr@2
  2110
	IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
williamr@2
  2111
	IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
williamr@2
  2112
//=================Extra functions specific to wserv GDI==============
williamr@2
  2113
	IMPORT_C virtual void SetDitherOrigin(const TPoint& aPoint);
williamr@2
  2114
	IMPORT_C virtual TInt SetClippingRegion(const TRegion &aRegion);
williamr@2
  2115
	IMPORT_C virtual void CancelClippingRegion();
williamr@2
  2116
	IMPORT_C virtual void SetOpaque(TBool aDrawOpaque=ETrue);
williamr@2
  2117
//=================Functions also supplied by CFbsBitGc==============
williamr@2
  2118
	IMPORT_C virtual void SetFaded(TBool aFaded);
williamr@2
  2119
	IMPORT_C virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
williamr@2
  2120
	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
williamr@2
  2121
	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
williamr@4
  2122
//
williamr@4
  2123
	IMPORT_C TAny* Interface(TUid aInterfaceId);
williamr@4
  2124
	IMPORT_C const TAny* Interface(TUid aInterfaceId) const;
williamr@2
  2125
	
williamr@2
  2126
protected:	
williamr@2
  2127
	IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
williamr@2
  2128
	
williamr@2
  2129
private:	
williamr@2
  2130
williamr@2
  2131
	IMPORT_C void Reserved_CGraphicsContext_2();
williamr@2
  2132
williamr@2
  2133
	IMPORT_C void Reserved_CBitmapContext_1();
williamr@2
  2134
	IMPORT_C void Reserved_CBitmapContext_2();
williamr@2
  2135
	IMPORT_C void Reserved_CBitmapContext_3();
williamr@2
  2136
williamr@2
  2137
public:
williamr@2
  2138
	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect);
williamr@2
  2139
	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect,const TDesC8& aData);
williamr@2
  2140
private:
williamr@2
  2141
	IMPORT_C virtual void Reserved_CWindowGc_3();
williamr@2
  2142
	IMPORT_C virtual void Reserved_CWindowGc_4();
williamr@2
  2143
	IMPORT_C virtual void Reserved_CWindowGc_5();
williamr@2
  2144
williamr@4
  2145
//=============================================================
williamr@2
  2146
private: // Private code
williamr@2
  2147
	TRgb Color(TInt aOpcode)const;
williamr@2
  2148
	void SetJustification(TInt aExcessWidth,TInt aNumGaps, TInt aOpcode);
williamr@2
  2149
	void DrawArcOrPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd, TInt aOpcode);
williamr@2
  2150
	void doDrawPolyLine(const CArrayFix<TPoint> *aPointArray, const TPoint* aPointList,TInt aNumPoints);
williamr@2
  2151
	TInt doDrawPolygon(const CArrayFix<TPoint> *aPointArray,const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
williamr@2
  2152
	void WriteTextPos(TInt aOpcode,TInt aOpcodePtr,const TPoint &aPos,const TDesC &aBuf) const;
williamr@2
  2153
	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
williamr@2
  2154
	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC8 &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
williamr@4
  2155
	TInt APIExGetUnderlineMetrics(TAny*& aOutput);
williamr@2
  2156
	TInt APIExSetShadowColor(TAny* aShadowColor);
williamr@4
  2157
	TInt APIExGetShadowColor(TAny*& aOutput);
williamr@4
  2158
	// New DrawText API's that take in context
williamr@4
  2159
	TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TPoint &aPos);
williamr@4
  2160
	TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
williamr@4
  2161
	TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPos,TBool aUp);
williamr@4
  2162
	TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
williamr@4
  2163
	TInt APIExInterface(TAny*& aInterface, TUid aInterfaceId);
williamr@4
  2164
williamr@4
  2165
	void DrawResource(const TPoint& aPos, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
williamr@4
  2166
	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
williamr@4
  2167
	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TRect& aSrcRect, TGraphicsRotation aRotation=EGraphicsRotationNone);
williamr@4
  2168
	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TDesC8& aParam);
williamr@4
  2169
	
williamr@2
  2170
private: // Private data
williamr@4
  2171
	class CPimpl;
williamr@4
  2172
	CPimpl* iPimpl;
williamr@2
  2173
	CWsScreenDevice *iDevice;
williamr@2
  2174
	};
williamr@2
  2175
williamr@2
  2176
williamr@2
  2177
class CWsScreenDevice : public CBitmapDevice, public MWsClientClass
williamr@2
  2178
/** Software device screen.
williamr@2
  2179
williamr@2
  2180
An object of this class can be used to enquire or set parameters of the software
williamr@2
  2181
screen, and determine the physical limits of the device.
williamr@2
  2182
williamr@2
  2183
CWsScreenDevice gives access to the list of screen modes. These are the combinations
williamr@2
  2184
of screen rotation and screen size supported by the device. One of them is
williamr@2
  2185
selected as the current screen mode. The possible screen modes are initialised
williamr@2
  2186
in wsini.ini.
williamr@2
  2187
williamr@2
  2188
@publishedAll
williamr@2
  2189
@released
williamr@2
  2190
@see CFbsScreenDevice */
williamr@2
  2191
	{
williamr@2
  2192
public:
williamr@2
  2193
	/**	Whether or not to include sprites when comparing areas of the screen*/
williamr@2
  2194
	enum TSpriteInCompare
williamr@2
  2195
		{
williamr@2
  2196
		/** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
williamr@2
  2197
		const TRect &aRect2,TUint aFlags).
williamr@2
  2198
		When called with the value ERemoveSprite if there are any sprites visible in the areas of the screen being compared then these
williamr@2
  2199
		will not be included in the comparison.
williamr@2
  2200
		The function CWsScreenDevice::RectCompare(const TRect &aRect1,const TRect &aRect2) will not include
williamr@2
  2201
		sprites in the comparison.
williamr@2
  2202
		*/
williamr@2
  2203
		ERemoveSprite=0,
williamr@2
  2204
		/**	This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
williamr@2
  2205
		const TRect &aRect2,TUint aFlags).
williamr@2
  2206
		When called with the value EIncludeSprite if there are any sprites visible in the areas of the screen being compared then these
williamr@2
  2207
		will be included in the comparison.*/
williamr@2
  2208
		EIncludeSprite=1,
williamr@2
  2209
		/**	This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
williamr@2
  2210
		const TRect &aRect2,TUint aFlags). 
williamr@2
  2211
		When called with the value EIncludeTextCursor if there are any text cursors visible in the areas of the screen being compared then these 
williamr@2
  2212
		will be included in the comparison.*/
williamr@2
  2213
		EIncludeTextCursor=2
williamr@2
  2214
		};
williamr@2
  2215
public:
williamr@2
  2216
	IMPORT_C CWsScreenDevice();
williamr@2
  2217
	IMPORT_C CWsScreenDevice(RWsSession &aWs);
williamr@2
  2218
	IMPORT_C ~CWsScreenDevice();
williamr@2
  2219
	IMPORT_C TInt Construct();
williamr@2
  2220
	IMPORT_C TInt Construct( TInt aDefaultScreenNumber ) ;
williamr@4
  2221
	IMPORT_C TAny* GetInterface(TUint aInterfaceId);
williamr@4
  2222
	inline const TAny* GetInterface(TUint aInterfaceId) const;
williamr@4
  2223
	IMPORT_C TBool IsModeDynamic(TInt aSizeMode) const;
williamr@4
  2224
	IMPORT_C TBool IsCurrentModeDynamic() const;
williamr@2
  2225
//==== From CGraphicsDevice ====//
williamr@2
  2226
	IMPORT_C TDisplayMode DisplayMode() const;
williamr@2
  2227
	IMPORT_C TSize SizeInPixels() const;
williamr@2
  2228
	IMPORT_C TSize SizeInTwips() const;
williamr@2
  2229
	IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
williamr@2
  2230
	IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
williamr@2
  2231
	IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
williamr@2
  2232
	IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
williamr@2
  2233
	IMPORT_C TRect PointerRect() const;
williamr@2
  2234
	IMPORT_C TInt CreateContext(CGraphicsContext *&aGc);
williamr@2
  2235
	inline TInt CreateContext(CWindowGc*& aGc);
williamr@2
  2236
	IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
williamr@2
  2237
	IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
williamr@2
  2238
	IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
williamr@2
  2239
	IMPORT_C TInt NumTypefaces() const;
williamr@2
  2240
	IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
williamr@2
  2241
	IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
williamr@2
  2242
// ==== From CBitmapDevice ====//
williamr@2
  2243
	IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPixel) const;
williamr@2
  2244
	IMPORT_C void GetScanLine(TDes8& aScanLine,const TPoint& aStartPixel,TInt aPixelLength, TDisplayMode aDispMode) const;
williamr@2
  2245
	IMPORT_C TInt AddFile(const TDesC& aName,TInt& aId);
williamr@2
  2246
	IMPORT_C void RemoveFile(TInt aId=0);
williamr@2
  2247
	IMPORT_C virtual TInt GetNearestFontInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
williamr@2
  2248
	IMPORT_C virtual TInt GetNearestFontToDesignHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
williamr@2
  2249
	IMPORT_C virtual TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
williamr@2
  2250
	IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
williamr@2
  2251
	IMPORT_C void ReleaseFont(CFont* aFont);
williamr@2
  2252
//===== From CFbsScreenDevice ====//
williamr@2
  2253
	IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
williamr@2
  2254
	IMPORT_C void SetPalette(CPalette* aPalette);
williamr@2
  2255
	IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
williamr@2
  2256
//===== Extra functions ====//
williamr@2
  2257
	IMPORT_C TInt SetCustomPalette(const CPalette* aPalette);
williamr@2
  2258
	IMPORT_C TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
williamr@4
  2259
	IMPORT_C TBool RectCompare(const TRect &aRect1,const TRect &aRect2) const;
williamr@2
  2260
	IMPORT_C TBool RectCompare(const TRect& aRect1,const TRect &aRect2,TUint aFlags) const;
williamr@2
  2261
	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
williamr@2
  2262
	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
williamr@2
  2263
	IMPORT_C TInt SetBackLight(TBool aBackLight);
williamr@2
  2264
//===== Screen Rotation functions ====//
williamr@2
  2265
	IMPORT_C void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSizeAndRotation);
williamr@2
  2266
	IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &aSizeAndRotation) const;
williamr@2
  2267
	IMPORT_C void SetScreenSizeAndRotation(const TPixelsAndRotation &aSizeAndRotation);
williamr@2
  2268
	IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation) const;
williamr@2
  2269
	IMPORT_C TScreenModeEnforcement ScreenModeEnforcement() const;
williamr@2
  2270
	IMPORT_C void SetScreenModeEnforcement(TScreenModeEnforcement aMode) const;
williamr@2
  2271
	IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsTwipsAndRotation &aSizeAndRotation) const;
williamr@2
  2272
	IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsAndRotation &aSizeAndRotation) const;
williamr@2
  2273
	IMPORT_C void SetCurrentRotations(TInt aMode, CFbsBitGc::TGraphicsOrientation aRotation) const;
williamr@2
  2274
	IMPORT_C TInt GetRotationsList(TInt aMode, CArrayFixFlat<TInt> *aRotationList) const;
williamr@2
  2275
	IMPORT_C TInt NumScreenModes() const;
williamr@2
  2276
	IMPORT_C void SetScreenMode(TInt aMode);
williamr@2
  2277
	IMPORT_C TInt CurrentScreenMode() const;
williamr@2
  2278
	IMPORT_C void SetAppScreenMode(TInt aMode);
williamr@2
  2279
	IMPORT_C TPoint GetDefaultScreenModeOrigin() const;
williamr@2
  2280
	IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;
williamr@2
  2281
	IMPORT_C TSize GetCurrentScreenModeScale() const;
williamr@2
  2282
	IMPORT_C TSize GetScreenModeScale(TInt aMode) const;
williamr@2
  2283
	IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;
williamr@2
  2284
	IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;
williamr@4
  2285
	IMPORT_C TInt GetScreenSizeModeList(RArray<TInt>* aModeList) const;
williamr@2
  2286
	IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;
williamr@2
  2287
//===== Used for testing purpose only ====//
williamr@2
  2288
	IMPORT_C TSizeMode GetCurrentScreenModeAttributes() const;
williamr@2
  2289
	IMPORT_C void SetCurrentScreenModeAttributes(const TSizeMode &aModeAtt);
williamr@2
  2290
	IMPORT_C TInt GetScreenNumber() const;
williamr@4
  2291
private:
williamr@4
  2292
	CFbsTypefaceStore* TypeFaceStore()const;
williamr@4
  2293
	TSize DisplaySizeInPixels()const;
williamr@4
  2294
	TSize PhysicalScreenSizeInTwips()const;
williamr@2
  2295
private: // Private data
williamr@4
  2296
	class CScrDevExtension;				//Implements extension interfaces, including and replacing typeface store
williamr@4
  2297
	CScrDevExtension* iExtension;
williamr@2
  2298
	TSize iPhysicalScreenSizeInTwips;
williamr@2
  2299
	TSize iDisplaySizeInPixels;
williamr@2
  2300
	friend class CWindowGc;
williamr@2
  2301
	};
williamr@2
  2302
williamr@2
  2303
williamr@2
  2304
class RWsSpriteBase : public MWsClientClass
williamr@2
  2305
// Client side class base class for sprites and pointer cursors
williamr@2
  2306
/** Sprite base class.
williamr@2
  2307
williamr@2
  2308
Unless stated otherwise, references to sprites in the documentation for this class also
williamr@2
  2309
apply to pointer cursors.
williamr@2
  2310
williamr@2
  2311
@publishedAll
williamr@2
  2312
@released
williamr@2
  2313
@see RWsSprite
williamr@2
  2314
@see RWsPointerCursor */
williamr@2
  2315
	{
williamr@2
  2316
protected:
williamr@2
  2317
	IMPORT_C RWsSpriteBase();
williamr@2
  2318
	IMPORT_C RWsSpriteBase(RWsSession &aWs);
williamr@2
  2319
public:
williamr@2
  2320
	IMPORT_C TInt Activate();
williamr@2
  2321
	IMPORT_C TInt AppendMember(const TSpriteMember &aMemberData);
williamr@2
  2322
	IMPORT_C void UpdateMember(TInt aIndex);
williamr@2
  2323
	IMPORT_C TInt UpdateMember(TInt aIndex, const TSpriteMember &aMemberData);
williamr@2
  2324
	IMPORT_C void Close();
williamr@2
  2325
	};
williamr@2
  2326
williamr@2
  2327
williamr@2
  2328
class RWsSprite : public RWsSpriteBase
williamr@2
  2329
/** Sprite.
williamr@2
  2330
williamr@2
  2331
This class defines functions to create and initialise a sprite, and to set
williamr@2
  2332
its position.
williamr@2
  2333
williamr@2
  2334
@publishedAll
williamr@2
  2335
@released */
williamr@2
  2336
	{
williamr@2
  2337
public:
williamr@2
  2338
	IMPORT_C RWsSprite();
williamr@2
  2339
	IMPORT_C RWsSprite(RWsSession &aWs);
williamr@2
  2340
	IMPORT_C TInt Construct(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aFlags);
williamr@2
  2341
	IMPORT_C void SetPosition(const TPoint &aPos);
williamr@2
  2342
	};
williamr@2
  2343
williamr@2
  2344
williamr@2
  2345
class RWsPointerCursor : public RWsSpriteBase
williamr@2
  2346
/** Pointer cursor.
williamr@2
  2347
williamr@2
  2348
The pointer cursor is created in a similar way to a sprite. After creating it,
williamr@2
  2349
one or more sprite members containing the bitmaps to be displayed are added.
williamr@2
  2350
williamr@2
  2351
After a pointer cursor has been created and activated, it does not become
williamr@2
  2352
visible until the application calls RWindowTreeNode::SetPointerCursor() or
williamr@2
  2353
RWindowTreeNode::SetCustomPointerCursor(). The pointer cursor's origin automatically
williamr@4
  2354
tracks the position of the pointing device, or position of emulated single pointer if there
williamr@4
  2355
are more pointers in the system (see documentation of RWindowBase::EnableAdvancedPointers()
williamr@4
  2356
for more details), and the origin forms the pointer cursor's "hot spot", i.e., the point 
williamr@4
  2357
whose co-ordinates are sent to the client if a pointer event occurs. 
williamr@4
  2358
If the pointer cursor's bitmap needs to extend to the left or upwards from the pointer 
williamr@4
  2359
position, its sprite member should be given a negative offset in TSpriteMember::iOffset.
williamr@2
  2360
williamr@2
  2361
Note:
williamr@2
  2362
williamr@2
  2363
Pointer cursors are rarely used in pure pen architectures, but they are supported
williamr@2
  2364
for mouse or tablet use.
williamr@2
  2365
williamr@4
  2366
@see RWindowBase::EnableAdvancedPointers()
williamr@4
  2367
williamr@2
  2368
@publishedAll
williamr@2
  2369
@released */
williamr@2
  2370
	{
williamr@2
  2371
public:
williamr@2
  2372
	IMPORT_C RWsPointerCursor();
williamr@2
  2373
	IMPORT_C RWsPointerCursor(RWsSession &aWs);
williamr@2
  2374
	IMPORT_C TInt Construct(TInt aFlags);
williamr@2
  2375
	};
williamr@2
  2376
williamr@2
  2377
williamr@2
  2378
class RAnim;
williamr@2
  2379
williamr@2
  2380
williamr@2
  2381
class RAnimDll : public MWsClientClass
williamr@2
  2382
/** Client-side interface to the server-side animation DLL.
williamr@2
  2383
williamr@2
  2384
This is the client side class matching the server side CAnimDLL class. It
williamr@2
  2385
provides functions to create, load, close and destroy a server-side CAnimDll
williamr@2
  2386
object.
williamr@2
  2387
williamr@2
  2388
@publishedAll
williamr@2
  2389
@released
williamr@2
  2390
@see CreateCAnimDllL()
williamr@2
  2391
@see CAnimDll */
williamr@2
  2392
	{
williamr@2
  2393
public:
williamr@2
  2394
	IMPORT_C RAnimDll();
williamr@2
  2395
	IMPORT_C virtual ~RAnimDll();
williamr@2
  2396
	IMPORT_C RAnimDll(RWsSession &aWs);
williamr@2
  2397
	IMPORT_C TInt Load(const TDesC &aFileName);
williamr@2
  2398
	IMPORT_C void Destroy();
williamr@2
  2399
	IMPORT_C virtual void Close();
williamr@2
  2400
private:
williamr@2
  2401
	TInt CommandReply(TInt aHandle, TInt aOpcode, const TIpcArgs* aIpcArgs=NULL);
williamr@2
  2402
	TInt CommandReply(TInt aHandle, TInt aOpcode, const TDesC8& aArgs, const TIpcArgs* aIpcArgs=NULL);
williamr@2
  2403
	void Command(TInt aHandle, TInt aOpcode, const TPtrC8 &aArgs);
williamr@2
  2404
	void Command(TInt aHandle, TInt aOpcode);
williamr@2
  2405
	void AsyncCommandReply(TRequestStatus& aStatus, TInt aOpcode, TIpcArgs& aIpcArgs);
williamr@2
  2406
	TInt CreateInstance(TInt32& aHandle, const MWsClientClass &aDevice, TInt aType, const TDesC8 &aArgs, TInt aOpcode, const TIpcArgs* aIpcArgs);
williamr@2
  2407
	void DestroyInstance(TInt aHandle);
williamr@2
  2408
private:
williamr@2
  2409
	friend class RAnim;
williamr@2
  2410
	};
williamr@2
  2411
williamr@2
  2412
williamr@2
  2413
class RAnim
williamr@2
  2414
/** Client-side handle to a server-side animation class.
williamr@2
  2415
williamr@2
  2416
This class should be sub-classed to provide a client side interface to the
williamr@2
  2417
server side animation DLL. The server side animation DLL is derived from CAnim.
williamr@2
  2418
williamr@2
  2419
@publishedAll
williamr@2
  2420
@released */
williamr@2
  2421
	{
williamr@2
  2422
public:
williamr@2
  2423
	IMPORT_C virtual ~RAnim();
williamr@2
  2424
	IMPORT_C virtual void Close();
williamr@2
  2425
	IMPORT_C void Destroy();
williamr@2
  2426
protected:
williamr@2
  2427
	IMPORT_C RAnim();
williamr@2
  2428
	IMPORT_C RAnim(RAnimDll &aDll);
williamr@2
  2429
	IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams);
williamr@2
  2430
	IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
williamr@2
  2431
	IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams);
williamr@2
  2432
	IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
williamr@2
  2433
	IMPORT_C TInt CommandReply(TInt aOpcode);
williamr@2
  2434
	IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
williamr@2
  2435
	IMPORT_C TInt CommandReply(TInt aOpcode, const TDesC8& aArgs, const TIpcArgs& aIpcArgs);
williamr@2
  2436
	IMPORT_C void Command(TInt aOpcode, const TPtrC8 &aArgs);
williamr@2
  2437
	IMPORT_C void Command(TInt aOpcode);
williamr@2
  2438
	IMPORT_C void AsyncCommandReply(TRequestStatus& aRequestStatus,TInt aOpcode, const TIpcArgs& aIpcArgs);
williamr@2
  2439
private:
williamr@2
  2440
	TInt32 iHandle;
williamr@2
  2441
	RAnimDll *iAnimDll;
williamr@2
  2442
	};
williamr@2
  2443
williamr@2
  2444
class CDsaMsgQueue;
williamr@2
  2445
williamr@2
  2446
class RDirectScreenAccess : public MWsClientClass
williamr@2
  2447
/** The interface between an application that directly accesses the screen and
williamr@2
  2448
the window server.
williamr@2
  2449
williamr@2
  2450
Note that most applications that need to access the screen directly should
williamr@2
  2451
use CDirectScreenAccess instead. RDirectScreenAccess only needs to be used
williamr@2
  2452
directly by applications without access to an active scheduler.
williamr@2
  2453
williamr@2
  2454
@publishedAll
williamr@2
  2455
@released */
williamr@2
  2456
	{
williamr@2
  2457
public:
williamr@2
  2458
	/** Provides the reason why direct screen access must terminate. This enum is used
williamr@2
  2459
	in the MAbortDirectScreenAccess::AbortNow() and MDirectScreenAccess::Restart()
williamr@2
  2460
	functions.
williamr@2
  2461
williamr@2
  2462
	The first value (ETerminateCancel) indicates that direct screen access is
williamr@2
  2463
	being terminated by the application. The final three values indicate that
williamr@2
  2464
	direct screen access is being terminated by the window server. Note that
williamr@2
  2465
	for users of CDirectScreenAccess, the termination code is not important
williamr@2
  2466
	because these issues are dealt with by CDirectScreenAccess::StartL(). */
williamr@2
  2467
	enum TTerminationReasons
williamr@2
  2468
		{
williamr@2
  2469
		/** The application has finished direct screen access. */
williamr@2
  2470
		ETerminateCancel,
williamr@2
  2471
		/** A window is about to come in front of a part of the area that is being used
williamr@2
  2472
		for direct screen access. */
williamr@2
  2473
		ETerminateRegion,
williamr@2
  2474
		/** The screen's color depth (as enumerated by TDisplayMode) is about to change. */
williamr@2
  2475
		ETerminateScreenMode,
williamr@2
  2476
		/** The current screen mode (the combination of screen rotation and screen size)
williamr@2
  2477
		is about to change. */
williamr@2
  2478
		ETerminateRotation,
williamr@2
  2479
		};
williamr@2
  2480
	/** The priority of the active object that responds to notification that direct
williamr@2
  2481
	screen access must stop. */
williamr@2
  2482
	enum TPriority
williamr@2
  2483
		{
williamr@2
  2484
		/** A suggested value for the priority of the active object that responds to notification
williamr@2
  2485
		from the window server that direct screen access must stop. This is also the
williamr@2
  2486
		value used by CDirectScreenAccess for this purpose. */
williamr@2
  2487
		EPriorityVeryHigh=2000,
williamr@2
  2488
		};
williamr@2
  2489
public:
williamr@2
  2490
	IMPORT_C RDirectScreenAccess();
williamr@2
  2491
	IMPORT_C RDirectScreenAccess(RWsSession& aWs);
williamr@2
  2492
	IMPORT_C TInt Construct();
williamr@4
  2493
	IMPORT_C TInt Construct(TBool aRegionTrackingOnly);
williamr@2
  2494
	IMPORT_C TInt Request(RRegion*& aRegion,TRequestStatus& aStatus,const RWindowBase& aWindow);
williamr@2
  2495
	IMPORT_C void Completed();
williamr@2
  2496
	IMPORT_C void Cancel();
williamr@2
  2497
	IMPORT_C void Close();
williamr@2
  2498
private:
williamr@2
  2499
	RWsSession* iWs;
williamr@2
  2500
	CDsaMsgQueue* iMsgQueue;
williamr@2
  2501
	// To maintain BC we need the following
williamr@2
  2502
	RThread iWsThread;
williamr@2
  2503
	TRequestStatus* iDummyRequest;
williamr@2
  2504
	};
williamr@2
  2505
williamr@2
  2506
williamr@2
  2507
class MAbortDirectScreenAccess
williamr@2
  2508
/** The interface for terminating direct screen access.
williamr@2
  2509
williamr@2
  2510
An object of a class which implements this interface should be passed to CDirectScreenAccess::NewL().
williamr@2
  2511
williamr@2
  2512
@publishedAll
williamr@2
  2513
@released
williamr@2
  2514
@see MDirectScreenAccess */
williamr@2
  2515
	{
williamr@2
  2516
public:
williamr@2
  2517
	/** This function is called by the window server when direct screen access must
williamr@2
  2518
	stop (for example because a dialogue is moved in front of the area where direct
williamr@2
  2519
	screen access is taking place).
williamr@2
  2520
williamr@2
  2521
	In response to this, direct screen access must stop immediately. In simple cases,
williamr@2
  2522
	this will involve cancelling the active object that is driving the drawing to the
williamr@2
  2523
	screen.
williamr@2
  2524
williamr@2
  2525
	No attempt to call a Window Server API function can be made from
williamr@2
  2526
	AbortNow(), because then a temporary deadlock will occur. This is because WSERV
williamr@2
  2527
	is waiting to receive the client's acknowledgment that it has aborted, and so will
williamr@2
  2528
	not be able to service the call. As soon as the restriction no longer applies,
williamr@2
  2529
	the function Restart() will be called.
williamr@2
  2530
williamr@2
  2531
	@param aReason The reason why direct screen access was terminated. */
williamr@2
  2532
	virtual void AbortNow(RDirectScreenAccess::TTerminationReasons aReason)=0;
williamr@2
  2533
	};
williamr@2
  2534
williamr@2
  2535
williamr@2
  2536
class MDirectScreenAccess : public MAbortDirectScreenAccess
williamr@2
  2537
/** The interface for restarting direct screen access.
williamr@2
  2538
williamr@2
  2539
The Restart() function is called by the window server as soon as direct screen
williamr@2
  2540
access can resume. It is called after the window server has called AbortNow().
williamr@2
  2541
williamr@2
  2542
An object of the derived class is passed to CDirectScreenAccess::NewL().
williamr@2
  2543
williamr@2
  2544
@publishedAll
williamr@2
  2545
@released
williamr@2
  2546
@see CDirectScreenAccess::NewL() */
williamr@2
  2547
	{
williamr@2
  2548
public:
williamr@2
  2549
	/** This function is called by the window server as soon as direct screen access
williamr@2
  2550
	can resume.
williamr@2
  2551
williamr@2
  2552
	This function should call CDirectScreenAccess::StartL() within a trap harness.
williamr@2
  2553
	If this leaves, e.g. through lack of memory, direct screen access cannot be
williamr@2
  2554
	restarted. StartL() re-calculates the clipping region, so that if direct screen
williamr@2
  2555
	access was aborted because another window appeared in front of it, that window
williamr@2
  2556
	will not be overwritten when direct screen access resumes.
williamr@2
  2557
williamr@2
  2558
	In this function, you can resume calls to Window Server Client Side API functions.
williamr@2
  2559
williamr@2
  2560
	@param aReason Provides the reason why direct screen access was terminated. */
williamr@2
  2561
	virtual void Restart(RDirectScreenAccess::TTerminationReasons aReason)=0;
williamr@2
  2562
	};
williamr@2
  2563
williamr@2
  2564
williamr@2
  2565
class CDirectScreenAccess : public CActive
williamr@2
  2566
/** An active object used to start direct screen access.
williamr@2
  2567
williamr@2
  2568
Direct screen access is a way of drawing to the screen without using the window
williamr@2
  2569
server. As this avoids client-server communication, it is much faster, and
williamr@2
  2570
may be useful for games and video. Note that some interaction with the window
williamr@2
  2571
server is needed in order to prevent the application from drawing over other
williamr@2
  2572
application's data.
williamr@2
  2573
williamr@2
  2574
The object's (private) RunL() function is called by the window server in order
williamr@2
  2575
to abort direct screen access. This might occur when another window needs
williamr@2
  2576
to be displayed in front or when the window with direct screen access is moved.
williamr@2
  2577
The active object's priority is RDirectScreenAccess::EPriorityVeryHigh so
williamr@2
  2578
that direct screen access will be aborted as quickly as possible.
williamr@2
  2579
williamr@2
  2580
@publishedAll
williamr@2
  2581
@released */
williamr@2
  2582
	{
williamr@2
  2583
public:
williamr@2
  2584
	IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort);
williamr@4
  2585
	IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort,TBool aRegionTrackingOnly);
williamr@2
  2586
	~CDirectScreenAccess();
williamr@2
  2587
	IMPORT_C void StartL();
williamr@2
  2588
	inline CFbsBitGc* Gc();
williamr@2
  2589
	inline CFbsScreenDevice*& ScreenDevice();
williamr@2
  2590
	inline RRegion* DrawingRegion();
williamr@2
  2591
private:
williamr@2
  2592
	enum TFlags
williamr@2
  2593
		{
williamr@4
  2594
		EDirectCheckModeChange		=	0x01,
williamr@4
  2595
		EDirectCheckSizeModeChange	=	0x02,
williamr@4
  2596
		EDirectRegionTrackingOnly	=	0x04,
williamr@2
  2597
		};
williamr@2
  2598
private:
williamr@2
  2599
	inline CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort);
williamr@4
  2600
	void ConstructL(RWsSession& aWs,TBool aRegionTrackingOnly);
williamr@2
  2601
	void CreateScreenObjectsL(TDisplayMode aCurrentMode);
williamr@2
  2602
	void UpdateSizeAndRotation(CFbsBitGc* aGc);
williamr@2
  2603
	static TInt Restart(TAny* aDirect);
williamr@2
  2604
	void Restart();
williamr@2
  2605
	//Pure virtual functions from CActive
williamr@2
  2606
	void DoCancel();
williamr@2
  2607
	void RunL();
williamr@2
  2608
private:
williamr@2
  2609
	CFbsBitGc* iGc;
williamr@2
  2610
	CFbsScreenDevice* iScreenDevice;
williamr@2
  2611
	RRegion* iDrawingRegion;
williamr@2
  2612
	RWindowBase& iWindow;
williamr@2
  2613
	CWsScreenDevice* iWsScreenDevice;
williamr@2
  2614
	MDirectScreenAccess& iAbort;
williamr@2
  2615
	RDirectScreenAccess iDirectAccess;
williamr@2
  2616
	RDirectScreenAccess::TTerminationReasons iReason;
williamr@2
  2617
	CIdle* iRestart;
williamr@2
  2618
	TSize iScreenSize;
williamr@2
  2619
	TBool iAborting;
williamr@2
  2620
	TUint iFlags;
williamr@2
  2621
	TInt iScreenNumber;
williamr@2
  2622
	};
williamr@2
  2623
williamr@2
  2624
williamr@2
  2625
class RSoundPlugIn : public MWsClientClass
williamr@2
  2626
/** Client interface to the key or pointer click plug-in DLL.
williamr@2
  2627
williamr@2
  2628
The plug-in DLL implements the CClickMaker class.
williamr@2
  2629
williamr@2
  2630
@publishedAll
williamr@2
  2631
@released
williamr@2
  2632
@see CClickMaker */
williamr@2
  2633
	{
williamr@2
  2634
public:
williamr@2
  2635
	/** A possible return value for CommandReply(). */
williamr@2
  2636
	enum
williamr@2
  2637
		{
williamr@2
  2638
		/** The value returned by CommandReply() if no plug-in is loaded,
williamr@2
  2639
		or if the plug-in identified by the aUid parameter in Construct() is not loaded.
williamr@2
  2640
		Its value is set to KMinTInt so that it should not clash with any other expected
williamr@2
  2641
		return value from this function. */
williamr@2
  2642
		ESoundWrongPlugIn=KMinTInt
williamr@2
  2643
		};
williamr@2
  2644
public:
williamr@2
  2645
	IMPORT_C RSoundPlugIn();
williamr@2
  2646
	IMPORT_C RSoundPlugIn(RWsSession &aWs);
williamr@2
  2647
	IMPORT_C TInt Construct(TUid aUid=KNullUid);
williamr@2
  2648
	IMPORT_C void Close();
williamr@2
  2649
	IMPORT_C void Destroy();
williamr@4
  2650
	IMPORT_C TBool IsLoaded(TBool& aIsChangeable) const;
williamr@2
  2651
	IMPORT_C TInt Unload();
williamr@2
  2652
	IMPORT_C TInt Load(const TDesC &aFileName);
williamr@2
  2653
	IMPORT_C void SetKeyClick(TBool aEnabled);
williamr@2
  2654
	IMPORT_C void SetPenClick(TBool aEnabled);
williamr@4
  2655
	IMPORT_C TBool KeyClickEnabled() const;
williamr@4
  2656
	IMPORT_C TBool PenClickEnabled() const;
williamr@2
  2657
	IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
williamr@2
  2658
	};
williamr@2
  2659
williamr@2
  2660
inline TInt MWsClientClass::WsHandle() const
williamr@2
  2661
	/** Gets the server side handle for the object.
williamr@2
  2662
williamr@2
  2663
	@return The server-side handle for the object. */
williamr@2
  2664
	{return(iWsHandle);}
williamr@2
  2665
williamr@4
  2666
inline const TAny* CWsScreenDevice::GetInterface(TUint aInterfaceId) const
williamr@4
  2667
	{
williamr@4
  2668
	return const_cast<CWsScreenDevice*>(this)->GetInterface(aInterfaceId);
williamr@4
  2669
	}
williamr@4
  2670
williamr@2
  2671
inline TInt CWsScreenDevice::CreateContext(CWindowGc *&aGc)
williamr@2
  2672
	/** Creates a graphics context for this device.
williamr@2
  2673
williamr@2
  2674
	This function always causes a flush of the window server buffer.
williamr@2
  2675
williamr@2
  2676
	@param aGc On successful return, contains a new graphics context referring
williamr@2
  2677
	to this screen device.
williamr@2
  2678
	@return KErrNone if successful, otherwise one of the system-wide error codes.
williamr@2
  2679
	@see CGraphicsDevice::CreateContext() */
williamr@2
  2680
	{return(CreateContext((CGraphicsContext *&)aGc));}
williamr@2
  2681
williamr@2
  2682
inline TUint TWsRedrawEvent::Handle() const
williamr@2
  2683
	/** Gets the handle of the window which is the target of the redraw event.
williamr@2
  2684
williamr@2
  2685
	This is the handle that was passed to the window's Construct() function: typically
williamr@2
  2686
	it will be a pointer to the object owning the window, providing access to
williamr@2
  2687
	its member functions.
williamr@2
  2688
williamr@2
  2689
	@return The window's handle. */
williamr@2
  2690
	{return(iHandle);}
williamr@2
  2691
williamr@2
  2692
inline TRect TWsRedrawEvent::Rect() const
williamr@2
  2693
	/** Gets the rectangle to redraw.
williamr@2
  2694
williamr@2
  2695
	@return The rectangle that needs redrawing. Co-ordinates are relative to
williamr@2
  2696
	the window whose handle is given by Handle(). */
williamr@2
  2697
	{return(iRect);}
williamr@2
  2698
williamr@4
  2699
inline TWsEvent::TWsEvent()
williamr@4
  2700
	/** Constructor.  Zero Initialise Data
williamr@4
  2701
	@publishedAll
williamr@4
  2702
	@released */
williamr@4
  2703
	{
williamr@4
  2704
	iType=0;
williamr@4
  2705
	iHandle=0;
williamr@4
  2706
	iTime=0;
williamr@4
  2707
	Mem::FillZ(iEventData,EWsEventDataSize);
williamr@4
  2708
	}
williamr@4
  2709
williamr@4
  2710
inline TAdvancedPointerEvent* TWsEvent::Pointer() const
williamr@2
  2711
	/** Gets the pointer event.
williamr@4
  2712
	
williamr@4
  2713
	This method can be used to get information about the pointer event if Type()
williamr@4
  2714
	returns an event of type EEventPointer or EEventDragDrop.
williamr@4
  2715
	
williamr@4
  2716
	If the event has been received by the window without advanced pointer events enabled,
williamr@4
  2717
	this method will return a pointer to TPointerEvent with additional fields of
williamr@4
  2718
	TAdvancedPointerEvent being cleared to 0.
williamr@4
  2719
	
williamr@4
  2720
	@return Structure containing advanced pointer event data.
williamr@4
  2721
	@see TPointerEvent::AdvancedPointerEvent()
williamr@4
  2722
	@see RWindowBase::EnableAdvancedPointers() */
williamr@4
  2723
	{return((TAdvancedPointerEvent *)&iEventData);}
williamr@4
  2724
williamr@4
  2725
inline TInt TAdvancedPointerEvent::PointerNumber() const
williamr@4
  2726
/** Gets the pointer number of the pointer whose state change is described by this event.
williamr@4
  2727
williamr@4
  2728
  As soon as the pointer (for example a finger) is detected by the device's sensors,
williamr@4
  2729
  it is assigned a pointer number. Then all events related to this pointer always
williamr@4
  2730
  use the same pointer number. When the device loses track of the pointer,
williamr@4
  2731
  TPointerEvent::EOutOfRange is sent with its pointer number and the number is released
williamr@4
  2732
  - from this time it may be re-used to identify another pointer coming into range.  
williamr@4
  2733
  
williamr@4
  2734
  On a particular device, the pointer number is always an integer in the range 0 to 
williamr@4
  2735
  HALData::EPointerNumberOfPointers - 1. If the device doesn't provide value for
williamr@4
  2736
  this attribute, it is assumed to be 1.
williamr@4
  2737
  
williamr@4
  2738
  Please note that in order to receive events from multiple pointers in a window, the method
williamr@4
  2739
  RWindowBase::EnableAdvancedPointers() has to be called for this window's instance
williamr@4
  2740
  before it is activated. Otherwise this window will only receive TPointerEvents from one
williamr@4
  2741
  emulated pointer, which will always have pointer number 0.
williamr@4
  2742
  
williamr@4
  2743
  @return Pointer number of the pointer whose state change is described by this event.
williamr@4
  2744
  @see RWindowBase::EnableAdvancedPointers()
williamr@4
  2745
  @see HALData::EPointerNumberOfPointers */
williamr@4
  2746
	{
williamr@4
  2747
	return IsAdvancedPointerEvent() ? DoGetPointerNumber() : ENonAdvancedPointerPointerNumber;
williamr@4
  2748
	}
williamr@4
  2749
williamr@4
  2750
inline TInt TAdvancedPointerEvent::Proximity() const
williamr@4
  2751
/** Gets the proximity of the pointer to the screen's surface.
williamr@4
  2752
  Proximity units may vary between devices and may be non-linear.
williamr@4
  2753
  Returned value will be a negative integer as the maximum supported proximity
williamr@4
  2754
  range in Symbian OS is from KMinTInt to 0, where KMinTInt means the highest
williamr@4
  2755
  proximity that Symbian OS can support and 0 means touching the screen. 
williamr@4
  2756
  HALData attributes provide more information about proximity support on particular 
williamr@4
  2757
  device.
williamr@4
  2758
  
williamr@4
  2759
  On platforms without pointer proximity support, proximity is always assumed to be 0.
williamr@4
  2760
  
williamr@4
  2761
  @return Proximity of the pointer to the screen's surface.
williamr@4
  2762
  @see TAdvancedPointerEvent::Position3D()
williamr@4
  2763
  @see TAdvancedPointerEvent::ProximityAndPressure()
williamr@4
  2764
  @see HALData::EPointer3DMaxProximity
williamr@4
  2765
  @see HALData::EPointer3DProximityStep */
williamr@4
  2766
	{
williamr@4
  2767
	return IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
williamr@4
  2768
	}
williamr@4
  2769
williamr@4
  2770
inline TInt TAdvancedPointerEvent::Pressure() const
williamr@4
  2771
/** Gets the pressure applied by the pointer to the screen. 
williamr@4
  2772
  Pressure units may vary between devices and may be non-linear.
williamr@4
  2773
  Returned value will be a positive integer as the maximum supported pressure range
williamr@4
  2774
  in Symbian OS is from 0 to KMaxTInt. HALData attributes provide more information
williamr@4
  2775
  about pressure support on particular device.
williamr@4
  2776
  
williamr@4
  2777
  On platforms without pointer pressure support, pressure is always assumed to be 0.
williamr@4
  2778
  
williamr@4
  2779
  @return Pressure applied by the pointer to the screen.
williamr@4
  2780
  @see TAdvancedPointerEvent::Pressure3D()
williamr@4
  2781
  @see TAdvancedPointerEvent::ProximityAndPressure()
williamr@4
  2782
  @see HALData::EPointer3DMaxPressure
williamr@4
  2783
  @see HALData::EPointer3DPressureStep */
williamr@4
  2784
	{
williamr@4
  2785
	return IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
williamr@4
  2786
	}
williamr@4
  2787
williamr@4
  2788
inline TInt TAdvancedPointerEvent::ProximityAndPressure() const
williamr@4
  2789
/** Gets pressure applied by the pointer to the screen and proximity of the pointer
williamr@4
  2790
  to the screen as one value. This is possible because the pointer is never in proximity
williamr@4
  2791
  to the screen and pressing the screen at the same time.
williamr@4
  2792
  
williamr@4
  2793
  @return The value of proximity if the pointer is in proximity to the screen; proximity
williamr@4
  2794
          is always represented as negative TInt. The value of pressure if the pointer
williamr@4
  2795
          is touching the screen; pressure is always represented as positive TInt.
williamr@4
  2796
  @see TAdvancedPointerEvent::Proximity()
williamr@4
  2797
  @see TAdvancedPointerEvent::Pressure()
williamr@4
  2798
  @see TAdvancedPointerEvent::PositionAndPressure3D() */
williamr@4
  2799
	{return IsAdvancedPointerEvent() ? DoGetProximityAndPressure() : ENonAdvancedPointerZCoordinate;}
williamr@4
  2800
williamr@4
  2801
inline TPoint3D TAdvancedPointerEvent::PositionAndPressure3D() const
williamr@4
  2802
/**
williamr@4
  2803
  @return Pointer's X and Y coordinates plus combined proximity and pressure as
williamr@4
  2804
          Z coordinate. 
williamr@4
  2805
  @see TAdvancedPointerEvent::ProximityAndPressure() */
williamr@4
  2806
	{
williamr@4
  2807
	TPoint3D point3D;
williamr@4
  2808
	point3D.iX=iPosition.iX;
williamr@4
  2809
	point3D.iY=iPosition.iY;
williamr@4
  2810
	point3D.iZ=ProximityAndPressure();
williamr@4
  2811
	return point3D;
williamr@4
  2812
	}
williamr@4
  2813
williamr@4
  2814
inline TPoint3D TAdvancedPointerEvent::Position3D() const
williamr@4
  2815
/**
williamr@4
  2816
  @return Pointer's X and Y coordinates plus pointer's proximity to the screen as
williamr@4
  2817
          Z coordinate. Please note that returned Z coordinate will be always negative or 0.
williamr@4
  2818
  @see TAdvancedPointerEvent::Proximity() */
williamr@4
  2819
	{
williamr@4
  2820
	TPoint3D point3D;
williamr@4
  2821
	point3D.iX=iPosition.iX;
williamr@4
  2822
	point3D.iY=iPosition.iY;
williamr@4
  2823
	point3D.iZ=IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
williamr@4
  2824
	return point3D;
williamr@4
  2825
	}
williamr@4
  2826
williamr@4
  2827
inline TPoint3D TAdvancedPointerEvent::Pressure3D() const
williamr@4
  2828
/**  
williamr@4
  2829
  @return Pointer's X and Y coordinates plus pressure applied by the pointer to the screen
williamr@4
  2830
          as Z coordinate. 
williamr@4
  2831
  @see TAdvancedPointerEvent::Pressure() */
williamr@4
  2832
	{
williamr@4
  2833
	TPoint3D point3D;
williamr@4
  2834
	point3D.iX=iPosition.iX;
williamr@4
  2835
	point3D.iY=iPosition.iY;
williamr@4
  2836
	point3D.iZ=IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
williamr@4
  2837
	return point3D;
williamr@4
  2838
	}
williamr@2
  2839
williamr@2
  2840
inline TKeyEvent *TWsEvent::Key() const
williamr@2
  2841
	/** Gets the key event.
williamr@2
  2842
williamr@2
  2843
	This function can be used to get information about the key event if Type()
williamr@2
  2844
	returns an event of type EEventKey, EEventKeyUp or EEventKeyDown.
williamr@2
  2845
williamr@2
  2846
	@return Structure containing key event data */
williamr@2
  2847
	{return((TKeyEvent *)&iEventData);}
williamr@2
  2848
williamr@2
  2849
inline TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged()
williamr@2
  2850
	/** Gets information about the visibility changed event.
williamr@2
  2851
williamr@2
  2852
	This function can be used to get information about the visibility changed event
williamr@2
  2853
	if Type() returns an event of type EEventWindowVisibilityChanged.
williamr@2
  2854
williamr@2
  2855
	@return Structure containing visibility changed event data */
williamr@2
  2856
	{ return reinterpret_cast<TWsVisibilityChangedEvent*>(iEventData); }
williamr@2
  2857
williamr@2
  2858
inline const TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged() const
williamr@2
  2859
	/** Gets information about the visibility changed event.
williamr@2
  2860
williamr@2
  2861
	This function can be used to get information about the visibility changed event
williamr@2
  2862
	if Type() returns an event of type EEventWindowVisibilityChanged.
williamr@2
  2863
williamr@2
  2864
	@return Structure containing visibility changed event data */
williamr@2
  2865
	{ return reinterpret_cast<const TWsVisibilityChangedEvent*>(iEventData); }
williamr@2
  2866
williamr@4
  2867
inline TWsDisplayChangedEvent* TWsEvent::DisplayChanged()
williamr@4
  2868
	/** Gets information about the display changed event.
williamr@4
  2869
williamr@4
  2870
	This function can be used to get information about the display changed event
williamr@4
  2871
	if Type() returns an event of type EEventDisplayChanged.
williamr@4
  2872
williamr@4
  2873
	@return Structure containing display changed event data */
williamr@4
  2874
	{ return reinterpret_cast<TWsDisplayChangedEvent*>(iEventData); }
williamr@4
  2875
williamr@4
  2876
inline const TWsDisplayChangedEvent* TWsEvent::DisplayChanged() const
williamr@4
  2877
	/** Gets information about the display changed event.
williamr@4
  2878
williamr@4
  2879
	This function can be used to get information about the display changed event
williamr@4
  2880
	if Type() returns an event of type EEventDisplayChanged.
williamr@4
  2881
williamr@4
  2882
	@return Structure containing display changed event data */
williamr@4
  2883
	{ return reinterpret_cast<const TWsDisplayChangedEvent*>(iEventData); }
williamr@4
  2884
williamr@2
  2885
inline TModifiersChangedEvent *TWsEvent::ModifiersChanged() const
williamr@2
  2886
	/** Gets information about the modifier changed event.
williamr@2
  2887
williamr@2
  2888
	This function can be used to get information about the modifier changed event
williamr@2
  2889
	if Type() returns an event of type EEventModifiersChanged.
williamr@2
  2890
williamr@2
  2891
	@return Structure containing modifier changed event data */
williamr@2
  2892
	{return((TModifiersChangedEvent *)&iEventData);}
williamr@2
  2893
williamr@2
  2894
inline TWsErrorMessage *TWsEvent::ErrorMessage() const
williamr@2
  2895
	/** Gets an error event.
williamr@2
  2896
williamr@2
  2897
	This function can be used to get information about the error event if Type()
williamr@2
  2898
	returns an event of type EEventErrorMessage.
williamr@2
  2899
williamr@2
  2900
	@return The error event. */
williamr@2
  2901
	{return((TWsErrorMessage *)&iEventData);}
williamr@2
  2902
williamr@2
  2903
inline TUint8 *TWsEvent::EventData() const
williamr@2
  2904
	/** Gets information about the event.
williamr@2
  2905
williamr@2
  2906
	This function gives you direct access to the event data as a whole. The event
williamr@2
  2907
	can be a key or pointer event or it could be a new special event that only
williamr@2
  2908
	you and another application know about. You are limited to EWsEventDataSize
williamr@2
  2909
	bytes worth of data.
williamr@2
  2910
williamr@2
  2911
	@return A pointer to the event data. */
williamr@2
  2912
	{return((TUint8 *)&iEventData);}
williamr@2
  2913
williamr@2
  2914
inline TInt TWsEvent::Type() const
williamr@2
  2915
	/** Gets the type of event that occurred.
williamr@2
  2916
williamr@2
  2917
	@return The event type. Event types are defined in TEventCode. */
williamr@2
  2918
	{return(iType);}
williamr@2
  2919
williamr@2
  2920
inline TUint TWsEvent::Handle() const
williamr@2
  2921
	/** Gets the window handle.
williamr@2
  2922
williamr@2
  2923
	This is the handle that was passed to the window's Construct() function: typically
williamr@2
  2924
	it will be a pointer to the client-side object owning the window, providing
williamr@2
  2925
	access to its member functions.
williamr@2
  2926
williamr@2
  2927
	@return The window handle. */
williamr@2
  2928
	{return(iHandle);}
williamr@2
  2929
williamr@2
  2930
inline TTime TWsEvent::Time() const
williamr@2
  2931
	/** Gets the time when the event occurred.
williamr@2
  2932
williamr@2
  2933
	@return The time when the event occurred. */
williamr@2
  2934
	{return(iTime);}
williamr@2
  2935
williamr@2
  2936
inline void TWsEvent::SetType(TInt aType)
williamr@2
  2937
	/** Sets the event type.
williamr@2
  2938
williamr@2
  2939
	@param aType The event type. Event types are defined in TEventCode. */
williamr@2
  2940
	{iType=aType;}
williamr@2
  2941
williamr@2
  2942
inline void TWsEvent::SetHandle(TUint aHandle)
williamr@2
  2943
	/** Sets the event handle.
williamr@2
  2944
williamr@2
  2945
	This is the client handle of the window that is being sent the event.
williamr@2
  2946
williamr@2
  2947
	@param aHandle The event handle. */
williamr@2
  2948
	{iHandle=aHandle;}
williamr@2
  2949
williamr@2
  2950
inline void TWsEvent::SetTimeNow()
williamr@2
  2951
	/** Sets the event time to the current time. */
williamr@2
  2952
	{iTime.UniversalTime();}
williamr@2
  2953
williamr@2
  2954
inline TInt *TWsEvent::Int() const
williamr@4
  2955
	/** Gets the event data as a TInt.
williamr@4
  2956
	 
williamr@4
  2957
	 For TWsEvents of type EEventPointerEnter and EEventPointerExit this is the pointer number
williamr@4
  2958
	 of the pointer that entered/exited the window. Please note that on platforms that 
williamr@4
  2959
	 use the older Symbian OS, without multipointer support, pointer number is not initialized 
williamr@4
  2960
	 for EEventPointerEnter and EEventPointerExit and thus it is random.
williamr@4
  2961
	 
williamr@4
  2962
	 If the value of the attribute returned from HALData::EPointerNumberOfPointers is greater than 1,
williamr@4
  2963
	 then the system has multipointer support. 
williamr@4
  2964
	 
williamr@4
  2965
	 @see HALData::EPointerNumberOfPointers
williamr@4
  2966
	 @see HAL::Get(TAttribute,TInt&)
williamr@4
  2967
	*/
williamr@2
  2968
	{ return (TInt*)&iEventData; }
williamr@2
  2969
williamr@2
  2970
inline TUint TWsPriorityKeyEvent::Handle() const
williamr@2
  2971
	/** Gets the handle for the window group which added the priority key.
williamr@2
  2972
williamr@2
  2973
	This is the handle that was passed to the window group's Construct() function.
williamr@2
  2974
	Since most applications have only one window group, however, this function
williamr@2
  2975
	is rarely used.
williamr@2
  2976
williamr@2
  2977
	@return The window group handle. */
williamr@2
  2978
	{return(iHandle);}
williamr@2
  2979
williamr@2
  2980
inline TKeyEvent *TWsPriorityKeyEvent::Key() const
williamr@2
  2981
	/** Gets the priority key event.
williamr@2
  2982
williamr@2
  2983
	@return Structure containing priority key event data */
williamr@2
  2984
	{return((TKeyEvent *)&iEventData);}
williamr@2
  2985
williamr@2
  2986
inline void TWsPriorityKeyEvent::SetHandle(TUint aHandle)
williamr@2
  2987
	/** Sets the window group event handle.
williamr@2
  2988
williamr@2
  2989
	This is the client handle of the window that is being sent the event.
williamr@2
  2990
williamr@2
  2991
	@param aHandle The event handle. */
williamr@2
  2992
	{iHandle=aHandle;}
williamr@2
  2993
williamr@2
  2994
inline CDirectScreenAccess::CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort)
williamr@2
  2995
		:CActive(RDirectScreenAccess::EPriorityVeryHigh), iWindow(aWindow), iAbort(aAbort), iDirectAccess(aWs)
williamr@2
  2996
		{iWsScreenDevice=aScreenDevice;}
williamr@2
  2997
williamr@2
  2998
inline CFbsBitGc* CDirectScreenAccess::Gc()
williamr@2
  2999
	/** Gets the graphics context for drawing to the screen.
williamr@2
  3000
williamr@2
  3001
	This is set up by calling StartL(). Its origin is set so that you should use
williamr@2
  3002
	window coordinates to specify which part of the screen to draw to and its
williamr@2
  3003
	clipping region is set to the visible part of the window.
williamr@2
  3004
williamr@2
  3005
	Code built to run on the Emulator must call CFbsScreenDevice::Update() in
williamr@2
  3006
	order to see the results of drawing to this graphics context, but this may
williamr@2
  3007
	not be required on all target hardware.
williamr@2
  3008
williamr@2
  3009
	@return The graphics context for drawing to the screen. */
williamr@2
  3010
	{ return iGc; }
williamr@2
  3011
williamr@2
  3012
inline CFbsScreenDevice*& CDirectScreenAccess::ScreenDevice()
williamr@2
  3013
	/** Gets the screen device to draw to.
williamr@2
  3014
williamr@2
  3015
	You should not use this screen device to create fonts because the object is
williamr@2
  3016
	deleted and recreated when direct screen access is aborted and restarted.
williamr@2
  3017
	Instead, create and use your own CFbsScreenDevice object to create fonts.
williamr@2
  3018
williamr@2
  3019
	@return The target screen device. */
williamr@2
  3020
	{ return iScreenDevice; }
williamr@2
  3021
williamr@2
  3022
inline RRegion* CDirectScreenAccess::DrawingRegion()
williamr@2
  3023
	/** Gets the clipping region to draw to.
williamr@2
  3024
williamr@2
  3025
	You must not draw outside of this region.
williamr@2
  3026
williamr@2
  3027
	The clipping region is calculated when StartL() is called, and is only updated
williamr@2
  3028
	if StartL() is called again.
williamr@2
  3029
williamr@2
  3030
	The region is specified in screen coordinates. This can be useful if you need
williamr@2
  3031
	to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).
williamr@2
  3032
williamr@2
  3033
	@return The clipping region to draw to. */
williamr@2
  3034
	{ return iDrawingRegion; }
williamr@2
  3035
williamr@4
  3036
#endif //__W32STD_H__