wim/SwimReader/inc/SwimSysAgentObserver.h
changeset 0 164170e6151a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wim/SwimReader/inc/SwimSysAgentObserver.h	Tue Jan 26 15:20:08 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2003 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:  Implement SIM state observer for card removed event
+*
+*/
+
+
+
+#ifndef CSWIMSYSAGENTOBSERVER_H
+#define CSWIMSYSAGENTOBSERVER_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h> // RProperty
+
+//  FORWARD DECLARATIONS
+class CSwimReaderIF;
+
+// CLASS DECLARATION
+
+/**
+*  Publish and subscribe Observer class
+*  This class listens P/S events
+*
+*  @lib SwimReader.lib
+*  @since Series60 1.2
+*/
+class CSwimSysAgentObserver : public CActive
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aReaderIF Pointer to ReaderIF owning this observer
+        */ 
+        static CSwimSysAgentObserver* NewL( CSwimReaderIF* aReaderIF );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSwimSysAgentObserver();
+
+    public: // New functions
+        
+        /**
+        * Starts listener
+        * @return void 
+        */
+        void Start();
+
+    private: 
+
+        /**
+        * C++ default constructor.
+        * @param aReaderIF Pointer to ReaderIF owning this observer
+        */ 
+        CSwimSysAgentObserver( CSwimReaderIF* aReaderIF );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * This function starts listening card state from System agent
+        * @return void
+        */
+        void StartListening();
+        /**
+        * From CActive. Handle asyncronous event response
+        * @return void
+        */
+        void RunL();
+
+        /**
+        * From CActive. Handle Cancel call
+        * @return void
+        */
+        void DoCancel();
+
+    private:    // Data
+        // SIM status property
+        RProperty       iProperty;
+        // Pointer to ReaderIF owning this observer. Not owned.
+        CSwimReaderIF*  iReaderIF;
+    };
+
+#endif      // CSWIMSYSAGENTOBSERVER_H
+            
+// End of File