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

0001 /* This file is part of the KDE project
0002    Copyright 2007 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 KSPREAD_CELL_STORAGE_P
0021 #define KSPREAD_CELL_STORAGE_P
0022 
0023 // Sheets
0024 #include "Binding.h"
0025 #include "Condition.h"
0026 #include "Formula.h"
0027 #include "Style.h"
0028 #include "Validity.h"
0029 #include "Value.h"
0030 
0031 namespace Calligra
0032 {
0033 namespace Sheets
0034 {
0035 
0036 class CellStorageUndoData
0037 {
0038 public:
0039     bool isEmpty() const {
0040         if (!bindings.isEmpty())
0041             return false;
0042         if (!comments.isEmpty())
0043             return false;
0044         if (!conditions.isEmpty())
0045             return false;
0046         if (!databases.isEmpty())
0047             return false;
0048         if (!formulas.isEmpty())
0049             return false;
0050         if (!fusions.isEmpty())
0051             return false;
0052         if (!links.isEmpty())
0053             return false;
0054         if (!matrices.isEmpty())
0055             return false;
0056         if (!namedAreas.isEmpty())
0057             return false;
0058         if (!styles.isEmpty())
0059             return false;
0060         if (!userInputs.isEmpty())
0061             return false;
0062         if (!validities.isEmpty())
0063             return false;
0064         if (!values.isEmpty())
0065             return false;
0066         if (!richTexts.isEmpty())
0067             return false;
0068         return true;
0069     }
0070 
0071     QList< QPair<QRectF, Binding> >          bindings;
0072     QList< QPair<QRectF, QString> >          comments;
0073     QList< QPair<QRectF, Conditions> >       conditions;
0074     QList< QPair<QRectF, Database> >         databases;
0075     QVector< QPair<QPoint, Formula> >        formulas;
0076     QList< QPair<QRectF, bool> >             fusions;
0077     QVector< QPair<QPoint, QString> >        links;
0078     QList< QPair<QRectF, bool> >             matrices;
0079     QList< QPair<QRectF, QString> >          namedAreas;
0080     QList< QPair<QRectF, SharedSubStyle> >   styles;
0081     QVector< QPair<QPoint, QString> >        userInputs;
0082     QList< QPair<QRectF, Validity> >         validities;
0083     QVector< QPair<QPoint, Value> >          values;
0084     QVector< QPair<QPoint, QSharedPointer<QTextDocument> > > richTexts;
0085 };
0086 
0087 } // namespace Sheets
0088 } // namespace Calligra
0089 
0090 #endif // KSPREAD_CELL_STORAGE_P