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

« back to all changes in this revision

Viewing changes to src/include/pgColumn.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: pgColumn.h 4874 2006-01-06 17:33:27Z dpage $
5
 
// Copyright (C) 2002 - 2006, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
7
 
//
8
 
// pgColumn.h PostgreSQL Column
9
 
//
10
 
//////////////////////////////////////////////////////////////////////////
11
 
 
12
 
#ifndef PGCOLUMN_H
13
 
#define PGCOLUMN_H
14
 
 
15
 
// App headers
16
 
#include "pgTable.h"
17
 
 
18
 
class pgCollection;
19
 
 
20
 
class pgColumnFactory : public pgTableObjFactory
21
 
{
22
 
public:
23
 
    pgColumnFactory();
24
 
    virtual dlgProperty *CreateDialog(frmMain *frame, pgObject *node, pgObject *parent);
25
 
    virtual pgObject *CreateObjects(pgCollection *obj, ctlTree *browser, const wxString &restr=wxEmptyString);
26
 
};
27
 
extern pgColumnFactory columnFactory;
28
 
 
29
 
class pgColumn : public pgTableObject
30
 
{
31
 
public:
32
 
    pgColumn(pgTable *newTable, const wxString& newName = wxT(""));
33
 
    ~pgColumn();
34
 
 
35
 
    void ShowTreeDetail(ctlTree *browser, frmMain *form=0, ctlListView *properties=0, ctlSQLBox *sqlPane=0);
36
 
    void ShowStatistics(frmMain *form, ctlListView *statistics);
37
 
    void ShowDependsOn(frmMain *form, ctlListView *dependsOn, const wxString &where=wxEmptyString);
38
 
    void ShowReferencedBy(frmMain *form, ctlListView *referencedBy, const wxString &where=wxEmptyString);
39
 
 
40
 
    wxString GetDefinition();
41
 
 
42
 
    bool IsReferenced();
43
 
 
44
 
    wxString GetRawTypename() const { return rawTypename; }
45
 
    void iSetRawTypename(const wxString& s) { rawTypename=s; }
46
 
    wxString GetVarTypename() const { return varTypename; }
47
 
    void iSetVarTypename(const wxString& s) { varTypename=s; }
48
 
    wxString GetQuotedTypename() const { return quotedTypename; }
49
 
    void iSetQuotedTypename(const wxString& s) { quotedTypename=s; }
50
 
    wxString GetDefault() const { return defaultVal; }
51
 
    void iSetDefault(const wxString& s) { defaultVal=s; }
52
 
    long GetColNumber() const { return colNumber; }
53
 
    void iSetColNumber(const long l) { colNumber=l; }
54
 
    long GetLength() const { return length; }
55
 
    void iSetLength(const long l) { length=l; }
56
 
    long GetPrecision() const { return precision; }
57
 
    void iSetPrecision(const long l) { precision=l; }
58
 
    long GetStatistics() const { return statistics; }
59
 
    void iSetStatistics(const long l) { statistics=l; }
60
 
    bool GetIsPK() const {return isPK; }
61
 
    bool GetIsFK() const {return isFK; }
62
 
    bool GetNotNull() const {return notNull; }
63
 
    void iSetNotNull(const bool b) {notNull=b; }
64
 
    bool GetIsArray() const {return isArray; }
65
 
    void iSetIsArray(const bool b) {isArray=b; }
66
 
    long GetTyplen() const { return typlen; }
67
 
    void iSetTyplen(const long l) { typlen=l; }
68
 
    long GetTypmod() const { return typmod; }
69
 
    void iSetTypmod(const long l) { typmod=l; }
70
 
    wxString GetTableName() const { return tableName; }
71
 
    void iSetTableName(const wxString &s) { tableName=s; }
72
 
    wxString GetQuotedFullTable() const { return quotedFullTable; }
73
 
    void iSetQuotedFullTable(const wxString &s) { quotedFullTable=s; }
74
 
    wxString GetStorage() const {return storage; }
75
 
    void iSetStorage(const wxString& s) { storage=s; }
76
 
    long GetInheritedCount() const { return inheritedCount; }
77
 
    void iSetInheritedCount(const long l) { inheritedCount=l; }
78
 
    OID  GetAttTypId() const { return attTypId; }
79
 
    void iSetAttTypId(const OID o) { attTypId =o; }
80
 
    long GetAttstattarget() const { return attstattarget; }
81
 
    void iSetAttstattarget(const long l) { attstattarget=l; }
82
 
    wxString GetSerialSequence() const { return serialSequence; }
83
 
    void iSetSerialSequence(const wxString &s) { serialSequence=s; }
84
 
    wxString GetSerialSchema() const { return serialSchema; }
85
 
    void iSetSerialSchema(const wxString &s) { serialSchema=s; }
86
 
    void iSetPkCols(const wxString &s) { pkCols = s; }
87
 
    void iSetIsFK(const bool b) { isFK = b; }
88
 
 
89
 
    bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded);
90
 
    bool GetSystemObject() const { return colNumber < 0; }
91
 
    wxString GetSql(ctlTree *browser);
92
 
        wxString GetCommentSql();
93
 
    wxString GetHelpPage(bool forCreate) const { return wxT("pg/sql-createtable"); }
94
 
 
95
 
    virtual bool CanDrop() { return inheritedCount == 0 && pgSchemaObject::CanDrop(); }
96
 
    pgObject *Refresh(ctlTree *browser, const wxTreeItemId item);
97
 
 
98
 
private:
99
 
    wxString varTypename, quotedTypename, defaultVal, tableName, quotedFullTable, storage, rawTypename;
100
 
    wxString serialSequence, serialSchema, pkCols;
101
 
    long colNumber, length, precision, statistics, attstattarget;
102
 
    long typlen, typmod, inheritedCount;
103
 
    bool isPK, isFK, notNull, isArray;
104
 
    OID attTypId;
105
 
    int isReferenced;
106
 
};
107
 
 
108
 
#endif