File indexing completed on 2024-04-21 15:24:06

0001 /*
0002     SPDX-FileCopyrightText: 2009 Milian Wolff <mail@milianw.de>
0003     Basec on Cpp ImplementationHelperItem
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef IMPLEMENTATIONITEM_H
0009 #define IMPLEMENTATIONITEM_H
0010 
0011 #include "item.h"
0012 
0013 using namespace KDevelop;
0014 
0015 namespace Php
0016 {
0017 
0018 class ImplementationItem : public NormalDeclarationCompletionItem
0019 {
0020 public:
0021     enum HelperType {
0022         Override,
0023         Implement,
0024         OverrideVar
0025     };
0026 
0027     explicit ImplementationItem(HelperType type, KDevelop::DeclarationPointer decl = {},
0028                                 QExplicitlySharedDataPointer<Php::CodeCompletionContext> context = {}, int _inheritanceDepth = 0)
0029             : NormalDeclarationCompletionItem(decl, context, _inheritanceDepth), m_type(type) {}
0030 
0031     void execute(KTextEditor::View* view, const KTextEditor::Range& word) override;
0032 
0033     QVariant data(const QModelIndex& index, int role, const KDevelop::CodeCompletionModel* model) const override;
0034 
0035     HelperType m_type;
0036 };
0037 
0038 }
0039 
0040 #endif // IMPLEMENTATIONITEM_H