/src/sip/jabber/tomahawksipmessage.cpp

http://github.com/tomahawk-player/tomahawk · C++ · 79 lines · 49 code · 13 blank · 17 comment · 0 complexity · 2507bb06a150cd7c2967c8fd53b6a1d0 MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4. *
  5. * Tomahawk is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Tomahawk is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "tomahawksipmessage.h"
  19. #include "utils/logger.h"
  20. class TomahawkSipMessagePrivate
  21. {
  22. public:
  23. QString ip;
  24. int port;
  25. QString uniqname;
  26. QString key;
  27. bool visible;
  28. };
  29. TomahawkSipMessage::TomahawkSipMessage(const QString &ip, unsigned int port, const QString &uniqname, const QString &key) : d_ptr(new TomahawkSipMessagePrivate)
  30. {
  31. Q_D(TomahawkSipMessage);
  32. d->ip = ip;
  33. d->port = port;
  34. d->uniqname = uniqname;
  35. d->key = key;
  36. d->visible = true;
  37. }
  38. TomahawkSipMessage::TomahawkSipMessage() : d_ptr(new TomahawkSipMessagePrivate)
  39. {
  40. Q_D(TomahawkSipMessage);
  41. d->visible = false;
  42. d->port = -1;
  43. }
  44. TomahawkSipMessage::~TomahawkSipMessage()
  45. {
  46. }
  47. const QString TomahawkSipMessage::ip() const
  48. {
  49. return d_func()->ip;
  50. }
  51. unsigned int TomahawkSipMessage::port() const
  52. {
  53. return d_func()->port;
  54. }
  55. const QString TomahawkSipMessage::uniqname() const
  56. {
  57. return d_func()->uniqname;
  58. }
  59. const QString TomahawkSipMessage::key() const
  60. {
  61. return d_func()->key;
  62. }
  63. bool TomahawkSipMessage::visible() const
  64. {
  65. return d_func()->visible;
  66. }