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
**********************************************************************/
31
#include <qiconview.h>
35
class NewItem : public QIconViewItem
46
NewItem( QIconView *view, const QString &text )
47
: QIconViewItem( view, text ) {}
48
virtual void insert( Project *pro ) = 0;
49
virtual void setProject( Project * ) {}
53
class ProjectItem : public NewItem
56
ProjectItem( QIconView *view, const QString &text );
57
void insert( Project *pro );
58
int rtti() const { return (int)ProjectType; }
60
void setLanguage( const QString &l ) { lang = l; }
61
QString language() const { return lang; }
68
class FormItem : public NewItem
78
FormItem( QIconView *view, const QString &text );
79
void insert( Project *pro );
80
int rtti() const { return (int)Form; }
82
void setFormType( FormType ft ) { fType = ft; }
83
FormType formType() const { return fType; }
90
class CustomFormItem : public NewItem
93
CustomFormItem( QIconView *view, const QString &text );
94
void insert( Project *pro );
95
int rtti() const { return (int)CustomForm; }
97
void setTemplateFile( const QString &tf ) { templFile = tf; }
98
QString templateFileName() const { return templFile; }
105
class SourceFileItem : public NewItem
108
SourceFileItem( QIconView *view, const QString &text );
109
void insert( Project *pro );
110
int rtti() const { return (int)SourceFileType; }
112
void setExtension( const QString &e ) { ext = e; }
113
QString extension() const { return ext; }
114
void setLanguage( const QString &l ) { lang = l; }
115
void setProject( Project *pro );
124
class SourceTemplateItem : public NewItem
127
SourceTemplateItem( QIconView *view, const QString &text );
128
void insert( Project *pro );
129
int rtti() const { return (int)SourceTemplateType; }
131
void setTemplate( const QString &t ) { templ = t; }
132
QString tenplate() const { return templ; }
133
void setLanguage( const QString &l ) { lang = l; }
134
void setProject( Project *pro );
143
class NewForm : public NewFormBase
148
NewForm( QIconView *templateView, const QString &templatePath );
149
NewForm( QWidget *parent, const QStringList& projects,
150
const QString& currentProject, const QString &templatePath );
151
void insertTemplates( QIconView*, const QString& );
153
QPtrList<QIconViewItem> allViewItems();
156
void projectChanged( const QString &project );
157
void itemChanged( QIconViewItem *item );
160
QPtrList<QIconViewItem> allItems;