2013-09-04 18:15:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-09-04 18:15:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-09-04 18:15:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-09-04 18:15:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-09-04 18:15:08 +02:00
|
|
|
|
|
|
|
|
#include "cppmodelmanagersupport.h"
|
|
|
|
|
|
|
|
|
|
#include <QScopedPointer>
|
|
|
|
|
|
2022-04-25 13:37:58 +02:00
|
|
|
namespace CppEditor { class FollowSymbolUnderCursor; }
|
|
|
|
|
|
2021-08-30 10:58:08 +02:00
|
|
|
namespace CppEditor::Internal {
|
2013-09-04 18:15:08 +02:00
|
|
|
|
2018-10-18 09:21:35 +02:00
|
|
|
class BuiltinModelManagerSupport: public ModelManagerSupport
|
2013-09-04 18:15:08 +02:00
|
|
|
{
|
2018-10-18 09:21:35 +02:00
|
|
|
Q_DISABLE_COPY(BuiltinModelManagerSupport)
|
2013-09-04 18:15:08 +02:00
|
|
|
|
|
|
|
|
public:
|
2018-10-18 09:21:35 +02:00
|
|
|
BuiltinModelManagerSupport();
|
2019-01-14 01:40:53 +01:00
|
|
|
~BuiltinModelManagerSupport() override;
|
2013-09-04 18:15:08 +02:00
|
|
|
|
2017-09-19 11:51:45 +02:00
|
|
|
CppCompletionAssistProvider *completionAssistProvider() final;
|
2020-07-31 16:50:03 +02:00
|
|
|
CppCompletionAssistProvider *functionHintAssistProvider() override;
|
2018-01-11 17:06:26 +01:00
|
|
|
TextEditor::BaseHoverHandler *createHoverHandler() final;
|
2018-01-11 16:46:45 +01:00
|
|
|
BaseEditorDocumentProcessor *createEditorDocumentProcessor(
|
2017-09-19 11:51:45 +02:00
|
|
|
TextEditor::TextDocument *baseTextDocument) final;
|
2018-02-02 13:01:07 +01:00
|
|
|
std::unique_ptr<AbstractOverviewModel> createOverviewModel() final;
|
2013-09-04 18:15:08 +02:00
|
|
|
|
2022-04-25 13:37:58 +02:00
|
|
|
FollowSymbolUnderCursor &followSymbolInterface() { return *m_followSymbol; }
|
|
|
|
|
|
2013-09-04 18:15:08 +02:00
|
|
|
private:
|
2022-06-03 14:58:37 +02:00
|
|
|
void followSymbol(const CursorInEditor &data, Utils::LinkHandler &&processLinkCallback,
|
2022-04-25 13:37:58 +02:00
|
|
|
bool resolveTarget, bool inNextSplit) override;
|
|
|
|
|
void switchDeclDef(const CursorInEditor &data,
|
2022-06-03 14:58:37 +02:00
|
|
|
Utils::LinkHandler &&processLinkCallback) override;
|
2022-04-29 16:52:48 +02:00
|
|
|
void startLocalRenaming(const CursorInEditor &data,
|
|
|
|
|
const ProjectPart *projectPart,
|
|
|
|
|
RenameCallback &&renameSymbolsCallback) override;
|
2022-06-02 00:23:11 +02:00
|
|
|
void globalRename(const CursorInEditor &data, const QString &replacement) override;
|
2022-06-02 00:42:28 +02:00
|
|
|
void findUsages(const CursorInEditor &data) const override;
|
2022-05-18 15:16:40 +02:00
|
|
|
void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) override;
|
2022-04-25 13:37:58 +02:00
|
|
|
|
2013-09-04 18:15:08 +02:00
|
|
|
QScopedPointer<CppCompletionAssistProvider> m_completionAssistProvider;
|
2022-04-25 13:37:58 +02:00
|
|
|
QScopedPointer<FollowSymbolUnderCursor> m_followSymbol;
|
2013-09-04 18:15:08 +02:00
|
|
|
};
|
|
|
|
|
|
2018-10-18 09:21:35 +02:00
|
|
|
class BuiltinModelManagerSupportProvider : public ModelManagerSupportProvider
|
2015-05-08 15:48:17 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString id() const override;
|
|
|
|
|
QString displayName() const override;
|
|
|
|
|
|
2021-08-30 10:58:08 +02:00
|
|
|
ModelManagerSupport::Ptr createModelManagerSupport() override;
|
2015-05-08 15:48:17 +02:00
|
|
|
};
|
|
|
|
|
|
2021-08-30 10:58:08 +02:00
|
|
|
} // namespace CppEditor::Internal
|