• 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
  • utils
kateglobal.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2001-2010 Christoph Cullmann <cullmann@kde.org>
4  * Copyright (C) 2009 Erlend Hamberg <ehamberg@gmail.com>
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 as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef __KATE_GLOBAL_H__
23 #define __KATE_GLOBAL_H__
24 
25 #include "katepartprivate_export.h"
26 #include "katescript.h"
27 
28 #include <ktexteditor/editor.h>
29 
30 #include <kservice.h>
31 #include <kcomponentdata.h>
32 #include <kaboutdata.h>
33 #include <ktexteditor/commandinterface.h>
34 #include <ktexteditor/containerinterface.h>
35 #include <ktexteditor/templateinterface2.h>
36 #include <QtCore/QList>
37 
38 class KateCmd;
39 class KateModeManager;
40 class KateSchemaManager;
41 class KateGlobalConfig;
42 class KateDocumentConfig;
43 class KateViewConfig;
44 class KateRendererConfig;
45 class KateDocument;
46 class KateRenderer;
47 class KateView;
48 class KateScriptManager;
49 class KDirWatch;
50 class KateHlManager;
51 class KatePartPluginManager;
52 class KateSpellCheckManager;
53 class KateViGlobal;
54 class KateWordCompletionModel;
55 class KateKeywordCompletionModel;
56 class KateSnippetGlobal;
57 
58 namespace Kate {
59  class Command;
60 }
61 
62 Q_DECLARE_METATYPE(KSharedConfig::Ptr)
63 
64 
71 class KATEPART_TESTS_EXPORT KateGlobal : public KTextEditor::Editor, public KTextEditor::CommandInterface, public KTextEditor::ContainerInterface, public KTextEditor::TemplateScriptRegistrar
72 {
73  Q_OBJECT
74  Q_INTERFACES(KTextEditor::CommandInterface)
75  Q_INTERFACES(KTextEditor::ContainerInterface)
76  Q_INTERFACES(KTextEditor::TemplateScriptRegistrar)
77 
78  public:
83  Q_PROPERTY (QWidget *snippetWidget READ snippetWidget)
84 
85 
89  QWidget *snippetWidget ();
90 
97  Q_PROPERTY (KSharedConfig::Ptr sessionConfig READ sessionConfig WRITE setSessionConfig)
98 
99 
103  KSharedConfig::Ptr sessionConfig ()
104  {
105  return m_sessionConfig;
106  }
107 
112  void setSessionConfig (KSharedConfig::Ptr sessionConfig)
113  {
114  m_sessionConfig = sessionConfig;
115  }
116 
117  // for setDefaultEncoding
118  friend class KateDocumentConfig;
119 
120  private:
124  KateGlobal ();
125 
126  public:
130  ~KateGlobal ();
131 
137  KTextEditor::Document *createDocument ( QObject *parent );
138 
143  const QList<KTextEditor::Document*> &documents ();
144 
148  public:
153  const KAboutData* aboutData() const { return &m_aboutData; }
154 
158  public:
163  void readConfig (KConfig *config = 0);
164 
169  void writeConfig (KConfig *config = 0);
170 
175  bool configDialogSupported () const;
176 
182  void configDialog (QWidget *parent);
183 
190  int configPages () const;
191 
197  KTextEditor::ConfigPage *configPage (int number, QWidget *parent);
198 
199  QString configPageName (int number) const;
200 
201  QString configPageFullName (int number) const;
202 
203  KIcon configPageIcon (int number) const;
204 
208  public:
213  static KateGlobal *self ();
214 
218  static void incRef () { ++s_ref; }
219 
223  static void decRef () { if (s_ref > 0) --s_ref; if (s_ref == 0) { delete s_self; s_self = 0L; } }
224 
229  static QString katePartVersion();
230 
235  const KComponentData &componentData() { return m_componentData; }
236 
242  void registerDocument ( KateDocument *doc );
243 
248  void deregisterDocument ( KateDocument *doc );
249 
255  void registerView ( KateView *view );
256 
261  void deregisterView ( KateView *view );
262 
267  QList<KateDocument*> &kateDocuments () { return m_documents; }
268 
273  QList<KateView*> &views () { return m_views; }
274 
279  KatePartPluginManager *pluginManager () { return m_pluginManager; }
280 
285  KDirWatch *dirWatch () { return m_dirWatch; }
286 
292  KateModeManager *modeManager () { return m_modeManager; }
293 
298  KateSchemaManager *schemaManager () { return m_schemaManager; }
299 
304  KateDocumentConfig *documentConfig () { return m_documentConfig; }
305 
310  KateViewConfig *viewConfig () { return m_viewConfig; }
311 
316  KateRendererConfig *rendererConfig () { return m_rendererConfig; }
317 
321  KateScriptManager *scriptManager () { return m_scriptManager; }
322 
327  KateHlManager *hlManager () { return m_hlManager; }
328 
333  KateCmd *cmdManager () { return m_cmdManager; }
334 
339  KateViGlobal *viInputModeGlobal () { return m_viInputModeGlobal; }
340 
345  KateSpellCheckManager *spellCheckManager () { return m_spellCheckManager; }
346 
351  KateWordCompletionModel *wordCompletionModel () { return m_wordCompletionModel; }
352 
357  KateKeywordCompletionModel *keywordCompletionModel () { return m_keywordCompletionModel; }
358 
365  KateSnippetGlobal *snippetGlobal();
366 
373  bool registerCommand (KTextEditor::Command *cmd);
374 
381  bool unregisterCommand (KTextEditor::Command *cmd);
382 
388  KTextEditor::Command *queryCommand (const QString &cmd) const;
389 
394  QList<KTextEditor::Command*> commands() const;
395 
400  QStringList commandList() const;
401 
402 
407  QObject * container();
408 
412  void setContainer( QObject * container );
413 
417  KTextEditor::TemplateScript* registerTemplateScript (QObject* owner, const QString& script);
418  void unregisterTemplateScript(KTextEditor::TemplateScript* templateScript);
419 
424  void copyToClipboard (const QString &text);
425 
430  const QStringList &clipboardHistory () const
431  {
432  return m_clipboardHistory;
433  }
434 
435  Q_SIGNALS:
439  void clipboardHistoryChanged ();
440 
441  private Q_SLOTS:
442  void updateColorPalette();
443 
444  private:
448  static KateGlobal *s_self;
449 
453  static int s_ref;
454 
458  KAboutData m_aboutData;
459 
463  KComponentData m_componentData;
464 
468  QList<KateDocument*> m_documents;
469 
473  QList<KateView*> m_views;
474 
478  KDirWatch *m_dirWatch;
479 
483  KateModeManager *m_modeManager;
484 
488  KateSchemaManager *m_schemaManager;
489 
493  KatePartPluginManager *m_pluginManager;
494 
498  KateGlobalConfig *m_globalConfig;
499 
503  KateDocumentConfig *m_documentConfig;
504 
508  KateViewConfig *m_viewConfig;
509 
513  KateRendererConfig *m_rendererConfig;
514 
518  QList<KTextEditor::Command *> m_cmds;
519 
523  KateScriptManager *m_scriptManager;
524 
528  KateHlManager *m_hlManager;
529 
533  KateCmd *m_cmdManager;
534 
538  KateViGlobal *m_viInputModeGlobal;
539 
543  KateSpellCheckManager *m_spellCheckManager;
544 
545  QList<KTextEditor::Document*> m_docs;
546 
550  QPointer<QObject> m_container;
551 
555  KateWordCompletionModel *m_wordCompletionModel;
556 
560  KateKeywordCompletionModel *m_keywordCompletionModel;
561 
565  KateSnippetGlobal *m_snippetGlobal;
566 
570  KSharedConfig::Ptr m_sessionConfig;
571 
575  QStringList m_clipboardHistory;
576 };
577 
578 #endif
579 
580 // kate: space-indent on; indent-width 2; replace-tabs on;
KateScriptManager
Manage the scripts on disks – find them and query them.
Definition: katescriptmanager.h:43
QWidget
KateGlobal::spellCheckManager
KateSpellCheckManager * spellCheckManager()
spell check manager
Definition: kateglobal.h:345
KateGlobal::modeManager
KateModeManager * modeManager()
global mode manager used to manage the modes centrally
Definition: kateglobal.h:292
KateGlobal::kateDocuments
QList< KateDocument * > & kateDocuments()
return a list of all registered docs
Definition: kateglobal.h:267
KateGlobal::wordCompletionModel
KateWordCompletionModel * wordCompletionModel()
global instance of the simple word completion mode
Definition: kateglobal.h:351
KateHlManager
Definition: katesyntaxmanager.h:48
KateGlobal::documentConfig
KateDocumentConfig * documentConfig()
fallback document config
Definition: kateglobal.h:304
KateGlobal::decRef
static void decRef()
decrement reference counter
Definition: kateglobal.h:223
KateGlobal::aboutData
const KAboutData * aboutData() const
General Information about this editor.
Definition: kateglobal.h:153
QPointer< QObject >
KateDocumentConfig::KateGlobal
friend class KateGlobal
Definition: kateconfig.h:148
katescript.h
KateDocumentConfig::readConfig
void readConfig(const KConfigGroup &config)
Read config from object.
Definition: kateconfig.cpp:325
KATEPART_TESTS_EXPORT
#define KATEPART_TESTS_EXPORT
Definition: katepartprivate_export.h:36
KateGlobal::componentData
const KComponentData & componentData()
public accessor to the instance
Definition: kateglobal.h:235
KateModeManager
Definition: katemodemanager.h:66
KateGlobal::clipboardHistory
const QStringList & clipboardHistory() const
Clipboard history, filled with text we ever copied to clipboard via copyToClipboard.
Definition: kateglobal.h:430
KateRenderer
Handles all of the work of rendering the text (used for the views and printing)
Definition: katerenderer.h:50
KateGlobal::incRef
static void incRef()
increment reference counter
Definition: kateglobal.h:218
KateGlobalConfig
Definition: kateconfig.h:93
QObject
katepartprivate_export.h
KateGlobal::setSessionConfig
void setSessionConfig(KSharedConfig::Ptr sessionConfig)
Set session config.
Definition: kateglobal.h:112
KateGlobal::views
QList< KateView * > & views()
return a list of all registered views
Definition: kateglobal.h:273
KateSpellCheckManager
Definition: spellcheck.h:36
QString
QList< KTextEditor::Document * >
KateGlobal::pluginManager
KatePartPluginManager * pluginManager()
global plugin manager
Definition: kateglobal.h:279
QStringList
KateView
Definition: kateview.h:77
KateSchemaManager
Definition: kateschema.h:47
KateGlobal::dirWatch
KDirWatch * dirWatch()
global dirwatch
Definition: kateglobal.h:285
KateGlobal::hlManager
KateHlManager * hlManager()
hl manager
Definition: kateglobal.h:327
KateDocument
Definition: katedocument.h:74
KateGlobal::schemaManager
KateSchemaManager * schemaManager()
manager for the katepart schemas
Definition: kateglobal.h:298
KateSnippetGlobal
This is the main class of KDevelop's snippet plugin.
Definition: katesnippetglobal.h:39
KateViGlobal
Definition: kateviglobal.h:46
KateGlobal::viInputModeGlobal
KateViGlobal * viInputModeGlobal()
vi input mode global
Definition: kateglobal.h:339
KateRendererConfig
Definition: kateconfig.h:618
KateGlobal::viewConfig
KateViewConfig * viewConfig()
fallback view config
Definition: kateglobal.h:310
KatePartPluginManager
Definition: katepartpluginmanager.h:56
KateWordCompletionModel
Definition: katewordcompletion.h:39
KateGlobal
KateGlobal One instance of this class is hold alive during a kate part session, as long as any factor...
Definition: kateglobal.h:71
KateDocumentConfig
Definition: kateconfig.h:145
KateCmd
Definition: katecmd.h:33
KateDocumentConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:379
KateKeywordCompletionModel
Highlighting-file based keyword completion for the editor.
Definition: katekeywordcompletion.h:34
KateGlobal::keywordCompletionModel
KateKeywordCompletionModel * keywordCompletionModel()
global instance of the language-aware keyword completion model
Definition: kateglobal.h:357
KateViewConfig
Definition: kateconfig.h:381
KateGlobal::rendererConfig
KateRendererConfig * rendererConfig()
fallback renderer config
Definition: kateglobal.h:316
KateGlobal::cmdManager
KateCmd * cmdManager()
command manager
Definition: kateglobal.h:333
KateGlobal::scriptManager
KateScriptManager * scriptManager()
Global script collection.
Definition: kateglobal.h:321
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