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

cantor/src/lib

  • sources
  • kde-4.14
  • kdeedu
  • cantor
  • src
  • lib
completionobject.h
Go to the documentation of this file.
1 /*
2  This program is free software; you can redistribute it and/or
3  modify it under the terms of the GNU General Public License
4  as published by the Free Software Foundation; either version 2
5  of the License, or (at your option) any later version.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin Street, Fifth Floor,
15  Boston, MA 02110-1301, USA.
16 
17  ---
18  Copyright (C) 2009 Alexander Rieder <alexanderrieder@gmail.com>
19  */
20 
21 #ifndef _COMPLETIONOBJECT_H
22 #define _COMPLETIONOBJECT_H
23 
24 #include <kcompletion.h>
25 
26 #include "cantor_export.h"
27 
28 namespace Cantor
29 {
30 class CompletionObjectPrivate;
31 class Session;
32 
41 class CANTOR_EXPORT CompletionObject : public KCompletion
42 {
43  Q_OBJECT
44  public:
49  CompletionObject(Session* parent);
51  ~CompletionObject();
52 
53  enum LineCompletionMode {
54  PreliminaryCompletion,
55  FinalCompletion
56  };
57 
62  QStringList completions() const;
67  QString completion() const;
72  QString command() const;
77  Session* session() const;
78 
86  void setLine(const QString& line, int index);
94  void updateLine(const QString& line, int index);
103  void completeLine(const QString& comp, LineCompletionMode mode);
104 
105  protected:
106 
107  enum IdentifierType {
108  VariableType,
109  FunctionWithArguments,
110  FunctionType = FunctionWithArguments,
111  FunctionWithoutArguments,
112  KeywordType,
113  UnknownType
114  };
119  QString identifier() const;
120 
125  void setCompletions(const QStringList& completions);
130  void setCommand(const QString& cmd);
136  virtual int locateIdentifier(const QString& cmd, int index) const;
141  virtual bool mayIdentifierContain(QChar c) const;
146  virtual bool mayIdentifierBeginWith(QChar c) const;
152  void completeFunctionLine(IdentifierType type = FunctionWithArguments);
157  void completeKeywordLine();
162  void completeVariableLine();
167  void completeUnknownLine();
168  protected Q_SLOTS:
174  virtual void fetchCompletions() = 0;
179  virtual void fetchIdentifierType();
184  void findCompletion();
189  void completeLineWithType(IdentifierType type);
194  void handleParenCompletionWithType(IdentifierType type);
195  Q_SIGNALS:
199  void fetchingDone();
205  void fetchingTypeDone(IdentifierType type);
210  void done();
217  void lineDone(QString line, int index);
218  private:
219  CompletionObjectPrivate* d;
220 };
221 
222 }
223 
224 #endif /* _COMPLETIONOBJECT_H */
Cantor::CompletionObject::FunctionWithoutArguments
a function that takes no arguments
Definition: completionobject.h:111
Cantor::CompletionObject
This Object is used to provide a Tab Completion, in an asynchroneous way.
Definition: completionobject.h:41
CANTOR_EXPORT
#define CANTOR_EXPORT
Definition: cantor_export.h:33
Cantor::CompletionObject::KeywordType
a keyword
Definition: completionobject.h:112
QChar
Cantor::CompletionObject::IdentifierType
IdentifierType
Definition: completionobject.h:107
Cantor::CompletionObject::VariableType
a variable
Definition: completionobject.h:108
Cantor::CompletionObject::PreliminaryCompletion
Only insert the completion.
Definition: completionobject.h:54
KCompletion
Cantor::CompletionObject::LineCompletionMode
LineCompletionMode
Definition: completionobject.h:53
QString
QStringList
Cantor::CompletionObject::FunctionWithArguments
a function that takes arguments
Definition: completionobject.h:109
cantor_export.h
Cantor::Session
The Session object is the main class used to interact with a Backend.
Definition: session.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

cantor/src/lib

Skip menu "cantor/src/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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