/* * 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 namespace Swift { class UIEventStream; class QtBarriersFreeChatView : public QtChatView { public: QtBarriersFreeChatView(QtChatTheme* theme, QWidget* parent, UIEventStream* eventStream, SettingsProvider* settings, QMap 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 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 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 emoticons_; }; }