dbuspresencemanager.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2013-2017 Savoir-faire Linux Inc.
  3. *
  4. * Author: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * 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
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #ifndef __RING_DBUSPRESENCEMANAGER_H__
  21. #define __RING_DBUSPRESENCEMANAGER_H__
  22. #include <vector>
  23. #include <map>
  24. #include <string>
  25. #include "dbus_cpp.h"
  26. #if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
  27. /* This warning option only exists for gcc 4.6.0 and greater. */
  28. #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  29. #endif
  30. #pragma GCC diagnostic ignored "-Wignored-qualifiers"
  31. #pragma GCC diagnostic ignored "-Wunused-parameter"
  32. #include "dbuspresencemanager.adaptor.h"
  33. #pragma GCC diagnostic warning "-Wignored-qualifiers"
  34. #pragma GCC diagnostic warning "-Wunused-parameter"
  35. #if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
  36. /* This warning option only exists for gcc 4.6.0 and greater. */
  37. #pragma GCC diagnostic warning "-Wunused-but-set-variable"
  38. #endif
  39. class DBusPresenceManager :
  40. public cx::ring::Ring::PresenceManager_adaptor,
  41. public DBus::IntrospectableAdaptor,
  42. public DBus::ObjectAdaptor
  43. {
  44. public:
  45. DBusPresenceManager(DBus::Connection& connection);
  46. // Methods
  47. void publish(const std::string& accountID, const bool& status, const std::string& note);
  48. void answerServerRequest(const std::string& uri, const bool& flag);
  49. void subscribeBuddy(const std::string& accountID, const std::string& uri, const bool& flag);
  50. std::vector<std::map<std::string, std::string>> getSubscriptions(const std::string& accountID);
  51. void setSubscriptions(const std::string& accountID, const std::vector<std::string>& uris);
  52. };
  53. #endif // __RING_DBUSPRESENCEMANAGER_H__