logsui/logsengine/logssymbianos/inc/logsremove.h
changeset 16 c5af8598d22c
parent 14 f27aebe284bb
equal deleted inserted replaced
14:f27aebe284bb 16:c5af8598d22c
    20 #include <QObject>
    20 #include <QObject>
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include "logsworker.h"
    22 #include "logsworker.h"
    23 #include "logsmodel.h"
    23 #include "logsmodel.h"
    24 #include "logsremovestatecontext.h"
    24 #include "logsremovestatecontext.h"
       
    25 #include "logsremoveobserver.h"
    25 
    26 
    26 // FORWARDS DECLARATIONS
    27 // FORWARDS DECLARATIONS
    27 class CLogClient;
    28 class CLogClient;
    28 class RFs;
    29 class RFs;
    29 class CLogViewRecent;
    30 class CLogViewRecent;
    31 // CLASS DECLARATION
    32 // CLASS DECLARATION
    32 class LogsRemoveObserver;
    33 class LogsRemoveObserver;
    33 /**
    34 /**
    34  *	Clearing class.
    35  *	Clearing class.
    35  */
    36  */
    36 class LogsRemove : public LogsWorker, public LogsRemoveStateContext
    37 class LogsRemove : public LogsWorker, 
       
    38                    public LogsRemoveStateContext, 
       
    39                    public LogsRemoveObserver
    37     {
    40     {
    38     public:
    41     public:
    39         friend class UT_LogsRemove;
    42         friend class UT_LogsRemove;
    40 
    43 
    41         /**
    44         /**
    52           */
    55           */
    53         int init();
    56         int init();
    54 
    57 
    55         bool clearList(LogsModel::ClearType cleartype);
    58         bool clearList(LogsModel::ClearType cleartype);
    56         
    59         
    57         int clearEvents(const QList<int>& eventIds, bool& async);
    60         int clearEvents(const QList<LogsEvent*>& events, bool& async);
    58         
    61         
    59     protected: // from CActive
    62     protected: // from CActive
    60         
    63         
    61         TInt RunError(TInt aError);
    64         TInt RunError(TInt aError);
    62 
    65 
    63     private: // From LogsRemoveStateContext
    66     private: // From LogsRemoveStateContext
    64         
    67         
    65         inline LogsRemoveObserver& observer();
    68         inline LogsRemoveObserver& observer();
    66         inline QList<int>& removedEvents();
    69         inline QList<LogsEvent>& removedEvents();
    67         inline int clearType();
    70         inline int clearType();
       
    71         
       
    72     private: // From LogsRemoveObserver
       
    73         
       
    74         void removeCompleted();
       
    75         void logsRemoveErrorOccured(int err);
    68         
    76         
    69     private:
    77     private:
    70         
    78         
    71         void initL();
    79         void initL();
    72         bool clearListL(LogsModel::ClearType cleartype);
    80         bool clearListL(LogsModel::ClearType cleartype);
    73         void clearEventsL(const QList<int>& eventIds, bool& async);
    81         void clearEventsL(const QList<LogsEvent*>& events, bool& async);
    74         void initializeClearAllL();
    82         void initializeClearAllL();
    75         void initializeIdBasedRemovalL();
    83         void initializeIdBasedRemovalL();
    76         bool startClearingL();
    84         bool startClearingL();
       
    85         void removeAssociatedDuplicatesL();
    77         
    86         
    78     private: // data
    87     private: // data
    79         LogsRemoveObserver& mObserver;
    88         LogsRemoveObserver& mObserver;
    80         QList<int> mRemovedEvents;
    89         QList<LogsEvent> mRemovedEvents;
       
    90         QList<LogsEvent> mRemovedEventDuplicates;
    81      
    91      
    82         RFs* mFsSession;
    92         RFs* mFsSession;
    83         
    93         
    84         int mClearType;
    94         int mClearType;
    85         QList<LogsStateBase*> mRemoveStates;
    95         QList<LogsStateBase*> mRemoveStates;