1
//////////////////////////////////////////////////////////////////////////
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: slNode.h 6930 2008-01-02 00:10:01Z dpage $
5
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
// This software is released under the Artistic Licence
8
// slNode.h PostgreSQL Slony-I Node
10
//////////////////////////////////////////////////////////////////////////
15
#include "slony/slCluster.h"
18
class slNodeFactory : public slObjFactory
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
int GetLocalIconId() { return localIconId; }
26
int GetDisabledIconId() { return disabledIconId; }
29
int localIconId, disabledIconId;
31
extern slNodeFactory nodeFactory;
34
class slNode : public slObject
37
slNode(slCluster *_cluster, const wxString& newName = wxT(""));
41
void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
42
void ShowStatistics(frmMain *form, ctlListView *statistics);
45
bool RequireDropConfirm() { return true; }
46
bool WantDummyChild() { return true; }
48
long GetOutstandingAcks();
49
bool CheckAcksAndContinue(wxFrame *frame);
51
bool GetActive() const { return active; }
52
void iSetActive(bool b) { active=b; }
53
bool GetSpool() const { return spool; }
54
void iSetSpool(bool b) { spool=b; }
55
wxString GetConnInfo() const {return connInfo; }
56
void iSetConnInfo(const wxString s) { connInfo = s; }
57
long GetPid() { return pid; }
58
bool WaitForEvent(long evNode);
60
bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
62
wxString GetSql(ctlTree *browser);
63
pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
72
class slNodeCollection : public slObjCollection
75
slNodeCollection(pgaFactory *factory, slCluster *cl) : slObjCollection(factory, cl) {}
76
void ShowStatistics(frmMain *form, ctlListView *statistics);
79
//////////////////////////////////////////
81
// Object under a Slony-I node
82
class slNodeObject : public slObject
85
slNodeObject(slNode *n, pgaFactory &factory, const wxString& newName = wxT(""));
86
slNode *GetNode() const { return node; }
92
// Collection of node objects
93
class slNodeObjCollection : public slObjCollection
96
slNodeObjCollection(pgaFactory *factory, slNode *n);
97
slNode *GetNode() {return node; }
104
class slNodeObjFactory : public slObjFactory
107
slNodeObjFactory(const wxChar *tn, const wxChar *ns, const wxChar *nls, char **img) : slObjFactory(tn, ns, nls, img) {}
108
virtual pgCollection *CreateCollection(pgObject *obj);