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

« back to all changes in this revision

Viewing changes to pgadmin/include/slony/slNode.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: 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
 
7
//
 
8
// slNode.h PostgreSQL Slony-I Node
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef SLNODE_H
 
13
#define SLNODE_H
 
14
 
 
15
#include "slony/slCluster.h"
 
16
 
 
17
 
 
18
class slNodeFactory : public slObjFactory
 
19
{
 
20
public:
 
21
    slNodeFactory();
 
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; }
 
27
 
 
28
private:
 
29
    int localIconId, disabledIconId;
 
30
};
 
31
extern slNodeFactory nodeFactory;
 
32
 
 
33
 
 
34
class slNode : public slObject
 
35
{
 
36
public:
 
37
    slNode(slCluster *_cluster, const wxString& newName = wxT(""));
 
38
 
 
39
    int GetIconId();
 
40
 
 
41
    void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
 
42
    void ShowStatistics(frmMain *form, ctlListView *statistics);
 
43
 
 
44
    bool CanDrop();
 
45
    bool RequireDropConfirm() { return true; }
 
46
    bool WantDummyChild() { return true; }
 
47
 
 
48
    long GetOutstandingAcks();
 
49
    bool CheckAcksAndContinue(wxFrame *frame);
 
50
 
 
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);
 
59
 
 
60
    bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
 
61
    wxMenu *GetNewMenu();
 
62
    wxString GetSql(ctlTree *browser);
 
63
    pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
 
64
 
 
65
private:
 
66
    bool active, spool;
 
67
    long pid;
 
68
    wxString connInfo;
 
69
};
 
70
 
 
71
 
 
72
class slNodeCollection : public slObjCollection
 
73
{
 
74
public:
 
75
    slNodeCollection(pgaFactory *factory, slCluster *cl) : slObjCollection(factory, cl) {}
 
76
    void ShowStatistics(frmMain *form, ctlListView *statistics);
 
77
};
 
78
 
 
79
//////////////////////////////////////////
 
80
 
 
81
// Object under a Slony-I node
 
82
class slNodeObject : public slObject
 
83
{
 
84
public:
 
85
    slNodeObject(slNode *n, pgaFactory &factory, const wxString& newName = wxT(""));
 
86
    slNode *GetNode() const { return node; }
 
87
 
 
88
private:
 
89
    slNode *node;
 
90
};
 
91
 
 
92
// Collection of node objects 
 
93
class slNodeObjCollection : public slObjCollection
 
94
{
 
95
public:
 
96
    slNodeObjCollection(pgaFactory *factory, slNode *n);
 
97
    slNode *GetNode() {return node; }
 
98
 
 
99
private:
 
100
    slNode *node;
 
101
};
 
102
 
 
103
 
 
104
class slNodeObjFactory : public slObjFactory
 
105
{
 
106
public:
 
107
    slNodeObjFactory(const wxChar *tn, const wxChar *ns, const wxChar *nls, char **img) : slObjFactory(tn, ns, nls, img) {}
 
108
    virtual pgCollection *CreateCollection(pgObject *obj);
 
109
};
 
110
 
 
111
 
 
112
#endif
 
113