psmservices/psmserver/inc/server/psmsrvmessage.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/psmservices/psmserver/inc/server/psmsrvmessage.h	Tue Feb 02 00:53:00 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2007 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:  PSM server message.
+*
+*/
+
+
+#ifndef PSMSRVMESSAGE_H
+#define PSMSRVMESSAGE_H
+
+#include <e32base.h>
+#include "psmmodechangeobserver.h"
+
+class CPsmManager;
+
+/**
+ *  PSM Message
+ *
+ *  Wraps the message for PSM servers internal message handling
+ *
+ *  @since S60 5.0
+ */
+class CPsmMessage : public CBase,
+                    public MPsmModeChangeObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor for external message
+         *
+         * @return New CSensrvMessage instance
+         */
+        static CPsmMessage* NewL( CPsmManager& aPsmManager );
+
+        /**
+         * Two-phased constructor for external message
+         *
+         * @return New CSensrvMessage instance
+         */
+        static CPsmMessage* NewLC( CPsmManager& aPsmManager );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPsmMessage();
+
+        /**
+         * Initializes the message. Must be done before message is
+         * used first time and before use after each complete.
+         *
+         * @param aMessage Client message to wrap
+         */
+        void Initialize( const RMessage2& aMessage );
+
+        /**
+         * Completes the message
+         *
+         * @param aReason Completion reason identifier. Usually error code.
+         */
+        void Complete( TInt aReason ) const;
+
+        /**
+         * Observes the mode change completion
+         */
+        void NotifyPsmModeChangeComplete( const TInt aError );
+
+    private:
+
+        /**
+         * C++ constructor.
+         */
+        CPsmMessage( CPsmManager& aPsmManager );
+
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+
+    private:    // Data
+
+        /**
+         * Wrapped message
+         */
+        RMessage2 iMessage;
+
+        /**
+         * Reference to PSM manager
+         */
+        CPsmManager& iPsmManager;
+
+    };
+
+#endif // PSMSRVMESSAGE_H