summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtChatWindow.h')
-rw-r--r--Swift/QtUI/QtChatWindow.h49
1 files changed, 11 insertions, 38 deletions
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h
index a703818..6871a3d 100644
--- a/Swift/QtUI/QtChatWindow.h
+++ b/Swift/QtUI/QtChatWindow.h
@@ -4,6 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
+/*
+ * Copyright (c) 2012 Thilo Cestonaro
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
#pragma once
#include <Swift/Controllers/UIInterfaces/ChatWindow.h>
@@ -13,8 +19,6 @@
#include <QtTabbable.h>
-#include <SwifTools/LastLineTracker.h>
-
#include <map>
#include <QPointer>
#include <QTextCursor>
@@ -34,7 +38,6 @@ namespace Swift {
class TreeWidget;
class QtTextEdit;
class UIEventStream;
- class QtChatWindowJSBridge;
class SettingsProvider;
class LabelModel : public QAbstractListModel {
@@ -73,13 +76,6 @@ namespace Swift {
Q_OBJECT
public:
- static const QString ButtonFileTransferCancel;
- static const QString ButtonFileTransferSetDescription;
- static const QString ButtonFileTransferSendRequest;
- static const QString ButtonFileTransferAcceptRequest;
- static const QString ButtonMUCInvite;
-
- public:
QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventStream* eventStream, SettingsProvider* settings, QMap<QString, QString> emoticons);
~QtChatWindow();
std::string addMessage(const std::string &message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const std::string& avatarPath, const boost::posix_time::ptime& time);
@@ -127,8 +123,6 @@ namespace Swift {
InviteToChatWindow* createInviteToChatWindow();
- static QString buildChatWindowButton(const QString& name, const QString& id, const QString& arg1 = QString(), const QString& arg2 = QString(), const QString& arg3 = QString());
-
public slots:
void handleChangeSplitterState(QByteArray state);
void handleFontResized(int fontSizeSteps);
@@ -162,36 +156,24 @@ namespace Swift {
void handleSplitterMoved(int pos, int index);
void handleAlertButtonClicked();
void handleActionButtonClicked();
+ void handleFileTransferAccept(std::string id, std::string description);
+ void handleFileTransferStart(std::string id, std::string description);
+ void handleFileTransferCancel(std::string id);
- void handleHTMLButtonClicked(QString id, QString arg1, QString arg2, QString arg3);
void handleAffiliationEditorAccepted();
void handleCurrentLabelChanged(int);
private:
- enum PreviousMessageKind {
- PreviosuMessageWasNone,
- PreviousMessageWasMessage,
- PreviousMessageWasSystem,
- PreviousMessageWasPresence,
- PreviousMessageWasFileTransfer,
- PreviousMessageWasMUCInvite
- };
-
- private:
void updateTitleWithUnreadCount();
void tabComplete();
void beginCorrection();
void cancelCorrection();
- void handleSettingChanged(const std::string& setting);
- 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);
- void replaceMessage(const QString& message, const std::string& id, const boost::posix_time::ptime& time, const QString& style);
+ std::string addMessage(const std::string &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);
+ void replaceMessage(const std::string& message, const std::string& id, const boost::posix_time::ptime& time, const QString& style);
void handleOccupantSelectionChanged(RosterItem* item);
- bool appendToPreviousCheck(PreviousMessageKind messageKind, const std::string& senderName, bool senderIsSelf) const;
- QString linkimoticonify(const QString& message) const;
int unreadCount_;
bool contactIsTyping_;
- LastLineTracker lastLineTracker_;
QString contact_;
QString lastSentMessage_;
QTextCursor tabCompleteCursor_;
@@ -209,25 +191,16 @@ namespace Swift {
QLineEdit* subject_;
QPushButton* actionButton_;
bool isCorrection_;
- bool previousMessageWasSelf_;
- PreviousMessageKind previousMessageKind_;
- QString previousSenderName_;
bool inputClearing_;
bool tabCompletion_;
- UIEventStream* eventStream_;
bool inputEnabled_;
QSplitter *logRosterSplitter_;
Tristate correctionEnabled_;
QString alertStyleSheet_;
- std::map<QString, QString> descriptions;
- QtChatWindowJSBridge* jsBridge;
QPointer<QtMUCConfigurationWindow> mucConfigurationWindow_;
QPointer<QtAffiliationEditor> affiliationEditor_;
- int idCounter_;
SettingsProvider* settings_;
std::vector<ChatWindow::RoomAction> availableRoomActions_;
- QMap<QString, QString> emoticons_;
- bool showEmoticons_;
QPalette defaultLabelsPalette_;
LabelModel* labelModel_;
};