KoPictureKey Class Reference
KoPictureKey is the structure describing a picture in a unique way.Structure describing a picture on disk. More...
#include <koPictureKey.h>
Collaboration diagram for KoPictureKey:

Public Member Functions | |
KoPictureKey () | |
KoPictureKey (const QString &fn, const QDateTime &mod) | |
KoPictureKey (const QString &fn) | |
KoPictureKey (const KoPictureKey &key) | |
KoPictureKey & | operator= (const KoPictureKey &key) |
bool | operator== (const KoPictureKey &key) const |
bool | operator< (const KoPictureKey &key) const |
QString | toString () const |
void | saveAttributes (QDomElement &elem) const |
void | loadAttributes (const QDomElement &elem) |
QString | filename () const |
QDateTime | lastModified () const |
void | setKeyFromFile (const QString &filename) |
Protected Attributes | |
QString | m_filename |
QDateTime | m_lastModified |
Detailed Description
KoPictureKey is the structure describing a picture in a unique way.Structure describing a picture on disk.It currently includes the original path to the picture and the modification date.
- Note:
- We use the *nix epoch (1970-01-01) as a time base because it is a valid date. That way we do not depend on a behaviour of the current QDateTime that might change in future versions of Qt and we are also nice to non-Qt programs wanting to read KOffice's files.
This behaviour is also needed for re-saving KWord files having <FORMAT id="2">. When saving again, these files get a <KEY> element as child of <PIXMAPS> but not one as child of <FORMAT> and <IMAGE>. Therefore we need to be careful that the key remains compatible to default values (another good reason for the *NIX epoch)
In case of a remote path, the "original path" is the name of the temporary file that was used to download the file.
Definition at line 75 of file koPictureKey.h.
Constructor & Destructor Documentation
|
Default constructor. Creates a null key Definition at line 38 of file koPictureKey.cc. |
|
Constructs a key, from a filename and a modification date. Storing the modification date as part of the key allows the user to update the file and import it into the application again, without the application reusing the old copy from the collection. Definition at line 43 of file koPictureKey.cc. |
|
Constructs a key from a filename.
Definition at line 53 of file koPictureKey.cc. |
|
Copy constructor.
Definition at line 59 of file koPictureKey.cc. |
Member Function Documentation
|
Assignment operator.
Definition at line 64 of file koPictureKey.cc. References m_filename, and m_lastModified. |
|
Comparison operator.
Definition at line 71 of file koPictureKey.cc. References m_filename, and m_lastModified. |
|
Comparison operator.
Definition at line 77 of file koPictureKey.cc. References toString(). |
|
Convert this key into a string representation of it.
Definition at line 139 of file koPictureKey.cc. Referenced by KoPictureCollection::findPicture(), loadAttributes(), and operator<(). |
|
Save this key in XML (as KOffice 1.3).
Definition at line 82 of file koPictureKey.cc. |
|
Load this key from XML (as KOffice 1.3).
Definition at line 96 of file koPictureKey.cc. References toString(). Referenced by KoPictureCollection::readXML(). |
|
First part of the key: the filename.
Definition at line 137 of file koPictureKey.h. |
|
Second part of the key: the modification date.
Definition at line 142 of file koPictureKey.h. |
|
Sets the key according to
Definition at line 146 of file koPictureKey.cc. Referenced by KoPictureCollection::loadPicture(), and KoPicture::setKeyAndDownloadPicture(). |
The documentation for this class was generated from the following files: