summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.h')
-rw-r--r--Swift/QtUI/QtWebKitChatView.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.h b/Swift/QtUI/QtWebKitChatView.h
index fb6e4da..925ceeb 100644
--- a/Swift/QtUI/QtWebKitChatView.h
+++ b/Swift/QtUI/QtWebKitChatView.h
@@ -1,37 +1,37 @@
/*
- * Copyright (c) 2010-2013 Remko Tronçon
+ * Copyright (c) 2010-2014 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <QString>
#include <QWidget>
#include <QList>
#include <QWebElement>
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Override.h>
#include <Swift/Controllers/UIInterfaces/ChatWindow.h>
#include <Swift/QtUI/ChatSnippet.h>
#include <Swift/QtUI/QtChatView.h>
class QWebPage;
class QUrl;
class QDate;
namespace Swift {
class QtWebView;
class QtChatTheme;
class QtChatWindowJSBridge;
class UIEventStream;
class QtChatWindow;
class QtWebKitChatView : public QtChatView {
Q_OBJECT
public:
static const QString ButtonWhiteboardSessionCancel;
@@ -116,72 +116,73 @@ namespace Swift {
private slots:
void handleViewLoadFinished(bool);
void handleFrameSizeChanged();
void handleClearRequested();
void handleScrollRequested(int dx, int dy, const QRect& rectToScroll);
void handleHTMLButtonClicked(QString id, QString arg1, QString arg2, QString arg3, QString arg4, QString arg5);
private:
enum PreviousMessageKind {
PreviosuMessageWasNone,
PreviousMessageWasMessage,
PreviousMessageWasSystem,
PreviousMessageWasPresence,
PreviousMessageWasFileTransfer,
PreviousMessageWasMUCInvite
};
std::string addMessage(
const QString& 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,
const HighlightAction& highlight,
ChatSnippet::Direction direction);
void replaceMessage(
const QString& message,
const std::string& id,
const boost::posix_time::ptime& time,
const QString& style,
const HighlightAction& highlight);
bool appendToPreviousCheck(PreviousMessageKind messageKind, const std::string& senderName, bool senderIsSelf);
static ChatSnippet::Direction getActualDirection(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction);
- QString chatMessageToHTML(const ChatWindow::ChatMessage& message);
+ QString getHighlightSpanStart(const std::string& text, const std::string& background);
QString getHighlightSpanStart(const HighlightAction& highlight);
+ QString chatMessageToHTML(const ChatWindow::ChatMessage& message);
static QString buildChatWindowButton(const QString& name, const QString& id, const QString& arg1 = QString(), const QString& arg2 = QString(), const QString& arg3 = QString(), const QString& arg4 = QString(), const QString& arg5 = QString());
private:
void headerEncode();
void messageEncode();
void addToDOM(boost::shared_ptr<ChatSnippet> snippet);
QWebElement snippetToDOM(boost::shared_ptr<ChatSnippet> snippet);
QtChatWindow* window_;
UIEventStream* eventStream_;
bool viewReady_;
bool isAtBottom_;
bool topMessageAdded_;
int scrollBarMaximum_;
QtWebView* webView_;
QWebPage* webPage_;
int fontSizeSteps_;
QtChatTheme* theme_;
QWebElement newInsertPoint_;
QWebElement topInsertPoint_;
QWebElement lineSeparator_;
QWebElement lastElement_;
QWebElement firstElement_;
QWebElement document_;
bool disableAutoScroll_;
QtChatWindowJSBridge* jsBridge;
PreviousMessageKind previousMessageKind_;
bool previousMessageWasSelf_;
bool showEmoticons_;
bool insertingLastLine_;
int idCounter_;
QString previousSenderName_;
std::map<QString, QString> descriptions_;
};
}