• 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
katesnippetglobal.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) 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 __SNIPPETPLUGIN_H__
24 #define __SNIPPETPLUGIN_H__
25 
26 #include <QtCore/QVariant>
27 #include <QtCore/QPointer>
28 
29 #include <kateglobal.h>
30 #include <kateview.h>
31 
32 class SnippetCompletionModel;
33 class Snippet;
34 
39 class KateSnippetGlobal : public QObject
40 {
41  Q_OBJECT
42 
43 public:
44  KateSnippetGlobal(QObject *parent, const QVariantList &args = QVariantList() );
45  ~KateSnippetGlobal ();
46 
52  void insertSnippet(Snippet* snippet);
53 
54  static KateSnippetGlobal* self() { return KateGlobal::self()->snippetGlobal(); }
55 
60  SnippetCompletionModel *completionModel () { return m_model; }
61 
66  QWidget *snippetWidget ();
67 
68 public slots:
73  void createSnippet (KateView *view);
74 
80  void showDialog (KateView *view);
81 
82  void insertSnippetFromActionData();
83 
84 private:
85  class SnippetCompletionModel* m_model;
86  QPointer<KateView> m_activeViewForDialog;
87 };
88 
89 #endif
90 
KateSnippetGlobal::KateSnippetGlobal
KateSnippetGlobal(QObject *parent, const QVariantList &args=QVariantList())
Definition: katesnippetglobal.cpp:48
QWidget
kateview.h
KateSnippetGlobal::insertSnippet
void insertSnippet(Snippet *snippet)
Inserts the given snippet into the currently active view.
Definition: katesnippetglobal.cpp:95
QPointer< KateView >
KateSnippetGlobal::completionModel
SnippetCompletionModel * completionModel()
Code completion model.
Definition: katesnippetglobal.h:60
KateGlobal::self
static KateGlobal * self()
Kate Part Internal stuff ;)
Definition: kateglobal.cpp:465
KateSnippetGlobal::showDialog
void showDialog(KateView *view)
Show the snippet dialog, used by most simple apps using just KatePart.
Definition: katesnippetglobal.cpp:61
KateSnippetGlobal::insertSnippetFromActionData
void insertSnippetFromActionData()
Definition: katesnippetglobal.cpp:123
KateSnippetGlobal::snippetWidget
QWidget * snippetWidget()
Create a new snippet widget, to allow to manage and insert snippets.
Definition: katesnippetglobal.cpp:90
QObject
KateGlobal::snippetGlobal
KateSnippetGlobal * snippetGlobal()
global instance of the snippet handling lazy constructed on first use to allow it to use the session ...
Definition: kateglobal.cpp:253
kateglobal.h
Snippet
One object of this class represents a single snippet.
Definition: snippet.h:42
KateView
Definition: kateview.h:77
SnippetCompletionModel
Definition: snippetcompletionmodel.h:39
KateSnippetGlobal
This is the main class of KDevelop's snippet plugin.
Definition: katesnippetglobal.h:39
KateSnippetGlobal::createSnippet
void createSnippet(KateView *view)
Create snippet for given view, e.g.
Definition: katesnippetglobal.cpp:132
QObject::parent
QObject * parent() const
KateSnippetGlobal::~KateSnippetGlobal
~KateSnippetGlobal()
Definition: katesnippetglobal.cpp:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 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