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 // slListen.h PostgreSQL Slony-I Node
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef SLLISTEN_H
13 #define SLLISTEN_H
14 
15 #include "slony/slNode.h"
16 
17 
18 class slListenFactory : public slNodeObjFactory
19 {
20 public:
21 	slListenFactory();
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 slListenFactory listenFactory;
27 
28 
29 class slListen : public slNodeObject
30 {
31 public:
32 	slListen(slNode *n, const wxString &newName = wxT(""));
33 
34 	void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0);
35 
36 	wxString GetTranslatedMessage(int kindOfMessage) const;
37 
GetProviderId()38 	long GetProviderId() const
39 	{
40 		return providerId;
41 	}
iSetProviderId(long l)42 	void iSetProviderId(long l)
43 	{
44 		providerId = l;
45 	}
GetProviderName()46 	wxString GetProviderName() const
47 	{
48 		return providerName;
49 	}
iSetProviderName(const wxString & s)50 	void iSetProviderName(const wxString &s)
51 	{
52 		providerName = s;
53 	}
GetOriginName()54 	wxString GetOriginName() const
55 	{
56 		return originName;
57 	}
iSetOriginName(const wxString & s)58 	void iSetOriginName(const wxString &s)
59 	{
60 		originName = 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 
67 private:
68 	long providerId;
69 	wxString providerName, originName;
70 };
71 
72 class slListenCollection : public slNodeObjCollection
73 {
74 public:
slListenCollection(pgaFactory * factory,slNode * nd)75 	slListenCollection(pgaFactory *factory, slNode *nd) : slNodeObjCollection(factory, nd) {}
76 	wxString GetTranslatedMessage(int kindOfMessage) const;
77 };
78 
79 #endif
80 
81