File indexing completed on 2024-05-12 16:35:53
0001 /* This file is part of the KDE project 0002 Copyright 2006 Stefan Nikolaus <stefan.nikolaus@kdemail.net> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef CALLIGRA_SHEETS_TABLE_TOOL 0021 #define CALLIGRA_SHEETS_TABLE_TOOL 0022 0023 #include "CellToolBase.h" 0024 0025 0026 namespace Calligra 0027 { 0028 namespace Sheets 0029 { 0030 0031 class TableTool : public CellToolBase 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 explicit TableTool(KoCanvasBase* canvas); 0037 ~TableTool(); 0038 0039 virtual void repaintDecorations(); 0040 0041 virtual Selection* selection(); 0042 0043 public Q_SLOTS: 0044 virtual void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes); 0045 virtual void deactivate(); 0046 0047 protected: 0048 virtual QPointF offset() const; 0049 virtual QSizeF size() const; 0050 virtual QPointF canvasOffset() const; 0051 virtual int maxCol() const; 0052 virtual int maxRow() const; 0053 virtual SheetView* sheetView(const Sheet* sheet) const; 0054 0055 private Q_SLOTS: 0056 void changeColumns(int num); 0057 void changeRows(int num); 0058 void sheetActivated(const QString& sheetName); 0059 void sheetsBtnClicked(); 0060 void importDocument(); 0061 void exportDocument(); 0062 0063 private: 0064 void updateSheetsList(); 0065 virtual QList<QPointer<QWidget> > createOptionWidgets(); 0066 0067 private: 0068 Q_DISABLE_COPY(TableTool) 0069 0070 class Private; 0071 Private * const d; 0072 }; 0073 0074 } // namespace Sheets 0075 } // namespace Calligra 0076 0077 #endif // CALLIGRA_SHEETS_TABLE_TOOL