mailchecker.h

来自「张勇的linQ学习P2P及IM软件的极佳素材代码」· C头文件 代码 · 共 78 行

H
78
字号
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   copyright            : (C) 2003 by Zhang Yong                         *
 *   email                : z-yong163@163.com                              *
 ***************************************************************************/

#ifndef _MAIL_CHECKER_H
#define _MAIL_CHECKER_H

#include <qobject.h>
#include <qpixmap.h>
#include "plugin.h"


class Options {
public:
	Options();

	void load(const QDomElement &pref);
	void save(QDomDocument &doc, QDomElement &pref);

	QString host;
	int port;
	QString user;
	QString password;
	int interval;
};


class QSocket;
class QTimer;

class MailChecker : public QObject, public Plugin {
	Q_OBJECT

public:
	MailChecker();
	~MailChecker();

	virtual bool init(MAPI *mapi);
	virtual void destroy() { delete this; }

	virtual void load(const QDomElement &pref);
	virtual void unload(QDomDocument &doc, QDomElement &pref);

	virtual QString getName();
	virtual QString getDesc();
	virtual const QPixmap *getIcon() {
		return &iconPix;
	}
	virtual QWidget *getConfigWidget(QWidget *parent);
	virtual void saveConfig(QWidget *w);

private slots:
	void slotDataReady();
	void slotCheckMail();

private:
	bool startTimer();
	void sendCmd(const char *cmd);
	void onStatReply(const QString &reply);

	NotifyText *notifyText;
	QPixmap iconPix;
	Options options;
	QSocket *popSocket;
	int lastCmd;
	QTimer *checkTimer;
};


#endif

⌨️ 快捷键说明

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