~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kspread/Map.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of the KDE project
 
2
   Copyright 2010 Marijn Kruisselbrink <m.kruisselbrink@student.tue.nl>
2
3
   Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
4
 
4
5
   This library is free software; you can redistribute it and/or
25
26
#include <QString>
26
27
#include <QStringList>
27
28
 
 
29
#include "ProtectableObject.h"
 
30
 
28
31
#include "kspread_export.h"
29
32
 
30
33
#include <KoDataCenterBase.h>
34
37
class KoOdfLoadingContext;
35
38
class KoEmbeddedDocumentSaver;
36
39
class KoStyleManager;
 
40
class KoResourceManager;
 
41
 
 
42
class KCompletion;
37
43
 
38
44
class QDomElement;
39
45
class QDomDocument;
 
46
class QUndoCommand;
 
47
 
40
48
class KoXmlWriter;
41
49
class KoGenStyles;
42
50
class KoOasisSettings;
50
58
class Damage;
51
59
class DatabaseManager;
52
60
class DependencyManager;
53
 
class Doc;
 
61
class DocBase;
54
62
class LoadingInfo;
55
63
class NamedAreaManager;
56
64
class RecalcManager;
67
75
 * The "embedded document".
68
76
 * The Map holds all the document data.
69
77
 */
70
 
class KSPREAD_EXPORT Map : public QObject, public KoDataCenterBase
 
78
class KSPREAD_EXPORT Map : public QObject, public KoDataCenterBase, public ProtectableObject
71
79
{
72
80
    Q_OBJECT
73
81
public:
74
82
    /**
75
83
     * Created an empty map.
76
84
     */
77
 
    explicit Map(Doc* doc, const char* name = 0);
 
85
    explicit Map(DocBase* doc = 0, int syntaxVersion = 1);
78
86
 
79
87
    /**
80
88
     * This deletes all sheets contained in this map.
84
92
    /**
85
93
     * \return the document this map belongs to
86
94
     */
87
 
    Doc* doc() const;
 
95
    DocBase* doc() const;
88
96
 
89
97
    /**
90
98
     * \brief Sets whether the document can be edited or is read only.
188
196
    /**
189
197
     * \ingroup OpenDocument
190
198
     */
191
 
    void saveOdfSettings(KoXmlWriter &settingsWriter);
192
 
 
193
 
    /**
194
 
     * \ingroup OpenDocument
195
 
     */
196
199
    void loadOdfSettings(KoOasisSettings &settings);
197
200
 
198
201
    /**
219
222
    bool loadChildren(KoStore* _store);
220
223
    bool saveChildren(KoStore* _store);
221
224
 
222
 
    void password(QByteArray & passwd) const;
223
 
    bool isProtected() const;
224
 
    void setProtected(QByteArray const & passwd);
225
 
    bool checkPassword(QByteArray const & passwd) const;
226
 
 
227
225
    /**
228
226
     * The sheet named @p _from is being moved to the sheet @p _to.
229
227
     * If @p  _before is true @p _from is inserted before (after otherwise)
253
251
     * The sheet is not added to the map nor added to the GUI.
254
252
     * @return a pointer to a new Sheet
255
253
     */
256
 
    Sheet* createSheet();
 
254
    Sheet* createSheet(const QString& name = QString());
257
255
 
258
256
    /**
259
257
     * Adds @p sheet to this map.
266
264
     * Adds a new sheet to this map.
267
265
     * @return a pointer to the new sheet
268
266
     */
269
 
    Sheet* addNewSheet();
 
267
    Sheet* addNewSheet(const QString& name = QString());
270
268
 
271
269
    /**
272
270
     * @return a pointer to the sheet at index @p index in this map
278
276
     * @return index of @p sheet in this map
279
277
     * @return @c 0 if the index exceeds the list boundaries
280
278
     */
281
 
    int indexOf( Sheet* sheet ) const;
 
279
    int indexOf(Sheet* sheet) const;
282
280
 
283
281
    /**
284
282
     * @return the list of sheets in this map
296
294
    QStringList visibleSheets() const;
297
295
    QStringList hiddenSheets() const;
298
296
 
299
 
    void increaseLoadedRowsCounter(int i = 1);
 
297
    int increaseLoadedRowsCounter(int i = 1);
300
298
 
301
299
    /**
302
300
     * \ingroup OpenDocument
306
304
    bool isLoading() const;
307
305
 
308
306
    /**
 
307
     * \return the document's syntax version
 
308
     * \ingroup NativeFormat
 
309
     */
 
310
    int syntaxVersion() const;
 
311
 
 
312
    /**
 
313
     * Sets the document's syntax \p version.
 
314
     * \ingroup NativeFormat
 
315
     */
 
316
    void setSyntaxVersion(int version);
 
317
 
 
318
    /**
309
319
     * \ingroup OpenDocument
310
320
     * \ingroup NativeFormat
311
321
     * Creates the loading info, if it does not exist yet.
321
331
    void deleteLoadingInfo();
322
332
 
323
333
    /**
324
 
     * \ingroup Operations
 
334
     * \return the KCompletion object, that allows user input completions.
 
335
     */
 
336
    KCompletion &stringCompletion();
 
337
 
 
338
    /**
 
339
     * Adds \p string to the list of string values in order to be able to
 
340
     * complete user inputs.
 
341
     */
 
342
    void addStringCompletion(const QString &string);
 
343
 
 
344
    /**
 
345
     * \ingroup Damages
325
346
     */
326
347
    void addDamage(Damage* damage);
327
348
 
 
349
    /**
 
350
     * Return a pointer to the resource manager associated with the
 
351
     * document. The resource manager contains
 
352
     * document wide resources * such as variable managers, the image
 
353
     * collection and others.
 
354
     * @see KoCanvasBase::resourceManager()
 
355
     */
 
356
    KoResourceManager *resourceManager() const;
328
357
public Q_SLOTS:
329
358
    /**
330
 
     * \ingroup Operations
 
359
     * \ingroup Damages
331
360
     */
332
361
    void flushDamages();
333
362
 
334
363
    /**
335
 
     * \ingroup Operations
 
364
     * \ingroup Damages
336
365
     */
337
366
    void handleDamages(const QList<Damage*>& damages);
338
367
 
 
368
    /**
 
369
     * Emits the signal commandAdded(QUndoCommand *).
 
370
     * You have to connect the signal to the object holding the undo stack or
 
371
     * any relay object, that propagates \p command to the undo stack.
 
372
     */
 
373
    void addCommand(QUndoCommand *command);
 
374
 
339
375
Q_SIGNALS:
340
376
    /**
341
 
     * \ingroup Operations
 
377
     * \ingroup Damages
342
378
     */
343
379
    void damagesFlushed(const QList<Damage*>& damages);
344
380
 
345
381
    /**
 
382
     * Emitted, if a command was added by addCommand(QUndoCommand *).
 
383
     */
 
384
    void commandAdded(QUndoCommand *command);
 
385
 
 
386
    /**
346
387
     * Emitted, if a newly created sheet was added to the document.
347
388
     */
348
389
    void sheetAdded(Sheet* sheet);
357
398
     */
358
399
    void sheetRevived(Sheet* sheet);
359
400
 
 
401
    /**
 
402
     * Emitted, if a status \p message should be shown in the status bar
 
403
     * for \p timeout msecs.
 
404
     */
 
405
    void statusMessage(const QString &message, int timeout);
 
406
 
360
407
private:
361
408
    Q_DISABLE_COPY(Map)
362
409