X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.h;h=3cd6f6a7f6f2c1b10c30ecb06dabe995b08ff789;hp=3465e5f282ccacb4ca807e40028fd9baea8bf811;hb=2f05c5d7e94d5e96d2b4bae59140fd3b60a7a62f;hpb=902c95728306e5ba115de84800fc8d5d239c9d62 diff --git a/src/client/buffer.h b/src/client/buffer.h index 3465e5f2..3cd6f6a7 100644 --- a/src/client/buffer.h +++ b/src/client/buffer.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -22,6 +22,8 @@ #define _BUFFER_H_ class AbstractUiMsg; +class IrcChannel; +class NickModel; struct BufferState; @@ -38,12 +40,12 @@ class Buffer : public QObject { public: Buffer(BufferInfo, QObject *parent = 0); - ~Buffer(); + virtual ~Buffer(); enum Type { - ServerBuffer, - ChannelBuffer, - QueryBuffer + StatusType, + ChannelType, + QueryType }; enum Activity { @@ -60,12 +62,12 @@ public: BufferInfo bufferInfo() const; void updateBufferInfo(BufferInfo bufferid); - - uint networkId() const; + + BufferId uid() const; + NetworkId networkId() const; QString networkName() const; - QString bufferName() const; - QString displayName() const; + QString name() const; QList contents() const; @@ -73,13 +75,20 @@ public: QString topic() const; QString ownNick() const; + //! Returns a pointer to the associated IrcChannel object for the buffer. + /** A buffer has an IrcChannel object only if it is a channel buffer + * (i.e. bufferType() == ChannelType), and if it is active at the moment. + * \returns A pointer to the associated IrcChannel object, if the buffer is a channel and online; 0 else. + */ + IrcChannel *ircChannel() const; + NickModel *nickModel() const; + signals: void userInput(const BufferInfo &, QString); void nickListChanged(QVariantMap nicks); void topicSet(QString topic); void ownNickSet(QString ownNick); void bufferUpdated(Buffer *); - void bufferDestroyed(Buffer *); void msgAppended(AbstractUiMsg *); void msgPrepended(AbstractUiMsg *); @@ -90,6 +99,7 @@ public slots: void appendMsg(const Message &); void prependMsg(const Message &); bool layoutMsg(); + void setIrcChannel(IrcChannel *chan = 0); // no longer needed // void setTopic(QString); @@ -107,6 +117,8 @@ private: bool _active; Type _type; BufferState *state; + QPointer _ircChannel; + QPointer _nickModel; QList layoutQueue; QList layoutedMsgs;