File indexing completed on 2024-04-28 04:36:30

0001 /*
0002     SPDX-FileCopyrightText: 2007 Alexander Dymo <adymo@kdevelop.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_ILANGUAGECONTROLLER_H
0008 #define KDEVPLATFORM_ILANGUAGECONTROLLER_H
0009 
0010 #include <QList>
0011 #include <QObject>
0012 #include <QUrl>
0013 
0014 #include "interfacesexport.h"
0015 
0016 namespace KDevelop {
0017 
0018 class ILanguageSupport;
0019 
0020 class BackgroundParser;
0021 class ICompletionSettings;
0022 class StaticAssistantsManager;
0023 class ProblemModelSet;
0024 
0025 /**
0026  * @class ILanguageController
0027  */
0028 class KDEVPLATFORMINTERFACES_EXPORT ILanguageController: public QObject {
0029     Q_OBJECT
0030 public:
0031     explicit ILanguageController(QObject *parent = nullptr);
0032 
0033     /**
0034      *@return the language for given @p name.
0035      */
0036     virtual ILanguageSupport* language(const QString &name) const = 0;
0037 
0038     /**
0039      * @return the languages that support the MIME type of @p url.
0040      * @warning If this is called from within the foreground thread,
0041      *          the language support is loaded if required.
0042      *          If it is called from a background thread, it can not
0043      *          be loaded, and thus zero will be returned.
0044      */
0045     virtual QList<ILanguageSupport*> languagesForUrl(const QUrl &url) = 0;
0046 
0047     /** @return All languages currently loaded */
0048     virtual QList<ILanguageSupport*> loadedLanguages() const = 0;
0049 
0050     /** @return the background parser used to parse source files */
0051     virtual BackgroundParser *backgroundParser() const = 0;
0052 
0053     /** @return The global code assistant manager (manages assistants such as the RenameAssistant) */
0054     virtual StaticAssistantsManager *staticAssistantsManager() const = 0;
0055 
0056     /** Access to the completion settings */
0057     virtual ICompletionSettings *completionSettings() const = 0;
0058 
0059     virtual ProblemModelSet* problemModelSet() const = 0;
0060 };
0061 
0062 }
0063 
0064 #endif
0065