1 //////////////////////////////////////////////////////////////////////////
2 //
3 // pgAdmin III - PostgreSQL Tools
4 //
5 // Copyright (C) 2002 - 2016, The pgAdmin Development Team
6 // This software is released under the PostgreSQL Licence
7 //
8 // dlgSchedule.h - Job property
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef __DLG_SCHEDULEPROP
14 #define __DLG_SCHEDULEPROP
15 
16 #include "dlg/dlgProperty.h"
17 #include "ctl/timespin.h"
18 #include "ctl/calbox.h"
19 
20 class pgaSchedule;
21 class pgaJob;
22 
23 class dlgSchedule : public dlgAgentProperty
24 {
25 public:
26 	dlgSchedule(pgaFactory *factory, frmMain *frame, pgaSchedule *s, pgaJob *j);
27 
28 	void CheckChange();
29 	int Go(bool modal);
30 
31 	wxString GetComment();
32 	wxString GetUpdateSql();
33 	wxString GetInsertSql();
34 	pgObject *CreateObject(pgCollection *collection);
35 	pgObject *GetObject();
SetJobId(long id)36 	void SetJobId(long id)
37 	{
38 		jobId = id;
39 	}
40 
GetHelpPage(bool forCreate)41 	wxString GetHelpPage(bool forCreate) const
42 	{
43 		return wxT("pgagent-schedules");
44 	}
45 
46 private:
47 	long jobId;
48 	pgaSchedule *schedule;
49 	pgaJob *job;
50 
51 	wxArrayString deleteExceptions;
52 
53 #ifdef __WXMAC__
54 	void OnChangeSize(wxSizeEvent &ev);
55 #endif
56 
57 	void OnChangeCom(wxCommandEvent &ev);
58 	void OnChangeCal(wxCalendarEvent &ev);
59 	void OnSelChangeException(wxListEvent &ev);
60 	void OnAddException(wxCommandEvent &ev);
61 	void OnChangeException(wxCommandEvent &ev);
62 	void OnRemoveException(wxCommandEvent &ev);
63 	const wxString ChkListBox2PgArray(wxCheckListBox *lb);
64 	const wxString ChkListBox2StrArray(wxCheckListBox *lb);
65 	void OnSelectAll(wxCommandEvent &ev, int origin);
OnSelectAllWeekdays(wxCommandEvent & ev)66 	void OnSelectAllWeekdays(wxCommandEvent &ev)
67 	{
68 		OnSelectAll(ev, 1);
69 	};
OnSelectAllMonthdays(wxCommandEvent & ev)70 	void OnSelectAllMonthdays(wxCommandEvent &ev)
71 	{
72 		OnSelectAll(ev, 2);
73 	};
OnSelectAllMonths(wxCommandEvent & ev)74 	void OnSelectAllMonths(wxCommandEvent &ev)
75 	{
76 		OnSelectAll(ev, 3);
77 	};
OnSelectAllHours(wxCommandEvent & ev)78 	void OnSelectAllHours(wxCommandEvent &ev)
79 	{
80 		OnSelectAll(ev, 4);
81 	};
OnSelectAllMinutes(wxCommandEvent & ev)82 	void OnSelectAllMinutes(wxCommandEvent &ev)
83 	{
84 		OnSelectAll(ev, 5);
85 	};
86 	void InitSelectAll();
87 
88 	DECLARE_EVENT_TABLE()
89 };
90 
91 
92 #endif
93