summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-29 22:32:59 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-30 14:53:32 (GMT)
commitb9b535ffd46382c413504a1781400c1a554e04a8 (patch)
tree723b1e948930478e0324c374f74f1fabc88699ec /Swift/QtUI/QtChatView.h
parent5546afc2bbf8ab0fd49647150da7a5f3df01deaf (diff)
downloadswift-b9b535ffd46382c413504a1781400c1a554e04a8.zip
swift-b9b535ffd46382c413504a1781400c1a554e04a8.tar.bz2
Render the Chat view directly with DOM commands, not javascript.
Tested locally, but it's conceivable there will be regressions.
Diffstat (limited to 'Swift/QtUI/QtChatView.h')
-rw-r--r--Swift/QtUI/QtChatView.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/Swift/QtUI/QtChatView.h b/Swift/QtUI/QtChatView.h
index f60d049..3936c18 100644
--- a/Swift/QtUI/QtChatView.h
+++ b/Swift/QtUI/QtChatView.h
@@ -9,6 +9,10 @@
#include <QString>
#include <QWidget>
+#include <QList>
+#include <QWebElement>
+
+#include <boost/shared_ptr.hpp>
#include "ChatSnippet.h"
@@ -17,12 +21,13 @@ class QUrl;
namespace Swift {
class QtWebView;
+ class QtChatTheme;
class QtChatView : public QWidget {
Q_OBJECT
public:
- QtChatView(QWidget* parent);
+ QtChatView(QtChatTheme* theme, QWidget* parent);
- void addMessage(const ChatSnippet& snippet);
+ void addMessage(boost::shared_ptr<ChatSnippet> snippet);
bool isScrolledToBottom() const;
signals:
@@ -38,11 +43,22 @@ namespace Swift {
void handleViewLoadFinished(bool);
private:
+ void headerEncode();
+ void messageEncode();
+ void addQueuedSnippets();
+ void addToDOM(boost::shared_ptr<ChatSnippet> snippet);
+ QWebElement snippetToDOM(boost::shared_ptr<ChatSnippet> snippet);
+
bool viewReady_;
QtWebView* webView_;
QWebPage* webPage_;
QString previousContinuationElementID_;
- QString queuedMessages_;
+ QList<boost::shared_ptr<ChatSnippet> > queuedSnippets_;
+
+ QtChatTheme* theme_;
+ QWebElement newInsertPoint_;
+ QWebElement lastElement_;
+ QWebElement document_;
};
}