• 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
katecmd.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  *
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 as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
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_CMD_H
22 #define _KATE_CMD_H
23 
24 #include "katepartprivate_export.h"
25 
26 #include <ktexteditor/commandinterface.h>
27 
28 #include <kcompletion.h>
29 
30 #include <QtCore/QHash>
31 #include <QtCore/QStringList>
32 
33 class KATEPART_TESTS_EXPORT KateCmd
34 {
35  public:
36  KateCmd ();
37  ~KateCmd ();
38 
39  static KateCmd *self ();
40 
41  bool registerCommand (KTextEditor::Command *cmd);
42  bool unregisterCommand (KTextEditor::Command *cmd);
43  KTextEditor::Command *queryCommand (const QString &cmd) const;
44  QList<KTextEditor::Command*> commands() const;
45  QStringList commandList() const;
46 
47  QStringList cmds ();
48  void appendHistory( const QString &cmd );
49  const QString fromHistory( int i ) const;
50  uint historyLength() const { return m_history.count(); }
51 
52  KCompletion* commandCompletionObject();
53 
54  private:
55  QHash<QString, KTextEditor::Command *> m_dict;
56  QStringList m_cmds;
57  QStringList m_history;
58  KCompletion m_cmdCompletion; // shared completion object for all KateCmdLineEdits in each KTE::View
59 };
60 
67 class KateCmdShellCompletion : public KCompletion
68 {
69  public:
70  KateCmdShellCompletion();
71 
78  QString makeCompletion(const QString &text);
79 
80  protected:
81  // Called by KCompletion
82  void postProcessMatch( QString *match ) const;
83  void postProcessMatches( QStringList *matches ) const;
84  void postProcessMatches( KCompletionMatches *matches ) const;
85 
86  private:
93  void splitText( const QString &text, QString &text_start, QString &text_compl ) const;
94 
95  QChar m_word_break_char;
96  QChar m_quote_char1;
97  QChar m_quote_char2;
98  QChar m_escape_char;
99 
100  QString m_text_start;
101  QString m_text_compl;
102 
103 };
104 
105 #endif
106 
107 // kate: space-indent on; indent-width 2; replace-tabs on;
KateCmd::historyLength
uint historyLength() const
Definition: katecmd.h:50
KateCmdShellCompletion::postProcessMatches
void postProcessMatches(QStringList *matches) const
Definition: katecmd.cpp:177
QChar
KateCmdShellCompletion::makeCompletion
QString makeCompletion(const QString &text)
Finds completions to the given text.
Definition: katecmd.cpp:158
KATEPART_TESTS_EXPORT
#define KATEPART_TESTS_EXPORT
Definition: katepartprivate_export.h:36
KateCmdShellCompletion::postProcessMatch
void postProcessMatch(QString *match) const
Definition: katecmd.cpp:169
QHash< QString, KTextEditor::Command * >
katepartprivate_export.h
QString
QList< KTextEditor::Command * >
QStringList
KateCmd
Definition: katecmd.h:33
KateCmdShellCompletion
A KCompletion object that completes last ?unquoted? word in the string passed.
Definition: katecmd.h:67
KateCmdShellCompletion::KateCmdShellCompletion
KateCmdShellCompletion()
Definition: katecmd.cpp:149
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:57 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