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 // pgTextSearchTemplate.h PostgreSQL Text Search Template
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef PG_TSTEMPLATE_H
13 #define PG_TSTEMPLATE_H
14 
15 
16 #include "pgSchema.h"
17 
18 
19 class pgTextSearchTemplateFactory : public pgSchemaObjFactory
20 {
21 public:
22 	pgTextSearchTemplateFactory();
23 	virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
24 	virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr = wxEmptyString);
25 	virtual pgCollection *CreateCollection(pgObject *obj);
26 };
27 extern pgTextSearchTemplateFactory textSearchTemplateFactory;
28 
29 class pgTextSearchTemplate : public pgSchemaObject
30 {
31 public:
32 	pgTextSearchTemplate(pgSchema *newSchema, const wxString &newName = wxT(""));
33 	~pgTextSearchTemplate();
34 
35 	wxString GetTranslatedMessage(int kindOfMessage) const;
36 	void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0);
GetHelpPage(bool forCreate)37 	virtual wxString GetHelpPage(bool forCreate) const
38 	{
39 		return wxT("pg/sql-createtstemplate");
40 	}
CanDropCascaded()41 	bool CanDropCascaded()
42 	{
43 		return GetSchema()->GetMetaType() != PGM_CATALOG;
44 	}
45 
GetInit()46 	wxString GetInit() const
47 	{
48 		return init;
49 	}
iSetInit(const wxString & s)50 	void iSetInit(const wxString &s)
51 	{
52 		init = s;
53 	}
GetLexize()54 	wxString GetLexize() const
55 	{
56 		return lexize;
57 	}
iSetLexize(const wxString & s)58 	void iSetLexize(const wxString &s)
59 	{
60 		lexize = s;
61 	}
62 
63 	bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
64 	wxString GetSql(ctlTree *browser);
65 	pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
66 
HasStats()67 	bool HasStats()
68 	{
69 		return false;
70 	}
HasDepends()71 	bool HasDepends()
72 	{
73 		return true;
74 	}
HasReferences()75 	bool HasReferences()
76 	{
77 		return true;
78 	}
79 
80 private:
81 	wxString init, lexize;
82 };
83 
84 class pgTextSearchTemplateCollection : public pgSchemaObjCollection
85 {
86 public:
87 	pgTextSearchTemplateCollection(pgaFactory *factory, pgSchema *sch);
88 	wxString GetTranslatedMessage(int kindOfMessage) const;
89 };
90 
91 #endif
92