Mudlet  0
Mudclient
ircbuffermodel_p.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008-2016 The Communi Project
3 
4  You may use this file under the terms of BSD license as follows:
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are met:
8  * Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright
11  notice, this list of conditions and the following disclaimer in the
12  documentation and/or other materials provided with the distribution.
13  * Neither the name of the copyright holder nor the names of its
14  contributors may be used to endorse or promote products derived
15  from this software without specific prior written permission.
16 
17  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
21  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef IRCBUFFERMODEL_P_H
30 #define IRCBUFFERMODEL_P_H
31 
32 #include "ircbuffer.h"
33 #include "ircfilter.h"
34 #include "ircbuffermodel.h"
35 #include <qpointer.h>
36 
38 
40 {
41  Q_OBJECT
42  Q_DECLARE_PUBLIC(IrcBufferModel)
44 
45 public:
47 
48  bool messageFilter(IrcMessage* message);
49  bool commandFilter(IrcCommand* command);
50 
51  IrcBuffer* createBufferHelper(const QString& title);
52  IrcChannel* createChannelHelper(const QString& title);
53 
54  IrcBuffer* createBuffer(const QString& title);
55  void destroyBuffer(const QString& title, bool force = false);
56 
57  void addBuffer(IrcBuffer* buffer, bool notify = true);
58  void insertBuffer(int index, IrcBuffer* buffer, bool notify = true);
59  void removeBuffer(IrcBuffer* buffer, bool notify = true);
60  bool renameBuffer(const QString& from, const QString& to);
61  void promoteBuffer(IrcBuffer* buffer);
62 
63  void restoreBuffer(IrcBuffer* buffer);
64  QVariantMap saveBuffer(IrcBuffer* buffer) const;
65 
66  bool processMessage(const QString& title, IrcMessage* message, bool create = false);
67 
68  void _irc_connected();
69  void _irc_initialized();
70  void _irc_disconnected();
71  void _irc_bufferDestroyed(IrcBuffer* buffer);
72 
73  void _irc_restoreBuffers();
74  void _irc_monitorStatus();
75 
77  {
78  return model->d_func();
79  }
80 
83  QPointer<IrcConnection> connection;
84  QList<IrcBuffer*> bufferList;
85  QMap<QString, IrcBuffer*> bufferMap;
86  QHash<QString, QString> keys;
87  QVariantMap bufferStates;
88  QStringList channels;
90  Qt::SortOrder sortOrder;
93  bool persistent;
94  int joinDelay;
97 };
98 
100 
101 #endif // IRCBUFFERMODEL_P_H
IrcBuffer * createBuffer(const QString &title)
void insertBuffer(int index, IrcBuffer *buffer, bool notify=true)
Provides the most common commands.
Definition: irccommand.h:44
void removeBuffer(IrcBuffer *buffer, bool notify=true)
Keeps track of channel status.
Definition: ircchannel.h:40
IrcBuffer * createBufferHelper(const QString &title)
void _irc_bufferDestroyed(IrcBuffer *buffer)
void restoreBuffer(IrcBuffer *buffer)
QList< IrcBuffer * > bufferList
QPointer< IrcConnection > connection
Keeps track of buffer status.
Definition: ircbuffer.h:49
QMap< QString, IrcBuffer * > bufferMap
#include <IrcBufferModel>
void addBuffer(IrcBuffer *buffer, bool notify=true)
SortMethod
Definition: irc.h:88
void destroyBuffer(const QString &title, bool force=false)
#include <IrcFilter>
The base class of all messages.
Definition: ircmessage.h:47
bool messageFilter(IrcMessage *message)
IrcBufferModel * q_ptr
bool commandFilter(IrcCommand *command)
QVariantMap saveBuffer(IrcBuffer *buffer) const
Irc::SortMethod sortMethod
DataRole
Definition: irc.h:78
Keeps track of buffers.
void promoteBuffer(IrcBuffer *buffer)
bool renameBuffer(const QString &from, const QString &to)
Provides an interface for filtering commands.
Definition: ircfilter.h:47
bool processMessage(const QString &title, IrcMessage *message, bool create=false)
#include <IrcBuffer>
Provides an interface for filtering messages.
Definition: ircfilter.h:40
#define IRC_END_NAMESPACE
Definition: ircglobal.h:112
IrcChannel * createChannelHelper(const QString &title)
#define IRC_BEGIN_NAMESPACE
Definition: ircglobal.h:111
QHash< QString, QString > keys