upnpavcontroller/upnpavcontrollerclient/inc/upnpavdeviceactive.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 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:      AO for monitoring device disconnections per session
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_UPNPAVDEVICEACTIVE_H
       
    24 #define C_UPNPAVDEVICEACTIVE_H
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <e32base.h>
       
    28 #include "upnpavrenderingsessionobserver.h"
       
    29 
       
    30 class RUPnPAVControllerClient;
       
    31 class MUPnPAVDeviceObserver;
       
    32 
       
    33 /**
       
    34  *  Device active
       
    35  *
       
    36  *  Active object for listening if a device disappears.
       
    37  *
       
    38  *  @lib upnpavcontrollerclient.lib
       
    39  *  @since S60 v3.1
       
    40  */
       
    41 class CUPnPAVDeviceActive : public CActive
       
    42     {
       
    43 
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      *
       
    49      * @param aServer session handle
       
    50      * @param aObserver device observer
       
    51      * @return an instance
       
    52      */
       
    53     static CUPnPAVDeviceActive* NewL( RUPnPAVControllerClient& aServer,
       
    54         MUPnPAVDeviceObserver& aObserver );
       
    55     
       
    56     /**
       
    57      * Destructor
       
    58      */
       
    59     virtual ~CUPnPAVDeviceActive();
       
    60        
       
    61 private:
       
    62 
       
    63     /**
       
    64      * Constructor.
       
    65      */
       
    66     CUPnPAVDeviceActive( RUPnPAVControllerClient& aServer,
       
    67         MUPnPAVDeviceObserver& aObserver );
       
    68     
       
    69     /**
       
    70      * 2nd phase construct
       
    71      */
       
    72     void ConstructL();
       
    73 
       
    74 protected: // From CActive
       
    75 
       
    76     /**
       
    77      * See e32base.h
       
    78      */
       
    79     void RunL();
       
    80     
       
    81     /**
       
    82      * See e32base.h
       
    83      */
       
    84     void DoCancel();
       
    85     
       
    86     /**
       
    87      * See e32base.h
       
    88      */
       
    89     TInt RunError( TInt aError );
       
    90 
       
    91 public: // New functions    
       
    92 
       
    93     /**
       
    94      * Starts listening
       
    95      *
       
    96      * @param aId session id
       
    97      */
       
    98     void StartListening( TInt aId );
       
    99 
       
   100 private:
       
   101 
       
   102     RUPnPAVControllerClient& iServer;
       
   103     
       
   104     TInt iId;
       
   105 
       
   106     MUPnPAVDeviceObserver& iObserver;       
       
   107     
       
   108     };
       
   109 
       
   110 #endif // C_UPNPAVDEVICEACTIVE_H