File indexing completed on 2024-05-05 04:39:48

0001 /*
0002     SPDX-FileCopyrightText: 2008 Hamish Rodda <rodda@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KDEVPLATFORM_PLUGIN_CLASSIDENTIFIERPAGE_H
0008 #define KDEVPLATFORM_PLUGIN_CLASSIDENTIFIERPAGE_H
0009 
0010 #include <QWidget>
0011 
0012 #include "ipagefocus.h"
0013 
0014 namespace KDevelop
0015 {
0016 
0017 /**
0018  * Assistant dialog page for setting the identifier and inheritances of a new class
0019  */
0020 class ClassIdentifierPage : public QWidget, public IPageFocus
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY(QStringList inheritance READ inheritanceList)
0024 
0025 public:
0026     explicit ClassIdentifierPage(QWidget* parent);
0027     ~ClassIdentifierPage() override;
0028 
0029     /**
0030      * @return The full identifier of the new class, with namespaces,
0031      *         as entered by the user.
0032      */
0033     QString identifier() const;
0034 
0035     /**
0036      * @return A list of inheritances for the new class.
0037      *
0038      * Each list elements contains both inheritance type and the base class name,
0039      * such as "public QObject" or "implements Serializable"
0040      */
0041     QStringList inheritanceList() const;
0042 
0043     /**
0044      * Sets the contents of the inheritance list to @p list
0045      *
0046      * @param list list of inheritance descriptions. 
0047      */
0048     void setInheritanceList(const QStringList& list);
0049 
0050     void setFocusToFirstEditWidget() override;
0051 
0052 Q_SIGNALS:
0053     void inheritanceChanged();
0054     /**
0055      * Emitted whenever the content of the page changes.
0056      *
0057      * @param valid @c true if the content is valid and the user can proceed to
0058      *        the next page, @c false otherwise.
0059      */
0060     void isValid(bool valid);
0061 
0062 private Q_SLOTS:
0063     void checkIdentifier();
0064 
0065 private:
0066     struct ClassIdentifierPagePrivate* const d;
0067 };
0068 
0069 }
0070 
0071 #endif // KDEVPLATFORM_PLUGIN_CLASSIDENTIFIERPAGE_H