• 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
  • script
kateindentscript.h
Go to the documentation of this file.
1 // This file is part of the KDE libraries
2 // Copyright (C) 2008 Paul Giannaros <paul@giannaros.org>
3 // Copyright (C) 2009 Dominik Haumann <dhaumann kde org>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) version 3.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
14 //
15 // You should have received a copy of the GNU Library General Public License
16 // along with this library; see the file COPYING.LIB. If not, write to
17 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 // Boston, MA 02110-1301, USA.
19 
20 #ifndef KATE_INDENT_SCRIPT_H
21 #define KATE_INDENT_SCRIPT_H
22 
23 #include "katescript.h"
24 #include "kateview.h"
25 
26 #include <QtCore/QPair>
27 
28 class KateScriptDocument;
29 
30 class KateIndentScriptHeader
31 {
32  public:
33  KateIndentScriptHeader() : m_priority(0)
34  {}
35 
36  inline void setName(const QString& name)
37  { m_name = name; }
38  inline const QString& name() const
39  { return m_name; }
40 
41  inline void setRequiredStyle(const QString& requiredStyle)
42  { m_requiredStyle = requiredStyle; }
43  inline const QString& requiredStyle() const
44  { return m_requiredStyle; }
45 
46  inline void setIndentLanguages(const QStringList& indentLanguages)
47  { m_indentLanguages = indentLanguages; }
48  inline const QStringList& indentLanguages() const
49  { return m_indentLanguages; }
50 
51  inline void setPriority(int priority)
52  { m_priority = priority; }
53  inline int priority() const
54  { return m_priority; }
55 
56  inline void setBaseName(const QString& baseName)
57  { m_baseName = baseName; }
58  inline const QString& baseName() const
59  { return m_baseName; }
60 
61  private:
62  QString m_name;
63 
69  QString m_requiredStyle;
75  QStringList m_indentLanguages;
81  int m_priority;
82 
86  QString m_baseName;
87 };
88 
89 
94 class KateIndentScript : public KateScript
95 {
96  public:
97  KateIndentScript(const QString &url, const KateIndentScriptHeader &header);
98 
99  const QString &triggerCharacters();
100 
101  const KateIndentScriptHeader& indentHeader() const;
102 
107  QPair<int, int> indent(KateView* view, const KTextEditor::Cursor& position,
108  QChar typedCharacter, int indentWidth);
109 
110  private:
111  QString m_triggerCharacters;
112  bool m_triggerCharactersSet;
113  KateIndentScriptHeader m_indentHeader;
114 };
115 
116 
117 #endif
118 
119 // kate: space-indent on; indent-width 2; replace-tabs on;
kateview.h
KateIndentScriptHeader::priority
int priority() const
Definition: kateindentscript.h:53
KateScript
KateScript objects represent a script that can be executed and inspected.
Definition: katescript.h:106
KateIndentScriptHeader::setRequiredStyle
void setRequiredStyle(const QString &requiredStyle)
Definition: kateindentscript.h:41
QChar
katescript.h
KateIndentScriptHeader::name
const QString & name() const
Definition: kateindentscript.h:38
KateIndentScript::indent
QPair< int, int > indent(KateView *view, const KTextEditor::Cursor &position, QChar typedCharacter, int indentWidth)
Returns a pair where the first value is the indent amount, and the second value is the alignment...
Definition: kateindentscript.cpp:55
KateScriptDocument
Thinish wrapping around KateDocument, exposing the methods we want exposed and adding some helper met...
Definition: katescriptdocument.h:46
QString
KateScript::url
const QString & url()
The script's URL.
Definition: katescript.h:123
KateIndentScript
A specialized class for scripts that are of type KateScriptInformation::IndentationScript.
Definition: kateindentscript.h:94
QStringList
QPair
KateView
Definition: kateview.h:77
KateIndentScriptHeader::baseName
const QString & baseName() const
Definition: kateindentscript.h:58
KateIndentScriptHeader::setBaseName
void setBaseName(const QString &baseName)
Definition: kateindentscript.h:56
KateIndentScript::triggerCharacters
const QString & triggerCharacters()
Definition: kateindentscript.cpp:40
KateIndentScriptHeader::KateIndentScriptHeader
KateIndentScriptHeader()
Definition: kateindentscript.h:33
KateIndentScriptHeader::setPriority
void setPriority(int priority)
Definition: kateindentscript.h:51
KateIndentScriptHeader::requiredStyle
const QString & requiredStyle() const
Definition: kateindentscript.h:43
KateIndentScript::KateIndentScript
KateIndentScript(const QString &url, const KateIndentScriptHeader &header)
Definition: kateindentscript.cpp:28
KateIndentScriptHeader
Definition: kateindentscript.h:30
KateIndentScriptHeader::setName
void setName(const QString &name)
Definition: kateindentscript.h:36
KateIndentScriptHeader::indentLanguages
const QStringList & indentLanguages() const
Definition: kateindentscript.h:48
KateIndentScript::indentHeader
const KateIndentScriptHeader & indentHeader() const
Definition: kateindentscript.cpp:35
KateIndentScriptHeader::setIndentLanguages
void setIndentLanguages(const QStringList &indentLanguages)
Definition: kateindentscript.h:46
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