• 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
  • schema
kateschema.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
3  Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
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 version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __KATE_SCHEMA_H__
21 #define __KATE_SCHEMA_H__
22 
23 #include <kactionmenu.h>
24 #include <kconfig.h>
25 #include <klocale.h>
26 
27 #include <QtCore/QStringList>
28 #include <QtCore/QPointer>
29 
30 class KateView;
31 class QActionGroup;
32 
33 class KateSchema
34 {
35  public:
36  QString rawName;
37  int shippedDefaultSchema;
38 
42  QString translatedName () const {
43  return shippedDefaultSchema ? i18nc("Color Schema", rawName.toUtf8()) : rawName;
44  }
45 };
46 
47 class KateSchemaManager
48 {
49  public:
50  KateSchemaManager ();
51 
55  KConfig &config ()
56  {
57  return m_config;
58  }
59 
63  KConfigGroup schema (const QString &name);
64 
68  KateSchema schemaData (const QString &name);
69 
73  QList<KateSchema> list ();
74 
75  private:
76  KConfig m_config;
77 };
78 
79 
80 class KateViewSchemaAction : public KActionMenu
81 {
82  Q_OBJECT
83 
84  public:
85  KateViewSchemaAction(const QString& text, QObject *parent)
86  : KActionMenu(text, parent) { init(); }
87 
88  void updateMenu (KateView *view);
89 
90  private:
91  void init();
92 
93  QPointer<KateView> m_view;
94  QStringList names;
95  QActionGroup *m_group;
96  int last;
97 
98  public Q_SLOTS:
99  void slotAboutToShow();
100 
101  private Q_SLOTS:
102  void setSchema();
103 };
104 
105 #endif
106 
107 // kate: space-indent on; indent-width 2; replace-tabs on;
KateSchema
Definition: kateschema.h:33
KateViewSchemaAction::KateViewSchemaAction
KateViewSchemaAction(const QString &text, QObject *parent)
Definition: kateschema.h:85
QActionGroup
Kate::Script::i18nc
QScriptValue i18nc(QScriptContext *context, QScriptEngine *engine)
i18nc("context", "text", arguments [optional])
Definition: katescripthelpers.cpp:210
QPointer< KateView >
KateViewSchemaAction::slotAboutToShow
void slotAboutToShow()
Definition: kateschema.cpp:93
KateSchema::translatedName
QString translatedName() const
construct translated name for shipped schemas
Definition: kateschema.h:42
KateSchemaManager::KateSchemaManager
KateSchemaManager()
Definition: kateschema.cpp:38
KateViewSchemaAction
Definition: kateschema.h:80
KateSchemaManager::config
KConfig & config()
Config.
Definition: kateschema.h:55
KateSchema::rawName
QString rawName
Definition: kateschema.h:36
QObject
KateSchemaManager::schemaData
KateSchema schemaData(const QString &name)
return schema data for on schema
Definition: kateschema.cpp:48
KateViewSchemaAction::updateMenu
void updateMenu(KateView *view)
Definition: kateschema.cpp:88
QString
KateSchema::shippedDefaultSchema
int shippedDefaultSchema
Definition: kateschema.h:37
QList
QStringList
KateView
Definition: kateview.h:77
KateSchemaManager
Definition: kateschema.h:47
KateSchemaManager::list
QList< KateSchema > list()
Constructs list of schemas atm known in config object.
Definition: kateschema.cpp:65
KateSchemaManager::schema
KConfigGroup schema(const QString &name)
return kconfiggroup for the given schema
Definition: kateschema.cpp:43
KActionMenu
QString::toUtf8
QByteArray toUtf8() const
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