summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baczynski <danielbaczynski8@gmail.com>2015-03-25 00:16:20 (GMT)
committerKevin Smith <git@kismith.co.uk>2015-03-26 07:39:31 (GMT)
commit85e53159321ab3e013dd2fc0a16748ed6755b119 (patch)
tree6ed333198bb756c8e1946505663ae0c95e72223b /Swift/QtUI/QtChatWindow.h
parentb23f4fb9bee49f93bbba6a9039f0f764664125cd (diff)
downloadswift-85e53159321ab3e013dd2fc0a16748ed6755b119.zip
swift-85e53159321ab3e013dd2fc0a16748ed6755b119.tar.bz2
Add emoticons input popup
This is simple popup menu added to chat window where it is possible to choose an emoticon. To activate click on the smiling face next to input field. When emoticon is selected its text equivalent is appended to input. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tested on Ubuntu 14.10 with KDE and Qt 4.8.6 Change-Id: I6c5907959970398c9c38591f64ceec20efcbf409
Diffstat (limited to 'Swift/QtUI/QtChatWindow.h')
-rw-r--r--Swift/QtUI/QtChatWindow.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h
index da3a3b9..5c6fa2a 100644
--- a/Swift/QtUI/QtChatWindow.h
+++ b/Swift/QtUI/QtChatWindow.h
@@ -5,28 +5,30 @@
*/
#pragma once
#include <map>
+#include <QMap>
+#include <QMenu>
#include <QPointer>
+#include <QString>
#include <QTextCursor>
-#include <QMap>
#include <SwifTools/LastLineTracker.h>
#include <Swift/Controllers/UIInterfaces/ChatWindow.h>
#include <Swift/QtUI/ChatSnippet.h>
#include <Swift/QtUI/QtAffiliationEditor.h>
+#include <Swift/QtUI/QtEmoticonsGrid.h>
#include <Swift/QtUI/QtMUCConfigurationWindow.h>
#include <Swift/QtUI/QtSwiftUtil.h>
#include <Swift/QtUI/QtTabbable.h>
-
class QTextEdit;
class QLineEdit;
class QComboBox;
class QLabel;
class QSplitter;
class QPushButton;
@@ -74,13 +76,13 @@ namespace Swift {
};
class QtChatWindow : public QtTabbable, public ChatWindow {
Q_OBJECT
public:
- QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventStream* eventStream, SettingsProvider* settings);
+ QtChatWindow(const QString& contact, QtChatTheme* theme, UIEventStream* eventStream, SettingsProvider* settings, const std::map<std::string, std::string>& emoticons);
virtual ~QtChatWindow();
std::string addMessage(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const std::string& avatarPath, const boost::posix_time::ptime& time, const HighlightAction& highlight);
std::string addAction(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const std::string& avatarPath, const boost::posix_time::ptime& time, const HighlightAction& highlight);
std::string addSystemMessage(const ChatMessage& message, Direction direction);
void addPresenceMessage(const ChatMessage& message, Direction direction);
@@ -166,12 +168,14 @@ namespace Swift {
void handleKeyPressEvent(QKeyEvent* event);
void handleSplitterMoved(int pos, int index);
void handleAlertButtonClicked();
void handleActionButtonClicked();
void handleAffiliationEditorAccepted();
void handleCurrentLabelChanged(int);
+ void handleEmoticonsButtonClicked();
+ void handleEmoticonClicked(QString emoticonAsText);
private:
void updateTitleWithUnreadCount();
void tabComplete();
void beginCorrection();
void cancelCorrection();
@@ -218,8 +222,9 @@ namespace Swift {
QPalette defaultLabelsPalette_;
LabelModel* labelModel_;
BlockingState blockingState_;
bool impromptu_;
bool isMUC_;
bool supportsImpromptuChat_;
+ QMenu* emoticonsMenu_;
};
}