usbengines/usbwatcher/inc/cusbdevicelock.h
changeset 35 9d8b04ca6939
parent 0 1e05558e2206
equal deleted inserted replaced
34:7858bc6ead78 35:9d8b04ca6939
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:  Header file for class CUsbDeviceLock.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CUSBDEVICELOCK_H
       
    20 #define CUSBDEVICELOCK_H
       
    21 
       
    22 class CUsbWatcher;
       
    23 
       
    24 /**
       
    25  *  Class for device lock notification
       
    26  *
       
    27  *  @lib euser.lib usbman.lib SysUtil.lib
       
    28  *  @since Series 60 2.?
       
    29  */
       
    30 NONSHARABLE_CLASS( CUsbDeviceLock ) : public CActive
       
    31     {
       
    32 
       
    33 public:
       
    34 
       
    35     static CUsbDeviceLock* NewL( CUsbWatcher& aOwner );
       
    36 
       
    37     virtual ~CUsbDeviceLock();
       
    38 
       
    39 public:
       
    40     /**
       
    41      * Subscribes device lock change event.
       
    42      *
       
    43      * @since Series 60 3.0
       
    44      */    
       
    45     void Subscribe();
       
    46     
       
    47     /**
       
    48      * Current state of device lock.
       
    49      *
       
    50      * @since Series 60 3.0
       
    51      * @return When set (ETrue) device is locked. When unset (EFalse) device is unlocked.
       
    52      */
       
    53     TBool Locked();
       
    54     
       
    55 public: // from base class CActive
       
    56     
       
    57     /**
       
    58      * From CActive.
       
    59      * This method is never called in this implementation.
       
    60      *
       
    61      * @since Series 60 3.0
       
    62      */
       
    63     TInt RunError( TInt /*aError*/ );
       
    64 
       
    65     /**
       
    66      * From CActive.
       
    67      * This method is called when device lock state has changed. 
       
    68      * New state is given to owner class.
       
    69      *
       
    70      * @since Series 60 3.0
       
    71      */
       
    72     void RunL();
       
    73 
       
    74     /**
       
    75      * From CActive.
       
    76      * Will cancel outstanding request if called.
       
    77      *
       
    78      * @since Series 60 3.0
       
    79      */
       
    80     void DoCancel();
       
    81       
       
    82 private:
       
    83 
       
    84     /**
       
    85      * C++ constructor.
       
    86      */
       
    87     CUsbDeviceLock( CUsbWatcher& aOwner );
       
    88 
       
    89     CUsbDeviceLock();
       
    90 
       
    91     void ConstructL();
       
    92       
       
    93 
       
    94 private:
       
    95     /**
       
    96      * Handle to P&S key
       
    97      */
       
    98     RProperty  iProperty;
       
    99     
       
   100     /**
       
   101      * Owner of this class
       
   102      */
       
   103     CUsbWatcher& iOwner;
       
   104 };
       
   105 
       
   106 #endif // CUSBDEVICELOCK_H
       
   107 
       
   108 // End of file
       
   109