sl@0: /* sl@0: * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: Definition of the event observer class sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #ifndef CSOURCEORIENTATIONEVENTOBSERVER_H sl@0: #define CSOURCEORIENTATIONEVENTOBSERVER_H sl@0: sl@0: // INCLUDES sl@0: #include sl@0: #include "SourceOrientationProxy.h" sl@0: sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * SourceOrientation event observer provides encapsulates a monitoring request towards the message handler. sl@0: * sl@0: * @lib SourceOrientationProxy.lib sl@0: * @since 3.0 sl@0: */ sl@0: class CSourceOrientationEventObserver : public CActive sl@0: { sl@0: public: // Constructors and destructor sl@0: sl@0: /** sl@0: * Two-phased constructor. sl@0: */ sl@0: static CSourceOrientationEventObserver* NewL(TMMFMessageDestinationPckg aMessageHandler, MCustomCommand& aCustomCommand, sl@0: MSourceOrientationCallback& aCallback); sl@0: sl@0: /** sl@0: * Destructor. sl@0: */ sl@0: virtual ~CSourceOrientationEventObserver(); sl@0: sl@0: public: // New functions sl@0: sl@0: /** sl@0: * Start event monitoring sl@0: * @since 3.0 sl@0: */ sl@0: void Start(); sl@0: sl@0: /** sl@0: * Stop event monitoring sl@0: * @since 3.0 sl@0: */ sl@0: void Stop(); sl@0: sl@0: sl@0: private: sl@0: sl@0: /** sl@0: * C++ default constructor. sl@0: */ sl@0: CSourceOrientationEventObserver(); sl@0: sl@0: /** sl@0: * By default Symbian 2nd phase constructor is private. sl@0: */ sl@0: void ConstructL(TMMFMessageDestinationPckg aMessageHandler, MCustomCommand& aCustomCommand, sl@0: MSourceOrientationCallback& aCallback); sl@0: sl@0: void RunL(); sl@0: sl@0: void DoCancel(); sl@0: sl@0: private: sl@0: sl@0: // Pointer to custom command utility sl@0: MCustomCommand* iCustomCommand; sl@0: // Message handler handle sl@0: TMMFMessageDestinationPckg iMessageHandler; sl@0: // SourceOrientation change event Callbacks sl@0: MSourceOrientationCallback* iCallback; sl@0: // Data package received from server sl@0: TEfOrientationDataPckg iDataPckgFrom; sl@0: // sl@0: TBool iStopped; sl@0: }; sl@0: sl@0: #endif // CSOURCEORIENTATIONEVENTOBSERVER_H sl@0: