2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2016-01-28 16:39:05 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2016-01-28 16:39:05 +01:00
|
|
|
|
|
|
|
|
#include <texteditor/codeassist/assistproposaliteminterface.h>
|
|
|
|
|
|
|
|
|
|
#include <QIcon>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
|
|
namespace ClangCodeModel {
|
2019-02-06 16:17:03 +01:00
|
|
|
namespace Internal {
|
2016-01-28 16:39:05 +01:00
|
|
|
|
|
|
|
|
class ClangPreprocessorAssistProposalItem final : public TextEditor::AssistProposalItemInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-11-04 21:44:21 +01:00
|
|
|
~ClangPreprocessorAssistProposalItem() noexcept override = default;
|
2016-01-28 16:39:05 +01:00
|
|
|
bool prematurelyApplies(const QChar &typedChar) const final;
|
2018-11-04 21:44:21 +01:00
|
|
|
bool implicitlyApplies() const final;
|
2016-01-19 14:54:59 +01:00
|
|
|
void apply(TextEditor::TextDocumentManipulatorInterface &manipulator,
|
|
|
|
|
int basePosition) const final;
|
2016-01-28 16:39:05 +01:00
|
|
|
|
|
|
|
|
void setText(const QString &text);
|
|
|
|
|
QString text() const final;
|
|
|
|
|
|
|
|
|
|
void setIcon(const QIcon &icon);
|
|
|
|
|
QIcon icon() const final;
|
|
|
|
|
|
|
|
|
|
void setDetail(const QString &detail);
|
|
|
|
|
QString detail() const final;
|
|
|
|
|
|
2019-05-21 14:51:10 +02:00
|
|
|
Qt::TextFormat detailFormat() const final;
|
|
|
|
|
|
2016-01-28 16:39:05 +01:00
|
|
|
bool isSnippet() const final;
|
|
|
|
|
bool isValid() const final;
|
|
|
|
|
|
|
|
|
|
quint64 hash() const final;
|
|
|
|
|
|
|
|
|
|
void setCompletionOperator(uint completionOperator);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool isInclude() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_text;
|
|
|
|
|
QString m_detail;
|
|
|
|
|
QIcon m_icon;
|
|
|
|
|
uint m_completionOperator;
|
|
|
|
|
mutable QChar m_typedCharacter;
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-06 16:17:03 +01:00
|
|
|
} // namespace Internal
|
2016-01-28 16:39:05 +01:00
|
|
|
} // namespace ClangCodeModel
|