File indexing completed on 2024-04-21 15:42:59

0001 /*
0002  * This file is part of TelepathyLoggerQt
0003  *
0004  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0019  */
0020 
0021 #ifndef _TelepathyLoggerQt_pending_log_manager_h_HEADER_GUARD_
0022 #define _TelepathyLoggerQt_pending_log_manager_h_HEADER_GUARD_
0023 
0024 #include "pending-operation.h"
0025 
0026 #include <TelepathyLoggerQt_export.h>
0027 
0028 #include <TelepathyQt/Types>
0029 
0030 namespace Tpl
0031 {
0032 
0033 class LoggerInterface;
0034 
0035 /**
0036  * \internal
0037  */
0038 class TELEPATHY_LOGGER_QT_NO_EXPORT PendingClear : public Tpl::PendingOperation
0039 {
0040     Q_OBJECT
0041 
0042 public:
0043     PendingClear();
0044     ~PendingClear() {};
0045 
0046     void clearLog();
0047     void clearAccount(const Tp::AccountPtr &account);
0048     void clearContact(const Tp::AccountPtr &account, const QString &objectId);
0049     void clearRoom(const Tp::AccountPtr &account, const QString &objectId);
0050 
0051 protected:
0052     void setError(const QString &errorName, const QString &errorMessage);
0053     void finish();
0054 
0055 private Q_SLOTS:
0056     void onLogCleared(QDBusPendingCallWatcher *watcher);
0057 
0058 private:
0059     QString errorName, errorMessage;
0060     Tpl::LoggerInterface *mInterface;
0061 };
0062 
0063 }
0064 
0065 #endif