supl/locationsuplfw/settingsapi/inc/epos_csuplsettingsnotifier.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 12:40:28 +0300
branchRCL_3
changeset 49 10852b179f64
parent 45 6b6920c56e2f
child 55 ea98413ce11f
permissions -rw-r--r--
Revision: 201035 Kit: 201036

/*
* 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;

        
        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