~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to lib/kofficecore/koImageCollection.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE project
2
 
   Copyright (c) 2001 Simon Hausmann <hausmann@kde.org>
3
 
 
4
 
   This library is free software; you can redistribute it and/or
5
 
   modify it under the terms of the GNU Library General Public
6
 
   License as published by the Free Software Foundation; either
7
 
   version 2 of the License, or (at your option) any later version.
8
 
 
9
 
   This library is distributed in the hope that it will be useful,
10
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
   Library General Public License for more details.
13
 
 
14
 
   You should have received a copy of the GNU Library General Public License
15
 
   along with this library; see the file COPYING.LIB.  If not, write to
16
 
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
 
   Boston, MA 02111-1307, USA.
18
 
*/
19
 
#ifndef __koImageCollection_h__
20
 
#define __koImageCollection_h__
21
 
 
22
 
#include <qmap.h>
23
 
#include <qdom.h>
24
 
 
25
 
#include "koImage.h"
26
 
class KoStore;
27
 
 
28
 
/**
29
 
 * This is a little extension to a QMap holding a bunch of @ref KoImage
30
 
 * objects. It actually inherits from QMap, but it provides additional
31
 
 * methods.
32
 
 */
33
 
class KoImageCollection : public QMap<KoImageKey, KoImage>
34
 
{
35
 
public:
36
 
    /**
37
 
     * Convenience method to QMap::find . Returns the data directly.
38
 
     */
39
 
    KoImage findImage( const KoImageKey &key ) const;
40
 
 
41
 
    /**
42
 
     * Similar to QMap::insert, however it doesn't overwrite the
43
 
     * existing entry if it exists already.
44
 
     */
45
 
    KoImage insertImage( const KoImageKey &key, const QImage &image );
46
 
 
47
 
    /**
48
 
     * Load an image from a file (and insert into the collection).
49
 
     * The modification date of the file is checked, to create the key
50
 
     * for this KoImage. If this key maps to an existing image in the
51
 
     * collection, then this image is returned, otherwise the file is loaded.
52
 
     */
53
 
    KoImage loadImage( const QString &fileName );
54
 
 
55
 
    /**
56
 
     * Save the used images from the collection into the store
57
 
     * Usually called from completeSaving().
58
 
     *
59
 
     * @param store the store in which to save the images
60
 
     * @param keys the list of keys corresponding to the images to save
61
 
     * @param prefix the prefix to use when saving the images in the store
62
 
     * (usually: isStoredExtern() ? QString::null : url().url() + "/",
63
 
     * where 'this' is the document)
64
 
     */
65
 
    void saveToStore( KoStore * store, QValueList<KoImageKey> keys, const QString & prefix ) const;
66
 
 
67
 
    /**
68
 
     * Generate the <PIXMAPS> tag, that saves the key and the related
69
 
     * relative path in the store (e.g. pictures/picture1.ext) for each pixmap.
70
 
     */
71
 
    QDomElement saveXML( QDomDocument &doc, QValueList<KoImageKey> keys, const QString & prefix ) const;
72
 
 
73
 
    typedef QMap<KoImageKey, QString> StoreMap;
74
 
    /**
75
 
     * Read the <PIXMAPS> tag, and save the result (key<->store-filename associations)
76
 
     * into the QMap. You may want to 'new' a QMap in loadXML, and to use and then delete
77
 
     * it in completeLoading (to save memory).
78
 
     */
79
 
    StoreMap readXML( QDomElement &pixmapsElem, const QDateTime & defaultDateTime );
80
 
 
81
 
    /**
82
 
     * Read all images from the store, into this collection
83
 
     * The map comes from readXML above, and is used to find which images
84
 
     * to load, and which key to associate them.
85
 
     * @param prefix same as above (only used for old format support)
86
 
     */
87
 
    void readFromStore( KoStore * store, const StoreMap &storeMap,const QString &prefix );
88
 
 
89
 
};
90
 
 
91
 
#endif