logsui/logsengine/logssymbianos/inc/logsremove.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 04 May 2010 12:39:37 +0300
changeset 0 4a5361db8937
child 9 68f3171a5819
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
#ifndef LOGSREMOVE_H
#define LOGSREMOVE_H

#include <QObject>
#include <e32base.h>
#include "logsmodel.h"

// FORWARDS DECLARATIONS
class CLogClient;
class RFs;
class CLogViewRecent;

// CLASS DECLARATION
class LogsRemoveObserver;
/**
 *	Clearing class.
 */
class LogsRemove : public CActive
    {
    public:
        friend class UT_LogsRemove;

        /**
         *  Destructor
         */
        ~LogsRemove();
        
        LogsRemove( LogsRemoveObserver& observer, bool readingAllEvents = false );
	

        /**
          * Initialize LogsRemove
          * @return 0 if initialized succesfully
          */
        int init();

        bool clearList(LogsModel::ClearType cleartype);
        
        int clearEvents(const QList<int>& eventIds, bool& async);
        
    protected: // from CActive

        void DoCancel();
        void RunL();
        TInt RunError(TInt aError);

    private:
        
        void initL();
        void clearEventsL(const QList<int>& eventIds, bool& async);
        bool DeleteNextEvent();
        
    private: // data
        LogsRemoveObserver& mObserver;
        bool mReadingAllEvents;
        
        QList<int> mRemovedEvents;
        CLogClient* mLogClient;
        CLogViewRecent* mRecentView;
        RFs* mFsSession;
    };

                  
#endif // LOGSREMOVE_H