• 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
snippet.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) 2007 Robert Gruber <rgruber@users.sourceforge.net>
5  * Copyright (C) 2010 Milian Wolff <mail@milianw.de>
6  * Copyright (C) 2012 Christoph Cullmann <cullmann@kde.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB. If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef __SNIPPET_H__
25 #define __SNIPPET_H__
26 
27 #include <QStandardItem>
28 
29 class SnippetRepository;
30 class KAction;
31 
42 class Snippet : public QStandardItem
43 {
44 public:
48  Snippet();
49  ~Snippet();
50 
54  QString snippet() const;
58  void setSnippet(const QString& snippet);
59 
63  QString prefix() const;
67  void setPrefix(const QString& prefix);
68 
72  QString postfix() const;
76  void setPostfix(const QString& postfix);
77 
81  QString arguments() const;
85  void setArguments(const QString& arguments);
86 
90  KAction* action();
91 
92  virtual QVariant data(int role = Qt::UserRole + 1) const;
93 
94 private:
96  QString m_snippet;
98  QString m_postfix;
100  QString m_prefix;
102  QString m_arguments;
104  KAction* m_action;
105 };
106 
107 Q_DECLARE_METATYPE ( Snippet* )
108 
109 #endif
Snippet::setSnippet
void setSnippet(const QString &snippet)
Sets the actual contents of this snippet.
Definition: snippet.cpp:52
Snippet::setArguments
void setArguments(const QString &arguments)
Sets the display arguments of this snippet.
Definition: snippet.cpp:82
Snippet::setPrefix
void setPrefix(const QString &prefix)
Sets the display prefix of this snippet.
Definition: snippet.cpp:62
Snippet::action
KAction * action()
Action to trigger insertion of this snippet.
Definition: snippet.cpp:87
Snippet::data
virtual QVariant data(int role=Qt::UserRole+1) const
Definition: snippet.cpp:106
Snippet::setPostfix
void setPostfix(const QString &postfix)
Sets the display postfix of this snippet.
Definition: snippet.cpp:72
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
Snippet::prefix
QString prefix() const
Returns the display prefix of this snippet.
Definition: snippet.cpp:57
Snippet::Snippet
Snippet()
Construct an empty snippet.
Definition: snippet.cpp:36
Snippet::snippet
QString snippet() const
Returns the actual contents of this snippet.
Definition: snippet.cpp:47
KAction
Snippet::~Snippet
~Snippet()
Definition: snippet.cpp:42
QStandardItem
Snippet::arguments
QString arguments() const
Returns the display arguments of this snippet.
Definition: snippet.cpp:77
Snippet::postfix
QString postfix() const
Returns the display postfix of this snippet.
Definition: snippet.cpp:67
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