From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksirc/ksopts.h | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 ksirc/ksopts.h (limited to 'ksirc/ksopts.h') diff --git a/ksirc/ksopts.h b/ksirc/ksopts.h new file mode 100644 index 00000000..5739f6fd --- /dev/null +++ b/ksirc/ksopts.h @@ -0,0 +1,218 @@ + +#ifndef _KSOPTS_H_ +#define _KSOPTS_H_ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define IRC_SAFE_MAX_LINE 450 + +#include "boundscheckingarray.h" +#include "ksircchannel.h" +#include "ksircserver.h" + +// Central place to hold KSirc's options +// and manage default values. The base classes +// are only used directly by the prefs dialog. +// The constructors initialize all options with default values. +class KSOGeneral +{ +public: + KSOGeneral(); + + enum { SDI, MDI } displayMode; + bool autoCreateWin : 1; + bool autoCreateWinForNotice : 1; + bool nickCompletion : 1; + bool displayTopic : 1; + bool oneLineEntry : 1; + bool runDocked : 1; +// bool timeStamp : 1; +// bool beepNotify : 1; + bool colorPicker : 1; + bool autoRejoin : 1; +// bool beepOnMsg : 1; +// bool logging : 1; + bool publicAway : 1; + bool useColourNickList : 1; + // bool topicShow : 1; + bool dockPopups : 1; + bool autoSaveHistory : 1; + int windowLength; + QString backgroundFile; + + QPixmap backgroundPixmap(); + +private: + QPixmap m_backgroundPixmap; +}; + +class KSOChannel +{ +public: + KSOChannel(); + + QString server; + QString channel; + + bool timeStamp : 1; + bool beepNotify : 1; + bool beepOnMsg : 1; + bool logging : 1; + bool topicShow : 1; + bool filterJoinPart : 1; + QString encoding; + + QDateTime lastUsed; + + static bool applyGlobally; + + + +}; + +class KSOServer +{ +public: + KSOServer(); + + QString server; + bool globalCopy; + + QString nick; + QString altNick; + QString realName; + QString userID; + QStringList notifyList; + + QDateTime lastUsed; +}; + +class KSOStartup +{ +public: + KSOStartup(); + + QRect geometry; +// QString nick; +// QString altNick; +// QString realName; +// QString userID; +// QStringList notifyList; +}; + +class KSOColors +{ +public: + enum { numColors = 16 }; + + KSOColors(); + + QColor textColor; + QColor linkColor; + QColor infoColor; + QColor channelColor; + QColor errorColor; + QColor ownNickColor; + bool ownNickBold : 1; + bool ownNickUl : 1; + bool ownNickRev : 1; + + QColor msgContainNick; // needs config + impl + QColor msg1Contain; // needs config + QString msg1String; // needs config + bool msg1Regex; + QColor msg2Contain; // need config + QString msg2String; // needs config + bool msg2Regex; + + QColor nickForeground; + QColor nickBackground; + QColor backgroundColor; + QColor selBackgroundColor; + QColor selForegroundColor; + //QColor ircColors[numColors]; + BoundsCheckingArray ircColors; + BoundsCheckingArray nickHighlight; + + QString colourTheme; + + QFont defaultFont; + bool ksircColors : 1; + bool mircColors : 1; + bool nickColourization : 1; + +}; + +class KSORMBMenu +{ +public: + KSORMBMenu(); +}; + +class KSOServChan +{ +public: + KSOServChan(); +}; + +typedef QMap ChannelOpMap; +typedef QMap ServerChannelOpMap; +typedef QMap ServerOpMap; + +class KSOptions + : public KSOGeneral, + public KSOStartup, + public KSOColors, + public KSORMBMenu, + public KSOServChan +{ +public: + KSOptions() { s_options = this; } + + void load( int sections = -1 ); + void save( int sections = -1 ); + + static KSOptions *options() { return s_options; } + + ServerChannelOpMap channel; + ServerOpMap server; + + KSOChannel &chan( const KSircChannel &chanInfo ) + { + return channel[chanInfo.server()][chanInfo.channel()]; + } + + KSOServer &serv( const KSircServer &servInfo ) + { + return server[servInfo.server()]; + } + + void channelSetup(QString serv, QString chan); + void applyChannelGlobal(void); + + void serverSetup(QString server); + void serverSetup( const KSircServer &servInfo ) + { + serverSetup(servInfo.server()); + } + + enum { + All = -1, General = 1, Startup = 2, + Colors = 4, RMBMenu = 8, ServChan = 16, + Channels = 32, Servers = 64 + }; + +private: + static KSOptions *s_options; +}; + +#define ksopts (KSOptions::options()) + +#endif -- cgit v1.2.1