Communi  3.0.0
A cross-platform IRC framework written with Qt
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Macros Groups Pages
ircuser.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2008-2013 The Communi Project
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 * License for more details.
13 */
14 
15 #ifndef IRCUSER_H
16 #define IRCUSER_H
17 
18 #include <IrcGlobal>
19 #include <QtCore/qobject.h>
20 #include <QtCore/qmetatype.h>
21 #include <QtCore/qscopedpointer.h>
22 
23 IRC_BEGIN_NAMESPACE
24 
25 class IrcChannel;
26 class IrcUserPrivate;
27 
28 class IRC_MODEL_EXPORT IrcUser : public QObject
29 {
30  Q_OBJECT
31  Q_PROPERTY(QString title READ title NOTIFY titleChanged)
32  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
33  Q_PROPERTY(QString prefix READ prefix NOTIFY prefixChanged)
34  Q_PROPERTY(QString mode READ mode NOTIFY modeChanged)
35  Q_PROPERTY(IrcChannel* channel READ channel CONSTANT)
36 
37 public:
38  explicit IrcUser(QObject* parent = 0);
39  virtual ~IrcUser();
40 
41  QString title() const;
42  QString name() const;
43  QString prefix() const;
44  QString mode() const;
45 
46  IrcChannel* channel() const;
47 
48 Q_SIGNALS:
49  void titleChanged(const QString& title);
50  void nameChanged(const QString& name);
51  void prefixChanged(const QString& prefix);
52  void modeChanged(const QString& mode);
53 
54 private:
55  QScopedPointer<IrcUserPrivate> d_ptr;
56  Q_DECLARE_PRIVATE(IrcUser)
57  Q_DISABLE_COPY(IrcUser)
58 };
59 
60 #ifndef QT_NO_DEBUG_STREAM
61 IRC_MODEL_EXPORT QDebug operator<<(QDebug debug, const IrcUser* user);
62 #endif // QT_NO_DEBUG_STREAM
63 
64 IRC_END_NAMESPACE
65 
66 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(IrcUser*))
67 Q_DECLARE_METATYPE(QList<IRC_PREPEND_NAMESPACE(IrcUser*)>)
68 
69 #endif // IRCUSER_H
Keeps track of channel status.
Definition: ircchannel.h:26
Keeps track of user status on a channel.
Definition: ircuser.h:28