Kate
kateextendedattribute.cpp
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2003, 2004 Anders Lund <anders@alweb.dk> 00003 Copyright (C) 2003, 2005 Hamish Rodda <rodda@kde.org> 00004 Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org> 00005 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> 00006 Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de> 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public 00010 License version 2 as published by the Free Software Foundation. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #include "kateextendedattribute.h" 00024 00025 KateExtendedAttribute::KateExtendedAttribute(const QString& name, int defaultStyleIndex) 00026 { 00027 setName(name); 00028 setDefaultStyleIndex(defaultStyleIndex); 00029 } 00030 00031 int KateExtendedAttribute::indexForStyleName( const QString & name ) 00032 { 00033 if (name=="dsNormal") return KateExtendedAttribute::dsNormal; 00034 else if (name=="dsKeyword") return KateExtendedAttribute::dsKeyword; 00035 else if (name=="dsDataType") return KateExtendedAttribute::dsDataType; 00036 else if (name=="dsDecVal") return KateExtendedAttribute::dsDecVal; 00037 else if (name=="dsBaseN") return KateExtendedAttribute::dsBaseN; 00038 else if (name=="dsFloat") return KateExtendedAttribute::dsFloat; 00039 else if (name=="dsChar") return KateExtendedAttribute::dsChar; 00040 else if (name=="dsString") return KateExtendedAttribute::dsString; 00041 else if (name=="dsComment") return KateExtendedAttribute::dsComment; 00042 else if (name=="dsOthers") return KateExtendedAttribute::dsOthers; 00043 else if (name=="dsAlert") return KateExtendedAttribute::dsAlert; 00044 else if (name=="dsFunction") return KateExtendedAttribute::dsFunction; 00045 else if (name=="dsRegionMarker") return KateExtendedAttribute::dsRegionMarker; 00046 else if (name=="dsError") return KateExtendedAttribute::dsError; 00047 00048 return KateExtendedAttribute::dsNormal; 00049 } 00050 00051 QString KateExtendedAttribute::name( ) const 00052 { 00053 return stringProperty(AttributeName); 00054 } 00055 00056 void KateExtendedAttribute::setName( const QString & name ) 00057 { 00058 setProperty(AttributeName, name); 00059 } 00060 00061 bool KateExtendedAttribute::isDefaultStyle( ) const 00062 { 00063 return hasProperty(AttributeDefaultStyleIndex); 00064 } 00065 00066 int KateExtendedAttribute::defaultStyleIndex( ) const 00067 { 00068 return intProperty(AttributeDefaultStyleIndex); 00069 } 00070 00071 void KateExtendedAttribute::setDefaultStyleIndex( int index ) 00072 { 00073 setProperty(AttributeDefaultStyleIndex, QVariant(index)); 00074 }