dbuspresencemanager.h 2.33 KB
Newer Older
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
1
/*
2 3
 *  Copyright (C) 2013-2015 Savoir-faire Linux Inc.
 *
4
 *  Author: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Julien Bonjean's avatar
Julien Bonjean committed
5
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
6 7
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 3 of the License, or
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
9
 *  (at your option) any later version.
Julien Bonjean's avatar
Julien Bonjean committed
10
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
11 12 13 14
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
Julien Bonjean's avatar
Julien Bonjean committed
15
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
16 17
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
19
 */
Julien Bonjean's avatar
Julien Bonjean committed
20

Adrien Béraud's avatar
Adrien Béraud committed
21 22
#ifndef __RING_DBUSPRESENCEMANAGER_H__
#define __RING_DBUSPRESENCEMANAGER_H__
23 24 25 26 27 28

#include <vector>
#include <map>
#include <string>

#include "dbus_cpp.h"
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
29

30
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
31
/* This warning option only exists for gcc 4.6.0 and greater. */
32 33 34
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

Julien Bonjean's avatar
Julien Bonjean committed
35 36
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
37
#include "dbuspresencemanager.adaptor.h"
38 39
#pragma GCC diagnostic warning "-Wignored-qualifiers"
#pragma GCC diagnostic warning "-Wunused-parameter"
40

41
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
42
/* This warning option only exists for gcc 4.6.0 and greater. */
43 44 45
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif

46
class DBusPresenceManager :
Adrien Béraud's avatar
Adrien Béraud committed
47
    public cx::ring::Ring::PresenceManager_adaptor,
48 49 50
    public DBus::IntrospectableAdaptor,
    public DBus::ObjectAdaptor
{
Julien Bonjean's avatar
Julien Bonjean committed
51
    public:
52
        DBusPresenceManager(DBus::Connection& connection);
Julien Bonjean's avatar
Julien Bonjean committed
53

54 55 56 57
        // Methods
        void publish(const std::string& accountID, const bool& status, const std::string& note);
        void answerServerRequest(const std::string& uri, const bool& flag);
        void subscribeBuddy(const std::string& accountID, const std::string& uri, const bool& flag);
58
        std::vector<std::map<std::string, std::string>> getSubscriptions(const std::string& accountID);
59
        void setSubscriptions(const std::string& accountID, const std::vector<std::string>& uris);
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
60 61
};

Adrien Béraud's avatar
Adrien Béraud committed
62
#endif // __RING_DBUSPRESENCEMANAGER_H__