summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-10-04 14:20:53 (GMT)
committerSwift Review <review@swift.im>2013-11-08 20:42:01 (GMT)
commit238ee0861cc2f9b0143bce986abbd15ce638c561 (patch)
tree304ed1e0e9af2f27509dd33102232d174817b992 /Swift/QtUI/QtPlainChatView.h
parentef23f6f50352dc24db7ddea07d3a90c1637d7369 (diff)
downloadswift-238ee0861cc2f9b0143bce986abbd15ce638c561.zip
swift-238ee0861cc2f9b0143bce986abbd15ce638c561.tar.bz2
Improve some access for screen readers.
Includes the start of a very ugly plain text chat log Change-Id: I26b6d8f752164e4f8a12fe66aedc93af67345cca
Diffstat (limited to 'Swift/QtUI/QtPlainChatView.h')
-rw-r--r--Swift/QtUI/QtPlainChatView.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/Swift/QtUI/QtPlainChatView.h b/Swift/QtUI/QtPlainChatView.h
new file mode 100644
index 0000000..c475862
--- /dev/null
+++ b/Swift/QtUI/QtPlainChatView.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <string>
+#include <boost/shared_ptr.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+#include <QWidget>
+
+#include <Swift/Controllers/UIInterfaces/ChatWindow.h>
+
+#include <Swift/QtUI/QtChatView.h>
+
+class QTextEdit;
+
+namespace Swift {
+ class HighlightAction;
+ class SecurityLabel;
+
+ class QtPlainChatView : public QtChatView {
+ Q_OBJECT
+ public:
+ QtPlainChatView(QWidget* parent);
+ virtual ~QtPlainChatView();
+
+ /** Add message to window.
+ * @return id of added message (for acks).
+ */
+ virtual std::string addMessage(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr<SecurityLabel> /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/);
+ /** Adds action to window.
+ * @return id of added message (for acks);
+ */
+ virtual std::string addAction(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr<SecurityLabel> /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/);
+
+ virtual void addSystemMessage(const ChatWindow::ChatMessage& /*message*/, ChatWindow::Direction /*direction*/) {};
+ virtual void addPresenceMessage(const ChatWindow::ChatMessage& /*message*/, ChatWindow::Direction /*direction*/) {};
+
+ virtual void addErrorMessage(const ChatWindow::ChatMessage& /*message*/) {};
+ virtual void replaceMessage(const ChatWindow::ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/) {};
+ virtual void replaceWithAction(const ChatWindow::ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/) {};
+ virtual void replaceLastMessage(const ChatWindow::ChatMessage& /*message*/) {};
+ virtual void setAckState(const std::string& /*id*/, ChatWindow::AckState /*state*/) {};
+
+ virtual std::string addFileTransfer(const std::string& /*senderName*/, bool /*senderIsSelf*/, const std::string& /*filename*/, const boost::uintmax_t /*sizeInBytes*/) {return "";};
+ virtual void setFileTransferProgress(std::string, const int /*percentageDone*/) {};
+ virtual void setFileTransferStatus(std::string, const ChatWindow::FileTransferState /*state*/, const std::string& /*msg*/ = "") {};
+ virtual void addMUCInvitation(const std::string& /*senderName*/, const JID& /*jid*/, const std::string& /*reason*/, const std::string& /*password*/, bool /*direct*/, bool /*isImpromptu*/, bool /*isContinuation*/) {};
+ virtual std::string addWhiteboardRequest(const QString& /*contact*/, bool /*senderIsSelf*/) {return "";};
+ virtual void setWhiteboardSessionStatus(const std::string& /*id*/, const ChatWindow::WhiteboardSessionState /*state*/) {};
+ virtual void setMessageReceiptState(const std::string& /*id*/, ChatWindow::ReceiptState /*state*/) {};
+
+ virtual void showEmoticons(bool /*show*/) {};
+ virtual void addLastSeenLine() {};
+
+ public slots:
+ virtual void resizeFont(int /*fontSizeSteps*/) {};
+ virtual void scrollToBottom() {};
+ virtual void handleKeyPressEvent(QKeyEvent* /*event*/) {};
+
+ private:
+ QTextEdit* log_;
+
+ };
+}