appinstall_plat/task_plugin_api/inc/SWInstTask.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:   This file contains the header file of the CTask class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SWINSTTASK_H
       
    20 #define SWINSTTASK_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32strm.h>
       
    25 #include <ecom/ecom.h>
       
    26 
       
    27 #include <SWInstUid.h>
       
    28 
       
    29 class RWriteStream;
       
    30 class RReadStream;
       
    31 
       
    32 namespace SwiUI
       
    33 {
       
    34 
       
    35 //  CONSTANTS
       
    36 const TUid KTaskInterfaceUid = { KSWInstTaskInterfaceUid } ;
       
    37 
       
    38 /**
       
    39 * Task represents a single task in task manager. This is an abstract interface
       
    40 * and concrete tasks are implemented as ecom plugins.
       
    41 *
       
    42 * @since 3.0
       
    43 */
       
    44 class CTask : public CBase
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47  
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         inline static CTask* NewL( const TUid& aImplUid, TBool aIsPersistent );
       
    52         
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         inline virtual ~CTask();
       
    57 
       
    58     public: // New functions
       
    59         
       
    60         /**
       
    61         * Return the ECOM implementation uid of this task.
       
    62         * @since 3.0
       
    63         * @return ECOM uid of this implementation.
       
    64         */
       
    65         inline const TUid& ImplementationUid() const;
       
    66 
       
    67         /**
       
    68         * Indicate if this task is persistent or not.
       
    69         * @since 3.0
       
    70         * @return ETrue, if the task is persistent, EFalse otherwise.
       
    71         */
       
    72         inline TBool IsPersistent() const;
       
    73 
       
    74         /**
       
    75         * Gets the id of the task.
       
    76         * @since 3.0
       
    77         * @return Id of the task.
       
    78         */
       
    79         inline TInt Id() const;
       
    80 
       
    81         /**
       
    82         * Sets the id of the task. This should be used only by the 
       
    83         * task manager.
       
    84         * @since 3.0
       
    85         * @param aId - Id of the task.
       
    86         */
       
    87         inline void SetId( TInt aId );
       
    88 
       
    89         /**
       
    90         * Externalizes the task.
       
    91         * @since 3.0
       
    92         * @param aStream - The stream where to externalize.
       
    93         */      
       
    94         inline void ExternalizeL( RWriteStream& aStream ) const;
       
    95 
       
    96         /**
       
    97         * Internalizes the task.
       
    98         * @since 3.0
       
    99         * @param aStream - The stream where to internalize.
       
   100         */      
       
   101         inline void InternalizeL( RReadStream& aStream );
       
   102         
       
   103         /**
       
   104         * Executes the task.
       
   105         * @since 3.0
       
   106         */
       
   107         virtual void ExecuteL() = 0;
       
   108       
       
   109         /**
       
   110         * Adds a parameter to the task.
       
   111         * @since 3.0
       
   112         * @param aParam - Packaged paramter to set.
       
   113         * @param aIndex - Index of the parameter.
       
   114         */
       
   115         virtual void SetParameterL( const TDesC8& aParam, TInt aIndex ) = 0;        
       
   116 
       
   117     protected: // New functions        
       
   118 
       
   119         /**
       
   120         * Derived classes must implement this to externalize themselves.
       
   121         * @since 3.0
       
   122         * @param aStream - The stream where to externalize.
       
   123         */      
       
   124         virtual void DoExternalizeL( RWriteStream& aStream ) const = 0;
       
   125 
       
   126         /**
       
   127         * Derived classes must implement this to internalize themselves.
       
   128         * @since 3.0
       
   129         * @param aStream - The stream where to internalize.
       
   130         */      
       
   131         virtual void DoInternalizeL( RReadStream& aStream ) = 0;   
       
   132 
       
   133     private: // Data
       
   134        
       
   135         TUid iDestructKey;
       
   136         TUid iImplementationUid; 
       
   137         TBool iIsPersistent;        
       
   138         TInt iId;        
       
   139     };
       
   140 }
       
   141 
       
   142 #include "SWInstTask.inl"
       
   143 
       
   144 #endif      // SWINSTTASK_H   
       
   145             
       
   146 // End of File