2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** No Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
|
** this package.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at qt-info@nokia.com.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
|
|
|
|
#ifndef CUSTOMWIDGETS_H
|
|
|
|
|
#define CUSTOMWIDGETS_H
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include "customwidget.h"
|
|
|
|
|
|
|
|
|
|
#include <utils/newclasswidget.h>
|
|
|
|
|
#include <utils/classnamevalidatinglineedit.h>
|
|
|
|
|
#include <utils/filenamevalidatinglineedit.h>
|
|
|
|
|
#include <utils/linecolumnlabel.h>
|
|
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
#include <utils/projectnamevalidatinglineedit.h>
|
2009-11-27 13:54:27 +01:00
|
|
|
#include <utils/filterlineedit.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <utils/qtcolorbutton.h>
|
|
|
|
|
#include <utils/submiteditorwidget.h>
|
2009-03-23 12:03:20 +01:00
|
|
|
#include <utils/submitfieldwidget.h>
|
2009-05-08 12:21:18 +02:00
|
|
|
#include <utils/pathlisteditor.h>
|
2009-10-02 10:12:32 +02:00
|
|
|
#include <utils/detailsbutton.h>
|
|
|
|
|
#include <utils/detailswidget.h>
|
2010-03-31 10:13:05 +02:00
|
|
|
#include <utils/styledbar.h>
|
|
|
|
|
#include <utils/wizard.h>
|
2010-04-14 14:34:10 +02:00
|
|
|
#include <utils/welcomemodetreewidget.h>
|
2010-09-16 14:59:05 +02:00
|
|
|
#include <utils/crumblepath.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <QtDesigner/QDesignerCustomWidgetCollectionInterface>
|
2009-10-02 10:12:32 +02:00
|
|
|
#include <QtDesigner/QDesignerContainerExtension>
|
|
|
|
|
#include <QtDesigner/QExtensionFactory>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <QtCore/qplugin.h>
|
|
|
|
|
#include <QtCore/QList>
|
|
|
|
|
|
2009-10-02 10:12:32 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QExtensionManager;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
// Custom Widgets
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class NewClassCustomWidget :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::NewClassWidget>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit NewClassCustomWidget(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class ClassNameValidatingLineEdit_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::ClassNameValidatingLineEdit>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit ClassNameValidatingLineEdit_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class FileNameValidatingLineEdit_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::FileNameValidatingLineEdit>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit FileNameValidatingLineEdit_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class ProjectNameValidatingLineEdit_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::ProjectNameValidatingLineEdit>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit ProjectNameValidatingLineEdit_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class LineColumnLabel_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::LineColumnLabel>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit LineColumnLabel_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class PathChooser_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::PathChooser>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit PathChooser_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2010-07-02 16:42:34 +02:00
|
|
|
class IconButton_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::IconButton>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit IconButton_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class FancyLineEdit_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::FancyLineEdit>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit FancyLineEdit_CW(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
virtual QWidget *createWidget(QWidget *parent);
|
|
|
|
|
};
|
|
|
|
|
|
2009-11-27 13:54:27 +01:00
|
|
|
class FilterLineEdit_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::FilterLineEdit>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit FilterLineEdit_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class QtColorButton_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::QtColorButton>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit QtColorButton_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class SubmitEditorWidget_CW :
|
2008-12-02 12:01:29 +01:00
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::SubmitEditorWidget>
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit SubmitEditorWidget_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2009-03-23 12:03:20 +01:00
|
|
|
class SubmitFieldWidget_CW :
|
|
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::SubmitFieldWidget>
|
2009-03-23 12:03:20 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit SubmitFieldWidget_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2009-05-08 12:21:18 +02:00
|
|
|
class PathListEditor_CW :
|
|
|
|
|
public QObject,
|
2009-10-05 11:06:05 +02:00
|
|
|
public CustomWidget<Utils::PathListEditor>
|
2009-05-08 12:21:18 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit PathListEditor_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2009-10-02 10:12:32 +02:00
|
|
|
class DetailsButton_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::DetailsButton>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit DetailsButton_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2010-03-31 10:13:05 +02:00
|
|
|
class StyledBar_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::StyledBar>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit StyledBar_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class StyledSeparator_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::StyledSeparator>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit StyledSeparator_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Wizard_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::Wizard>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit Wizard_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2010-04-14 14:34:10 +02:00
|
|
|
class WelcomePageWidget_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::WelcomeModeTreeWidget>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit WelcomePageWidget_CW(QObject *parent = 0);
|
|
|
|
|
virtual QWidget *createWidget(QWidget *parent);
|
|
|
|
|
};
|
2010-03-31 10:13:05 +02:00
|
|
|
|
2010-04-15 16:01:18 +02:00
|
|
|
class WelcomeModeLabel_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::WelcomeModeLabel>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit WelcomeModeLabel_CW(QObject *parent = 0);
|
|
|
|
|
};
|
|
|
|
|
|
2010-09-16 14:59:05 +02:00
|
|
|
class CrumblePath_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::CrumblePath>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit CrumblePath_CW(QObject *parent = 0);
|
|
|
|
|
};
|
2010-04-15 16:01:18 +02:00
|
|
|
|
2009-10-02 10:12:32 +02:00
|
|
|
// Details Widget: plugin + simple, hacky container extension that
|
|
|
|
|
// accepts only one page.
|
|
|
|
|
|
|
|
|
|
class DetailsWidget_CW :
|
|
|
|
|
public QObject,
|
|
|
|
|
public CustomWidget<Utils::DetailsWidget>
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit DetailsWidget_CW(QObject *parent = 0);
|
|
|
|
|
QString domXml() const;
|
|
|
|
|
void initialize(QDesignerFormEditorInterface *core);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class DetailsWidgetContainerExtension: public QObject,
|
|
|
|
|
public QDesignerContainerExtension
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerContainerExtension)
|
|
|
|
|
public:
|
|
|
|
|
explicit DetailsWidgetContainerExtension(Utils::DetailsWidget *widget, QObject *parent);
|
|
|
|
|
|
|
|
|
|
void addWidget(QWidget *widget);
|
|
|
|
|
int count() const;
|
|
|
|
|
int currentIndex() const;
|
|
|
|
|
void insertWidget(int index, QWidget *widget);
|
|
|
|
|
void remove(int index);
|
|
|
|
|
void setCurrentIndex(int index);
|
|
|
|
|
QWidget *widget(int index) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Utils::DetailsWidget *m_detailsWidget;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class DetailsWidgetExtensionFactory: public QExtensionFactory
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit DetailsWidgetExtensionFactory(QExtensionManager *parent = 0);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ------------ Collection
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
class WidgetCollection : public QObject, public QDesignerCustomWidgetCollectionInterface
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
|
|
|
|
public:
|
|
|
|
|
explicit WidgetCollection(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2010-01-29 21:33:57 +01:00
|
|
|
QList<QDesignerCustomWidgetInterface*> m_plugins;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
#endif // CUSTOMWIDGETS_H
|