epoc32/include/w32click.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100 (2010-03-31)
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@2
     1
// Copyright (c) 2001-2009 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
// Definition of class that needs to be provided by a Key Click plugin
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __W32CLICK_H__
williamr@2
    19
#define __W32CLICK_H__
williamr@2
    20
williamr@2
    21
#ifndef __E32STD_H__
williamr@2
    22
#include <e32std.h>
williamr@2
    23
#endif
williamr@2
    24
#ifndef __E32BASE_H__
williamr@2
    25
#include <e32base.h>
williamr@2
    26
#endif
williamr@2
    27
#ifndef __W32STD_H__
williamr@2
    28
#include <w32std.h>
williamr@2
    29
#endif
williamr@2
    30
williamr@4
    31
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
    32
#include <graphics/pointereventdata.h>
williamr@4
    33
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@2
    34
williamr@2
    35
class CClickMaker: public CBase
williamr@2
    36
/** Key or pointer click plug-in provider interface.
williamr@2
    37
williamr@2
    38
This class should be implemented by a plug-in DLL in order to produce a sound 
williamr@2
    39
when a key is pressed, a key auto repeats or when the screen is tapped with 
williamr@2
    40
a pointer. When any of these events occur, the window server informs the plug-in 
williamr@2
    41
DLL, which can then make the sound.
williamr@2
    42
williamr@2
    43
The details of the event are also passed to the plug-in so that the sound 
williamr@2
    44
can be tailored to the precise event, for example clicking on different keys on the 
williamr@2
    45
keypad or on different parts of the screen could make different sounds.
williamr@2
    46
williamr@2
    47
The name of the initial plug-in to use can be specified in the wsini.ini configuration 
williamr@2
    48
file using the KEYCLICKPLUGIN or KEYCLICKPLUGINFIXED keywords. When the operating 
williamr@2
    49
system boots, wsini.ini is read for the name of this plug-in. If a plug-in 
williamr@2
    50
name exists, the window server will try to load it. At a later time, any client 
williamr@2
    51
of the window server can request a new plug-in to be loaded or the current 
williamr@2
    52
one to be unloaded, using the RSoundPlugIn class.
williamr@2
    53
williamr@2
    54
The plug-in is a polymorphic DLL which implements the CClickMaker interface. 
williamr@2
    55
Its first UID is KDynamicLibraryUidValue and its second UID is 0x10004F63. 
williamr@2
    56
Its first exported function should create an object of the CClickMaker sub-class 
williamr@2
    57
and should have the following signature:
williamr@2
    58
williamr@2
    59
EXPORT_C CClickMaker* CreateClickMakerL() 
williamr@2
    60
williamr@2
    61
@publishedAll 
williamr@2
    62
@released 
williamr@2
    63
@see RSoundPlugIn */
williamr@2
    64
	{
williamr@2
    65
public:
williamr@2
    66
	/** This function is called by the window server whenever there is a key event, 
williamr@2
    67
	to generate the sound.
williamr@2
    68
	
williamr@2
    69
	It must be implemented by the key or pointer click plug-in.
williamr@2
    70
	
williamr@2
    71
	If the sound cannot be made, the function should continue without leaving.
williamr@2
    72
	
williamr@2
    73
	@param aType The type of key event: EEventKey, EEventKeyUp, EEventKeyDown 
williamr@2
    74
	or EEventKeyRepeat.
williamr@2
    75
	@param aEvent The key event details. */
williamr@2
    76
	virtual void KeyEvent(TEventCode aType,const TKeyEvent& aEvent)=0;
williamr@2
    77
williamr@2
    78
	/** This function is called by the window server whenever there is a pointer event, 
williamr@2
    79
	to generate the sound.
williamr@2
    80
	
williamr@2
    81
	It must be implemented by the key or pointer click plug-in.
williamr@2
    82
	
williamr@2
    83
	If the sound cannot be made, the function should continue without leaving.
williamr@2
    84
	
williamr@2
    85
	The iParentPosition data member of aEvent is not the position of the pointer 
williamr@2
    86
	event relative to origin of the parent window. Instead it is the position 
williamr@2
    87
	on the screen. This is because the parent window has no meaning inside the 
williamr@2
    88
	plug-in as it does to the window server client and also knowledge 
williamr@2
    89
	of the screen position may be useful to the plug-in.
williamr@2
    90
	
williamr@4
    91
	On devices where these features are supported, aEvent will contain pointer number, 
williamr@4
    92
	proximity of the pointer to the screen and/or pressure applied by the pointer to the screen.
williamr@4
    93
	In order to retrieve this information, implementation of this method should
williamr@4
    94
	use TPointerEvent::AdvancedPointerEvent().
williamr@4
    95
	
williamr@4
    96
	@param aEvent The pointer event details. 
williamr@4
    97
	@see TPointerEvent::AdvancedPointerEvent() */
williamr@2
    98
	virtual void PointerEvent(const TPointerEvent& aEvent)=0;
williamr@2
    99
williamr@2
   100
	/** This function is intended for future expansion of the interface, in case it 
williamr@2
   101
	needs to support sounds for other types of event.
williamr@2
   102
williamr@2
   103
	Currently it is called by the window server, with several values for aType.
williamr@2
   104
	For each of these aParam will need to be cast to a different class type 
williamr@2
   105
	to get the data:
williamr@2
   106
	EEventPointer: cast to TPointerEventData*
williamr@2
   107
	EEventScreenDeviceChanged: TClickMakerData*
williamr@2
   108
	EEventGroupWindowOpen: TGroupWindowOpenData*
williamr@2
   109
	EEventGroupWindowClose: TInt (the identifier of the window group being closed)
williamr@2
   110
	EEventWindowClose: TWindowCloseData*
williamr@2
   111
williamr@2
   112
	@param aType One of the above listed values, in future may be used with other values.
williamr@2
   113
	@param aParam See above. */
williamr@2
   114
	virtual void OtherEvent(TInt aType,TAny* aParam=NULL)=0;
williamr@2
   115
williamr@2
   116
	/** This function may be implemented by the key or pointer click plug-in to enable 
williamr@2
   117
	the plug-in to communicate with the window server client.
williamr@2
   118
	
williamr@2
   119
	If this is not required, the implementation may simply return zero.
williamr@2
   120
	
williamr@2
   121
	It is called by RSoundPlugIn::CommandReply() which returns the value returned 
williamr@2
   122
	by this function.
williamr@2
   123
	
williamr@2
   124
	The return value can be generated either by returning it from the function 
williamr@2
   125
	or by leaving with the value. In either case, the client will get back the 
williamr@2
   126
	value concerned.
williamr@2
   127
	
williamr@2
   128
	@param aOpcode Opcode understood by both the window server client and the 
williamr@2
   129
	plug-in DLL.
williamr@2
   130
	@param aArgs Arguments packaged by the window server client.
williamr@2
   131
	@return A value passed back to the client. This may be KErrNone or another 
williamr@2
   132
	of the system-wide error codes. */
williamr@2
   133
	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs)=0;
williamr@2
   134
	};
williamr@2
   135
williamr@2
   136
struct TClickMakerData
williamr@2
   137
/**
williamr@2
   138
Passed to a Key Click Plug-in using the function CClickMaker::OtherEvent when the 
williamr@2
   139
aType value is EEventScreenDeviceChanged.
williamr@2
   140
williamr@2
   141
@publishedAll 
williamr@2
   142
@released 
williamr@2
   143
*/
williamr@2
   144
	{
williamr@2
   145
	TInt screenDeviceMode;
williamr@2
   146
	};
williamr@2
   147
williamr@2
   148
class TGroupWindowOpenData
williamr@2
   149
/**
williamr@2
   150
Passed to a Key Click Plug-in using the function CClickMaker::OtherEvent when the 
williamr@2
   151
aType value is EEventGroupWindowOpen.
williamr@2
   152
williamr@2
   153
@publishedAll 
williamr@2
   154
@released 
williamr@2
   155
*/
williamr@2
   156
	{
williamr@2
   157
public:
williamr@2
   158
	/**
williamr@2
   159
	The Window Group Identifier of the window being created.
williamr@2
   160
	*/
williamr@2
   161
	TInt iIdentifier;
williamr@2
   162
	/**
williamr@2
   163
	A number unique to the client creating the window group - allows the Plug-in to tell 
williamr@2
   164
	different clients apart.
williamr@2
   165
	*/
williamr@2
   166
	TUint iClient;
williamr@2
   167
	/**
williamr@2
   168
	The number of Window Groups currently owned by that client (not including the one being created).
williamr@2
   169
	*/
williamr@2
   170
	TInt iNumClientWindowGroups;
williamr@2
   171
	};
williamr@2
   172
williamr@2
   173
class TWindowCloseData
williamr@2
   174
/**
williamr@2
   175
Passed to a Key Click Plug-in using the function CClickMaker::OtherEvent when the aType value 
williamr@2
   176
is EEventWindowClose.
williamr@2
   177
williamr@2
   178
@publishedAll 
williamr@2
   179
@released 
williamr@2
   180
*/
williamr@2
   181
	{
williamr@2
   182
public:
williamr@2
   183
	/**
williamr@2
   184
	The client handle of the window being closed.
williamr@2
   185
	*/
williamr@2
   186
	TUint32 iClientHandle;
williamr@2
   187
	/**
williamr@2
   188
	The Window Group Identifier of the window group that is a parent (or grandparent etc.)
williamr@2
   189
	of the window being closed, or 0 if the window has been orphaned.
williamr@2
   190
	*/
williamr@2
   191
	TInt iWindowGroupId;
williamr@2
   192
	};
williamr@2
   193
williamr@2
   194
#endif