File indexing completed on 2024-05-12 04:38:07
0001 /* 0002 SPDX-FileCopyrightText: 2012 Miha Čančula <miha@noughmad.eu> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_ICREATECLASSHELPER_H 0008 #define KDEVPLATFORM_ICREATECLASSHELPER_H 0009 0010 #include <language/languageexport.h> 0011 #include <language/duchain/duchainpointer.h> 0012 0013 class QUrl; 0014 0015 namespace KDevelop { 0016 class TemplateClassGenerator; 0017 0018 /** 0019 * @brief A language-specific helper interface for creating new classes. 0020 * 0021 * This interface contains methods that the "create class" dialog cannot determine 0022 * by itself and which cannot be specified in a template. 0023 * 0024 * They are mostly taken from CreateClassAssistant. 0025 **/ 0026 class KDEVPLATFORMLANGUAGE_EXPORT ICreateClassHelper 0027 { 0028 public: 0029 virtual ~ICreateClassHelper(); 0030 0031 /** 0032 * @return a new class generator. 0033 * 0034 * The caller takes ownership of the returned object. 0035 **/ 0036 virtual TemplateClassGenerator* createGenerator(const QUrl& url) = 0; 0037 0038 /** 0039 * Returns a list of suggested default methods for a new class named @p name. 0040 * The user will be able to select the ones for including in the class. 0041 * 0042 * @param name the name of the new class 0043 * @return a list of default methods for the new class 0044 */ 0045 virtual QList<DeclarationPointer> defaultMethods(const QString& name) const = 0; 0046 }; 0047 } 0048 0049 #endif // KDEVPLATFORM_ICREATECLASSHELPER_H