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 // pgExtension.h PostgreSQL Extension
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef PGEXTENSION_H
13 #define PGEXTENSION_H
14 
15 #include "pgDatabase.h"
16 
17 class pgCollection;
18 class pgExtensionFactory : public pgDatabaseObjFactory
19 {
20 public:
21 	pgExtensionFactory();
22 	virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
23 	virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr = wxEmptyString);
24 	virtual pgCollection *CreateCollection(pgObject *obj);
25 };
26 extern pgExtensionFactory extensionFactory;
27 
28 class pgExtension : public pgDatabaseObject
29 {
30 public:
31 	pgExtension(const wxString &newName = wxT(""));
32 
33 	wxString GetTranslatedMessage(int kindOfMessage) const;
34 	void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0);
CanDropCascaded()35 	bool CanDropCascaded()
36 	{
37 		return true;
38 	}
39 
GetSchemaStr()40 	wxString GetSchemaStr() const
41 	{
42 		return schema;
43 	}
iSetSchemaStr(const wxString & s)44 	void iSetSchemaStr(const wxString &s)
45 	{
46 		schema = s;
47 	}
GetVersion()48 	wxString GetVersion() const
49 	{
50 		return version;
51 	}
iSetVersion(const wxString & s)52 	void iSetVersion(const wxString &s)
53 	{
54 		version = s;
55 	}
GetIsRelocatable()56 	bool GetIsRelocatable() const
57 	{
58 		return isrelocatable;
59 	}
iSetIsRelocatable(const bool b)60 	void iSetIsRelocatable(const bool b)
61 	{
62 		isrelocatable = b;
63 	}
64 
65 	bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
66 	wxString GetSql(ctlTree *browser);
67 	pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
68 
HasStats()69 	bool HasStats()
70 	{
71 		return false;
72 	}
HasDepends()73 	bool HasDepends()
74 	{
75 		return false;
76 	}
HasReferences()77 	bool HasReferences()
78 	{
79 		return false;
80 	}
81 
82 private:
83 	wxString schema, version;
84 	bool isrelocatable;
85 };
86 
87 class pgExtensionCollection : public pgDatabaseObjCollection
88 {
89 public:
90 	pgExtensionCollection(pgaFactory *factory, pgDatabase *db);
91 	wxString GetTranslatedMessage(int kindOfMessage) const;
92 };
93 
94 #endif
95