sensorservices/orientationssy/inc/OrientationCRListener.h
changeset 0 4e1aa6a622a0
child 59 0f7422b6b602
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CTCChannel class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ORIENTATIONCRLISTENER_H
       
    21 #define ORIENTATIONCRLISTENER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <centralrepository.h>
       
    26 #include "internalorientationcrkeys.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MCenRepCallBack;
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * This class implements a central repository listener and is used for testing
       
    34 * purposes only.
       
    35 */
       
    36 NONSHARABLE_CLASS( CSsyOrientationCRListener ): public CActive
       
    37     {
       
    38     public:
       
    39     
       
    40         // Default C++ destructor
       
    41         ~CSsyOrientationCRListener();
       
    42     
       
    43     public: // New methods
       
    44     
       
    45         // Default C++ constructor
       
    46         CSsyOrientationCRListener( MCenRepCallBack& aPrtToCallback );
       
    47         
       
    48         /**
       
    49         * Creates a pointer to the timer
       
    50         *
       
    51         * @param aSetTimerToHzLevel the herz level the timer is set to
       
    52         * @param aPrtToCallback callback function of the caller
       
    53         * @return CTCSendEventTimer
       
    54         */
       
    55         static CSsyOrientationCRListener* NewL( 
       
    56             MCenRepCallBack& aPrtToCallback,
       
    57             CRepository* aRepository );
       
    58         
       
    59     protected: // Methods from base classes
       
    60         
       
    61         void ConstructL( CRepository* aRepository );
       
    62         
       
    63         // @see CActive
       
    64     	void RunL();
       
    65     	
       
    66     	// @see CActive
       
    67         void DoCancel();
       
    68         
       
    69         // @see CActive
       
    70         TInt RunError( TInt aError );
       
    71         
       
    72         void SetCenRepListener();
       
    73         
       
    74     private: // Private data for base channel
       
    75     
       
    76     // Pointer to 
       
    77     CRepository* iRepository;
       
    78     
       
    79     MCenRepCallBack& iCallBack;
       
    80     
       
    81     };
       
    82 
       
    83 /**
       
    84 * A callback for creating the configurations each time the value has changed.
       
    85 * This is used for testing purposes only so no need to optimize.
       
    86 */
       
    87 class MCenRepCallBack
       
    88     {
       
    89 public:
       
    90     virtual void CreateConfigurations() = 0;
       
    91     };
       
    92 
       
    93 #endif // ORIENTATIONCRLISTENER_H
       
    94 
       
    95 // End of File