KCompletion

kcompletionbase.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999, 2000 Carsten Pfeiffer <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KCOMPLETIONBASE_H
9 #define KCOMPLETIONBASE_H
10 
11 #include <kcompletion.h>
12 #include <kcompletion_export.h>
13 
14 #include <QMap>
15 
16 class KCompletionBasePrivate;
17 
35 class KCOMPLETION_EXPORT KCompletionBase
36 {
37 public:
38  Q_DECLARE_PRIVATE(KCompletionBase)
60  SubstringCompletion
61  };
62 
63  // Map for the key binding types mentioned above.
65 
70 
74  virtual ~KCompletionBase();
75 
91  KCompletion *completionObject(bool handleSignals = true);
92 
109  virtual void setCompletionObject(KCompletion *completionObject, bool handleSignals = true);
110 
123  virtual void setHandleSignals(bool handle);
124 
135  bool isCompletionObjectAutoDeleted() const;
136 
146  void setAutoDeleteCompletionObject(bool autoDelete);
147 
168  void setEnableSignals(bool enable);
169 
175  bool handleSignals() const;
176 
182  bool emitSignals() const;
183 
189  void setEmitSignals(bool emitRotationSignals);
190 
197  virtual void setCompletionMode(KCompletion::CompletionMode mode);
198 
204  KCompletion::CompletionMode completionMode() const;
205 
235  bool setKeyBinding(KeyBindingType item, const QList<QKeySequence> &key);
236 
250  QList<QKeySequence> keyBinding(KeyBindingType item) const;
251 
252 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 0)
253 
256  KCOMPLETION_DEPRECATED_VERSION(5, 0, "Use KCompletionBase::keyBinding(KeyBindingType)")
257  QList<QKeySequence> getKeyBinding(KeyBindingType item) const
258  {
259  return keyBinding(item);
260  }
261 #endif
262 
274  void useGlobalKeyBindings();
275 
290  virtual void setCompletedText(const QString &text) = 0;
291 
299  virtual void setCompletedItems(const QStringList &items, bool autoSuggest = true) = 0;
300 
312  KCompletion *compObj() const;
313 
314 protected:
324  KeyBindingMap keyBindingMap() const;
325 
326 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 0)
327 
330  KCOMPLETION_DEPRECATED_VERSION(5, 0, "Use KCompletionBase::keyBindingMap()")
331  KeyBindingMap getKeyBindings() const
332  {
333  return keyBindingMap();
334  }
335 #endif
336 
342  void setKeyBindingMap(KeyBindingMap keyBindingMap);
343 
349  void setDelegate(KCompletionBase *delegate);
350 
356  KCompletionBase *delegate() const;
357 
361  virtual void virtual_hook(int id, void *data);
362 
363 private:
364  Q_DISABLE_COPY(KCompletionBase)
366 };
367 
368 #endif // KCOMPLETIONBASE_H
Switch to next completion (by default Ctrl-Down).
Text completion (by default Ctrl-E).
Switch to previous completion (by default Ctrl-Up).
CompletionMode
This enum describes the completion mode used for by the KCompletion class.
Definition: kcompletion.h:129
A generic class for completing QStrings.
Definition: kcompletion.h:115
An abstract base class for adding a completion feature into widgets.
KeyBindingType
Constants that represent the items whose shortcut key binding is programmable.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 4 2020 22:51:13 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.