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 // pgConversion.h PostgreSQL Conversion 9 // 10 ////////////////////////////////////////////////////////////////////////// 11 12 #ifndef PGCONVERSION_H 13 #define PGCONVERSION_H 14 15 #include "pgSchema.h" 16 17 class pgCollection; 18 19 class pgConversionFactory : public pgSchemaObjFactory 20 { 21 public: 22 pgConversionFactory(); 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 pgConversionFactory conversionFactory; 28 29 30 class pgConversion : public pgSchemaObject 31 { 32 public: 33 pgConversion(pgSchema *newSchema, const wxString &newName = wxT("")); 34 ~pgConversion(); 35 36 wxString GetTranslatedMessage(int kindOfMessage) const; 37 void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0); CanDropCascaded()38 bool CanDropCascaded() 39 { 40 return GetSchema()->GetMetaType() != PGM_CATALOG; 41 } 42 GetProc()43 wxString GetProc() const 44 { 45 return proc; 46 } iSetProc(const wxString & s)47 void iSetProc(const wxString &s) 48 { 49 proc = s; 50 } GetProcNamespace()51 wxString GetProcNamespace() const 52 { 53 return procNamespace; 54 } iSetProcNamespace(const wxString & s)55 void iSetProcNamespace(const wxString &s) 56 { 57 procNamespace = s; 58 } GetForEncoding()59 wxString GetForEncoding() const 60 { 61 return forEncoding; 62 } iSetForEncoding(const wxString & s)63 void iSetForEncoding(const wxString &s) 64 { 65 forEncoding = s; 66 } GetToEncoding()67 wxString GetToEncoding() const 68 { 69 return toEncoding; 70 } iSetToEncoding(const wxString & s)71 void iSetToEncoding(const wxString &s) 72 { 73 toEncoding = s; 74 } GetDefaultConversion()75 bool GetDefaultConversion() const 76 { 77 return defaultConversion; 78 } iSetDefaultConversion(const bool b)79 void iSetDefaultConversion(const bool b) 80 { 81 defaultConversion = b; 82 } 83 84 bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded); 85 wxString GetSql(ctlTree *browser); 86 pgObject *Refresh(ctlTree *browser, const wxTreeItemId item); 87 HasStats()88 bool HasStats() 89 { 90 return false; 91 } HasDepends()92 bool HasDepends() 93 { 94 return true; 95 } HasReferences()96 bool HasReferences() 97 { 98 return true; 99 } 100 101 private: 102 wxString proc, procNamespace, forEncoding, toEncoding; 103 bool defaultConversion; 104 }; 105 106 class pgConversionCollection : public pgSchemaObjCollection 107 { 108 public: 109 pgConversionCollection(pgaFactory *factory, pgSchema *sch); 110 wxString GetTranslatedMessage(int kindOfMessage) const; 111 }; 112 113 #endif 114