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

0001 /*
0002     SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_IPARTCONTROLLER_H
0008 #define KDEVPLATFORM_IPARTCONTROLLER_H
0009 
0010 #include "interfacesexport.h"
0011 
0012 #include <KParts/PartManager>
0013 
0014 namespace KTextEditor
0015 {
0016 class Editor;
0017 }
0018 
0019 namespace KDevelop {
0020 
0021 class ICore;
0022 
0023 class KDEVPLATFORMINTERFACES_EXPORT IPartController : public KParts::PartManager 
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit IPartController( QWidget* parent );
0028 
0029     /**
0030      * Returns an instance of a part for @p mimetype. If @p prefName is given and non-empty,
0031      * then the part with a matching plugin ID will be returned if found.
0032      */
0033     KParts::Part* createPart( const QString& mimetype, const QString& prefName = QString() );
0034 
0035     /**
0036      * Returns the global editor instance.
0037      */
0038     virtual KTextEditor::Editor* editorPart() const = 0;
0039 };
0040 
0041 }
0042 
0043 #endif
0044