summaryrefslogtreecommitdiff
path: root/plugins/XSoundNotify/SettingsDialog.h
blob: c68503a6e8ee2b4f695f5f8a4a58287f6a649044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef __XSN_SETTINGS_DIALOG_H
#define __XSN_SETTINGS_DIALOG_H

#include <atlbase.h>
#include <atlwin.h>
#include <atlapp.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include "resource.h"
#include "SoundNotifyDataStorage.h"

class SettingsDialog : public CDialogImpl<SettingsDialog>
{
private:
	CComboBox	_userCombo;
	CComboBox	_protoCombo;
	CButton		_chooseButton;
	CButton		_resetButton;
	CButton		_playButton;
	CStatic		_soundLabel;
	SoundNotifyDataStorage & _dataStorage;

public:	
	SettingsDialog(SoundNotifyDataStorage & dataStorage);
	virtual ~SettingsDialog() {}
	static BOOL DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);

public:
	enum {IDD = IDD_DIALOG1};

	BEGIN_MSG_MAP(SettingsDialog)		
		MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
		COMMAND_HANDLER(IDC_COMBO_PROTO, CBN_SELCHANGE, onSelectProtocol)		
		COMMAND_HANDLER(IDC_COMBO_USERS, CBN_SELCHANGE, onSelectUser)
		COMMAND_ID_HANDLER(IDOK, onOk)
		COMMAND_ID_HANDLER(IDCANCEL, onCancel)
		COMMAND_ID_HANDLER(IDC_BUTTON_CHOOSE_SOUND, onChooseSound)
		COMMAND_ID_HANDLER(IDC_BUTTON_RESET_SOUND, onResetSound)
		COMMAND_ID_HANDLER(IDC_BUTTON_TEST_PLAY, onTestPlay)
	END_MSG_MAP()

	virtual BOOL PreTranslateMessage(MSG* pMsg);

protected:
	LRESULT onInitDialog(UINT, WPARAM, LPARAM, BOOL&);
	
	LRESULT onOk(WORD, WORD, HWND, BOOL&);
	LRESULT onCancel(WORD, WORD, HWND, BOOL &);
	LRESULT onSelectProtocol(WORD, WORD, HWND, BOOL&);
	LRESULT onSelectUser(WORD, WORD, HWND, BOOL &);
	LRESULT onChooseSound(WORD, WORD, HWND , BOOL&);
	LRESULT onResetSound(WORD, WORD, HWND , BOOL&);
	LRESULT onTestPlay(WORD, WORD, HWND , BOOL&);

	void addProtocolItem(ProtocolTable::value_type & value);

	void setSoundLabelText(LPCTSTR text);	
};

#endif