browserutilities/feedsengine/FeedsServer/Server/inc/Task.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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:  Task base class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TASK_H
       
    20 #define TASK_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CIdle;
       
    36 class CFeedsServer;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 
       
    41 /**
       
    42 *  Task base class.  To cancel a task just simply delete it.
       
    43 *
       
    44 *  \b Library: FeedsEngine.lib
       
    45 *
       
    46 *  @since 3.0
       
    47 */
       
    48 class CTask: public CBase
       
    49     {
       
    50     public: // Destructor
       
    51         /**
       
    52         * Destructor.
       
    53         */        
       
    54         virtual ~CTask();
       
    55         
       
    56         
       
    57     public: // New Methods
       
    58         /**
       
    59         * Starts the task.
       
    60         *
       
    61         * @since 3.0
       
    62         * @return Void
       
    63         */
       
    64         virtual void StartTaskL() = 0;
       
    65         
       
    66         /**
       
    67         * Starts an CIdle to delete the instance after the callstack has unrolled.
       
    68         *
       
    69         * @since 3.0
       
    70         * @return Void
       
    71         */
       
    72         void AutoDelete();
       
    73         
       
    74 
       
    75     protected:
       
    76         /**
       
    77         * C++ default constructor.
       
    78         */
       
    79         CTask(CFeedsServer& aFeedsServer);
       
    80         
       
    81         /**
       
    82         * By default Symbian 2nd phase constructor is private.
       
    83         */
       
    84         void BaseConstructL(TBool aAutoDelete);
       
    85 
       
    86         
       
    87     private:
       
    88         /**
       
    89         * Deletes the instance after the callstack has unrolled..
       
    90         *
       
    91         * @since 3.0
       
    92         * @return Void
       
    93         */
       
    94         static TInt DelayedDelete(TAny* aPtr);
       
    95                
       
    96         
       
    97     protected:
       
    98         CFeedsServer&  iFeedsServer;
       
    99 
       
   100 
       
   101     private:
       
   102         CIdle*         iAutoDelete;    
       
   103     };
       
   104 
       
   105 #endif      // TASK_H
       
   106             
       
   107 // End of File