File indexing completed on 2024-04-14 04:56:37

0001 /*
0002  * This file is part of TelepathyLoggerQt
0003  *
0004  * Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
0005  *
0006  * This library is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU Lesser General Public License as published
0008  * by the Free Software Foundation; either version 2.1 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program 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
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 #ifndef _TelepathyLoggerQt_tlp_tool_h_HEADER_GUARD_
0020 #define _TelepathyLoggerQt_tlp_tool_h_HEADER_GUARD_
0021 
0022 #include <QApplication>
0023 #include <TelepathyQt/Account>
0024 #include <TelepathyLoggerQt/Entity>
0025 #include <TelepathyLoggerQt/PendingOperation>
0026 
0027 class TplToolApplication : public QCoreApplication {
0028     Q_OBJECT
0029 public:
0030     TplToolApplication(int &argc, char **argv);
0031 
0032     Tp::AccountPtr accountPtr(const QString &id);
0033     Tpl::EntityPtr entityPtr(const QString &id);
0034 
0035     bool parseArgs1();
0036     bool parseArgs2();
0037 
0038 private Q_SLOTS:
0039     void onAccountManagerReady(Tp::PendingOperation*);
0040     void onAccountReady(Tp::PendingOperation*);
0041     void onConnectionReady(Tp::PendingOperation*);
0042     void onPendingSearch(Tpl::PendingOperation*);
0043     void onPendingEntities(Tpl::PendingOperation*);
0044     void onPendingDates(Tpl::PendingOperation*);
0045     void onPendingEvents(Tpl::PendingOperation*);
0046 
0047 private:
0048     static bool eventFilterMethod(const Tpl::EventPtr &event, void *user_data);
0049 
0050     Tp::AccountManagerPtr mAccountManager;
0051     Tp::AccountPtr mAccountPtr;
0052 };
0053 
0054 #endif
0055