messagingfw/alwaysonline/AlwaysOnlineManager/inc/MuiuMsvSingleOpWatcher.h
branchRCL_3
changeset 22 d2c4c66342f3
equal deleted inserted replaced
21:e5b3a2155e1a 22:d2c4c66342f3
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Messaging progress watching classes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __MUIUMSVSINGLEOPWATCHER_H__
       
    23 #define __MUIUMSVSINGLEOPWATCHER_H__
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <MSVSTD.H>
       
    28 
       
    29 
       
    30 // CONSTANTS
       
    31 const TInt KMsvSingleOpWatcherArrayGranularity = 4;
       
    32 
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CMsvOperation;
       
    36 class MMsvSingleOpWatcher;
       
    37 
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 * CMsvOperation watcher class.
       
    44 */
       
    45 class CMsvSingleOpWatcher : public CActive
       
    46     {
       
    47     public:
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         IMPORT_C static CMsvSingleOpWatcher* NewLC( MMsvSingleOpWatcher& aObserver );
       
    52 
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         IMPORT_C static CMsvSingleOpWatcher* NewL( MMsvSingleOpWatcher& aObserver );
       
    57 
       
    58         /**
       
    59         * Destructor
       
    60         */
       
    61         IMPORT_C ~CMsvSingleOpWatcher();
       
    62 
       
    63         /**
       
    64         * Sets operation
       
    65         * Must only be called once during the lifetime of a CMsvSingleOpWatcher
       
    66         * object.
       
    67         */
       
    68         IMPORT_C void SetOperation( CMsvOperation* aOperation );
       
    69 
       
    70         /**
       
    71         * Returns reference to the operation
       
    72         */
       
    73         IMPORT_C CMsvOperation& Operation() const;
       
    74 
       
    75     private:
       
    76         /**
       
    77         * C++ constructor
       
    78         */
       
    79         CMsvSingleOpWatcher( MMsvSingleOpWatcher& aObserver );
       
    80 
       
    81         /**
       
    82         * Symbian OS constructor
       
    83         */
       
    84         void ConstructL();
       
    85 
       
    86         /**
       
    87         * From CActive
       
    88         */
       
    89         virtual void DoCancel();
       
    90 
       
    91         /**
       
    92         * From CActive
       
    93         */
       
    94         virtual void RunL();
       
    95 
       
    96     private:
       
    97         MMsvSingleOpWatcher& iObserver;
       
    98         CMsvOperation *iOperation;
       
    99     };
       
   100 
       
   101 
       
   102 /**
       
   103 * Mixin class MMsvSingleOpWatcher
       
   104 *
       
   105 * Function OpCompleted is called when operation is completed.
       
   106 */
       
   107 class MMsvSingleOpWatcher
       
   108     {
       
   109     public:
       
   110         virtual void OpCompleted( CMsvSingleOpWatcher& aOpWatcher, TInt aCompletionCode ) = 0;
       
   111     };
       
   112 
       
   113 
       
   114 /**
       
   115 * Class CMsvSingleOpWatcherArray
       
   116 *
       
   117 * Use this define when we want to use an array of CMsvSingleOpWatcher objects.
       
   118 */
       
   119 
       
   120 typedef CArrayPtrFlat<CMsvSingleOpWatcher> CMsvSingleOpWatcherArray;
       
   121 
       
   122 
       
   123 #endif // __MSVSINGLEOPWATCHER_H__
       
   124 
       
   125 // End of file