examples/SFExamples/Symbian_OS_Explained_Hercules-v9_Example_Code/testcode/task.h

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 // task.h
00017 
00018 #ifndef TASK_H
00019 #define TASK_H
00020 
00021 #include "client-server.h"
00022 
00023 enum TTaskManagerPanic
00024 {
00025 EInvalidTaskId = 1,
00026 };
00027 
00028 const TInt KTaskArrayGranularity = 4;
00029 
00030 _LIT(KTaskEntry, "\n\tTask: ");
00031 _LIT(KNewLine, "\n");
00032 
00033 class TTask
00034 {
00035 public:
00036         TTask(THerculeanLabours aLabour);
00037 public:
00038         static TInt CompareTaskNumbers(const TTask& aTask1, const TTask& aTask2);
00039         static TBool MatchTasks(const TTask& aTask1, const TTask& aTask2);
00040 public:
00041         TTask(const TTask&);
00042         TTask& operator=(const TTask&);
00043 public:
00044         inline const TDesC& LabourName() const {return (iLabourName);};
00045         inline THerculeanLabours Labour() const {return (iLabour);};    
00046 private:
00047         void Initialize();
00048         TTask();        //      Prevent default construction of uninitialized task
00049 private:
00050         THerculeanLabours iLabour;
00051         TPtrC iLabourName;
00052 };
00053 
00054 
00055 class CHerculeanTaskManager : public CBase
00056 {
00057 public:
00058         virtual ~CHerculeanTaskManager();
00059         static CHerculeanTaskManager* NewLC();
00060 public:
00061         void AppendTaskL(THerculeanLabours aTaskNumber);
00062         void DeleteTask(THerculeanLabours aTaskNumber); 
00063         void GetTask(THerculeanLabours aTaskNumber, TTask& aTask);
00064         void ListTasksAscendingL(RBuf& aTaskList);
00065         void ListTasksL(RBuf& aTaskList);
00066 public:
00067         inline TInt TaskCount() const {return (iTaskArray.Count());};
00068 private:
00069         void SortTasksAscending();
00070         TInt GetTaskListLength();
00071 private:
00072         CHerculeanTaskManager();
00073         void ConstructL();
00074 private:
00075         RArray<TTask> iTaskArray;
00076 };
00077 
00078 #endif // TASK_H

Generated by  doxygen 1.6.2