appinstall_plat/task_management_api/inc/SWInstTaskManager.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 CTaskManager class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SWINSTTASKMANAGER_H
       
    20 #define SWINSTTASKMANAGER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 namespace SwiUI
       
    26 {
       
    27 
       
    28 class CTask;
       
    29 class CTaskManagerImpl;
       
    30 
       
    31 /**
       
    32 * TaskManager handles persistent and nonpersistent tasks in the subsystem. It
       
    33 * can be used to make sure that critical tasks are executed even in case of
       
    34 * fatal error such as power failure.
       
    35 *
       
    36 * @since 3.0
       
    37 * @lib SWInstTaskManager.lib
       
    38 */
       
    39 class CTaskManager : public CBase
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42        
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         IMPORT_C static CTaskManager* NewL();
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         IMPORT_C virtual ~CTaskManager();
       
    52 
       
    53     public: // New functions
       
    54         
       
    55         /**
       
    56         * Adds a task to the task list.
       
    57         * @since 3.0
       
    58         * @param aTask - Pointer to the CTask object. Transfers ownership to TaskManager.
       
    59         */
       
    60         IMPORT_C void AddTaskL( CTask* aTask );
       
    61 
       
    62         /**
       
    63         * Removes a task from the task list.
       
    64         * @since 3.0
       
    65         * @param aTask - Pointer to the CTask object.
       
    66         */
       
    67         IMPORT_C void RemoveTaskL( CTask* aTask );
       
    68 
       
    69         /**
       
    70         * Removes tasks from task list without executing them.
       
    71         * @since 3.0
       
    72         */                
       
    73         IMPORT_C void FlushTasks();
       
    74 
       
    75         /**
       
    76         * Executes all pending tasks that are added to the task list within 
       
    77         * the lifetime of this thread.
       
    78         * In order to recover from fatal error, please use ExecutelRecoveryTasksL.
       
    79         * @since 3.0
       
    80         */        
       
    81         IMPORT_C void ExecutePendingTasksL();
       
    82 
       
    83         /**
       
    84         * Executes all tasks from non persistent and persistent memory. This
       
    85         * should be used to recover from fatal error e.g. power loss.
       
    86         * @since 3.0
       
    87         */        
       
    88         IMPORT_C void ExecuteRecoveryTasksL();
       
    89 
       
    90         /**
       
    91         * Writes all persistent tasks from the task list to a persistent storage.
       
    92         * @since 3.0
       
    93         */                
       
    94         IMPORT_C void CommitL();
       
    95 
       
    96     private: // New functions
       
    97         
       
    98         /**
       
    99         * Constructor.
       
   100         */  
       
   101         CTaskManager();
       
   102        
       
   103         /**
       
   104         * 2nd phase constructor.
       
   105         */
       
   106         void ConstructL();
       
   107 
       
   108         /**
       
   109         * Return pointer to TaskManager implementation.
       
   110         * @since 3.0       
       
   111         * @return Pointer to CTaskManager instance.
       
   112         */
       
   113         static CTaskManagerImpl* Impl(); 
       
   114 
       
   115     private: // Data
       
   116         
       
   117         CTaskManagerImpl* iImpl;        
       
   118     };
       
   119 }
       
   120 
       
   121 #endif      // SWINSTTASKMANAGER_H   
       
   122             
       
   123 // End of File