2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: ?Description
19 #if !defined(__AKNWSEVENTOBSERVER_H__)
20 #define __AKNWSEVENTOBSERVER_H__
29 enum TAknWsEventObserverPanic
31 EAknWsEventObserverFailedToAddObserver,
32 EAknWsEventObserverUnknownObserverRemoved
35 GLREF_C void Panic(TAknWsEventObserverPanic aPanic);
41 * Support for events to be sent independent of the control stack to other
42 * consumers yet internal to the application.
46 class MAknWsEventObserver
49 virtual void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination) = 0;
56 * This class distributes events to the window server event observers;
57 * It is itself a window server event observer.
59 * @since Series 60 0.9
61 class CAknWsEventMonitor: public CBase, public MAknWsEventObserver
66 * Two-phased constructor.
68 static CAknWsEventMonitor* NewL();
73 virtual ~CAknWsEventMonitor();
76 * Two-phased constructor.
81 * Adds an event observer if there is not one yet.
82 * @param aEventObserver A pointer to the event observer.
84 IMPORT_C void AddObserverL(MAknWsEventObserver* aEventObserver);
87 * Removes the event observer.
88 * @param aEventObserver A pointer to the event observer. (not used in default implementation)
90 IMPORT_C void RemoveObserver(const MAknWsEventObserver* aEventObserver);
93 * Window server event handler.
94 * @param aEvent The event.
95 * @param aDestination Event destination.
97 IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
100 * Enables / disables event observer. AknAppUi provides all window server events to enabled monitor automatically
104 IMPORT_C void Enable(TBool aEnable = ETrue);
116 RPointerArray<MAknWsEventObserver>* iEventObservers;
117 TBool iEnabled; // was TInt iSpare;
120 // reserved virtual function space
121 IMPORT_C virtual void Reserved_1();
126 #endif // __AKNWSEVENTOBSERVER_H__