~ubuntu-branches/debian/squeeze/pgadmin3/squeeze

« back to all changes in this revision

Viewing changes to pgadmin/include/slony/slSet.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Porcheron
  • Date: 2008-02-07 00:56:22 UTC
  • mto: (2.1.6 hardy) (6.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080207005622-c2ail8p4d0sk3dnw
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////
 
2
//
 
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
 
7
//
 
8
// slSet.h PostgreSQL Slony-I Set
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef SLSET_H
 
13
#define SLSET_H
 
14
 
 
15
#include "slony/slCluster.h"
 
16
 
 
17
 
 
18
class slSetFactory : public slObjFactory
 
19
{
 
20
public:
 
21
    slSetFactory();
 
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; }
 
25
    
 
26
protected:
 
27
    int exportedIconId;
 
28
};
 
29
extern slSetFactory setFactory;
 
30
 
 
31
 
 
32
class slSet : public slObject
 
33
{
 
34
public:
 
35
    slSet(slCluster *_cluster, const wxString& newName = wxT(""));
 
36
 
 
37
    int GetIconId();
 
38
    void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
 
39
 
 
40
    bool CanDrop();
 
41
    bool RequireDropConfirm() { return true; }
 
42
    bool WantDummyChild() { return true; }
 
43
 
 
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; }
 
50
 
 
51
    wxString GetLockXXID();
 
52
    bool Lock();
 
53
    bool Unlock();
 
54
 
 
55
    bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
 
56
    wxMenu *GetNewMenu();
 
57
    wxString GetSql(ctlTree *browser);
 
58
    pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
 
59
 
 
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);
 
63
 
 
64
private:
 
65
    long subscriptionCount;
 
66
    long originId;
 
67
    wxString originNode;
 
68
};
 
69
 
 
70
 
 
71
// Object in a Slony-I set
 
72
class slSetObject : public slObject
 
73
{
 
74
public:
 
75
    slSetObject(slSet *s, pgaFactory &factory, const wxString& newName = wxT(""));
 
76
    slSet *GetSet() { return set; }
 
77
 
 
78
    bool CanDrop();
 
79
    bool CanCreate();
 
80
 
 
81
private:
 
82
    slSet *set;
 
83
};
 
84
 
 
85
 
 
86
// Collection of set objects 
 
87
class slSubscription;
 
88
class slSetObjCollection : public slObjCollection
 
89
{
 
90
public:
 
91
    slSetObjCollection(pgaFactory *factory, slSet *_set);
 
92
    bool CanCreate();
 
93
 
 
94
    slSet *GetSet() {return set; }
 
95
 
 
96
private:
 
97
    slSet *set;
 
98
    slSubscription *subscription;
 
99
};
 
100
 
 
101
 
 
102
class slSetObjFactory : public slObjFactory
 
103
{
 
104
public:
 
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);
 
107
};
 
108
 
 
109
class slonyMoveSetFactory : public contextActionFactory
 
110
{
 
111
public:
 
112
    slonyMoveSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
 
113
    wxWindow *StartDialog(frmMain *form, pgObject *obj);
 
114
    bool CheckEnable(pgObject *obj);
 
115
};
 
116
 
 
117
 
 
118
class slonyMergeSetFactory : public contextActionFactory
 
119
{
 
120
public:
 
121
    slonyMergeSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
 
122
    wxWindow *StartDialog(frmMain *form, pgObject *obj);
 
123
    bool CheckEnable(pgObject *obj);
 
124
};
 
125
 
 
126
 
 
127
class slonyLockSetFactory : public contextActionFactory
 
128
{
 
129
public:
 
130
    slonyLockSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
 
131
    wxWindow *StartDialog(frmMain *form, pgObject *obj);
 
132
    bool CheckEnable(pgObject *obj);
 
133
};
 
134
 
 
135
 
 
136
class slonyUnlockSetFactory : public contextActionFactory
 
137
{
 
138
public:
 
139
    slonyUnlockSetFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
 
140
    wxWindow *StartDialog(frmMain *form, pgObject *obj);
 
141
    bool CheckEnable(pgObject *obj);
 
142
};
 
143
 
 
144
#endif
 
145