• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • snippet
snippetcompletionitem.h
Go to the documentation of this file.
1 /* This file is part of the Kate project.
2  * Based on the snippet plugin from KDevelop 4.
3  *
4  * Copyright (C) 2009 Milian Wolff <mail@milianw.de>
5  * Copyright (C) 2012 Christoph Cullmann <cullmann@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SNIPPETCOMPLETIONITEM_H
24 #define SNIPPETCOMPLETIONITEM_H
25 
27 
28 #include <QString>
29 #include <QVariant>
30 
31 class Snippet;
32 class SnippetRepository;
33 class QModelIndex;
34 
35 namespace KTextEditor {
36  class View;
37  class Range;
38  class CodeCompletionModel2;
39 }
40 
41 class SnippetCompletionItem
42 {
43 public:
44  SnippetCompletionItem(Snippet* snippet, SnippetRepository* repo);
45  ~SnippetCompletionItem();
46 
47  void execute( KTextEditor::View* view, const KTextEditor::Range& word );
48  QVariant data( const QModelIndex& index, int role, const KTextEditor::CodeCompletionModel2* model ) const;
49 
50 private:
51  // we copy since the snippet itself can be deleted at any time
52  QString m_name;
53  QString m_snippet;
54  QString m_prefix;
55  QString m_arguments;
56  QString m_postfix;
57  SnippetRepository* m_repo;
58 };
59 
60 #endif // SNIPPETCOMPLETIONITEM_H
QModelIndex
SnippetCompletionItem::SnippetCompletionItem
SnippetCompletionItem(Snippet *snippet, SnippetRepository *repo)
Definition: snippetcompletionitem.cpp:40
SnippetCompletionItem::data
QVariant data(const QModelIndex &index, int role, const KTextEditor::CodeCompletionModel2 *model) const
Definition: snippetcompletionitem.cpp:52
SnippetCompletionItem
Definition: snippetcompletionitem.h:41
SnippetCompletionItem::execute
void execute(KTextEditor::View *view, const KTextEditor::Range &word)
Definition: snippetcompletionitem.cpp:92
QString
SnippetRepository
Each object of this type represents a repository of snippets.
Definition: snippetrepository.h:52
Snippet
One object of this class represents a single snippet.
Definition: snippet.h:42
SnippetCompletionItem::~SnippetCompletionItem
~SnippetCompletionItem()
Definition: snippetcompletionitem.cpp:48
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal