File indexing completed on 2024-05-12 16:36:02

0001 /* This file is part of the KDE project
0002    Copyright 1999-2006 The KSpread Team <calligra-devel@kde.org>
0003    Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@kde.org>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018    Boston, MA 02110-1301, USA.
0019 */
0020 #ifndef CALLIGRA_SHEETS_CELLEDITORBASE_H
0021 #define CALLIGRA_SHEETS_CELLEDITORBASE_H
0022 
0023 #include "sheets_common_export.h"
0024 
0025 class QFont;
0026 class KoViewConverter;
0027 class QString;
0028 class QWidget;
0029 
0030 namespace Calligra
0031 {
0032 namespace Sheets
0033 {
0034 
0035 class CALLIGRA_SHEETS_COMMON_EXPORT CellEditorBase
0036 {
0037 public:
0038     CellEditorBase();
0039     virtual ~CellEditorBase();
0040     virtual QWidget* widget() = 0;
0041     virtual void selectionChanged() = 0;
0042     virtual void setEditorFont(QFont const & font, bool updateSize, const KoViewConverter *viewConverter) = 0;
0043     virtual void setText(const QString& text, int cursorPos = -1) = 0;
0044     virtual QString toPlainText() const = 0;
0045     virtual void setCursorPosition(int pos) = 0;
0046     virtual int cursorPosition() const = 0;
0047     virtual void cut() = 0;
0048     virtual void copy() = 0;
0049     virtual void paste() = 0;
0050     virtual void setActiveSubRegion(int index) = 0;
0051     virtual bool captureArrowKeys() const = 0;
0052     virtual void setCaptureArrowKeys(bool capture) = 0;
0053 };
0054 
0055 } // namespace Sheets
0056 } // namespace Calligra
0057 
0058 #endif // CALLIGRA_SHEETS_CELLEDITORBASE_H