upnpsharing/applicationengine/inc/upnpprogresswatcher.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2007 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:      file sharing engine active object class defition
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef __UPNPPROGRESSWATCHER_H__
       
    25 #define __UPNPPROGRESSWATCHER_H__
       
    26 
       
    27 
       
    28 // Include Files
       
    29 #include <e32base.h>
       
    30 #include <e32property.h>
       
    31 #include "upnpcontentserverclient.h"
       
    32 #include "upnpfilesharingengineobserver.h"
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 /**
       
    39  * Active object class for observing sharing progress
       
    40  * @since S60 3.1
       
    41  */
       
    42 NONSHARABLE_CLASS( CUpnpProgressWatcher ): public CActive
       
    43     {
       
    44 public: // Constructors and destructor
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @param aEngine File sharing engine
       
    49      */
       
    50     static CUpnpProgressWatcher* NewL( CUPnPFileSharingEngine& aEngine );
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CUpnpProgressWatcher();
       
    56 
       
    57 public: // New functions
       
    58 
       
    59     /**
       
    60      * Starts listening property
       
    61      * @since S60 3.1
       
    62      */
       
    63     void StartL();
       
    64 
       
    65     /**
       
    66      * Stops listening property
       
    67      * @since S60 3.1
       
    68      */
       
    69     void Stop();
       
    70 
       
    71 protected:
       
    72 
       
    73     /**
       
    74      * Function is called when active request is ready
       
    75      */
       
    76     virtual void RunL();
       
    77 
       
    78     /**
       
    79      * Cancels active request
       
    80      */
       
    81     virtual void DoCancel();
       
    82 
       
    83 private:
       
    84 
       
    85     /**
       
    86      * C++ default constructor.
       
    87      * @param aEngine File sharing engine
       
    88      */
       
    89     CUpnpProgressWatcher( CUPnPFileSharingEngine& aEngine );
       
    90 
       
    91     /**
       
    92      * By default Symbian 2nd phase constructor is private.
       
    93      */
       
    94     void ConstructL();
       
    95 
       
    96     /**
       
    97      * Determine if the sharing completed note needs to be shown
       
    98      * @since S60 3.1
       
    99      * @param aProgress Progress information struct
       
   100      */
       
   101     void SetShowCompleteNote( const TUpnpProgress& aProgress );
       
   102 
       
   103     /**
       
   104      * Determine if there is sharing ongoing
       
   105      * @since S60 3.1
       
   106      * @param aProgress Progress information struct
       
   107      * @return ETrue if there is sharing ongoing for at least one media type
       
   108      */
       
   109     TBool SharingOngoing( const TUpnpProgress& aProgress );
       
   110 
       
   111     /**
       
   112      * Handle Errors
       
   113      * @since S60 3.1
       
   114      * @param aProgress Progress information struct
       
   115      */
       
   116     void HandleErrorL( const TUpnpProgress& aProgress );
       
   117 
       
   118 private: // data
       
   119 
       
   120     /**
       
   121      * file sharing engine
       
   122      */
       
   123     CUPnPFileSharingEngine& iEngine;
       
   124 
       
   125     /**
       
   126      * property subscribed
       
   127      */
       
   128     RProperty iProgressInfo;
       
   129 
       
   130     /**
       
   131      * Indicates if is is needed to show note about sharing end 
       
   132      */
       
   133     TBool iShowCompleteNote;
       
   134 
       
   135     };
       
   136 
       
   137 
       
   138 #endif  // __UPNPPROGRESSWATCHER_H__
       
   139 
       
   140 // End of file