• 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
katesyntaxmanager.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org>
3  Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
4  Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
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 
21 #ifndef __KATE_SYNTAXMANAGER_H__
22 #define __KATE_SYNTAXMANAGER_H__
23 
24 #include "katetextline.h"
25 #include "kateextendedattribute.h"
26 
27 #include <ktexteditor/highlightinterface.h>
28 
29 #include <kconfig.h>
30 #include <kactionmenu.h>
31 
32 #include <QtCore/QVector>
33 #include <QtCore/QList>
34 #include <QtCore/QHash>
35 #include <QtCore/QMap>
36 
37 #include <QtCore/QRegExp>
38 #include <QtCore/QObject>
39 #include <QtCore/QStringList>
40 #include <QtCore/QPointer>
41 #include <QtCore/QDate>
42 #include <QtCore/QLinkedList>
43 
44 class KateSyntaxDocument;
45 class KateHighlighting;
46 
47 
48 class KateHlManager : public QObject
49 {
50  Q_OBJECT
51 
52  public:
53  KateHlManager();
54  ~KateHlManager();
55 
56  static KateHlManager *self();
57 
58  KateSyntaxDocument *syntaxDocument () { return syntax; }
59 
60  inline KConfig *getKConfig() { return &m_config; }
61 
62  KateHighlighting *getHl(int n);
63  int nameFind(const QString &name);
64 
65  QString identifierForName(const QString&);
70  QString nameForIdentifier(const QString&);
71 
72  // methodes to get the default style count + names
73  static uint defaultStyles();
74  static QString defaultStyleName(int n, bool translateNames = false);
75 
76  void getDefaults(const QString &schema, KateAttributeList &, KConfig *cfg=0);
77  void setDefaults(const QString &schema, KateAttributeList &, KConfig *cfg=0);
78 
79  int highlights();
80  QString hlName(int n);
81  QString hlNameTranslated (int n);
82  QString hlSection(int n);
83  bool hlHidden(int n);
84 
85  void incDynamicCtxs() { ++dynamicCtxsCount; }
86  int countDynamicCtxs() { return dynamicCtxsCount; }
87  void setForceNoDCReset(bool b) { forceNoDCReset = b; }
88 
89  // be carefull: all documents hl should be invalidated after having successfully called this method!
90  bool resetDynamicCtxs();
91 
92  Q_SIGNALS:
93  void changed();
94 
95  private:
96  friend class KateHighlighting;
97 
98  // This list owns objects it holds, thus they should be deleted when the object is removed
99  QList<KateHighlighting*> hlList;
100  // This hash does not own the objects it holds, thus they should not be deleted
101  QHash<QString, KateHighlighting*> hlDict;
102 
103  KConfig m_config;
104  QStringList commonSuffixes;
105 
106  KateSyntaxDocument *syntax;
107 
108  int dynamicCtxsCount;
109  QTime lastCtxsReset;
110  bool forceNoDCReset;
111 };
112 
113 #endif
114 
115 // kate: space-indent on; indent-width 2; replace-tabs on;
KateHlManager::hlName
QString hlName(int n)
Definition: katesyntaxmanager.cpp:360
katetextline.h
KateHlManager::syntaxDocument
KateSyntaxDocument * syntaxDocument()
Definition: katesyntaxmanager.h:58
KateHlManager
Definition: katesyntaxmanager.h:48
KateHlManager::KateHlManager
KateHlManager()
Definition: katesyntaxmanager.cpp:70
KateHlManager::nameForIdentifier
QString nameForIdentifier(const QString &)
Returns the mode name for a given identifier, as e.g.
Definition: katesyntaxmanager.cpp:388
kateextendedattribute.h
KateHlManager::changed
void changed()
QTime
KateHlManager::hlNameTranslated
QString hlNameTranslated(int n)
Definition: katesyntaxmanager.cpp:365
KateHlManager::defaultStyleName
static QString defaultStyleName(int n, bool translateNames=false)
Definition: katesyntaxmanager.cpp:132
QObject::name
const char * name() const
QHash< QString, KateHighlighting * >
KateHlManager::setForceNoDCReset
void setForceNoDCReset(bool b)
Definition: katesyntaxmanager.h:87
QObject
KateHlManager::defaultStyles
static uint defaultStyles()
Definition: katesyntaxmanager.cpp:127
KateHlManager::setDefaults
void setDefaults(const QString &schema, KateAttributeList &, KConfig *cfg=0)
Definition: katesyntaxmanager.cpp:327
KateSyntaxDocument
Store and manage the information about Syntax Highlighting.
Definition: katesyntaxdocument.h:73
KateHlManager::getKConfig
KConfig * getKConfig()
Definition: katesyntaxmanager.h:60
KateHlManager::incDynamicCtxs
void incDynamicCtxs()
Definition: katesyntaxmanager.h:85
QString
QList
QStringList
KateHlManager::~KateHlManager
~KateHlManager()
Definition: katesyntaxmanager.cpp:97
KateHlManager::countDynamicCtxs
int countDynamicCtxs()
Definition: katesyntaxmanager.h:86
KateHlManager::resetDynamicCtxs
bool resetDynamicCtxs()
Definition: katesyntaxmanager.cpp:401
KateHlManager::hlSection
QString hlSection(int n)
Definition: katesyntaxmanager.cpp:370
KateHlManager::getHl
KateHighlighting * getHl(int n)
Definition: katesyntaxmanager.cpp:108
KateHighlighting
Definition: katehighlight.h:119
KateHlManager::nameFind
int nameFind(const QString &name)
Definition: katesyntaxmanager.cpp:116
KateHlManager::getDefaults
void getDefaults(const QString &schema, KateAttributeList &, KConfig *cfg=0)
Definition: katesyntaxmanager.cpp:177
KateHlManager::identifierForName
QString identifierForName(const QString &)
Definition: katesyntaxmanager.cpp:380
KateHlManager::hlHidden
bool hlHidden(int n)
Definition: katesyntaxmanager.cpp:375
KateHlManager::highlights
int highlights()
Definition: katesyntaxmanager.cpp:355
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