epoc32/include/mw/aknwseventobserver.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
/*
williamr@2
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  ?Description
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#if !defined(__AKNWSEVENTOBSERVER_H__)
williamr@2
    20
#define __AKNWSEVENTOBSERVER_H__
williamr@2
    21
williamr@2
    22
// INCLUDES
williamr@2
    23
#include <e32std.h>
williamr@2
    24
//#include <w32std.h>
williamr@2
    25
#include <coecntrl.h>
williamr@2
    26
williamr@2
    27
// CONSTANTS
williamr@2
    28
williamr@2
    29
enum TAknWsEventObserverPanic
williamr@2
    30
	{
williamr@2
    31
	EAknWsEventObserverFailedToAddObserver,
williamr@2
    32
	EAknWsEventObserverUnknownObserverRemoved
williamr@2
    33
	};
williamr@2
    34
williamr@2
    35
GLREF_C void Panic(TAknWsEventObserverPanic aPanic);
williamr@2
    36
williamr@2
    37
williamr@2
    38
// CLASS DECLARATION
williamr@2
    39
williamr@2
    40
/**
williamr@2
    41
*  Support for events to be sent independent of the control stack to other 
williamr@2
    42
*  consumers yet internal to the application.
williamr@2
    43
*
williamr@2
    44
*  
williamr@2
    45
*/
williamr@2
    46
class MAknWsEventObserver
williamr@2
    47
	{
williamr@2
    48
public:
williamr@2
    49
	virtual void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination) = 0;
williamr@2
    50
	};
williamr@2
    51
williamr@2
    52
williamr@2
    53
// CLASS DECLARATION
williamr@2
    54
williamr@2
    55
/**
williamr@2
    56
*  This class distributes events to the window server event observers; 
williamr@2
    57
*  It is itself a window server event observer.
williamr@2
    58
*
williamr@2
    59
*  @since Series 60 0.9
williamr@2
    60
*/
williamr@2
    61
class CAknWsEventMonitor: public CBase, public MAknWsEventObserver
williamr@2
    62
{
williamr@2
    63
public:
williamr@2
    64
williamr@2
    65
    /**
williamr@2
    66
    * Two-phased constructor.
williamr@2
    67
    */
williamr@2
    68
	static CAknWsEventMonitor* NewL();
williamr@2
    69
williamr@2
    70
    /**
williamr@2
    71
    * Destructor.
williamr@2
    72
    */
williamr@2
    73
	virtual ~CAknWsEventMonitor();
williamr@2
    74
williamr@2
    75
    /**
williamr@2
    76
    * Two-phased constructor.
williamr@2
    77
    */
williamr@2
    78
	void ConstructL();
williamr@2
    79
williamr@2
    80
    /**
williamr@2
    81
    * Adds an event observer if there is not one yet.
williamr@2
    82
    * @param aEventObserver A pointer to the event observer.
williamr@2
    83
    */
williamr@2
    84
	IMPORT_C void AddObserverL(MAknWsEventObserver* aEventObserver);
williamr@2
    85
williamr@2
    86
    /**
williamr@2
    87
    * Removes the event observer.
williamr@2
    88
    * @param aEventObserver A pointer to the event observer. (not used in default implementation)
williamr@2
    89
    */
williamr@2
    90
	IMPORT_C void RemoveObserver(const MAknWsEventObserver* aEventObserver);
williamr@2
    91
williamr@2
    92
    /**
williamr@2
    93
    * Window server event handler.
williamr@2
    94
    * @param aEvent The event.
williamr@2
    95
    * @param aDestination Event destination.
williamr@2
    96
    */
williamr@2
    97
	IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
williamr@2
    98
	
williamr@2
    99
    /**
williamr@2
   100
    * Enables / disables event observer. AknAppUi provides all window server events to enabled monitor automatically
williamr@2
   101
    *
williamr@2
   102
    * @since S60 3.2
williamr@2
   103
    */
williamr@2
   104
    IMPORT_C void Enable(TBool aEnable = ETrue);
williamr@2
   105
	
williamr@2
   106
	/**
williamr@2
   107
	* Internal to Avkon
williamr@2
   108
	*
williamr@2
   109
	* @since S60 3.2
williamr@2
   110
	*/	
williamr@2
   111
	TBool IsEnabled();
williamr@2
   112
	
williamr@2
   113
	
williamr@2
   114
williamr@2
   115
private:
williamr@2
   116
	RPointerArray<MAknWsEventObserver>* iEventObservers;
williamr@2
   117
	TBool iEnabled; // was TInt iSpare;
williamr@2
   118
williamr@2
   119
private:
williamr@2
   120
// reserved virtual function space
williamr@2
   121
	IMPORT_C virtual void Reserved_1();
williamr@2
   122
williamr@2
   123
};
williamr@2
   124
williamr@2
   125
williamr@2
   126
#endif  // __AKNWSEVENTOBSERVER_H__