sensorservices/orientationssy/inc/OrientationCRListener.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:29:05 +0300
branchRCL_3
changeset 21 ccb4f6b3db21
parent 0 4e1aa6a622a0
child 22 8cb079868133
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2008 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:  CTCChannel class declaration.
*
*/



#ifndef ORIENTATIONCRLISTENER_H
#define ORIENTATIONCRLISTENER_H

// INCLUDES
#include <e32base.h>
#include <centralrepository.h>
#include "internalorientationcrkeys.h"

// FORWARD DECLARATIONS
class MCenRepCallBack;
// CLASS DECLARATION

/**
* This class implements a central repository listener and is used for testing
* purposes only.
*/
NONSHARABLE_CLASS( CSsyOrientationCRListener ): public CActive
    {
    public:
    
        // Default C++ destructor
        ~CSsyOrientationCRListener();
    
    public: // New methods
    
        // Default C++ constructor
        CSsyOrientationCRListener( MCenRepCallBack& aPrtToCallback );
        
        /**
        * Creates a pointer to the timer
        *
        * @param aSetTimerToHzLevel the herz level the timer is set to
        * @param aPrtToCallback callback function of the caller
        * @return CTCSendEventTimer
        */
        static CSsyOrientationCRListener* NewL( 
            MCenRepCallBack& aPrtToCallback,
            CRepository* aRepository );
        
    protected: // Methods from base classes
        
        void ConstructL( CRepository* aRepository );
        
        // @see CActive
    	void RunL();
    	
    	// @see CActive
        void DoCancel();
        
        // @see CActive
        TInt RunError( TInt aError );
        
        void SetCenRepListener();
        
    private: // Private data for base channel
    
    // Pointer to 
    CRepository* iRepository;
    
    MCenRepCallBack& iCallBack;
    
    };

/**
* A callback for creating the configurations each time the value has changed.
* This is used for testing purposes only so no need to optimize.
*/
class MCenRepCallBack
    {
public:
    virtual TInt CreateConfigurations() = 0;
    };

#endif // ORIENTATIONCRLISTENER_H

// End of File