File indexing completed on 2024-04-21 15:43:00

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_utils_h_HEADER_GUARD_
0020 #define _TelepathyLoggerQt_utils_h_HEADER_GUARD_
0021 
0022 #include "global.h"
0023 
0024 #include <TelepathyLoggerQt_export.h>
0025 
0026 #include <TelepathyQt/Types>
0027 #include <telepathy-glib/account-manager.h>
0028 #include <telepathy-glib/account.h>
0029 
0030 #include <QtCore/QDebug>
0031 
0032 namespace Tpl {
0033 
0034 class TELEPATHY_LOGGER_QT_NO_EXPORT Utils {
0035 public:
0036     static Utils *instance();
0037 
0038     void setAccountManagerPtr(const Tp::AccountManagerPtr & accountManager);
0039     Tp::AccountManagerPtr accountManagerPtr();
0040     TpAccountManager *tpAccountManager();
0041 
0042     Tp::AccountPtr accountPtr(TpAccount *account);
0043     Tp::AccountPtr accountPtr(const QString &objectPath);
0044     TpAccount *tpAccount(const Tp::AccountPtr & accountPtr);
0045 
0046 private:
0047     Utils();
0048     ~Utils();
0049 
0050     Tp::AccountManagerPtr mAccountManagerPtr;
0051 };
0052 
0053 };
0054 
0055 #endif