PageRenderTime 162ms CodeModel.GetById 80ms app.highlight 6ms RepoModel.GetById 45ms app.codeStats 0ms

/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
19#include "tomahawksipmessage.h"
20
21#include "utils/logger.h"
22
23
24class TomahawkSipMessagePrivate
25{
26public:
27    QString ip;
28    int port;
29    QString uniqname;
30    QString key;
31    bool visible;
32};
33
34TomahawkSipMessage::TomahawkSipMessage(const QString &ip, unsigned int port, const QString &uniqname, const QString &key) : d_ptr(new TomahawkSipMessagePrivate)
35{
36    Q_D(TomahawkSipMessage);
37    d->ip = ip;
38    d->port = port;
39    d->uniqname = uniqname;
40    d->key = key;
41    d->visible = true;
42}
43
44TomahawkSipMessage::TomahawkSipMessage() : d_ptr(new TomahawkSipMessagePrivate)
45{
46    Q_D(TomahawkSipMessage);
47    d->visible = false;
48    d->port = -1;
49}
50
51
52TomahawkSipMessage::~TomahawkSipMessage()
53{
54}
55
56const QString TomahawkSipMessage::ip() const
57{
58    return d_func()->ip;
59}
60
61unsigned int TomahawkSipMessage::port() const
62{
63    return d_func()->port;
64}
65
66const QString TomahawkSipMessage::uniqname() const
67{
68    return d_func()->uniqname;
69}
70
71const QString TomahawkSipMessage::key() const
72{
73    return d_func()->key;
74}
75
76bool TomahawkSipMessage::visible() const
77{
78    return d_func()->visible;
79}