File indexing completed on 2024-04-28 04:37:24

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_SELECTIONCONTROLLER_H
0008 #define KDEVPLATFORM_SELECTIONCONTROLLER_H
0009 
0010 #include <interfaces/iselectioncontroller.h>
0011 #include "shellexport.h"
0012 
0013 namespace KDevelop
0014 {
0015 
0016 class Context;
0017 class SelectionControllerPrivate;
0018 
0019 /**
0020  * The main controller for running processes.
0021  */
0022 class KDEVPLATFORMSHELL_EXPORT SelectionController : public ISelectionController
0023 {
0024     Q_OBJECT
0025 public:
0026     ///Constructor.
0027     explicit SelectionController(QObject *parent);
0028     ~SelectionController() override;
0029 
0030     /**
0031      * Provides the current selection, note that this might be 0
0032      */
0033     Context* currentSelection() override;
0034 
0035 
0036     void initialize();
0037     void cleanup();
0038 
0039 public Q_SLOTS:
0040     /**
0041      * updates the current selection
0042      * @param context the new selection
0043      */
0044     void updateSelection( Context* context ) override;
0045 
0046 private:
0047     const QScopedPointer<class SelectionControllerPrivate> d_ptr;
0048     Q_DECLARE_PRIVATE(SelectionController)
0049 };
0050 
0051 }
0052 
0053 #endif // KDEVPLATFORM_SELECTIONCONTROLLER_H