1
/**********************************************************************
2
** Copyright (C) 2000 Trolltech AS. All rights reserved.
4
** This file is part of Qt Designer.
6
** This file may be distributed and/or modified under the terms of the
7
** GNU General Public License version 2 as published by the Free Software
8
** Foundation and appearing in the file LICENSE.GPL included in the
9
** packaging of this file.
11
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
12
** licenses may use this file in accordance with the Qt Commercial License
13
** Agreement provided with the Software.
15
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
** See http://www.trolltech.com/gpl/ for GPL licensing information.
19
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
20
** information about Qt Commercial License Agreements.
22
** Contact info@trolltech.com if any conditions of this licensing are
25
**********************************************************************/
30
#include <qlistview.h>
37
class QDragEnterEvent;
42
class QCompletionEdit;
45
class WorkspaceItem : public QListViewItem
48
enum Type { ProjectType, FormFileType, FormSourceType, SourceFileType, ObjectType };
50
WorkspaceItem( QListView *parent, Project* p );
51
WorkspaceItem( QListViewItem *parent, SourceFile* sf );
52
WorkspaceItem( QListViewItem *parent, FormFile* ff, Type t = FormFileType );
53
WorkspaceItem( QListViewItem *parent, QObject *o, Project *p );
55
void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
57
Type type() const { return t; }
59
bool isModified() const;
61
QString text( int ) const;
63
void fillCompletionList( QStringList& completion );
64
bool checkCompletion( const QString& completion );
66
QString key( int, bool ) const; // column sorting key
69
SourceFile* sourceFile;
75
void setAutoOpen( bool );
76
bool isAutoOpen() const { return isOpen() && autoOpen; }
83
QColor backgroundColor();
87
class Workspace : public QListView
92
Workspace( QWidget *parent , MainWindow *mw );
94
void setCurrentProject( Project *pro );
96
void contentsDropEvent( QDropEvent *e );
97
void contentsDragEnterEvent( QDragEnterEvent *e );
98
void contentsDragMoveEvent( QDragMoveEvent *e );
100
void setBufferEdit( QCompletionEdit *edit );
105
void update( FormFile* );
107
void activeFormChanged( FormWindow *fw );
108
void activeEditorChanged( SourceEditor *se );
111
void closeEvent( QCloseEvent *e );
112
bool eventFilter( QObject *, QEvent * );
116
void itemClicked( int, QListViewItem *i, const QPoint& pos );
117
void itemDoubleClicked( QListViewItem *i );
118
void rmbClicked( QListViewItem *i, const QPoint& pos );
119
void bufferChosen( const QString &buffer );
121
void projectDestroyed( QObject* );
123
void sourceFileAdded( SourceFile* );
124
void sourceFileRemoved( SourceFile* );
126
void formFileAdded( FormFile* );
127
void formFileRemoved( FormFile* );
129
void objectAdded( QObject* );
130
void objectRemoved( QObject * );
133
WorkspaceItem *findItem( FormFile *ff );
134
WorkspaceItem *findItem( SourceFile *sf );
135
WorkspaceItem *findItem( QObject *o );
137
void closeAutoOpenItems();
140
MainWindow *mainWindow;
142
WorkspaceItem *projectItem;
143
QCompletionEdit *bufferEdit;
145
void updateBufferEdit();
146
bool completionDirty;