File indexing completed on 2024-04-28 16:21:30

0001 /* This file is part of the KDE project
0002    Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@kde.org>
0003    Copyright 2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
0004    Copyright 1998,1999 Torben Weis <weis@kde.org>
0005    Copyright 1999-2007 The KSpread Team <calligra-devel@kde.org>
0006 
0007    This library is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU Library General Public
0009    License as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This library is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015    Library General Public License for more details.
0016 
0017    You should have received a copy of the GNU Library General Public License
0018    along with this library; see the file COPYING.LIB.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020    Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #ifndef CALLIGRA_SHEETS_SHEET
0024 #define CALLIGRA_SHEETS_SHEET
0025 
0026 #include <QClipboard>
0027 #include <QHash>
0028 #include <QList>
0029 #include <QRect>
0030 
0031 #include <KoDocument.h>
0032 #include <KoShapeBasedDocumentBase.h>
0033 #include <KoShapeUserData.h>
0034 
0035 #include "Cell.h"
0036 #include "Style.h"
0037 #include "Global.h"
0038 #include "ProtectableObject.h"
0039 #include "calligra_sheets_limits.h"
0040 
0041 class QAbstractItemModel;
0042 class QDomElement;
0043 
0044 class KoShape;
0045 
0046 namespace Calligra
0047 {
0048 namespace Sheets
0049 {
0050 class Cell;
0051 class CellStorage;
0052 class ColumnFormat;
0053 class CommentStorage;
0054 class ConditionsStorage;
0055 class FormulaStorage;
0056 class DocBase;
0057 class FusionStorage;
0058 class LinkStorage;
0059 class HeaderFooter;
0060 class Map;
0061 class PrintSettings;
0062 class Region;
0063 class RowFormat;
0064 class RowFormatStorage;
0065 class Sheet;
0066 class SheetPrint;
0067 class Style;
0068 class StyleStorage;
0069 class Validity;
0070 class ValidityStorage;
0071 class ValueStorage;
0072 class View;
0073 class SheetTest;
0074 
0075 /**
0076  * A sheet contains several cells.
0077  */
0078 class CALLIGRA_SHEETS_ODF_EXPORT Sheet : public KoShapeUserData, public KoShapeBasedDocumentBase,
0079         public ProtectableObject
0080 {
0081     Q_OBJECT
0082     Q_PROPERTY(QString sheetName READ sheetName)
0083     Q_PROPERTY(bool autoCalc READ isAutoCalculationEnabled WRITE setAutoCalculationEnabled)
0084     Q_PROPERTY(bool showGrid READ getShowGrid WRITE setShowGrid)
0085 
0086 public:
0087     enum ChangeRef       { ColumnInsert, ColumnRemove, RowInsert, RowRemove };
0088     enum TestType        { Text, Validity, Comment, ConditionalCellAttribute };
0089 
0090     /**
0091      * Creates a sheet in \p map with the name \p sheetName.
0092      */
0093     Sheet(Map* map, const QString& sheetName);
0094 
0095     /**
0096      * Copy constructor.
0097      * Creates a sheet with the contents and the settings of \p other.
0098      */
0099     Sheet(const Sheet& other);
0100 
0101     /**
0102      * Destructor.
0103      */
0104     ~Sheet() override;
0105 
0106     /**
0107      * \return a model for this sheet
0108      */
0109     QAbstractItemModel *model() const;
0110 
0111     /**
0112      * \return the map this sheet belongs to
0113      */
0114     Map* map() const;
0115 
0116     /**
0117      * \return the document this sheet belongs to
0118      */
0119     DocBase* doc() const;
0120 
0121     // KoShapeBasedDocumentBase interface
0122     void addShape(KoShape* shape) override;
0123     void removeShape(KoShape* shape) override;
0124     KoDocumentResourceManager* resourceManager() const override;
0125 
0126     /**
0127      * Deletes all shapes without emitting shapeRemoved()
0128      */
0129     void deleteShapes();
0130 
0131     /**
0132      * \ingroup Embedding
0133      * Returns the sheet's shapes.
0134      * \return the shapes this sheet contains
0135      */
0136     QList<KoShape*> shapes() const;
0137 
0138     //////////////////////////////////////////////////////////////////////////
0139     //
0140     //BEGIN Methods related to sheet properties
0141     //
0142 
0143     /**
0144      * \return the name of this sheet
0145      */
0146     QString sheetName() const;
0147 
0148     /**
0149      * Renames a sheet. This will automatically adapt all formulas
0150      * in all sheets and all cells to reflect the new name.
0151      *
0152      * If the name really changed then sig_nameChanged is emitted
0153      * and the GUI will reflect the change.
0154      *
0155      * @param name The new sheet name.
0156      * @param init If set to true then no formula will be changed and no signal
0157      *             will be emitted and no undo action created. Usually you do not
0158      *             want to do that.
0159      *
0160      * @return @c true if the sheet was renamed successfully
0161      * @return @c false if the sheet could not be renamed. Usually the reason is
0162      * that this name is already used.
0163      *
0164      * @see changeCellTabName
0165      * @see TabBar::renameTab
0166      * @see sheetName
0167      */
0168     bool setSheetName(const QString& name, bool init = false);
0169 
0170     /**
0171      * \return \c true , if a document is currently loading
0172      */
0173     bool isLoading();
0174 
0175     /**
0176      * Returns the layout direction of the sheet.
0177      */
0178     Qt::LayoutDirection layoutDirection() const;
0179 
0180     /**
0181      * Sets the layout direction of the sheet. For example, for Arabic or Hebrew
0182      * documents, it is possibly to layout the sheet from right to left.
0183      */
0184     void setLayoutDirection(Qt::LayoutDirection dir);
0185 
0186     /**
0187      * Returns, if the grid shall be shown on the screen
0188      */
0189     bool getShowGrid() const;
0190 
0191     /**
0192      * Sets, if the grid shall be shown on the screen
0193      */
0194     void setShowGrid(bool _showGrid);
0195 
0196     /**
0197      * Sets, if formula shall be shown instead of the result
0198      */
0199     bool getShowFormula() const;
0200 
0201     void setShowFormula(bool _showFormula);
0202 
0203     /**
0204      * Sets, if indicator must be shown when the cell holds a formula
0205      */
0206     bool getShowFormulaIndicator() const;
0207 
0208     void setShowFormulaIndicator(bool _showFormulaIndicator);
0209 
0210     /**
0211      * Returns true if comment indicator is visible.
0212      */
0213     bool getShowCommentIndicator() const;
0214 
0215     /**
0216      * If b is true, comment indicator is visible, otherwise
0217      * it will be hidden.
0218      */
0219     void setShowCommentIndicator(bool b);
0220 
0221     bool getLcMode() const;
0222 
0223     void setLcMode(bool _lcMode);
0224 
0225     bool isAutoCalculationEnabled() const;
0226 
0227     void setAutoCalculationEnabled(bool enable);
0228 
0229     bool getShowColumnNumber() const;
0230 
0231     void setShowColumnNumber(bool _showColumnNumber);
0232 
0233     bool getHideZero() const;
0234 
0235     void setHideZero(bool _hideZero);
0236 
0237     bool getFirstLetterUpper() const;
0238 
0239     void setFirstLetterUpper(bool _firstUpper);
0240 
0241     /**
0242      * @return true if this sheet is hidden
0243      */
0244     bool isHidden()const;
0245 
0246     /**
0247      * Hides or shows this sheets
0248      */
0249     void setHidden(bool hidden);
0250 
0251     /**
0252      * @return a flag that indicates whether the sheet should paint the page breaks.
0253      *
0254      * @see setShowPageOutline
0255      * @see Sheet::Private::showPageOutline
0256      */
0257     bool isShowPageOutline() const;
0258 
0259     /**
0260      * Turns the page break lines on or off.
0261      *
0262      * @see isShowPageOutline
0263      * @see Sheet::Private::showPageOutline
0264      */
0265     void setShowPageOutline(bool _b);
0266 
0267     struct BackgroundImageProperties {
0268         BackgroundImageProperties()
0269         : repeat(Repeat)
0270         , opacity(1.0)
0271         , horizontalPosition(HorizontalCenter)
0272         , verticalPosition(VerticalCenter)
0273         {}
0274 
0275         enum Repetition {
0276             NoRepeat,
0277             Repeat,
0278             Stretch
0279         };
0280         Repetition repeat;
0281 
0282         float opacity;
0283 
0284         enum HorizontalPosition {
0285             Left,
0286             HorizontalCenter,
0287             Right
0288         };
0289         HorizontalPosition horizontalPosition;
0290 
0291         enum VerticalPosition {
0292             Top,
0293             VerticalCenter,
0294             Bottom
0295         };
0296         VerticalPosition verticalPosition;
0297 
0298         //TODO filterName
0299     };
0300 
0301     /**
0302      * Set background image for this sheet
0303      */
0304     void setBackgroundImage( const QImage& image );
0305 
0306     /**
0307      * @return The QImage used as the background picture for this sheet
0308      */
0309     QImage backgroundImage() const;
0310 
0311     void setBackgroundImageProperties( const BackgroundImageProperties& properties );
0312 
0313     BackgroundImageProperties backgroundImageProperties() const;
0314 
0315     //
0316     //END Methods related to sheet properties
0317     //
0318     //////////////////////////////////////////////////////////////////////////
0319     //
0320     //BEGIN Methods related to old KSpread file format
0321     //
0322 
0323     /**
0324      * \ingroup NativeFormat
0325      * Saves the sheet and all it's children in XML format
0326      */
0327     QDomElement saveXML(QDomDocument&);
0328 
0329     /**
0330      * \ingroup NativeFormat
0331      * Loads the sheet and all it's children in XML format
0332      */
0333     bool loadXML(const KoXmlElement&);
0334 
0335     /**
0336      * \ingroup NativeFormat
0337      * Loads a children
0338      */
0339     bool loadChildren(KoStore* _store);
0340 
0341     //
0342     //END Methods related to old KSpread file format
0343     //
0344     //////////////////////////////////////////////////////////////////////////
0345     //
0346     //BEGIN Methods related to row formats
0347     //
0348 
0349     /**
0350      * \ingroup ColumnRowFormat
0351      * \return the row format storage for this sheet.
0352      */
0353     const RowFormatStorage* rowFormats() const;
0354     RowFormatStorage* rowFormats();
0355 
0356     //
0357     //END Methods related to row formats
0358     //
0359     //////////////////////////////////////////////////////////////////////////
0360     //
0361     //BEGIN Methods related to column formats
0362     //
0363 
0364     /**
0365      * \ingroup ColumnRowFormat
0366      * \return the column format of column \p _column . The default column format,
0367      * if no special one exists.
0368      */
0369     const ColumnFormat* columnFormat(int _column) const;
0370 
0371     /**
0372      * \ingroup ColumnRowFormat
0373      * If no special ColumnFormat exists for this column, then a new one is created.
0374      *
0375      * @return a non default ColumnFormat for this column.
0376      */
0377     ColumnFormat* nonDefaultColumnFormat(int _column, bool force_creation = true);
0378 
0379     /**
0380      * \ingroup ColumnRowFormat
0381      * \return the first non-default row format
0382      */
0383     ColumnFormat* firstCol() const;
0384     ColumnFormat *nextColumn(int col) const;
0385 
0386     /**
0387      * \ingroup ColumnRowFormat
0388      */
0389     void setDefaultWidth(double width);
0390 
0391     //
0392     //END Methods related to column formats
0393     //
0394     //////////////////////////////////////////////////////////////////////////
0395     //
0396     //BEGIN Methods for Storage access
0397     //
0398 
0399     /**
0400      * \ingroup Storage
0401      * \return the cell storage
0402      */
0403     CellStorage* cellStorage() const;
0404 
0405     const CommentStorage* commentStorage() const;
0406     const ConditionsStorage* conditionsStorage() const;
0407     const FormulaStorage* formulaStorage() const;
0408     const FusionStorage* fusionStorage() const;
0409     const LinkStorage* linkStorage() const;
0410     const StyleStorage* styleStorage() const;
0411     const ValidityStorage* validityStorage() const;
0412     const ValueStorage* valueStorage() const;
0413 
0414     /**
0415      * \ingroup Storage
0416      * Determines the used area, i.e. the area spanning from A1 to the maximum
0417      * occupied column and row.
0418      * \return the used area
0419      */
0420     QRect usedArea(bool onlyContent = false) const;
0421 
0422     //
0423     //END Methods for Storage access
0424     //
0425     //////////////////////////////////////////////////////////////////////////
0426     //
0427     //BEGIN UNSORTED METHODS !!!
0428     //
0429 
0430     /**
0431      * \ingroup Coordinates
0432      * Determines the row for a given position \p _ypos . If the position is
0433      * on the border between two cells, the upper row is returned. Also, the offset
0434      * between the coordinate system root and the upper row border is determined.
0435      *
0436      * \param _ypos the position for which the row should be determined
0437      * \param _top the offset between the coordinate system root and the upper row border
0438      *
0439      * \return the row for the given position \p _ypos
0440      */
0441     int topRow(qreal _ypos, qreal &_top) const;
0442 
0443     /**
0444      * \ingroup Coordinates
0445      * Determines the row for a given position \p _ypos . If the position is
0446      * on the border between two cells, the lower row is returned.
0447      *
0448      * \param _ypos the position for which the row should be determined
0449      *
0450      * \return the row for the given position \p _ypos
0451      */
0452     int bottomRow(double _ypos) const;
0453 
0454     /**
0455      * \ingroup Coordinates
0456      * Determines the column for a given position \p _xpos . If the position is
0457      * on the border between two cells, the left column is returned. Also, the offset
0458      * between the coordinate system root and the left column border is determined.
0459      *
0460      * \param _xpos the position for which the column should be determined
0461      * \param _left the offset between the coordinate system root and the left column border
0462      *
0463      * \return the column for the given position \p _xpos
0464      */
0465     int leftColumn(qreal _xpos, qreal &_left) const;
0466 
0467     /**
0468      * \ingroup Coordinates
0469      * Determines the column for a given position \p _xpos . If the position is
0470      * on the border between two cells, the right column is returned.
0471      *
0472      * \param _xpos the position for which the column should be determined
0473      *
0474      * \return the column for the given position \p _xpos
0475      */
0476     int rightColumn(double _xpos) const;
0477 
0478     /**
0479      * \ingroup Coordinates
0480      * Calculates the region in document coordinates occupied by a range of cells.
0481      * \param cellRange the range of cells
0482      * \return the document area covered by the cells
0483      */
0484     QRectF cellCoordinatesToDocument(const QRect& cellRange) const;
0485 
0486     /**
0487      * \ingroup Coordinates
0488      * Calculates the cell range covering a document area.
0489      * \param area the document area
0490      * \return the cell range covering the area
0491      */
0492     QRect documentToCellCoordinates(const QRectF& area) const;
0493 
0494     /**
0495      * \ingroup Coordinates
0496      * @return the left corner of the column as double.
0497      * Use this method, when you later calculate other positions depending on this one
0498      * to avoid rounding problems
0499      * @param col the column's index
0500      */
0501     double columnPosition(int col) const;
0502 
0503     /**
0504      * \ingroup Coordinates
0505      * @return the top corner of the row as double.
0506      * Use this method, when you later calculate other positions depending on this one
0507      * to avoid rounding problems
0508      * @param _row the row's index
0509      */
0510     double rowPosition(int _row) const;
0511 
0512     /**
0513      * \ingroup Coordinates
0514      * \return the document size
0515      */
0516     QSizeF documentSize() const;
0517 
0518     /**
0519      * \ingroup Coordinates
0520      * Adjusts the internal reference of the sum of the widths of all columns.
0521      * Used in resizing of columns.
0522      */
0523     void adjustDocumentWidth(double deltaWidth);
0524 
0525     /**
0526      * \ingroup Coordinates
0527      * Adjusts the internal reference of the sum of the heights of all rows.
0528      * Used in resizing of rows.
0529      */
0530     void adjustDocumentHeight(double deltaHeight);
0531 
0532     /**
0533      * Adjusts the position of cell anchored shapes as a result of a column size change/insertion/removal.
0534      * All cell anchored shapes with x coordinates >= minX and < maxX will be moved by delta.
0535      */
0536     void adjustCellAnchoredShapesX(qreal minX, qreal maxX, qreal delta);
0537     void adjustCellAnchoredShapesX(qreal delta, int firstCol, int lastCol = KS_colMax);
0538 
0539     /**
0540      * Adjusts the position of cell anchored shapes as a result of a row size change/insertion/removal.
0541      * All cell anchored shapes with y coordinates >= minY and < maxY will be moved by delta.
0542      */
0543     void adjustCellAnchoredShapesY(qreal minY, qreal maxY, qreal delta);
0544     void adjustCellAnchoredShapesY(qreal delta, int firstRow, int lastRow = KS_rowMax);
0545 
0546     //
0547     //END UNSORTED METHODS
0548     //
0549     //////////////////////////////////////////////////////////////////////////
0550     //
0551     //BEGIN Methods related to manipulations of selected cells
0552     //
0553 
0554     /**
0555      * \ingroup Commands
0556      */
0557     bool areaIsEmpty(const Region& area, TestType _type = Text) ;
0558 
0559     //
0560     //END Methods related to manipulations of selected cells
0561     //
0562     //////////////////////////////////////////////////////////////////////////
0563     //
0564     //BEGIN Methods related to column/row operations
0565     //
0566 
0567     /**
0568      * \ingroup Commands
0569      * Helper method.
0570      * \see ShiftManipulator
0571      */
0572     void insertShiftRight(const QRect& rect);
0573 
0574     /**
0575      * \ingroup Commands
0576      * Helper method.
0577      * \see ShiftManipulator
0578      */
0579     void insertShiftDown(const QRect& rect);
0580 
0581     /**
0582      * \ingroup Commands
0583      * Helper method.
0584      * \see ShiftManipulator
0585      */
0586     void removeShiftUp(const QRect& rect);
0587 
0588     /**
0589      * \ingroup Commands
0590      * Helper method.
0591      * \see ShiftManipulator
0592      */
0593     void removeShiftLeft(const QRect& rect);
0594 
0595     /**
0596      * \ingroup ColumnRowFormat
0597      * Helper method.
0598      * \see InsertDeleteColumnManipulator
0599      * Moves all columns which are >= \p col \p number positions to the right
0600      * and inserts a new and empty column.
0601      */
0602     void insertColumns(int row, int numbers);
0603 
0604     /**
0605      * Helper method.
0606      * \see InsertDeleteRowManipulator
0607      * Moves all rows which are >= \p row \p number positions down
0608      * and inserts a new and empty row.
0609      */
0610     void insertRows(int row, int numbers);
0611 
0612     /**
0613      * \ingroup ColumnRowFormat
0614      * Helper method.
0615      * \see InsertDeleteColumnManipulator
0616      * Deletes \p number columns beginning at \p col .
0617      */
0618     void removeColumns(int row, int numbers);
0619 
0620     /**
0621      * \ingroup ColumnRowFormat
0622      * Helper method.
0623      * \see InsertDeleteRowManipulator
0624      * Deletes \p number rows beginning at \p row .
0625      */
0626     void removeRows(int row, int number);
0627 
0628     //
0629     //END Methods related column/row operations
0630     //
0631     //////////////////////////////////////////////////////////////////////////
0632     //
0633     //BEGIN UNSORTED METHODS !!!
0634     //
0635 
0636     void hideSheet(bool _hide);
0637 
0638     /**
0639      * \ingroup Value
0640      * Change name of reference when the user inserts or removes a column,
0641      * a row or a cell (= insertion of a row [or column] on a single column [or row]).
0642      * For example the formula =Sheet1!A1 is changed into =Sheet1!B1 if a Column
0643      * is inserted before A.
0644      *
0645      * @param pos the point of insertion (only one coordinate may be used, depending
0646      * on the other parameters).
0647      * @param fullRowOrColumn if true, a whole row or column has been inserted/removed.
0648      *                        if false, we inserted or removed a cell
0649      * @param ref see ChangeRef
0650      * @param sheetName completes the pos specification by giving the sheet name
0651      * @param number number of columns which were inserted
0652      */
0653     void changeNameCellRef(const QPoint& pos, bool fullRowOrColumn, ChangeRef ref,
0654                            const QString& sheetName, int number);
0655 
0656     /**
0657      * \ingroup ColumnRowFormat
0658      * Insert the non-default column format \p columnFormat.
0659      */
0660     void insertColumnFormat(ColumnFormat* columnFormat);
0661 
0662     /**
0663      * \ingroup ColumnRowFormat
0664      * Inserts the non-default row format \p rowFormat.
0665      */
0666     void insertRowFormat(RowFormat* rowFormat);
0667 
0668     /**
0669      * \ingroup ColumnRowFormat
0670      * Deletes the column format at \p column.
0671      */
0672     void deleteColumnFormat(int column);
0673 
0674     /**
0675      * \ingroup ColumnRowFormat
0676      * Deletes the row format at \p row (changes the format of that row to be the default format).
0677      */
0678     void deleteRowFormat(int row);
0679 
0680     //
0681     //END UNSORTED METHODS
0682     //
0683     //////////////////////////////////////////////////////////////////////////
0684     //
0685     //BEGIN UNSORTED METHODS !!!
0686     //
0687 
0688     /**
0689      * Shows a status \p message in the status bar for \p timeout msecs.
0690      */
0691     void showStatusMessage(const QString &message, int timeout = 3000);
0692 
0693     void updateLocale();
0694 
0695 
0696     /**
0697      * \ingroup Page
0698      * The page layout manager.
0699      */
0700     SheetPrint *print() const;
0701 
0702     /**
0703      * \ingroup Page
0704      * Print settings.
0705      */
0706     PrintSettings* printSettings() const;
0707 
0708     /**
0709      * \ingroup Page
0710      * Sets the print settings.
0711      */
0712     void setPrintSettings(const PrintSettings& settings);
0713 
0714     /**
0715      * \ingroup Page
0716      * \return the header & footer object
0717      */
0718     HeaderFooter *headerFooter() const;
0719 
0720     /**
0721      * Applies a database filter.
0722      */
0723     void applyDatabaseFilter(const Database& database);
0724 #ifndef NDEBUG
0725     void printDebug();
0726 #endif
0727 
0728     //
0729     //END UNSORTED METHODS
0730     //
0731     //////////////////////////////////////////////////////////////////////////
0732 
0733 Q_SIGNALS:
0734     /**
0735      * Emitted, if the document size changed.
0736      * E.g. if some columns were inserted.
0737      * \param size new size
0738      */
0739     void documentSizeChanged(const QSizeF &size);
0740 
0741     /**
0742      * Emitted, if the visible size changed.
0743      * E.g. if the document size changed or the user selected an area,
0744      * which was not visible before.
0745      */
0746     void visibleSizeChanged();
0747 
0748     /**
0749      * Emitted, if a status \p message should be shown in the status bar
0750      * for \p timeout msecs.
0751      */
0752     void statusMessage(const QString& message, int timeout);
0753 
0754     /**
0755      * \ingroup Embedding
0756      * Emitted, if a \p shape was added.
0757      * \param sheet this sheet (for the View to determine, if it's the active one)
0758      * \param shape the shape
0759      */
0760     void shapeAdded(Sheet *sheet, KoShape *shape);
0761 
0762     /**
0763      * \ingroup Embedding
0764      * Emitted, if a \p shape was removed.
0765      * \param sheet this sheet (for the View to determine, if it's the active one)
0766      * \param shape the shape
0767      */
0768     void shapeRemoved(Sheet *sheet, KoShape *shape);
0769 
0770 protected:
0771     /**
0772      * \ingroup Value
0773      * Change the name of a sheet in all formulas.
0774      * When you change name sheet Sheet1 -> Price
0775      * for all cell which refers to Sheet1, this function changes the name.
0776      */
0777     void changeCellTabName(QString const & old_name, QString const & new_name);
0778 
0779     //
0780     //////////////////////////////////////////////////////////////////////////
0781     //
0782 
0783     /**
0784      * \ingroup Commands
0785      * \see areaIsEmpty()
0786      */
0787     bool cellIsEmpty(const Cell& cell, TestType _type);
0788 
0789     /**
0790      * \ingroup Value
0791      * \see changeNameCellRef()
0792      */
0793     QString changeNameCellRefHelper(const QPoint& pos, bool fullRowOrColumn, ChangeRef ref,
0794                                     int NbCol, const QPoint& point, bool isColumnFixed,
0795                                     bool isRowFixed);
0796     QString changeNameCellRefHelper(const QPoint& pos, const QRect& rect, bool fullRowOrColumn, ChangeRef ref,
0797                                     int NbCol, const QPoint& point, bool isColumnFixed,
0798                                     bool isRowFixed);
0799 
0800 private:
0801     /**
0802      * \ingroup NativeFormat
0803      */
0804     void convertObscuringBorders();
0805 
0806     /**
0807      * \ingroup NativeFormat
0808      */
0809     void checkContentDirection(QString const & name);
0810 
0811     // disable assignment operator
0812     void operator=(const Sheet& other);
0813 
0814     friend class SheetTest;
0815 
0816     class Private;
0817     Private * const d;
0818 };
0819 
0820 } // namespace Sheets
0821 } // namespace Calligra
0822 
0823 Q_DECLARE_METATYPE(Calligra::Sheets::Sheet*)
0824 
0825 #endif  // CALLIGRA_SHEETS_SHEET