~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/include/schema/pgEventTrigger.h

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-09-10 16:16:38 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130910161638-wwup1q553ylww7dr
Tags: 1.18.0-1
* New upstream release.
* Don't install /usr/bin/png2c anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// pgAdmin III - PostgreSQL Tools
 
4
//
 
5
// Copyright (C) 2002 - 2013, The pgAdmin Development Team
 
6
// This software is released under the PostgreSQL Licence
 
7
//
 
8
// pgEventTrigger.h PostgreSQL Event Trigger
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef PGEVENTTRIGGER_H
 
13
#define PGEVENTTRIGGER_H
 
14
 
 
15
#include "pgDatabase.h"
 
16
 
 
17
class pgCollection;
 
18
class pgFunction;
 
19
 
 
20
class pgEventTriggerFactory : public pgDatabaseObjFactory
 
21
{
 
22
public:
 
23
        pgEventTriggerFactory();
 
24
        virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
 
25
        virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr = wxEmptyString);
 
26
        virtual pgCollection *CreateCollection(pgObject *obj);
 
27
        virtual ~pgEventTriggerFactory() {};
 
28
 
 
29
        int GetClosedIconId()
 
30
        {
 
31
                return closedId;
 
32
        }
 
33
 
 
34
protected:
 
35
        int closedId;
 
36
};
 
37
 
 
38
extern pgEventTriggerFactory eventTriggerFactory;
 
39
 
 
40
class pgEventTrigger : public pgDatabaseObject
 
41
{
 
42
public:
 
43
        pgEventTrigger(const wxString &newName = wxT(""));
 
44
        ~pgEventTrigger();
 
45
        wxString GetTranslatedMessage(int kindOfMessage) const;
 
46
        void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0);
 
47
        bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
 
48
        bool IsUpToDate();
 
49
        wxString GetSql(ctlTree *browser);
 
50
        pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
 
51
 
 
52
        int GetIconId();
 
53
 
 
54
        wxString GetFunction() const
 
55
        {
 
56
                return function;
 
57
        }
 
58
        void iSetFunction(const wxString &s)
 
59
        {
 
60
                function = s ;
 
61
        }
 
62
        wxString GetWhen() const
 
63
        {
 
64
                return when;
 
65
        }
 
66
        void iSetWhen(const wxString &s)
 
67
        {
 
68
                when = s;
 
69
        }
 
70
        OID GetFunctionOid() const
 
71
        {
 
72
                return functionOid;
 
73
        }
 
74
        void iSetFunctionOid(const OID d)
 
75
        {
 
76
                functionOid = d;
 
77
        }
 
78
        OID GetSchemaOid() const
 
79
        {
 
80
                return schemaOid;
 
81
        }
 
82
        void iSetSchemaOid(const OID d)
 
83
        {
 
84
                schemaOid = d;
 
85
        }
 
86
        wxString GetSource() const
 
87
        {
 
88
                return source;
 
89
        }
 
90
        void iSetSource(const wxString &s)
 
91
        {
 
92
                source = s;
 
93
        }
 
94
        wxString GetLanguage() const
 
95
        {
 
96
                return language;
 
97
        }
 
98
        void iSetLanguage(const wxString &s)
 
99
        {
 
100
                language = s;
 
101
        }
 
102
        wxString GetEventName() const
 
103
        {
 
104
                return eventName;
 
105
        }
 
106
        wxString GetEnableStatus() const
 
107
        {
 
108
                return enableStatus;
 
109
        }
 
110
        void iSetEnableStatus(const wxString &s)
 
111
        {
 
112
                enableStatus = s;
 
113
        }
 
114
        void iSetEventName(const wxString &s)
 
115
        {
 
116
                eventName = s;
 
117
        }
 
118
 
 
119
        bool GetEnabled() const
 
120
        {
 
121
                return enabled;
 
122
        }
 
123
        void iSetEnabled(const bool b)
 
124
        {
 
125
                enabled = b;
 
126
        }
 
127
        void SetEnabled(ctlTree *browser, const bool b);
 
128
        void SetDirty();
 
129
 
 
130
private:
 
131
        wxString function, when, language, source, eventName, enableStatus;
 
132
        OID functionOid, schemaOid;
 
133
        bool enabled;
 
134
        pgFunction *eventTriggerFunction;
 
135
};
 
136
 
 
137
class pgEventTriggerCollection : public pgDatabaseObjCollection
 
138
{
 
139
public:
 
140
        pgEventTriggerCollection(pgaFactory *factory, pgDatabase *db);
 
141
        wxString GetTranslatedMessage(int kindOfMessage) const;
 
142
};
 
143
 
 
144
class enabledisableEventTriggerFactory : public contextActionFactory
 
145
{
 
146
public:
 
147
        enabledisableEventTriggerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar);
 
148
        wxWindow *StartDialog(frmMain *form, pgObject *obj);
 
149
        bool CheckEnable(pgObject *obj);
 
150
        bool CheckChecked(pgObject *obj);
 
151
};
 
152
 
 
153
#endif
 
 
b'\\ No newline at end of file'