X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.h;h=9bf4b783f3ad05172fa28154cce8f9a455594380;hp=2c361d3db161527d8bd5a1a9e03d2e984aa8af10;hb=08aac67d4dc813ed541a81d06fb83d9c4fec5834;hpb=73edffb5f0f6ecae4118c36a7ca2c0d479b7f8c6 diff --git a/src/client/buffer.h b/src/client/buffer.h index 2c361d3d..9bf4b783 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 * @@ -21,91 +21,44 @@ #ifndef _BUFFER_H_ #define _BUFFER_H_ -#include - -#include "global.h" -#include "message.h" -#include "quasselui.h" +class AbstractUiMsg; +class IrcChannel; +class NickModel; struct BufferState; +#include "message.h" +#include "bufferinfo.h" + //!\brief Encapsulates the contents of a single channel, query or server status context. -/** A Buffer maintains a list of existing nicks and their status. New messages can be appended using - * displayMsg(). A buffer displays its contents by way of a BufferWidget, which can be shown - * (and created on demand) by calling showWidget(). +/** A Buffer maintains a list of existing nicks and their status. */ class Buffer : public QObject { Q_OBJECT - public: - Buffer(BufferId); - ~Buffer(); - - enum Type { ServerBuffer, ChannelBuffer, QueryBuffer }; - - enum Activity { - NoActivity = 0x00, - OtherActivity = 0x01, - NewMessage = 0x02, - Highlight = 0x40 - }; - Q_DECLARE_FLAGS(ActivityLevel, Activity) - - Type bufferType() const; - bool isActive() const; - - QString networkName() const; - QString bufferName() const; - QString displayName() const; - BufferId bufferId() const; - QList contents() const; - VarMap nickList() const; - QString topic() const; - QString ownNick() const; - bool isStatusBuffer() const; - - signals: - void userInput(const BufferId &, QString); - void nickListChanged(VarMap nicks); - void topicSet(QString topic); - void ownNickSet(QString ownNick); - void bufferUpdated(Buffer *); - void bufferDestroyed(Buffer *); - - void msgAppended(AbstractUiMsg *); - void msgPrepended(AbstractUiMsg *); - void layoutQueueEmpty(); +public: + Buffer(BufferInfo, QObject *parent = 0); - public slots: - void setActive(bool active = true); - void appendMsg(const Message &); - void prependMsg(const Message &); - bool layoutMsg(); - void setTopic(QString); - //void setNicks(QStringList); - void addNick(QString nick, VarMap props); - void renameNick(QString oldnick, QString newnick); - void removeNick(QString nick); - void updateNick(QString nick, VarMap props); - void setOwnNick(QString nick); + BufferInfo bufferInfo() const; - void processUserInput(QString); + QList contents() const; + +signals: + void msgAppended(AbstractUiMsg *); + void msgPrepended(AbstractUiMsg *); + void layoutQueueEmpty(); - private: - BufferId id; - bool active; - Type type; +public slots: + void appendMsg(const Message &); + void prependMsg(const Message &); + bool layoutMsg(); - VarMap nicks; - QString _topic; - QString _ownNick; - QString _networkName, _bufferName; - BufferState *state; +private: + BufferInfo _bufferInfo; - QList layoutQueue; - QList layoutedMsgs; + QList layoutQueue; + QList layoutedMsgs; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel) #endif