KTextEditor

texthintinterface.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later
2 
3  Copyright (C) 2001 Joseph Wenninger <[email protected]>
4  Copyright (C) 2013-2014 Dominik Haumann <[email protected]>
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 KTEXTEDITOR_TEXTHINTINTERFACE_H
23 #define KTEXTEDITOR_TEXTHINTINTERFACE_H
24 
25 #include <QString>
26 
27 #include <ktexteditor_export.h>
28 
29 #include <ktexteditor/cursor.h>
30 
31 namespace KTextEditor
32 {
33 class TextHintProvider;
34 class View;
35 
81 class KTEXTEDITOR_EXPORT TextHintInterface
82 {
83 public:
85  virtual ~TextHintInterface();
86 
97  virtual void registerTextHintProvider(KTextEditor::TextHintProvider *provider) = 0;
98 
105  virtual void unregisterTextHintProvider(KTextEditor::TextHintProvider *provider) = 0;
106 
119  virtual void setTextHintDelay(int delay) = 0;
120 
126  virtual int textHintDelay() const = 0;
127 
128 private:
129  class TextHintInterfacePrivate *const d = nullptr;
130 };
131 
151 class KTEXTEDITOR_EXPORT TextHintProvider
152 {
153 public:
158 
162  virtual ~TextHintProvider();
163 
177  virtual QString textHint(KTextEditor::View *view, const KTextEditor::Cursor &position) = 0;
178 
179 private:
180  class TextHintProviderPrivate *const d = nullptr;
181 };
182 
183 }
184 
185 Q_DECLARE_INTERFACE(KTextEditor::TextHintInterface, "org.kde.KTextEditor.TextHintInterface")
186 
187 #endif
The Cursor represents a position in a Document.
Definition: cursor.h:85
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Text hint interface showing tool tips under the mouse for the View.
Class to provide text hints for a View.
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:155
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 22:55:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.