Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабы / 2 / lab.67.by mice / tube / src / ctb_hole

.h
Скачиваний:
9
Добавлен:
17.04.2013
Размер:
2.69 Кб
Скачать
/*******************************************************************************
* file:         ctb_hole.h                                                      *
* version:      0.0.1                                                          *
* author:       d-evil [tmd] (mailto:d-evil.tmd@mail.ru)                       *
* description:  not available                                                  *
*******************************************************************************/

#ifndef CTB_HOLE_INCLUDED
#define CTB_HOLE_INCLUDED

#include <afx.h>
#include <afxwin.h>
#include <afxcmn.h>
#include "resource.h"

#include "win_errors.h"
#include "tb_mail.h"


////////////////////////////////////////////////////////////////////////////////
// ctb_hole declaration
class ctb_hole: public CDialog {
public:
	ctb_hole();
	~ctb_hole();

	HICON get_icon() const { return _icon; }
	void set_icon(const HICON icon) { _icon = icon; }

	virtual BOOL OnInitDialog();
	virtual void OnOK() {}
	virtual void OnCancel() {}
	virtual void OnClose();

	int send_mail();
	int recv_mail();

protected:
	////////////////////////////////////////////////////////////////////////////
	// protected types
	struct _stb_message {
		std::string *text;
		// bool is_initial;
	};

	////////////////////////////////////////////////////////////////////////////
	// protected controls
	CButton *_btn_send;
	CButton *_btn_recv;
	CButton *_btn_show;
	CButton *_btn_exit;
	CEdit *_edit_smtp_host;
	CEdit *_edit_smtp_port;
	CEdit *_edit_smtp_from;
	CEdit *_edit_pop_host;
	CEdit *_edit_pop_port;
	CEdit *_edit_pop_from;
	CEdit *_edit_to;
	CEdit *_edit_from;
	CEdit *_edit_copy;
	CEdit *_edit_subj;
	CEdit *_edit_text;
	CEdit *_edit_login;
	CEdit *_edit_pass;
	CTreeCtrl *_tree;


	////////////////////////////////////////////////////////////////////////////
	// protected event handlers
	DECLARE_MESSAGE_MAP();

	void _on_btn_send();
	void _on_btn_recv();
	void _on_btn_show();
	void _on_btn_exit();

	void _lock_ctrls_serv(const bool lock = true);
	void _lock_ctrls_send(const bool lock = true);
	void _lock_ctrls_recv(const bool lock = true);
	void _lock_all(const bool lock = true);
	static unsigned short _ushort_from_edit(CEdit *const edit);
	
	static int _send_proc_helper(ctb_hole *const hole);
	int _send_proc();

	static int _recv_proc_helper(ctb_hole *const hole);
	int _recv_proc();

	bool _is_sending(const bool release = true);
	bool _is_recving(const bool release = true);

private:
	// net
	bool _sending;
	bool _recving;
	HANDLE _send_mtx;
	HANDLE _recv_mtx;

	// gui
	HICON _icon;

};



#endif
Соседние файлы в папке src