supl/locationsuplfw/settingsapi/inc/epos_csuplsettingsnotifier.h
changeset 0 667063e416a2
child 22 4c4ed41530db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/supl/locationsuplfw/settingsapi/inc/epos_csuplsettingsnotifier.h	Tue Feb 02 01:06:48 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005 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:  
+*       See class description below.
+*
+*/
+
+
+
+#ifndef __EPOS_CSUPLSETTINGSNOTIFIER_H__
+#define __EPOS_CSUPLSETTINGSNOTIFIER_H__
+
+//  INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CRepository;
+class MSuplSettingsObserver;
+
+// CLASS DECLARATION
+
+/**
+*  This class listens for SUPL settings events. Every change is reported to the
+*  observer.
+*
+* This is part of @lib epos_suplsettings.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS(CSuplSettingsNotifier) :public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        *
+        * @param aSuplSettingsEngine The SUPL Settings 
+        * @param aObserver The SUPL Settings observer
+        */
+        static CSuplSettingsNotifier* NewL(
+        /* IN  */   MSuplSettingsObserver& aObserver,/* IN */ TBool aDBListener = EFalse
+        );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSuplSettingsNotifier();
+
+    public: // New functions
+
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        TInt RunError(
+        /* IN  */       TInt  aError
+        );
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSuplSettingsNotifier(
+        /* IN  */   MSuplSettingsObserver& aObserver, /*IN*/ TBool aDBListener = EFalse);
+
+        /**
+        * By default EPOC constructor is protected.
+        */
+        void ConstructL();
+
+    private:  // New functions
+
+        void StartListening();
+        
+    private:
+        // By default, prohibit copy constructor
+        CSuplSettingsNotifier( const CSuplSettingsNotifier& );
+        // Prohibit assigment operator
+        CSuplSettingsNotifier& operator= ( const CSuplSettingsNotifier& );
+
+    private:    // Data
+        MSuplSettingsObserver&  iObserver;
+        CRepository* iRepository;
+        
+        TBool iStopObserve;
+
+        CSuplSettings::TSuplSettingsUsage   iUsage;
+        
+        TInt iFallBackValue;
+        TInt iFallBackTimerValue;
+        
+        
+        //used to indicate if this object was created to listen for DB Change events
+        TBool iDBListener; 
+         
+        HBufC* iImsi;
+    };
+
+#endif      // __EPOS_CSUPLSETTINGSNOTIFIER_H__
+
+// End of File