1
//////////////////////////////////////////////////////////////////////////
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: slSet.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
// slSet.h PostgreSQL Slony-I Set
10
//////////////////////////////////////////////////////////////////////////
15
#include "slony/slCluster.h"
18
class slSetFactory : 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
int GetExportedIconId() { return exportedIconId; }
29
extern slSetFactory setFactory;
32
class slSet : public slObject
35
slSet(slCluster *_cluster, const wxString& newName = wxT(""));
38
void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
41
bool RequireDropConfirm() { return true; }
42
bool WantDummyChild() { return true; }
44
long GetOriginId() const { return originId; }
45
void iSetOriginId(long l) { originId=l; }
46
wxString GetOriginNode() const { return originNode; }
47
void iSetOriginNode(const wxString s) { originNode = s; }
48
long GetSubscriptionCount() { return subscriptionCount; }
49
void iSetSubscriptionCount(long l) { subscriptionCount=l; }
51
wxString GetLockXXID();
55
bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
57
wxString GetSql(ctlTree *browser);
58
pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
60
void ShowDependents(frmMain *form, ctlListView *referencedBy, const wxString &wh);
61
void ShowDependencies(frmMain *form, ctlListView *Dependencies, const wxString &wh);
62
void ShowStatistics(pgCollection *collection, ctlListView *statistics);
65
long subscriptionCount;
71
// Object in a Slony-I set
72
class slSetObject : public slObject
75
slSetObject(slSet *s, pgaFactory &factory, const wxString& newName = wxT(""));
76
slSet *GetSet() { return set; }
86
// Collection of set objects
88
class slSetObjCollection : public slObjCollection
91
slSetObjCollection(pgaFactory *factory, slSet *_set);
94
slSet *GetSet() {return set; }
98
slSubscription *subscription;
102
class slSetObjFactory : public slObjFactory
105
slSetObjFactory(const wxChar *tn, const wxChar *ns, const wxChar *nls, char **img, char **smImg=0) : slObjFactory(tn, ns, nls, img, smImg) {}
106
virtual pgCollection *CreateCollection(pgObject *obj);
109
class slonyMoveSetFactory : public contextActionFactory
112
slonyMoveSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
113
wxWindow *StartDialog(frmMain *form, pgObject *obj);
114
bool CheckEnable(pgObject *obj);
118
class slonyMergeSetFactory : public contextActionFactory
121
slonyMergeSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
122
wxWindow *StartDialog(frmMain *form, pgObject *obj);
123
bool CheckEnable(pgObject *obj);
127
class slonyLockSetFactory : public contextActionFactory
130
slonyLockSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
131
wxWindow *StartDialog(frmMain *form, pgObject *obj);
132
bool CheckEnable(pgObject *obj);
136
class slonyUnlockSetFactory : public contextActionFactory
139
slonyUnlockSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
140
wxWindow *StartDialog(frmMain *form, pgObject *obj);
141
bool CheckEnable(pgObject *obj);