1 /* This file is part of the KDE project
2    Copyright 1999-2006 The KSpread Team <calligra-devel@kde.org>
3    Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@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 #ifndef CALLIGRA_SHEETS_CELLEDITORBASE_H
21 #define CALLIGRA_SHEETS_CELLEDITORBASE_H
22 
23 #include "sheets_common_export.h"
24 
25 class QFont;
26 class KoViewConverter;
27 class QString;
28 class QWidget;
29 
30 namespace Calligra
31 {
32 namespace Sheets
33 {
34 
35 class CALLIGRA_SHEETS_COMMON_EXPORT CellEditorBase
36 {
37 public:
38     CellEditorBase();
39     virtual ~CellEditorBase();
40     virtual QWidget* widget() = 0;
41     virtual void selectionChanged() = 0;
42     virtual void setEditorFont(QFont const & font, bool updateSize, const KoViewConverter *viewConverter) = 0;
43     virtual void setText(const QString& text, int cursorPos = -1) = 0;
44     virtual QString toPlainText() const = 0;
45     virtual void setCursorPosition(int pos) = 0;
46     virtual int cursorPosition() const = 0;
47     virtual void cut() = 0;
48     virtual void copy() = 0;
49     virtual void paste() = 0;
50     virtual void setActiveSubRegion(int index) = 0;
51     virtual bool captureArrowKeys() const = 0;
52     virtual void setCaptureArrowKeys(bool capture) = 0;
53 };
54 
55 } // namespace Sheets
56 } // namespace Calligra
57 
58 #endif // CALLIGRA_SHEETS_CELLEDITORBASE_H
59