diff options
Diffstat (limited to 'Swift/QtUI/QtBarriersFreeChatView.h')
-rw-r--r-- | Swift/QtUI/QtBarriersFreeChatView.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Swift/QtUI/QtBarriersFreeChatView.h b/Swift/QtUI/QtBarriersFreeChatView.h new file mode 100644 index 0000000..c5b3fdc --- /dev/null +++ b/Swift/QtUI/QtBarriersFreeChatView.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012 Thilo Cestonaro + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include "QtChatView.h" +#include <QTextEdit> + +namespace Swift { + class UIEventStream; + class QtBarriersFreeChatView : public QtChatView { + public: + QtBarriersFreeChatView(QtChatTheme* theme, QWidget* parent, UIEventStream* eventStream, SettingsProvider* settings, QMap<QString, QString> emoticons); + virtual ~QtBarriersFreeChatView(); + + // QtChatView Implementation + void replaceLastMessage(const QString& newMessage); + void replaceWithAction(const std::string& message, const std::string& id, const boost::posix_time::ptime& time); + void setFileTransferStatus(QString id, const ChatWindow::FileTransferState state, const QString& msg); + void setFileTransferProgress(QString id, const int percentageDone); + void addToJSEnvironment(const QString&, QObject*); + void setAckState(std::string const& id, ChatWindow::AckState); + void setMessageReceiptState(const std::string& id, ChatWindow::ReceiptState state); + 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); + void setChatWindowHasFocus(bool focus); + 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); + std::string addFileTransfer(const std::string& senderName, bool senderIsSelf, const std::string& filename, const boost::uintmax_t sizeInBytes); + void addErrorMessage(const std::string& errorMessage); + void addSystemMessage(const std::string& message); + void replaceMessage(const std::string& message, const QString& id, const QDateTime& time, const QString& style) { + replaceMessage(P2QSTRING(message), id, time, style); + } + void replaceMessage(const QString& newMessage, const QString& id, const QDateTime& time, const QString& style); + void addPresenceMessage(const std::string& message); + void showEmoticons(bool); + void setMUCInvitationJoined(QString id); + void addMUCInvitation(const std::string& senderName, const JID& jid, const std::string& reason, const std::string& password, bool direct); + public slots: + // QtChatView Implementation + void scrollToBottom(); + void resizeFont(int fontSizeSteps); + void handleKeyPressEvent(QKeyEvent* event); + + private: + QTextEdit *textEdit_; + int idCounter_; + UIEventStream* eventStream_; + SettingsProvider* settings_; + QMap<QString, QString> emoticons_; + }; +} |