~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/include/utils/misc.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// RCS-ID:      $Id: misc.h 7171 2008-03-17 16:45:52Z dpage $
5
 
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
 
4
// RCS-ID:      $Id: misc.h 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
7
7
//
8
8
// misc.h - Miscellaneous Utilties
9
9
//
48
48
#define END_OF_LINE wxT("\n")
49
49
#endif
50
50
 
 
51
#if !defined(PGSCLI)
 
52
 
51
53
#define wxCookieType wxTreeItemIdValue
52
54
 
53
55
class sysSettings;
68
70
#define CTRL_COMBOBOX(id)       ((ctlComboBoxFix*)(XRCCTRL(*this, id, wxComboBox)))
69
71
#define CTRL_LISTVIEW(id)       ((ctlListView*)(XRCCTRL(*this, id, wxListCtrl)))
70
72
#define CTRL_COMBOBOX2(id)      (XRCCTRL(*this, id, ctlComboBox))
 
73
#define CTRL_CHOICE(id)         (XRCCTRL(*this, id, wxChoice))
71
74
#define CTRL_CHECKBOX(id)       (XRCCTRL(*this, id, wxCheckBox))
72
75
#define CTRL_RADIOBOX(id)       (XRCCTRL(*this, id, wxRadioBox))
73
76
#define CTRL_BUTTON(id)         (XRCCTRL(*this, id, wxButton))
74
77
#define CTRL_CALENDAR(id)       (XRCCTRL(*this, id, wxCalendarBox))
75
78
#define CTRL_TIME(id)           (XRCCTRL(*this, id, wxTimeSpinCtrl))
 
79
#define CTRL_FLEXGRIDSIZER(id)  (XRCCTRL(*this, id, wxFlexGridSizer))
76
80
#define CTRL_PANEL(id)          (XRCCTRL(*this, id, wxPanel))
77
81
#define CTRL_SLIDER(id)         (XRCCTRL(*this, id, wxSlider))
78
82
#define CTRL_SQLBOX(id)         (XRCCTRL(*this, id, ctlSQLBox))
83
87
#define CTRL_DATEPICK(id)       (XRCCTRL(*this, id, wxDatePickerCtrl))
84
88
#define CTRL_TREE(id)           (XRCCTRL(*this, id, ctlTree))
85
89
 
 
90
#endif // PGSCLI
 
91
 
86
92
// Conversions
87
93
wxString BoolToStr(bool value);         // english; used for config values
88
94
wxString DateToAnsiStr(const wxDateTime &datetime);
94
100
wxDateTime StrToDateTime(const wxString &value);
95
101
OID StrToOid(const wxString& value);
96
102
 
 
103
wxString generate_spaces(int length);
 
104
 
97
105
// nls aware
98
106
wxString BoolToYesNo(bool value);
99
107
wxString NumToStr(long value);
106
114
// Quoting
107
115
wxString qtConnString(const wxString& value); // connection strings always have single quotes escaped with backslash
108
116
 
 
117
#if !defined(PGSCLI)
 
118
 
109
119
// check if size/pos have reasonable values
110
120
void CheckOnScreen(wxWindow *win, wxPoint &pos, wxSize &size, const int w0=100, const int h0=70);
111
121
 
139
149
    char delimiter;
140
150
};
141
151
 
 
152
// Get an array from a comma(,) separated list
 
153
bool getArrayFromCommaSeparatedList(const wxString& str, wxArrayString& res);
142
154
 
143
155
// File handling including encoding according to sysSettings if format<0,
144
156
// 0-> local charset, 1->utf8
150
162
    HELP_PGADMIN,
151
163
    HELP_POSTGRESQL,
152
164
    HELP_ENTERPRISEDB,
 
165
    HELP_GREENPLUM,
153
166
    HELP_SLONY
154
167
} HelpType;
155
168
 
174
187
bool pgAppMinimumVersion(const wxString &cmd, const int majorVer, const int minorVer);
175
188
bool isPgApp(const wxString &app);
176
189
bool isEdbApp(const wxString &app);
177
 
 
178
 
wxString commandLineCleanOption(const wxString &option);
 
190
bool isGpApp(const wxString &app);
179
191
 
180
192
enum 
181
193
{
182
194
    EDB_PACKAGE,
183
195
    EDB_PACKAGEFUNCTION,
184
 
        EDB_PACKAGEVARIABLE,
 
196
    EDB_PACKAGEVARIABLE,
185
197
 
186
 
        PGM_CATALOG,
187
 
        PGM_CATALOGOBJECT,
 
198
    PGM_CATALOG,
 
199
    PGM_CATALOGOBJECT,
188
200
    PGM_CHECK,
189
201
    PGM_COLUMN,    
190
 
        PGM_CONSTRAINT,
191
 
        PGM_DATABASE,
 
202
    PGM_CONSTRAINT,
 
203
    PGM_DATABASE,
192
204
    PGM_FOREIGNKEY,
193
205
    PGM_FUNCTION,
194
206
    PGM_INDEX,
195
 
        PGM_OPCLASS,
196
 
        PGM_OPFAMILY,
 
207
    PGM_OPCLASS,
 
208
    PGM_OPFAMILY,
197
209
    PGM_PRIMARYKEY,
198
 
        PGM_ROLE,
 
210
    PGM_ROLE,
199
211
    PGM_RULE,
200
212
    PGM_SCHEMA,
201
213
    PGM_SERVER,
204
216
    PGM_TABLESPACE,
205
217
    PGM_TRIGGER,
206
218
    PGM_UNKNOWN,
207
 
        PGM_UNIQUE,
 
219
    PGM_UNIQUE,
208
220
    PGM_VIEW,
209
221
 
 
222
    GP_EXTTABLE,
 
223
    GP_RESOURCE_QUEUE,
 
224
    GP_PARTITION,
 
225
 
210
226
    PGM_JOB,
211
227
    PGM_SCHEDULE,
212
228
    PGM_STEP,
228
244
    PGICON_PUBLIC
229
245
};
230
246
 
 
247
#endif // PGSCLI
 
248
 
231
249
#endif
 
250
 
 
251
#if !defined(PGSCLI)
 
252
 
 
253
// File/directory name cleanup
 
254
wxString sanitizePath(const wxString &path);
 
255
wxString commandLineCleanOption(const wxString &option);
 
256
 
 
257
#endif // PGSCLI