PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 1ms

/src/libtomahawk/sip/SipInfo.h

http://github.com/tomahawk-player/tomahawk
C Header | 69 lines | 34 code | 18 blank | 17 comment | 0 complexity | 7282294c2ccd812e37f0679194903c1c MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2011, Dominik Schmidt <dev@dominik-schmidt.de>
 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#ifndef SIPINFO_H
20#define SIPINFO_H
21
22#include <QSharedPointer>
23
24#include "DllMacro.h"
25
26class SipInfoPrivate;
27
28class DLLEXPORT SipInfo : public QObject
29{
30Q_OBJECT
31
32public:
33    SipInfo();
34    SipInfo(const SipInfo& other);
35    virtual ~SipInfo();
36    SipInfo& operator=(const SipInfo& info);
37
38    void clear();
39    bool isValid() const;
40
41    void setVisible( bool visible );
42    bool isVisible() const;
43
44    void setHost( const QString& host );
45    const QString host() const;
46
47    void setPort( int port );
48    int port() const;
49
50    void setNodeId( const QString& nodeId );
51    const QString nodeId() const;
52
53    void setKey( const QString& key );
54    const QString key() const;
55
56
57    const QString toJson() const;
58    static const SipInfo fromJson( QString json );
59
60    const QString debugString() const;
61
62private:
63    QSharedDataPointer<SipInfoPrivate> d;
64};
65
66DLLEXPORT QDebug operator<<( QDebug dbg, const SipInfo &info );
67DLLEXPORT bool operator==( const SipInfo& one, const SipInfo& two );
68
69#endif // SIPINFO_H