• 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
  • syntax
kateextendedattribute.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2003, 2004 Anders Lund <anders@alweb.dk>
3  Copyright (C) 2003, 2005 Hamish Rodda <rodda@kde.org>
4  Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org>
5  Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
6  Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
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 version 2 as published by the Free Software Foundation.
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 #include "kateextendedattribute.h"
24 
25 #include <ktexteditor/highlightinterface.h>
26 
27 KateExtendedAttribute::KateExtendedAttribute(const QString& name, int defaultStyleIndex)
28 {
29  setName(name);
30  setDefaultStyleIndex(defaultStyleIndex);
31  setPerformSpellchecking(true);
32 }
33 
34 int KateExtendedAttribute::indexForStyleName( const QString & name )
35 {
36  if (name=="dsNormal") return KTextEditor::HighlightInterface::dsNormal;
37  else if (name=="dsKeyword") return KTextEditor::HighlightInterface::dsKeyword;
38  else if (name=="dsDataType") return KTextEditor::HighlightInterface::dsDataType;
39  else if (name=="dsDecVal") return KTextEditor::HighlightInterface::dsDecVal;
40  else if (name=="dsBaseN") return KTextEditor::HighlightInterface::dsBaseN;
41  else if (name=="dsFloat") return KTextEditor::HighlightInterface::dsFloat;
42  else if (name=="dsChar") return KTextEditor::HighlightInterface::dsChar;
43  else if (name=="dsString") return KTextEditor::HighlightInterface::dsString;
44  else if (name=="dsComment") return KTextEditor::HighlightInterface::dsComment;
45  else if (name=="dsOthers") return KTextEditor::HighlightInterface::dsOthers;
46  else if (name=="dsAlert") return KTextEditor::HighlightInterface::dsAlert;
47  else if (name=="dsFunction") return KTextEditor::HighlightInterface::dsFunction;
48  else if (name=="dsRegionMarker") return KTextEditor::HighlightInterface::dsRegionMarker;
49  else if (name=="dsError") return KTextEditor::HighlightInterface::dsError;
50 
51  return KTextEditor::HighlightInterface::dsNormal;
52 }
53 
54 QString KateExtendedAttribute::name( ) const
55 {
56  return stringProperty(AttributeName);
57 }
58 
59 void KateExtendedAttribute::setName( const QString & name )
60 {
61  setProperty(AttributeName, name);
62 }
63 
64 bool KateExtendedAttribute::isDefaultStyle( ) const
65 {
66  return hasProperty(AttributeDefaultStyleIndex);
67 }
68 
69 int KateExtendedAttribute::defaultStyleIndex( ) const
70 {
71  return intProperty(AttributeDefaultStyleIndex);
72 }
73 
74 void KateExtendedAttribute::setDefaultStyleIndex( int index )
75 {
76  setProperty(AttributeDefaultStyleIndex, QVariant(index));
77 }
78 
79 bool KateExtendedAttribute::performSpellchecking( ) const
80 {
81  return boolProperty(Spellchecking);
82 }
83 
84 void KateExtendedAttribute::setPerformSpellchecking(bool spellchecking)
85 {
86  setProperty(Spellchecking, QVariant(spellchecking));
87 }
KateExtendedAttribute::AttributeName
Definition: kateextendedattribute.h:43
KateExtendedAttribute::defaultStyleIndex
int defaultStyleIndex() const
Definition: kateextendedattribute.cpp:69
KateExtendedAttribute::AttributeDefaultStyleIndex
Definition: kateextendedattribute.h:44
kateextendedattribute.h
KateExtendedAttribute::setDefaultStyleIndex
void setDefaultStyleIndex(int index)
Definition: kateextendedattribute.cpp:74
KateExtendedAttribute::name
QString name() const
Definition: kateextendedattribute.cpp:54
KateExtendedAttribute::performSpellchecking
bool performSpellchecking() const
Definition: kateextendedattribute.cpp:79
QString
KateExtendedAttribute::Spellchecking
Definition: kateextendedattribute.h:45
KateExtendedAttribute::indexForStyleName
static int indexForStyleName(const QString &name)
Definition: kateextendedattribute.cpp:34
KateExtendedAttribute::KateExtendedAttribute
KateExtendedAttribute(const QString &name, int defaultStyleIndex=-1)
Definition: kateextendedattribute.cpp:27
KateExtendedAttribute::isDefaultStyle
bool isDefaultStyle() const
Definition: kateextendedattribute.cpp:64
KateExtendedAttribute::setName
void setName(const QString &name)
Definition: kateextendedattribute.cpp:59
KateExtendedAttribute::setPerformSpellchecking
void setPerformSpellchecking(bool spellchecking)
Definition: kateextendedattribute.cpp:84
QVariant
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