1 /* 2 * %kadu copyright begin% 3 * Copyright 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) 4 * %kadu copyright end% 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #pragma once 21 22 #include "configuration/configuration-holder.h" 23 #include "exports.h" 24 25 #include <QtCore/QPointer> 26 #include <QtGui/QColor> 27 #include <QtGui/QFont> 28 #include <injeqt/injeqt.h> 29 30 enum class ChatWidgetTitleComposingStatePosition; 31 32 class Configuration; 33 34 class KADUAPI ChatConfigurationHolder : public ConfigurationHolder 35 { 36 Q_OBJECT 37 38 public: 39 Q_INVOKABLE explicit ChatConfigurationHolder(QObject *parent = nullptr); 40 virtual ~ChatConfigurationHolder(); 41 42 void configurationUpdated(); 43 autoSend()44 bool autoSend() const { return AutoSend; } niceDateFormat()45 bool niceDateFormat() const { return NiceDateFormat; } chatTextCustomColors()46 bool chatTextCustomColors() const { return ChatTextCustomColors; } chatTextBgColor()47 const QColor &chatTextBgColor() const { return ChatTextBgColor; } chatTextFontColor()48 const QColor &chatTextFontColor() const { return ChatTextFontColor; } forceCustomChatFont()49 bool forceCustomChatFont() const { return ForceCustomChatFont; } chatFont()50 const QFont &chatFont() const { return ChatFont; } myBackgroundColor()51 const QString &myBackgroundColor() const { return MyBackgroundColor; } myFontColor()52 const QString &myFontColor() const { return MyFontColor; } myNickColor()53 const QString &myNickColor() const { return MyNickColor; } usrBackgroundColor()54 const QString &usrBackgroundColor() const { return UsrBackgroundColor; } usrFontColor()55 const QString &usrFontColor() const { return UsrFontColor; } usrNickColor()56 const QString &usrNickColor() const { return UsrNickColor; } chatBgFilled()57 bool chatBgFilled() const { return ChatBgFilled; } chatBgColor()58 const QColor &chatBgColor() const { return ChatBgColor; } useTransparency()59 bool useTransparency() const { return UseTransparency; } 60 contactStateChats()61 bool contactStateChats() const { return ContactStateChats; } contactStateWindowTitle()62 bool contactStateWindowTitle() const { return ContactStateWindowTitle; } contactStateWindowTitlePosition()63 int contactStateWindowTitlePosition() const { return ContactStateWindowTitlePosition; } 64 ChatWidgetTitleComposingStatePosition composingStatePosition() const; 65 66 signals: 67 void chatConfigurationUpdated(); 68 69 private: 70 QPointer<Configuration> m_configuration; 71 72 bool AutoSend; 73 bool NiceDateFormat; 74 bool ChatTextCustomColors; 75 QColor ChatTextBgColor; 76 QColor ChatTextFontColor; 77 bool ForceCustomChatFont; 78 QFont ChatFont; 79 QString MyBackgroundColor; 80 QString MyFontColor; 81 QString MyNickColor; 82 QString UsrBackgroundColor; 83 QString UsrFontColor; 84 QString UsrNickColor; 85 bool ChatBgFilled; 86 QColor ChatBgColor; 87 bool UseTransparency; 88 89 bool ContactStateChats; 90 bool ContactStateWindowTitle; 91 int ContactStateWindowTitlePosition; 92 93 private slots: 94 INJEQT_SET void setConfiguration(Configuration *configuration); 95 INJEQT_INIT void init(); 96 97 }; 98