2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:14 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:14 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:14 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02: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>
|
2014-02-13 13:54:39 +01:00
|
|
|
#include <utils/fancylineedit.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-09-16 14:59:05 +02:00
|
|
|
#include <utils/crumblepath.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDesignerCustomWidgetCollectionInterface>
|
|
|
|
|
#include <QDesignerContainerExtension>
|
|
|
|
|
#include <QExtensionFactory>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <qplugin.h>
|
|
|
|
|
#include <QList>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
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);
|
|
|
|
|
};
|
|
|
|
|
|
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-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
|