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

« back to all changes in this revision

Viewing changes to pgadmin/include/schema/pgDomain.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: pgDomain.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
// pgDomain.h PostgreSQL Domain
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef PGDOMAIN_H
 
13
#define PGDOMAIN_H
 
14
 
 
15
#include "pgSchema.h"
 
16
 
 
17
class pgCollection;
 
18
 
 
19
class pgDomainFactory : public pgSchemaObjFactory
 
20
{
 
21
public:
 
22
    pgDomainFactory();
 
23
    virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
 
24
    virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr=wxEmptyString);
 
25
};
 
26
extern pgDomainFactory domainFactory;
 
27
 
 
28
 
 
29
class pgDomain : public pgSchemaObject
 
30
{
 
31
public:
 
32
    pgDomain(pgSchema *newSchema, const wxString& newName = wxT(""));
 
33
    ~pgDomain();
 
34
 
 
35
    void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
 
36
    bool CanDropCascaded() { return GetSchema()->GetMetaType() != PGM_CATALOG; }
 
37
 
 
38
    wxString GetBasetype() const { return basetype; }
 
39
    void iSetBasetype(const wxString& s) { basetype = s; }
 
40
    wxString GetQuotedBasetype() const { return quotedBasetype; }
 
41
    void iSetQuotedBasetype(const wxString& s) { quotedBasetype = s; }
 
42
    void iSetIsDup(bool b) { isDup = b; }
 
43
    long GetLength() const { return length; }
 
44
    void iSetLength(long l) { length=l; }
 
45
    long GetPrecision() const { return precision; }
 
46
    void iSetPrecision(long l) { precision = l; }
 
47
    wxString GetCheck() const { return check; }
 
48
    void iSetCheck(const wxString &s) { check=s; }
 
49
    wxString GetDefault() const { return defaultVal; }
 
50
    void iSetDefault(const wxString& s) { defaultVal = s; }
 
51
    bool GetNotNull() const { return notNull; }
 
52
    void iSetNotNull(bool b) { notNull = b; }
 
53
    long GetDimensions() const { return dimensions; }
 
54
    void iSetDimensions(long l) { dimensions=l; }
 
55
    wxString GetDelimiter() const { return delimiter; }
 
56
    void iSetDelimiter(const wxString& s) { delimiter = s; }
 
57
    OID GetBasetypeOid() const { return basetypeOid; }
 
58
    void iSetBasetypeOid(OID d) { basetypeOid = d; }
 
59
    long GetTyplen() const { return typlen; }
 
60
    void iSetTyplen(const long l) { typlen=l; }
 
61
    long GetTypmod() const { return typmod; }
 
62
    void iSetTypmod(const long l) { typmod=l; }
 
63
 
 
64
    bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
 
65
    wxString GetSql(ctlTree *browser);
 
66
    pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
 
67
 
 
68
    bool HasStats() { return false; }
 
69
    bool HasDepends() { return true; }
 
70
    bool HasReferences() { return true; }
 
71
 
 
72
private:
 
73
    wxString basetype, quotedBasetype, defaultVal, delimiter, check;
 
74
    long length, precision, dimensions;
 
75
    long typlen, typmod;
 
76
    bool notNull, isDup;
 
77
    OID basetypeOid;
 
78
};
 
79
 
 
80
#endif