• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • sources
  • kde-4.12
  • 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 KateSnippetGlobal;
56 
57 namespace Kate {
58  class Command;
59 }
60 
61 Q_DECLARE_METATYPE(KSharedConfig::Ptr)
62 
63 
70 class KATEPART_TESTS_EXPORT KateGlobal : public KTextEditor::Editor, public KTextEditor::CommandInterface, public KTextEditor::ContainerInterface, public KTextEditor::TemplateScriptRegistrar
71 {
72  Q_OBJECT
73  Q_INTERFACES(KTextEditor::CommandInterface)
74  Q_INTERFACES(KTextEditor::ContainerInterface)
75  Q_INTERFACES(KTextEditor::TemplateScriptRegistrar)
76 
77  public:
82  Q_PROPERTY (QWidget *snippetWidget READ snippetWidget)
83 
84 
88  QWidget *snippetWidget ();
89 
96  Q_PROPERTY (KSharedConfig::Ptr sessionConfig READ sessionConfig WRITE setSessionConfig)
97 
98 
102  KSharedConfig::Ptr sessionConfig ()
103  {
104  return m_sessionConfig;
105  }
106 
111  void setSessionConfig (KSharedConfig::Ptr sessionConfig)
112  {
113  m_sessionConfig = sessionConfig;
114  }
115 
116  // for setDefaultEncoding
117  friend class KateDocumentConfig;
118 
119  private:
123  KateGlobal ();
124 
125  public:
129  ~KateGlobal ();
130 
136  KTextEditor::Document *createDocument ( QObject *parent );
137 
142  const QList<KTextEditor::Document*> &documents ();
143 
147  public:
152  const KAboutData* aboutData() const { return &m_aboutData; }
153 
157  public:
162  void readConfig (KConfig *config = 0);
163 
168  void writeConfig (KConfig *config = 0);
169 
174  bool configDialogSupported () const;
175 
181  void configDialog (QWidget *parent);
182 
189  int configPages () const;
190 
196  KTextEditor::ConfigPage *configPage (int number, QWidget *parent);
197 
198  QString configPageName (int number) const;
199 
200  QString configPageFullName (int number) const;
201 
202  KIcon configPageIcon (int number) const;
203 
207  public:
212  static KateGlobal *self ();
213 
217  static void incRef () { ++s_ref; }
218 
222  static void decRef () { if (s_ref > 0) --s_ref; if (s_ref == 0) { delete s_self; s_self = 0L; } }
223 
228  static QString katePartVersion();
229 
234  const KComponentData &componentData() { return m_componentData; }
235 
241  void registerDocument ( KateDocument *doc );
242 
247  void deregisterDocument ( KateDocument *doc );
248 
254  void registerView ( KateView *view );
255 
260  void deregisterView ( KateView *view );
261 
266  QList<KateDocument*> &kateDocuments () { return m_documents; }
267 
272  QList<KateView*> &views () { return m_views; }
273 
278  KatePartPluginManager *pluginManager () { return m_pluginManager; }
279 
284  KDirWatch *dirWatch () { return m_dirWatch; }
285 
291  KateModeManager *modeManager () { return m_modeManager; }
292 
297  KateSchemaManager *schemaManager () { return m_schemaManager; }
298 
303  KateDocumentConfig *documentConfig () { return m_documentConfig; }
304 
309  KateViewConfig *viewConfig () { return m_viewConfig; }
310 
315  KateRendererConfig *rendererConfig () { return m_rendererConfig; }
316 
320  KateScriptManager *scriptManager () { return m_scriptManager; }
321 
326  KateHlManager *hlManager () { return m_hlManager; }
327 
332  KateCmd *cmdManager () { return m_cmdManager; }
333 
338  KateViGlobal *viInputModeGlobal () { return m_viInputModeGlobal; }
339 
344  KateSpellCheckManager *spellCheckManager () { return m_spellCheckManager; }
345 
350  KateWordCompletionModel *wordCompletionModel () { return m_wordCompletionModel; }
351 
358  KateSnippetGlobal *snippetGlobal();
359 
366  bool registerCommand (KTextEditor::Command *cmd);
367 
374  bool unregisterCommand (KTextEditor::Command *cmd);
375 
381  KTextEditor::Command *queryCommand (const QString &cmd) const;
382 
387  QList<KTextEditor::Command*> commands() const;
388 
393  QStringList commandList() const;
394 
395 
400  QObject * container();
401 
405  void setContainer( QObject * container );
406 
410  KTextEditor::TemplateScript* registerTemplateScript (QObject* owner, const QString& script);
411  void unregisterTemplateScript(KTextEditor::TemplateScript* templateScript);
412 
417  void copyToClipboard (const QString &text);
418 
423  const QStringList &clipboardHistory () const
424  {
425  return m_clipboardHistory;
426  }
427 
428  Q_SIGNALS:
432  void clipboardHistoryChanged ();
433 
434  private Q_SLOTS:
435  void updateColorPalette();
436 
437  private:
441  static KateGlobal *s_self;
442 
446  static int s_ref;
447 
451  KAboutData m_aboutData;
452 
456  KComponentData m_componentData;
457 
461  QList<KateDocument*> m_documents;
462 
466  QList<KateView*> m_views;
467 
471  KDirWatch *m_dirWatch;
472 
476  KateModeManager *m_modeManager;
477 
481  KateSchemaManager *m_schemaManager;
482 
486  KatePartPluginManager *m_pluginManager;
487 
491  KateGlobalConfig *m_globalConfig;
492 
496  KateDocumentConfig *m_documentConfig;
497 
501  KateViewConfig *m_viewConfig;
502 
506  KateRendererConfig *m_rendererConfig;
507 
511  QList<KTextEditor::Command *> m_cmds;
512 
516  KateScriptManager *m_scriptManager;
517 
521  KateHlManager *m_hlManager;
522 
526  KateCmd *m_cmdManager;
527 
531  KateViGlobal *m_viInputModeGlobal;
532 
536  KateSpellCheckManager *m_spellCheckManager;
537 
538  QList<KTextEditor::Document*> m_docs;
539 
543  QPointer<QObject> m_container;
544 
548  KateWordCompletionModel *m_wordCompletionModel;
549 
553  KateSnippetGlobal *m_snippetGlobal;
554 
558  KSharedConfig::Ptr m_sessionConfig;
559 
563  QStringList m_clipboardHistory;
564 };
565 
566 #endif
567 
568 // 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
KSharedPtr< KSharedConfig >
KateGlobal::spellCheckManager
KateSpellCheckManager * spellCheckManager()
spell check manager
Definition: kateglobal.h:344
KTextEditor::TemplateScript
KateGlobal::modeManager
KateModeManager * modeManager()
global mode manager used to manage the modes centrally
Definition: kateglobal.h:291
KSharedConfig
KateGlobal::kateDocuments
QList< KateDocument * > & kateDocuments()
return a list of all registered docs
Definition: kateglobal.h:266
KateGlobal::wordCompletionModel
KateWordCompletionModel * wordCompletionModel()
global instance of the simple word completion mode
Definition: kateglobal.h:350
KateHlManager
Definition: katesyntaxmanager.h:48
KateGlobal::documentConfig
KateDocumentConfig * documentConfig()
fallback document config
Definition: kateglobal.h:303
KateGlobal::decRef
static void decRef()
decrement reference counter
Definition: kateglobal.h:222
QWidget
KateGlobal::aboutData
const KAboutData * aboutData() const
General Information about this editor.
Definition: kateglobal.h:152
Command
Command
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:284
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:234
QString
KateModeManager
Definition: katemodemanager.h:66
QObject
KateGlobal::clipboardHistory
const QStringList & clipboardHistory() const
Clipboard history, filled with text we ever copied to clipboard via copyToClipboard.
Definition: kateglobal.h:423
editor.h
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:217
KateGlobalConfig
Definition: kateconfig.h:93
commandinterface.h
KTextEditor::Document
katepartprivate_export.h
QStringList
KateGlobal::setSessionConfig
void setSessionConfig(KSharedConfig::Ptr sessionConfig)
Set session config.
Definition: kateglobal.h:111
templateinterface2.h
KIcon
KAboutData
KateGlobal::views
QList< KateView * > & views()
return a list of all registered views
Definition: kateglobal.h:272
KateSpellCheckManager
Definition: spellcheck.h:36
KateGlobal::pluginManager
KatePartPluginManager * pluginManager()
global plugin manager
Definition: kateglobal.h:278
kservice.h
KateView
Definition: kateview.h:78
KateSchemaManager
Definition: kateschema.h:47
KTextEditor::Command
KateGlobal::dirWatch
KDirWatch * dirWatch()
global dirwatch
Definition: kateglobal.h:284
KateGlobal::hlManager
KateHlManager * hlManager()
hl manager
Definition: kateglobal.h:326
KateDocument
Definition: katedocument.h:74
KateGlobal::schemaManager
KateSchemaManager * schemaManager()
manager for the katepart schemas
Definition: kateglobal.h:297
KateSnippetGlobal
This is the main class of KDevelop's snippet plugin.
Definition: katesnippetglobal.h:39
KateViGlobal
Definition: kateviglobal.h:46
containerinterface.h
KateGlobal::viInputModeGlobal
KateViGlobal * viInputModeGlobal()
vi input mode global
Definition: kateglobal.h:338
KConfig
KTextEditor::CommandInterface
KateRendererConfig
Definition: kateconfig.h:591
KTextEditor::TemplateScriptRegistrar
KateGlobal::viewConfig
KateViewConfig * viewConfig()
fallback view config
Definition: kateglobal.h:309
KTextEditor::ContainerInterface
KatePartPluginManager
Definition: katepartpluginmanager.h:56
KTextEditor::ConfigPage
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:70
KateDocumentConfig
Definition: kateconfig.h:145
KateCmd
Definition: katecmd.h:33
KateDocumentConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:338
KateViewConfig
Definition: kateconfig.h:381
KDirWatch
kaboutdata.h
KateGlobal::rendererConfig
KateRendererConfig * rendererConfig()
fallback renderer config
Definition: kateglobal.h:315
KateGlobal::cmdManager
KateCmd * cmdManager()
command manager
Definition: kateglobal.h:332
kcomponentdata.h
KComponentData
QList< KTextEditor::Document * >
KateGlobal::scriptManager
KateScriptManager * scriptManager()
Global script collection.
Definition: kateglobal.h:320
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 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
  • Applications
  •   Libraries
  •     libkonq
  • 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