epoc32/include/mw/eiknotapi.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/eiknotapi.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 1997-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@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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
//
williamr@2
    15
williamr@2
    16
#ifndef __EIKNOTAPI_H__
williamr@2
    17
#define __EIKNOTAPI_H__
williamr@2
    18
williamr@2
    19
#include <e32std.h>
williamr@2
    20
#include <e32base.h>
williamr@2
    21
#include <f32file.h>
williamr@2
    22
williamr@2
    23
/** Defines the second Uid value for plug in notifier DLLs. 
williamr@2
    24
williamr@2
    25
@publishedAll
williamr@2
    26
@released */
williamr@2
    27
const TUid KUidNotifierPlugIn = {0x10005522}; 
williamr@2
    28
const TUid KUidNotifierPlugInV2 = {0x101fdfae};
williamr@2
    29
williamr@2
    30
/**
williamr@2
    31
@publishedAll
williamr@2
    32
@released
williamr@2
    33
*/
williamr@2
    34
enum TEikNotExtStatus
williamr@2
    35
	{
williamr@2
    36
	EEikNotExtRequestCompleted = 0,
williamr@2
    37
	EEikNotExtRequestQueued = 1
williamr@2
    38
	};
williamr@2
    39
williamr@2
    40
/** The Uid that identifies a screen change event.
williamr@2
    41
williamr@2
    42
@see MEikSrvNotifierBase2::HandleSystemEventL() 
williamr@2
    43
@internalTechnology */
williamr@2
    44
const TUid KUidEventScreenModeChanged = {0x101F3648};
williamr@2
    45
williamr@2
    46
/** A set of flags that define the capabilities of the notifier.
williamr@2
    47
williamr@2
    48
Capabilities are returned by calling MEikSrvNotifierBase2::NotifierCapabilites(). 
williamr@2
    49
williamr@2
    50
@publishedAll
williamr@2
    51
@released */
williamr@2
    52
enum TNotifierCapabilities
williamr@2
    53
	{
williamr@2
    54
	/** The notifier has no special capabilities. */
williamr@2
    55
	ENoSpecialCapabilities			= 0x00000000,
williamr@2
    56
	/** The notifier can handle a change to the screen device. */
williamr@2
    57
	EScreenDeviceChangeSupported	= 0x00000001,
williamr@2
    58
	};
williamr@2
    59
	
williamr@2
    60
/** 
williamr@2
    61
Interface to allow notifiers to manage their own startup/shutdown.  This class is likely to be of most
williamr@2
    62
interest to notifiers that observe engines using publically available APIs rather than those that are run
williamr@2
    63
via RNotifier.
williamr@2
    64
williamr@2
    65
@publishedAll
williamr@2
    66
@released 
williamr@2
    67
*/
williamr@2
    68
class MEikSrvNotifierManager
williamr@2
    69
	{
williamr@2
    70
public:
williamr@2
    71
	virtual void StartNotifierL(TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse) = 0;
williamr@2
    72
	virtual void CancelNotifier(TUid aNotifierUid) = 0;
williamr@2
    73
	virtual void UpdateNotifierL(TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse) = 0;
williamr@2
    74
protected:
williamr@2
    75
	IMPORT_C MEikSrvNotifierManager();
williamr@2
    76
private:
williamr@2
    77
	IMPORT_C virtual void MEikSrvNotifierManager_Reserved1();
williamr@2
    78
	IMPORT_C virtual void MEikSrvNotifierManager_Reserved2();
williamr@2
    79
private:
williamr@2
    80
	TInt iMEikSrvNotifierManager_Spare1;
williamr@2
    81
	};
williamr@2
    82
williamr@2
    83
williamr@2
    84
/** Interface to a plug-in server side notifier.
williamr@2
    85
williamr@2
    86
Any number of MEikSrvNotifierBase2 objects can be included in a single DLL. 
williamr@2
    87
All notifiers are loaded during device startup and are not destroyed until 
williamr@2
    88
the Uikon server closes down.
williamr@2
    89
williamr@2
    90
All notifiers run in the uikon server thread so are able to directly access 
williamr@2
    91
server side status panes but cannot call any functions on REikAppUiSession. 
williamr@2
    92
williamr@2
    93
@publishedAll
williamr@2
    94
@released */
williamr@2
    95
class MEikSrvNotifierBase2
williamr@2
    96
	{
williamr@2
    97
public:
williamr@2
    98
	/** Defines a set of notifier priorities. The use and application of these values 
williamr@2
    99
	is implementation-dependent. */
williamr@2
   100
	enum TNotifierPriority
williamr@2
   101
		{
williamr@2
   102
		/** The highest priority value. */
williamr@2
   103
		ENotifierPriorityAbsolute = 500,
williamr@2
   104
		/** The second highest priority value. */
williamr@2
   105
		ENotifierPriorityVHigh = 400,	
williamr@2
   106
		/** The third highest priority value. */
williamr@2
   107
		ENotifierPriorityHigh = 300,	
williamr@2
   108
		/** The fourth highest priority value. */
williamr@2
   109
		ENotifierPriorityLow = 200,	
williamr@2
   110
		/** The fifth highest priority value. */
williamr@2
   111
		ENotifierPriorityVLow = 100,	
williamr@2
   112
		/** The lowest priority value. */
williamr@2
   113
		ENotifierPriorityLowest = 0	
williamr@2
   114
		};
williamr@2
   115
public:
williamr@2
   116
	/** Contains the notifier parameters.
williamr@2
   117
williamr@2
   118
	@see TNotifierPriority */
williamr@2
   119
	class TNotifierInfo
williamr@2
   120
		{
williamr@2
   121
	public:
williamr@2
   122
		/** The Uid that identifies the notifier. */
williamr@2
   123
		TUid iUid;
williamr@2
   124
		/** The Uid that identifies the channel to be used by the notifier (e.g. the screen, 
williamr@2
   125
		an LED etc) */
williamr@2
   126
		TUid iChannel;
williamr@2
   127
		/** The notifier priority, typically chosen from the standard set.
williamr@2
   128
	
williamr@2
   129
		@see TNotifierPriority */
williamr@2
   130
		TInt iPriority;
williamr@2
   131
		};
williamr@2
   132
williamr@2
   133
public:
williamr@2
   134
	IMPORT_C MEikSrvNotifierBase2();
williamr@2
   135
	IMPORT_C virtual ~MEikSrvNotifierBase2();
williamr@2
   136
public:
williamr@2
   137
	/** Frees all resources owned by this notifier.
williamr@2
   138
	
williamr@2
   139
	This function is called by the notifier framework when all resources allocated 
williamr@2
   140
	by notifiers should be freed. As a minimum, this function should delete this 
williamr@2
   141
	object (i.e. delete this;).
williamr@2
   142
	
williamr@2
   143
	Note that it is important to implement this function correctly to avoid memory 
williamr@2
   144
	leaks. */
williamr@2
   145
	virtual void Release() = 0;
williamr@2
   146
	/** Performs any initialisation that this notifier may require.
williamr@2
   147
	
williamr@2
   148
	The function is called when the notifier is loaded (when the plug-in DLL is 
williamr@2
   149
	loaded). It is called only once.
williamr@2
   150
	
williamr@2
   151
	As a minimum, the function should return a TNotifierInfo instance describing 
williamr@2
   152
	the notifier parameters. A good implementation would be to set this into a 
williamr@2
   153
	data member, and then to return it. This is because the same information is 
williamr@2
   154
	returned by Info().
williamr@2
   155
	
williamr@2
   156
	The function is safe to leave from, so it is possible, although rarely necessary, 
williamr@2
   157
	to allocate objects as you would normally do in a ConstructL() function as 
williamr@2
   158
	part of two-phase construction.
williamr@2
   159
	
williamr@2
   160
	@return Describes the parameters of the notifier. */
williamr@2
   161
	virtual TNotifierInfo RegisterL() = 0;
williamr@2
   162
	/** Gets the notifier parameters.
williamr@2
   163
	
williamr@2
   164
	This is usually the same information as returned by RegisterL() but can be 
williamr@2
   165
	varied at run time.
williamr@2
   166
	
williamr@2
   167
	@return Describes the parameters of the notifier. */
williamr@2
   168
	virtual TNotifierInfo Info() const = 0;
williamr@2
   169
	/** Starts the notifier.
williamr@2
   170
	
williamr@2
   171
	This is called as a result of a client-side call to RNotifier::StartNotifier(), 
williamr@2
   172
	which the client uses to start a notifier from which it does not expect a 
williamr@2
   173
	response.
williamr@2
   174
	
williamr@2
   175
	The function is synchronous, but it should be implemented so that it completes 
williamr@2
   176
	as soon as possible, allowing the notifier framework to enforce its priority 
williamr@2
   177
	mechanism.
williamr@2
   178
	
williamr@2
   179
	It is not possible to to wait for a notifier to complete before returning 
williamr@2
   180
	from this function unless the notifier is likely to finish implementing its 
williamr@2
   181
	functionality immediately.
williamr@2
   182
	
williamr@2
   183
	@param aBuffer Data that can be passed from the client-side. The format and 
williamr@2
   184
	meaning of any data is implementation dependent.
williamr@2
   185
	@return A pointer descriptor representing data that may be returned. The format 
williamr@2
   186
	and meaning of any data is implementation dependent. */
williamr@2
   187
	virtual TPtrC8 StartL(const TDesC8& aBuffer) = 0;
williamr@2
   188
	/** Starts the notifier.
williamr@2
   189
	
williamr@2
   190
	This is called as a result of a client-side call to the asynchronous function 
williamr@2
   191
	RNotifier::StartNotifierAndGetResponse(). This means that the client is waiting, 
williamr@2
   192
	asynchronously, for the notifier to tell the client that it has finished its 
williamr@2
   193
	work.
williamr@2
   194
	
williamr@2
   195
	It is important to return from this function as soon as possible, and derived 
williamr@2
   196
	classes may find it useful to take a copy of the reply-slot number and 
williamr@2
   197
	the RMessage object.
williamr@2
   198
	
williamr@2
   199
	The implementation of a derived class must make sure that Complete() is called 
williamr@2
   200
	on the RMessage object when the notifier is deactivated.
williamr@2
   201
	
williamr@2
   202
	This function may be called multiple times if more than one client starts 
williamr@2
   203
	the notifier.
williamr@2
   204
	
williamr@2
   205
	@param aBuffer Data that can be passed from the client-side. The format and 
williamr@2
   206
	meaning of any data is implementation dependent.
williamr@2
   207
	@param aReplySlot Identifies which message argument to use for the reply.
williamr@2
   208
    This message argument will refer to a modifiable descriptor, a TDes8 type, 
williamr@2
   209
	into which data can be returned. The format and meaning of any returned data 
williamr@2
   210
	is implementation dependent.
williamr@2
   211
	@param aMessage Encapsulates a client request. */
williamr@2
   212
	virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) = 0;
williamr@2
   213
	
williamr@2
   214
	/** Cancels an active notifier.
williamr@2
   215
	
williamr@2
   216
	This is called as a result of a client-side call to RNotifier::CancelNotifier().
williamr@2
   217
	
williamr@2
   218
	An implementation should free any relevant resources and complete any outstanding 
williamr@2
   219
	messages, if relevant. */
williamr@2
   220
	virtual void Cancel() = 0;
williamr@2
   221
	/** Updates a currently active notifier with new data.
williamr@2
   222
	
williamr@2
   223
	This is called as a result of a client-side call to RNotifier::UpdateNotifier().
williamr@2
   224
	
williamr@2
   225
	@param aBuffer Data that can be passed from the client-side. The format and 
williamr@2
   226
	meaning of any data is implementation dependent.
williamr@2
   227
	@return A pointer descriptor representing data that may be returned. The format 
williamr@2
   228
	and meaning of any data is implementation dependent. */
williamr@2
   229
	virtual TPtrC8 UpdateL(const TDesC8& aBuffer) = 0;
williamr@2
   230
	/** Updates a currently active notifier with new data.
williamr@2
   231
	
williamr@2
   232
	This is called as a result of a client-side call to the asynchronous function 
williamr@2
   233
	RNotifier::UpdateNotifierAndGetResponse(). This means that the client is waiting, 
williamr@2
   234
	asynchronously, for the notifier to tell the client that it has finished its 
williamr@2
   235
	work.
williamr@2
   236
	
williamr@2
   237
	It is important to return from this function as soon as possible, and derived 
williamr@2
   238
	classes may find it useful to take a copy of the reply-slot number and 
williamr@2
   239
	the RMessage object.
williamr@2
   240
	
williamr@2
   241
	The implementation of a derived class must make sure that Complete() is called 
williamr@2
   242
	on the RMessage object when the notifier is deactivated.
williamr@2
   243
	
williamr@2
   244
	This function may be called multiple times if more than one client updates 
williamr@2
   245
	the notifier.
williamr@2
   246
	
williamr@2
   247
	@param aBuffer Data that can be passed from the client-side. The format and 
williamr@2
   248
	meaning of any data is implementation dependent.
williamr@2
   249
	@param aReplySlot Identifies which message argument to use for the reply.
williamr@2
   250
    This message argument will refer to a modifiable descriptor, a TDes8 type, 
williamr@2
   251
	into which data can be returned. The format and meaning of any returned data 
williamr@2
   252
	is implementation dependent.
williamr@2
   253
	@param aMessage Encapsulates a client request. */
williamr@2
   254
	IMPORT_C virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
williamr@2
   255
public:
williamr@2
   256
	void SetManager(MEikSrvNotifierManager* aManager);
williamr@2
   257
protected:
williamr@2
   258
	MEikSrvNotifierManager* iManager;
williamr@2
   259
private:
williamr@2
   260
	IMPORT_C virtual void MEikSrvNotifierBase2_Reserved_2();
williamr@2
   261
public:	// internal
williamr@2
   262
	IMPORT_C virtual void HandleSystemEventL(TUid aEvent);
williamr@2
   263
	IMPORT_C virtual TInt NotifierCapabilites();
williamr@2
   264
private:
williamr@2
   265
	TInt iNotBSpare;
williamr@2
   266
	TInt iMEikSrvNotifierBase2_Spare;
williamr@2
   267
	};
williamr@2
   268
williamr@2
   269
williamr@2
   270
#endif	// __EIKNOTAPI_H__