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 // frmHint.h - PostgreSQL Guru hints
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef __FRMHINT
13 #define __FRMHINT
14 
15 
16 #define HINT_CONNECTSERVER               wxT("conn-listen")
17 #define HINT_MISSINGHBA                  wxT("conn-hba")
18 #define HINT_MISSINGIDENT                wxT("conn-ident")
19 #define HINT_PRIMARYKEY                  wxT("pk")
20 #define HINT_FKINDEX                     wxT("fki")
21 #define HINT_VACUUM                      wxT("vacuum")
22 #define HINT_VACUUM_FULL                 wxT("vacuum-full")
23 #define HINT_QUERYRUNTIME                wxT("query-runtime")
24 #define HINT_INSTRUMENTATION             wxT("instrumentation")
25 #define HINT_INSTRUMENTATION_91_WITH     wxT("instrumentation91_with")
26 #define HINT_INSTRUMENTATION_91_WITHOUT  wxT("instrumentation91_without")
27 #define HINT_ENCODING_ASCII              wxT("encoding-ascii")
28 #define HINT_ENCODING_UNICODE            wxT("encoding-unicode")
29 #define HINT_READONLY_NOPK               wxT("view-without-pk")
30 #define HINT_AUTOVACUUM                  wxT("autovacuum")
31 #define HINT_OBJECT_EDITING              wxT("object-editing")
32 #define HINT_SAVING_PASSWORDS            wxT("saving-passwords")
33 
34 #define HINT_RC_FIX             42
35 
36 #include "dlg/dlgClasses.h"
37 #include "utils/factory.h"
38 
39 class frmMain;
40 class frmHint : public DialogWithHelp
41 {
42 public:
43 	static int ShowHint(wxWindow *fr,  const wxString &hint, const wxString &info = wxEmptyString, bool force = false);
44 	static int ShowHint(wxWindow *fr,  const wxArrayString &hints, const wxString &info = wxEmptyString, bool force = false);
45 	static bool WantHint(const wxString &hint);
46 	static void ResetHints();
47 
48 	void SetHint(int hint, const wxString &info);
49 	void SetHint(const wxArrayInt &hintnos, const wxString &info);
50 
51 private:
52 	frmHint(wxWindow *fr, bool force);
53 	~frmHint();
54 
55 	void SetHint(const wxString &info);
56 	void OnFix(wxCommandEvent &ev);
57 	static int GetHintNo(const wxString &hint);
58 	static bool WantHint(int hintno);
59 	wxString GetPage(const wxChar *hintpage);
60 	wxString GetHelpPage() const;
61 
62 	DECLARE_EVENT_TABLE()
63 
64 	wxArrayInt hintnos;
65 	int currentHint;
66 	bool force;
67 };
68 
69 
70 class hintFactory : public actionFactory
71 {
72 public:
73 	hintFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar, bool bigTool);
74 	wxWindow *StartDialog(frmMain *form, pgObject *obj);
75 	bool CheckEnable(pgObject *obj);
76 };
77 
78 
79 #endif
80