⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evausersetting.h

📁 linux下的eva源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*************************************************************************** *   Copyright (C) 2004 by yunfan                                          * *   yunfan_zg@163.com                                                     * *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * *   This program is distributed in the hope that it will be useful,       * *   but WITHOUT ANY WARRANTY; without even the implied warranty of        * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         * *   GNU General Public License for more details.                          * *                                                                         * *   You should have received a copy of the GNU General Public License     * *   along with this program; if not, write to the                         * *   Free Software Foundation, Inc.,                                       * *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             * ***************************************************************************/ #ifndef EVAUSERSETTING_H#define EVAUSERSETTING_H #include "evafriendlist.h"#include "evauserinfo.h"#include "evaqunlist.h"#include <list>#include <string>#include <stack>#include <inttypes.h>#include <qdatetime.h>#include <qpoint.h>#include <qsize.h>#include <qcolor.h>#include <kshortcut.h>typedef struct BuddyInfoCacheItem{	unsigned int id;	QString nick;	unsigned short face;	int group;	BuddyInfoCacheItem(const unsigned int qq, const QString &n,			const unsigned short f, const int g) :		id(qq),nick(n),face(f),group(g) { };} BuddyInfoCacheItem;// this class processes saving & loading buddy list, message recording & user settingsclass EvaUserSetting{public:	EvaUserSetting(const int id);	~EvaUserSetting();	typedef struct{	Q_UINT32 sender;	QString sNick;	Q_UINT32 receiver;	QString rNick;	Q_UINT8  type; // 0 auto reply,  1 normal	QString  message;	QDateTime time;	Q_UINT8   fontSize;	Q_UINT8   flag; // start from right.  bit 0: u, bit 1: i, bit 2: b	Q_UINT8   blue;	Q_UINT8   green;	Q_UINT8   red;	} chatMessage;		class sysMessage {	public:		Q_UINT16  messageType;		Q_UINT8  type;		Q_UINT32 from;		Q_UINT32 to;		Q_UINT32 commander; // for Qun sys message		Q_UINT32 internalQunID;		QString  message;		Q_UINT16 codeLen;		unsigned char *code;		Q_UINT16 tokenLen;		unsigned char *token;			sysMessage(): codeLen(0), code(0), tokenLen(0), token(0){		}			sysMessage(const sysMessage &rhs): codeLen(0), code(0), tokenLen(0), token(0){			*this = rhs;		}		sysMessage &operator=(const sysMessage &rhs){			messageType = rhs.messageType;			type = rhs.type;			from = rhs.from;			to = rhs.to;			commander = rhs.commander;			internalQunID = rhs.internalQunID;			message = rhs.message;			setCode(rhs.code, rhs.codeLen);			setToken(rhs.token, rhs.tokenLen);			return *this;		}		~sysMessage(){			if(code) delete []code;			if(token) delete []token;		}		void setCode(const unsigned char *c, const unsigned short len){			if(c || len){				if(code) delete []code;				codeLen = len;				code = new unsigned char[codeLen];				memcpy(code, c, codeLen);			}		}		void setToken(const unsigned char *t, const unsigned short len){			if(t || len){				if(token) delete []token;				tokenLen = len;				token = new unsigned char[tokenLen];				memcpy(token, t, tokenLen);			}		}	};		// save Qun information method		const bool saveQunList(QObject *receiver, QunList &list);	const bool loadQunList(QObject *receiver);		// the group names include user creating ones and the first one "buddy list"	const bool saveBuddyList(QObject *receiver, std::list<std::string> groups, ContactInfo &myInfo, FriendList &list,				unsigned short extraInfo, std::string sig, unsigned int sigTime);	const bool loadBuddyList(QObject * receiver);		const bool saveMessage(const int buddy, const int sender, QString sNick, 			const int receiver, QString rNick,			const bool isNormal, 			const QString message, 			const QDateTime time, const char fontSize, 			const bool u, const bool i, const bool b, 			const char blue, const char green, const char red, const bool isQunMsg = false);		std::list<chatMessage> getMessages( const int buddy, const int page, const bool isQunMsg = false); // page number starts from 0	std::list<chatMessage> getMessages(const int buddy, const int page, const QDateTime starttime, const QDateTime endtime, 						const bool isQunMsg = false);		const bool saveSysMessage(const short msgType, const unsigned char type, const int fromQQ, const int toQQ, 				const QString message, const int internalQunID = 0, const unsigned int commander = 0,					const unsigned char *code = 0, const unsigned short codeLen = 0,					const unsigned char *token = 0, const unsigned short tokenLen = 0);	std::list<sysMessage> getSysMessages( const int page); // page number starts from 0	sysMessage getLastSysMessage();		const bool saveSettings();	const bool loadSettings();	void loadDefaultSettings();		void setThemeDir(const QString &dir) { themeDir = dir; }	void setSoundDir(const QString &dir) { soundDir = dir; }	void setPageSize(const int size) { pageSize = size; }	void setFaceSize(const QSize &size) { faceSize = size; }	void setShowSystemBroadcastEnabled(const bool show) { showQQBroadcast = show; }	void setShowSystemNewsEnabled(const bool show) { m_ShowQQNews = show; }	void setShowMessageTipEnabled( const bool show) { showMessageTipWindow = show; }	void setShowBudyOnlineNotifyEnabled( const bool show) { showBudyOnlineNotifyWindow = show; }	void setShowOnlineEnabled( const bool show) { showOnlineUsers = show; }	void setSendKeyEnterEnabled(const bool ok) { isSendKeyEnter = ok; }	void setSoundEnabled(const bool play) { playSound = play; }	void setAutoReplyEnabled(const bool reply) { autoReply = reply; }	void setShowSmileyInNickName( const bool show ) { m_ShowSmileyInNickName = show; }	void setShowSignatureInSeperateLine( const bool show) { m_ShowSignatureInSeperateLine = show; }		const QString &getThemeDir() const { return themeDir; }	const QString &getSoundDir() const { return soundDir; }	const int getPageSize() const { return pageSize; }	const QSize &getFaceSize() const { return faceSize; }	const bool isShowSystemBroadcastEnabled() const { return showQQBroadcast; }	const bool isShowSystemNewsEnabled() const { return m_ShowQQNews; }	const bool isShowMessageTipEnabled() const { return showMessageTipWindow;}	const bool isShowBudyOnlineNotifyEnabled() const { return showBudyOnlineNotifyWindow;}	const bool isShowOnlineEnabled() const { return showOnlineUsers;}	const bool isSendKeyEnterEnabled() const { return isSendKeyEnter; }	const bool isSoundEnabled() const { return playSound;}	const bool isAutoReplyEnabled() const { return autoReply; }	const bool isShowSmileyInNickName() const { return m_ShowSmileyInNickName; }	const bool isShowSignatureInSeperateLine() const { return m_ShowSignatureInSeperateLine; }		const int getAutoReplySelectedIndex() const { return autoSelectedIndex; }	const QString &getSelectedAutoReply();	const QString &getQuickReplyMessageAt(const int index);	void addAutoReplyMessage(const QString &message);	void addQuickReplyMessage(const QString &message);		void setAutoReplySelectedIndex(const int index) { autoSelectedIndex = index; }	void setAutoReplyList(std::list<QString> list) { autoList = list;}	void setQuickReplyList(std::list<QString> list) { quickList = list;}	const std::list<QString> &getAutoReplyList();	const std::list<QString> &getQuickReplyList();	const QString getPictureCacheDir() const { return pictureCacheDir; }	void setPictureCacheDir(const QString path) { pictureCacheDir = path; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -