~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/toproject.h

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2007-05-29 13:13:36 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529131336-85ygaddivvmkd3xc
Tags: 1.3.21pre22-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules: call dh_iconcache
  - Remove g++ build dependency
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****
 
2
*
 
3
* TOra - An Oracle Toolkit for DBA's and developers
 
4
* Copyright (C) 2003-2005 Quest Software, Inc
 
5
* Portions Copyright (C) 2005 Other Contributors
 
6
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation;  only version 2 of
 
10
* the License is valid for this program.
 
11
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
 
17
* You should have received a copy of the GNU General Public License
 
18
* along with this program; if not, write to the Free Software
 
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
20
*
 
21
*      As a special exception, you have permission to link this program
 
22
*      with the Oracle Client libraries and distribute executables, as long
 
23
*      as you follow the requirements of the GNU GPL in regard to all of the
 
24
*      software in the executable aside from Oracle client libraries.
 
25
*
 
26
*      Specifically you are not permitted to link this program with the
 
27
*      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
 
28
*      And you are not permitted to distribute binaries compiled against
 
29
*      these libraries without written consent from Quest Software, Inc.
 
30
*      Observe that this does not disallow linking to the Qt Free Edition.
 
31
*
 
32
*      You may link this product with any GPL'd Qt library such as Qt/Free
 
33
*
 
34
* All trademarks belong to their respective owners.
 
35
*
 
36
*****/
 
37
 
 
38
#ifndef TOPROJECT_H
 
39
#define TOPROJECT_H
 
40
 
 
41
#include "config.h"
 
42
#include "totemplate.h"
 
43
 
 
44
#include <map>
 
45
 
 
46
class toProjectTemplateItem : public toTemplateItem
 
47
{
 
48
    QString Filename;
 
49
    int Order;
 
50
    void setup(const QString &name, bool open);
 
51
    int order(bool asc);
 
52
public:
 
53
    toProjectTemplateItem(toTemplateItem *item, QListViewItem *after, QString name, bool open = true);
 
54
    toProjectTemplateItem(QListView *item, QString name = QString::null, bool open = true);
 
55
 
 
56
    virtual QString key(int col, bool asc) const;
 
57
 
 
58
    const QString &filename(void) const
 
59
    {
 
60
        return Filename;
 
61
    }
 
62
    void setFilename(const QString &file);
 
63
    bool project(void);
 
64
    virtual void selected(void);
 
65
    toProjectTemplateItem *previousSibling(void);
 
66
 
 
67
    virtual QWidget *selectedWidget(QWidget *parent);
 
68
};
 
69
 
 
70
class toProject : public QVBox
 
71
{
 
72
    Q_OBJECT
 
73
 
 
74
    toProjectTemplateItem *Root;
 
75
    QToolButton *DelFile;
 
76
    QListView *Project;
 
77
    std::map<QListViewItem *, toProjectTemplateItem *> ItemMap;
 
78
 
 
79
    void update(toProjectTemplateItem *sourceparent, toResultViewItem *parent);
 
80
    QString generateSQL(toProjectTemplateItem *item);
 
81
public:
 
82
    toProject(toProjectTemplateItem *top, QWidget *parent);
 
83
    ~toProject();
 
84
 
 
85
    void selectItem(toProjectTemplateItem *);
 
86
public slots:
 
87
    void update(void);
 
88
    void addFile(void);
 
89
    void delFile(void);
 
90
    void newProject(void);
 
91
    void saveProject(void);
 
92
    void generateSQL(void);
 
93
    void selectionChanged(void);
 
94
    void moveDown(void);
 
95
    void moveUp(void);
 
96
};
 
97
 
 
98
class toProjectTemplate : public QObject, public toTemplateProvider
 
99
{
 
100
    Q_OBJECT
 
101
 
 
102
    toProjectTemplateItem *Root;
 
103
    std::map<QCString, QString> Import;
 
104
 
 
105
    QToolButton *AddFile;
 
106
    QToolButton *DelFile;
 
107
 
 
108
    toProject *Details;
 
109
public:
 
110
    toProjectTemplate(void)
 
111
            : QObject(NULL, "projecttemplate"), toTemplateProvider("project")
 
112
    {
 
113
        Details = NULL;
 
114
    }
 
115
 
 
116
    virtual void exportData(std::map<QCString, QString> &data, const QCString &prefix);
 
117
    virtual void importData(std::map<QCString, QString> &data, const QCString &prefix);
 
118
 
 
119
    virtual void insertItems(QListView *parent, QToolBar *toolbar);
 
120
    virtual void removeItems(QListViewItem *item);
 
121
 
 
122
    virtual toProject *selectedWidget(QWidget *parent);
 
123
 
 
124
    virtual toProjectTemplateItem *root(void)
 
125
    {
 
126
        return Root;
 
127
    }
 
128
 
 
129
    friend class toProject;
 
130
public slots:
 
131
    void addFile();
 
132
    void delFile();
 
133
    void changeItem(QListViewItem *item);
 
134
};
 
135
 
 
136
#endif