summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCătălin Badea <catalin.badea392@gmail.com>2012-08-21 19:06:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-08-30 20:54:18 (GMT)
commit7d0cd94de71d9e55e573e28206470439ecde3db5 (patch)
treec361caa96dac71d53a74ba76aa3dc1d349a0c59e /Swift/QtUI/QtChatView.h
parent6856199274e9c5e581220fccf520b8f011519d17 (diff)
downloadswift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.zip
swift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.tar.bz2
History dialog
Add history dialog as an experimental feature. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI/QtChatView.h')
-rw-r--r--Swift/QtUI/QtChatView.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/Swift/QtUI/QtChatView.h b/Swift/QtUI/QtChatView.h
index fdbdd5a..118f14b 100644
--- a/Swift/QtUI/QtChatView.h
+++ b/Swift/QtUI/QtChatView.h
@@ -20,6 +20,7 @@
class QWebPage;
class QUrl;
+class QDate;
namespace Swift {
class QtWebView;
@@ -27,8 +28,9 @@ namespace Swift {
class QtChatView : public QWidget {
Q_OBJECT
public:
- QtChatView(QtChatTheme* theme, QWidget* parent);
- void addMessage(boost::shared_ptr<ChatSnippet> snippet);
+ QtChatView(QtChatTheme* theme, QWidget* parent, bool disableAutoScroll = false);
+ void addMessageTop(boost::shared_ptr<ChatSnippet> snippet);
+ void addMessageBottom(boost::shared_ptr<ChatSnippet> snippet);
void addLastSeenLine();
void replaceLastMessage(const QString& newMessage);
void replaceLastMessage(const QString& newMessage, const QString& note);
@@ -44,10 +46,15 @@ namespace Swift {
void setFileTransferStatus(QString id, const ChatWindow::FileTransferState state, const QString& msg);
void setMUCInvitationJoined(QString id);
void showEmoticons(bool show);
+ int getSnippetPositionByDate(const QDate& date);
+
signals:
void gotFocus();
void fontResized(int);
void logCleared();
+ void scrollRequested(int pos);
+ void scrollReachedTop();
+ void scrollReachedBottom();
public slots:
void copySelectionToClipboard();
@@ -55,6 +62,7 @@ namespace Swift {
void handleLinkClicked(const QUrl&);
void handleKeyPressEvent(QKeyEvent* event);
void resetView();
+ void resetTopInsertPoint();
void increaseFontSize(int numSteps = 1);
void decreaseFontSize();
void resizeFont(int fontSizeSteps);
@@ -63,6 +71,7 @@ namespace Swift {
void handleViewLoadFinished(bool);
void handleFrameSizeChanged();
void handleClearRequested();
+ void handleScrollRequested(int dx, int dy, const QRect& rectToScroll);
private:
void headerEncode();
@@ -72,14 +81,19 @@ namespace Swift {
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_;
};
}