X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtgui%2Fbuffer.h;fp=src%2Fqtgui%2Fbuffer.h;h=0000000000000000000000000000000000000000;hb=130ccf5033c21ca3ad0e0357a82953b5727bd0e9;hp=944b07cc07c7882a71f96d347eba5739d928a486;hpb=077d44f36d2f5c730283ef6be839aea7dd073d56;p=quassel.git diff --git a/src/qtgui/buffer.h b/src/qtgui/buffer.h deleted file mode 100644 index 944b07cc..00000000 --- a/src/qtgui/buffer.h +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-07 by The Quassel Team * - * 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. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef _BUFFER_H_ -#define _BUFFER_H_ - -#include -#include - -#include "chatwidget.h" -#include "global.h" -#include "message.h" - -class ChatWidget; -class ChatLine; -class ChatWidgetContents; -class BufferWidget; -struct BufferState; - -//!\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(). - */ -class Buffer : public QObject { - Q_OBJECT - - public: - //Buffer(QString network, QString buffer); - Buffer(BufferId); - ~Buffer(); - static void init(); - - enum Type { ServerBuffer, ChannelBuffer, QueryBuffer }; - - enum Activity { - NoActivity = 0x00, - OtherActivity = 0x01, - NewMessage = 0x02, - Highlight = 0x40 - }; - Q_DECLARE_FLAGS(ActivityLevel, Activity) - - Type bufferType() { return type; } - bool isActive() { return active; } - - QString networkName() { return _networkName; } - QString bufferName() { return _bufferName; } - QString displayName(); - BufferId bufferId() { return id; } - QList contents() { return lines; } - VarMap nickList() { return nicks; } - QString topic() { return _topic; } - QString ownNick() { return _ownNick; } - bool isStatusBuffer() { return bufferType() == ServerBuffer; } - - signals: - void userInput(BufferId, QString); - //void msgDisplayed(Message); - void chatLineAppended(ChatLine *); - void chatLinePrepended(ChatLine *); - void nickListChanged(VarMap nicks); - void topicSet(QString topic); - void ownNickSet(QString ownNick); - void bufferUpdated(Buffer *); - void bufferDestroyed(Buffer *); - - public slots: - void setActive(bool active = true); - //void displayMsg(Message); - //void prependMessages(QList); // for backlog - void appendChatLine(ChatLine *); - void prependChatLine(ChatLine *); - //void prependChatLines(QList); - //void recvStatusMsg(QString msg); - 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); - - void processUserInput(QString); - - private: - BufferId id; - bool active; - Type type; - - VarMap nicks; - QString _topic; - QString _ownNick; - QString _networkName, _bufferName; - BufferState *state; - - //QList _contents; - QList lines; - -}; -Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel) - -#endif