diff options
| author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-13 15:26:24 (GMT) |
|---|---|---|
| committer | Swift Review <review@swift.im> | 2014-07-09 14:01:41 (GMT) |
| commit | f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285 (patch) | |
| tree | 01cf807b2ad59f5ea6504fd28d12e0f994e2f907 /Swift/QtUI/QtWebKitChatView.h | |
| parent | 8e03583fe21bcd5e0025da81d8f4a34ed05cd058 (diff) | |
| download | swift-contrib-f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285.zip swift-contrib-f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285.tar.bz2 | |
Reworked highlight rules dialog. Added support for highlighting individual words in messages.
Change-Id: I378fa69077c29008db4ef7c2265e5212924bc2ce
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.h')
| -rw-r--r-- | Swift/QtUI/QtWebKitChatView.h | 5 |
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_; }; } |
Swift