Files
qt-creator/src/tools/qtcreatorwidgets/customwidgets.h

330 lines
8.3 KiB
C
Raw Normal View History

/**************************************************************************
2008-12-02 12:01:29 +01:00
**
** This file is part of Qt Creator
**
2010-03-05 11:25:49 +01:00
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2008-12-02 12:01:29 +01:00
**
** Contact: Nokia Corporation (qt-info@nokia.com)
2008-12-02 12:01:29 +01:00
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
2009-08-14 09:30:56 +02:00
** contact the sales department at http://qt.nokia.com/contact.
2008-12-02 12:01:29 +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>
#include <utils/filterlineedit.h>
2008-12-02 12:01:29 +01:00
#include <utils/qtcolorbutton.h>
#include <utils/submiteditorwidget.h>
#include <utils/submitfieldwidget.h>
#include <utils/pathlisteditor.h>
#include <utils/detailsbutton.h>
#include <utils/detailswidget.h>
#include <utils/styledbar.h>
#include <utils/wizard.h>
#include <utils/welcomemodetreewidget.h>
#include <utils/crumblepath.h>
2008-12-02 12:01:29 +01:00
#include <QtDesigner/QDesignerCustomWidgetCollectionInterface>
#include <QtDesigner/QDesignerContainerExtension>
#include <QtDesigner/QExtensionFactory>
2008-12-02 12:01:29 +01:00
#include <QtCore/qplugin.h>
#include <QtCore/QList>
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,
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,
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,
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,
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,
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,
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,
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);
};
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,
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,
public CustomWidget<Utils::SubmitEditorWidget>
2008-12-02 12:01:29 +01:00
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit SubmitEditorWidget_CW(QObject *parent = 0);
};
class SubmitFieldWidget_CW :
public QObject,
public CustomWidget<Utils::SubmitFieldWidget>
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit SubmitFieldWidget_CW(QObject *parent = 0);
};
class PathListEditor_CW :
public QObject,
public CustomWidget<Utils::PathListEditor>
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit PathListEditor_CW(QObject *parent = 0);
};
class DetailsButton_CW :
public QObject,
public CustomWidget<Utils::DetailsButton>
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit DetailsButton_CW(QObject *parent = 0);
};
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);
};
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);
};
class WelcomeModeLabel_CW :
public QObject,
public CustomWidget<Utils::WelcomeModeLabel>
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit WelcomeModeLabel_CW(QObject *parent = 0);
};
class CrumblePath_CW :
public QObject,
public CustomWidget<Utils::CrumblePath>
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
explicit CrumblePath_CW(QObject *parent = 0);
};
// 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:
QList<QDesignerCustomWidgetInterface*> m_plugins;
2008-12-02 12:01:29 +01:00
};
2008-12-02 16:19:05 +01:00
#endif // CUSTOMWIDGETS_H