File indexing completed on 2024-04-28 16:13:14
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 0020 #include <QApplication> 0021 #include <TelepathyQt/Account> 0022 #include <TelepathyLoggerQt/Entity> 0023 #include <TelepathyLoggerQt/PendingOperation> 0024 0025 class TplToolApplication : public QCoreApplication { 0026 Q_OBJECT 0027 public: 0028 TplToolApplication(int &argc, char **argv); 0029 0030 Tp::AccountPtr accountPtr(const QString &id); 0031 Tpl::EntityPtr entityPtr(const QString &id); 0032 0033 bool parseArgs1(); 0034 bool parseArgs2(); 0035 0036 private Q_SLOTS: 0037 void onAccountManagerReady(Tp::PendingOperation*); 0038 void onAccountReady(Tp::PendingOperation*); 0039 void onConnectionReady(Tp::PendingOperation*); 0040 void onPendingSearch(Tpl::PendingOperation*); 0041 void onPendingEntities(Tpl::PendingOperation*); 0042 void onPendingDates(Tpl::PendingOperation*); 0043 void onPendingEvents(Tpl::PendingOperation*); 0044 0045 private: 0046 static bool eventFilterMethod(const Tpl::EventPtr &event, void *user_data); 0047 0048 Tp::AccountManagerPtr mAccountManager; 0049 Tp::AccountPtr mAccountPtr; 0050 }; 0051