1 /*
2  * Copyright (C) 2013  Daniel Vrátil <dvratil@redhat.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  */
19 
20 #include "abstract-logger-plugin.h"
21 
22 #include <TelepathyQt/Account>
23 #include <TelepathyQt/AccountManager>
24 
25 using namespace KTp;
26 
27 class AbstractLoggerPlugin::Private
28 {
29   public:
30     Tp::AccountManagerPtr accountManager;
31 };
32 
AbstractLoggerPlugin(QObject * parent)33 AbstractLoggerPlugin::AbstractLoggerPlugin(QObject *parent):
34     QObject(parent),
35     d(new Private)
36 {
37 }
38 
~AbstractLoggerPlugin()39 AbstractLoggerPlugin::~AbstractLoggerPlugin()
40 {
41     delete d;
42 }
43 
handlesAccount(const Tp::AccountPtr & account)44 bool KTp::AbstractLoggerPlugin::handlesAccount(const Tp::AccountPtr &account)
45 {
46     // Handle all valid accounts
47     return account && account->isValid();
48 }
49 
setAccountManager(const Tp::AccountManagerPtr & accountManager)50 void AbstractLoggerPlugin::setAccountManager(const Tp::AccountManagerPtr &accountManager)
51 {
52     d->accountManager = accountManager;
53 }
54 
accountManager() const55 Tp::AccountManagerPtr AbstractLoggerPlugin::accountManager() const
56 {
57     return d->accountManager;
58 }
59