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 // pgTextSearchDictionary.h PostgreSQL Text Search Dictionary 9 // 10 ////////////////////////////////////////////////////////////////////////// 11 12 #ifndef PG_TSDICTIONARY_H 13 #define PG_TSDICTIONARY_H 14 15 16 #include "pgSchema.h" 17 18 19 class pgTextSearchDictionaryFactory : public pgSchemaObjFactory 20 { 21 public: 22 pgTextSearchDictionaryFactory(); 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 pgTextSearchDictionaryFactory textSearchDictionaryFactory; 28 29 class pgTextSearchDictionary : public pgSchemaObject 30 { 31 public: 32 pgTextSearchDictionary(pgSchema *newSchema, const wxString &newName = wxT("")); 33 ~pgTextSearchDictionary(); 34 35 wxString GetTranslatedMessage(int kindOfMessage) const; 36 void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0); CanDropCascaded()37 bool CanDropCascaded() 38 { 39 return GetSchema()->GetMetaType() != PGM_CATALOG; 40 } 41 GetTemplate()42 wxString GetTemplate() const 43 { 44 return tmpl; 45 } iSetTemplate(const wxString & s)46 void iSetTemplate(const wxString &s) 47 { 48 tmpl = s; 49 } GetOptions()50 wxString GetOptions() const 51 { 52 return options; 53 } iSetOptions(const wxString & s)54 void iSetOptions(const wxString &s) 55 { 56 options = s; 57 } GetHelpPage(bool forCreate)58 virtual wxString GetHelpPage(bool forCreate) const 59 { 60 return wxT("pg/sql-createtsdictionary"); 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 tmpl, options; 82 }; 83 84 class pgTextSearchDictionaryCollection : public pgSchemaObjCollection 85 { 86 public: 87 pgTextSearchDictionaryCollection(pgaFactory *factory, pgSchema *sch); 88 wxString GetTranslatedMessage(int kindOfMessage) const; 89 }; 90 91 #endif 92