summaryrefslogtreecommitdiffstats
blob: 24546729104f67145d0d22324f5cfbd1181684b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (c) 2012 Thilo Cestonaro
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#ifndef SWIFT_QtChatView_H
#define SWIFT_QtChatView_H

#include "QtChatWindow.h"
#include <QWidget>
#include <QKeyEvent>

namespace Swift {
	class QtChatView : public QWidget {
			Q_OBJECT
	public:
		QtChatView(QWidget* parent);
		virtual ~QtChatView();


		virtual void setFileTransferStatus(QString id, const ChatWindow::FileTransferState state, const QString& msg) = 0;
		virtual void setFileTransferProgress(QString id, const int percentageDone) = 0;
		virtual void addToJSEnvironment(const QString&, QObject*) = 0;
		virtual void setAckState(std::string const& id, ChatWindow::AckState) = 0;
		virtual void setMessageReceiptState(const std::string& id, ChatWindow::ReceiptState state) = 0;
		virtual	std::string addMessage(const std::string &message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const std::string& avatarPath, const QString& style, const boost::posix_time::ptime& time) = 0;
		virtual void setChatWindowHasFocus(bool focus) = 0;
		virtual std::string addAction(const std::string &message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0;
		virtual std::string addFileTransfer(const std::string& senderName, bool senderIsSelf, const std::string& filename, const boost::uintmax_t sizeInBytes) = 0;
		virtual void addErrorMessage(const std::string& errorMessage) = 0;
		virtual void addSystemMessage(const std::string& message) = 0;
		virtual void replaceMessage(const std::string& newMessage, const QString& id, const QDateTime& time, const QString& style) = 0;
		virtual void replaceLastMessage(const QString& newMessage) = 0;
		virtual void replaceWithAction(const std::string& message, const std::string& id, const boost::posix_time::ptime& time) = 0;
		virtual void addPresenceMessage(const std::string& message) = 0;
		virtual void setMUCInvitationJoined(QString id) = 0;
		virtual void addMUCInvitation(const std::string& senderName, const JID& jid, const std::string& reason, const std::string& password, bool direct) = 0;
		virtual void showEmoticons(bool show) = 0;

	signals:
		void logCleared();
		void onFileTransferAccept(std::string, std::string);
		void onFileTransferStart(std::string, std::string);
		void onFileTransferCancel(std::string);
		void gotFocus();
		void fontResized(int);

	public slots:
		virtual void scrollToBottom() = 0;
		virtual void resizeFont(int fontSizeSteps) = 0;
		virtual void handleKeyPressEvent(QKeyEvent* event) = 0;
	};
}

#endif // #ifndef SWIFT_QtWebKitChatView_H