bluetoothengine/bthid/common/inc/bthidpskeywatcher.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2004-2006 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: 
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef BTHIDPSKEYWATCHER_H_
       
    21 #define BTHIDPSKEYWATCHER_H_
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32property.h>
       
    25 
       
    26 class MMouseCursorStatusObserver;
       
    27 
       
    28 /*
       
    29 * An abstarct interface that defines a callback method
       
    30 * for the hid mouse cursor observer. CursorStatusChangedL
       
    31 * is called by CBTMouseCursorStatusObserver when the mouse device 
       
    32 * connection state has changed. aStatus represents the new status 
       
    33 * value.
       
    34 */
       
    35 class MMouseCursorStatusObserver
       
    36     {
       
    37     public:
       
    38     virtual void MouseCursorStatusChangedL(TInt aStatus) = 0;
       
    39     };
       
    40     
       
    41 /*
       
    42 * An observer that monitors KPSUidBluetoothSapConnectionState
       
    43 * P&S key. The clients can call SubscribeCursorStatusL in order to 
       
    44 * get a chenged new SAP connection status returned via 
       
    45 * MSapStatusObserver::SapStatusChangedL.
       
    46 */ 
       
    47 class CBTMouseCursorStatusObserver : public CActive
       
    48     {
       
    49 public:
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     */
       
    53     static CBTMouseCursorStatusObserver* NewL();
       
    54     /**
       
    55     * Destructor.
       
    56     */
       
    57     virtual ~CBTMouseCursorStatusObserver();
       
    58     
       
    59     /**
       
    60     * Starts listening KPSUidBluetoothSapConnectionState P&S key.
       
    61     * When the key value is changed, the new state is indicated
       
    62     * through the observer interface (MSapStatusObserver).
       
    63     */
       
    64     void SubscribeMouseCursorStatusL(MMouseCursorStatusObserver* aObserver);
       
    65       
       
    66 private:
       
    67     /**
       
    68     * Two-Phase constructor
       
    69     */
       
    70     void ConstructL();
       
    71     
       
    72     /**
       
    73     * Default constructor
       
    74     */
       
    75     CBTMouseCursorStatusObserver();
       
    76     
       
    77     // From CActive
       
    78     virtual void DoCancel();
       
    79     virtual void RunL();
       
    80       
       
    81 private:
       
    82     MMouseCursorStatusObserver* iObserver;
       
    83     RProperty iProperty;
       
    84     };
       
    85 
       
    86 
       
    87 #endif /* BTHIDPSKEYWATCHER_H_ */