diff -r 000000000000 -r a2952bb97e68 mmappfw_plat/mpx_common_api/inc/mpxmessagemonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/mpx_common_api/inc/mpxmessagemonitor.h Thu Dec 17 08:55:47 2009 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Message monitor +* +*/ + + + +#ifndef CMPXMESSAGEMONITOR_H +#define CMPXMESSAGEMONITOR_H + +#include +#include +#include "mpxmessageobserver.h" + +class RMPXSession; + +/** +* Monitor messages in the message queue. +* The class is always derived from and is never instantiated explicitly. +* +* @lib mpxcommon.lib +*/ +class CMPXMessageMonitor : public CActive + { +public: + /** + * Two-phased constructor. + * + * @since S60 3.2.3 + * @param aSession refrence to session object + * @param aObserver observer + */ + IMPORT_C static CMPXMessageMonitor* NewL(const RMPXSession& aSession, + MMPXMessageObserver& aObserver); + + /** + * Destructor. + * + * @since S60 3.2.3 + */ + IMPORT_C virtual ~CMPXMessageMonitor(); + + /** + * Get next message. + * + * @since S60 3.2.3 + */ + IMPORT_C void GetNextMessage(); + +protected: // From base class + + /** + * From CActive. + * Handles request completion event. + * + * @since S60 3.2.3 + */ + IMPORT_C void RunL(); + + /** + * From CActive. + * Implements cancellation of an outstanding request. + * + * @since S60 3.2.3 + */ + IMPORT_C void DoCancel(); + + /** + * From CActive. + * Handles a leave occurring in the request completion event handler RunL(). + * + * @since S60 3.2.3 + * @param aError error code + */ + IMPORT_C TInt RunError(TInt aError); + + +protected: // New function + + /** + * Wait for next message. + * + * @since S60 3.2.3 + */ + void WaitForNextMessage(); + + +private: + + /** + * C++ constructor. + * + * @since S60 3.2.3 + * @param aSession refrence to session object + * @param aObserver observer + */ + CMPXMessageMonitor(const RMPXSession& aSession, + MMPXMessageObserver& aObserver); + + /** + * Second phase constructor. + * + * @since S60 3.2.3 + */ + void ConstructL(); + +private: + const RMPXSession& iSession; + MMPXMessageObserver& iObserver; + TPckgBuf iMsgDataPkg; // Message data package + TPckgBuf iErrorPkg; // Error code package + }; + +#endif // CMPXMESSAGEMONITOR_H + +// End of file