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 // pgTextSearchParser.h PostgreSQL Text Search Parser
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef PG_TSPARSER_H
13 #define PG_TSPARSER_H
14 
15 
16 #include "pgSchema.h"
17 
18 
19 class pgTextSearchParserFactory : public pgSchemaObjFactory
20 {
21 public:
22 	pgTextSearchParserFactory();
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 pgTextSearchParserFactory textSearchParserFactory;
28 
29 class pgTextSearchParser : public pgSchemaObject
30 {
31 public:
32 	pgTextSearchParser(pgSchema *newSchema, const wxString &newName = wxT(""));
33 	~pgTextSearchParser();
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-createtsparser");
40 	}
CanDropCascaded()41 	bool CanDropCascaded()
42 	{
43 		return GetSchema()->GetMetaType() != PGM_CATALOG;
44 	}
45 
GetStart()46 	wxString GetStart() const
47 	{
48 		return start;
49 	}
iSetStart(const wxString & s)50 	void iSetStart(const wxString &s)
51 	{
52 		start = s;
53 	}
GetGettoken()54 	wxString GetGettoken() const
55 	{
56 		return gettoken;
57 	}
iSetGettoken(const wxString & s)58 	void iSetGettoken(const wxString &s)
59 	{
60 		gettoken = s;
61 	}
GetEnd()62 	wxString GetEnd() const
63 	{
64 		return end;
65 	}
iSetEnd(const wxString & s)66 	void iSetEnd(const wxString &s)
67 	{
68 		end = s;
69 	}
GetLextypes()70 	wxString GetLextypes() const
71 	{
72 		return lextypes;
73 	}
iSetLextypes(const wxString & s)74 	void iSetLextypes(const wxString &s)
75 	{
76 		lextypes = s;
77 	}
GetHeadline()78 	wxString GetHeadline() const
79 	{
80 		return headline;
81 	}
iSetHeadline(const wxString & s)82 	void iSetHeadline(const wxString &s)
83 	{
84 		headline = s;
85 	}
86 
87 	bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
88 	wxString GetSql(ctlTree *browser);
89 	pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
90 
HasStats()91 	bool HasStats()
92 	{
93 		return false;
94 	}
HasDepends()95 	bool HasDepends()
96 	{
97 		return true;
98 	}
HasReferences()99 	bool HasReferences()
100 	{
101 		return true;
102 	}
103 
104 private:
105 	wxString start, gettoken, end, lextypes, headline;
106 };
107 
108 class pgTextSearchParserCollection : public pgSchemaObjCollection
109 {
110 public:
111 	pgTextSearchParserCollection(pgaFactory *factory, pgSchema *sch);
112 	wxString GetTranslatedMessage(int kindOfMessage) const;
113 };
114 
115 #endif
116