29 #ifndef IRCBUFFERMODEL_H 30 #define IRCBUFFERMODEL_H 34 #include <QtCore/qmetatype.h> 35 #include <QtCore/qstringlist.h> 36 #include <QtCore/qabstractitemmodel.h> 45 class IrcBufferModelPrivate;
50 Q_PROPERTY(
int count READ count NOTIFY countChanged)
51 Q_PROPERTY(
bool empty READ isEmpty NOTIFY emptyChanged)
52 Q_PROPERTY(
Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder)
53 Q_PROPERTY(
Irc::SortMethod sortMethod READ sortMethod WRITE setSortMethod)
54 Q_PROPERTY(
QStringList channels READ channels NOTIFY channelsChanged)
55 Q_PROPERTY(
Irc::DataRole displayRole READ displayRole WRITE setDisplayRole)
56 Q_PROPERTY(
bool persistent READ isPersistent WRITE setPersistent NOTIFY persistentChanged)
58 Q_PROPERTY(
IrcConnection* connection READ connection WRITE setConnection NOTIFY connectionChanged)
59 Q_PROPERTY(
IrcNetwork* network READ network NOTIFY networkChanged)
60 Q_PROPERTY(
IrcBuffer* bufferPrototype READ bufferPrototype WRITE setBufferPrototype NOTIFY bufferPrototypeChanged)
61 Q_PROPERTY(
IrcChannel* channelPrototype READ channelPrototype WRITE setChannelPrototype NOTIFY channelPrototypeChanged)
62 Q_PROPERTY(
int joinDelay READ joinDelay WRITE setJoinDelay NOTIFY joinDelayChanged)
63 Q_PROPERTY(
bool monitorEnabled READ isMonitorEnabled WRITE setMonitorEnabled NOTIFY monitorEnabledChanged)
78 Q_INVOKABLE
IrcBuffer* get(
int index) const;
80 Q_INVOKABLE
bool contains(const
QString& title) const;
81 Q_INVOKABLE
int indexOf(
IrcBuffer* buffer) const;
85 Q_INVOKABLE
void remove(const
QString& title);
86 Q_INVOKABLE
void remove(
IrcBuffer* buffer);
88 Qt::SortOrder sortOrder() const;
89 void setSortOrder(
Qt::SortOrder order);
91 Irc::SortMethod sortMethod() const;
92 void setSortMethod(
Irc::SortMethod method);
94 Irc::DataRole displayRole() const;
95 void setDisplayRole(
Irc::DataRole role);
97 bool isPersistent() const;
98 void setPersistent(
bool persistent);
109 void setBufferPrototype(
IrcBuffer* prototype);
112 void setChannelPrototype(
IrcChannel* prototype);
114 int joinDelay() const;
115 void setJoinDelay(
int delay);
117 bool isMonitorEnabled() const;
118 void setMonitorEnabled(
bool enabled);
120 Q_INVOKABLE
QByteArray saveState(
int version = 0) const;
121 Q_INVOKABLE
bool restoreState(const
QByteArray& state,
int version = 0);
126 void sort(
int column = 0,
Qt::SortOrder order =
Qt::AscendingOrder);
127 void sort(
Irc::SortMethod method,
Qt::SortOrder order =
Qt::AscendingOrder);
130 void countChanged(
int count);
131 void emptyChanged(
bool empty);
135 void aboutToBeRemoved(
IrcBuffer* buffer);
136 void persistentChanged(
bool persistent);
142 void bufferPrototypeChanged(
IrcBuffer* prototype);
143 void channelPrototypeChanged(
IrcChannel* prototype);
144 void destroyed(IrcBufferModel* model);
145 void joinDelayChanged(
int delay);
146 void monitorEnabledChanged(
bool enabled);
156 friend class IrcBufferLessThan;
157 friend class IrcBufferGreaterThan;
159 Q_DECLARE_PRIVATE(IrcBufferModel)
160 Q_DISABLE_COPY(IrcBufferModel)
162 Q_PRIVATE_SLOT(d_func(),
void _irc_connected())
163 Q_PRIVATE_SLOT(d_func(),
void _irc_initialized())
164 Q_PRIVATE_SLOT(d_func(),
void _irc_disconnected())
165 Q_PRIVATE_SLOT(d_func(),
void _irc_bufferDestroyed(
IrcBuffer*))
166 Q_PRIVATE_SLOT(d_func(),
void _irc_restoreBuffers())
167 Q_PRIVATE_SLOT(d_func(),
void _irc_monitorStatus())
172 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(IrcBufferModel*))
174 #endif // IRCBUFFERMODEL_H
Provides means to establish a connection to an IRC server.
Definition: ircconnection.h:48
Provides network information and capability management.
Definition: ircnetwork.h:43
Keeps track of buffer status.
Definition: ircbuffer.h:49
Keeps track of channel status.
Definition: ircchannel.h:40
Keeps track of buffers.
Definition: ircbuffermodel.h:47
The base class of all messages.
Definition: ircmessage.h:47
Miscellaneous identifiers used throughout the library.
Definition: irc.h:39