lib

#include <KoPictureKey.h>

Public Member Functions

 KoPictureKey ()
 KoPictureKey (const TQString &fn, const TQDateTime &mod)
 KoPictureKey (const TQString &fn)
 KoPictureKey (const KoPictureKey &key)
KoPictureKey & operator= (const KoPictureKey &key)
bool operator== (const KoPictureKey &key) const
bool operator< (const KoPictureKey &key) const
TQString toString () const
void saveAttributes (TQDomElement &elem) const
void loadAttributes (const TQDomElement &elem)
TQString filename () const
TQDateTime lastModified () const
void setKeyFromFile (const TQString &filename)

Protected Attributes

TQString m_filename
TQDateTime m_lastModified

Detailed Description

KoPictureKey is the structure describing a picture in a unique way.

It currently includes the original path to the picture and the modification date.

Structure describing a picture on disk

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 TQDateTime that might change in future versions of TQt and we are also nice to non-TQt 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

◆ KoPictureKey() [1/4]

KoPictureKey::KoPictureKey ( )

Default constructor.

Creates a null key

Definition at line 38 of file KoPictureKey.cpp.

◆ KoPictureKey() [2/4]

KoPictureKey::KoPictureKey ( const TQString & fn,
const TQDateTime & mod )

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.cpp.

◆ KoPictureKey() [3/4]

KoPictureKey::KoPictureKey ( const TQString & fn)

Constructs a key from a filename.

Note
The modification date is set to 1970-01-01

Definition at line 53 of file KoPictureKey.cpp.

◆ KoPictureKey() [4/4]

KoPictureKey::KoPictureKey ( const KoPictureKey & key)

Copy constructor.

Definition at line 59 of file KoPictureKey.cpp.

Member Function Documentation

◆ filename()

TQString KoPictureKey::filename ( ) const
inline

First part of the key: the filename.

Definition at line 137 of file KoPictureKey.h.

◆ lastModified()

TQDateTime KoPictureKey::lastModified ( ) const
inline

Second part of the key: the modification date.

Definition at line 142 of file KoPictureKey.h.

◆ loadAttributes()

void KoPictureKey::loadAttributes ( const TQDomElement & elem)

Load this key from XML (as KOffice 1.3).

Definition at line 96 of file KoPictureKey.cpp.

◆ operator<()

bool KoPictureKey::operator< ( const KoPictureKey & key) const

Comparison operator.

Note
Used for sorting in the collection's map

Definition at line 77 of file KoPictureKey.cpp.

◆ operator=()

KoPictureKey & KoPictureKey::operator= ( const KoPictureKey & key)

Assignment operator.

Definition at line 64 of file KoPictureKey.cpp.

◆ operator==()

bool KoPictureKey::operator== ( const KoPictureKey & key) const

Comparison operator.

Definition at line 71 of file KoPictureKey.cpp.

◆ saveAttributes()

void KoPictureKey::saveAttributes ( TQDomElement & elem) const

Save this key in XML (as KOffice 1.3).

Definition at line 82 of file KoPictureKey.cpp.

◆ setKeyFromFile()

void KoPictureKey::setKeyFromFile ( const TQString & filename)

Sets the key according to filename, including modification time.

Definition at line 146 of file KoPictureKey.cpp.

◆ toString()

TQString KoPictureKey::toString ( ) const

Convert this key into a string representation of it.

Definition at line 139 of file KoPictureKey.cpp.

Member Data Documentation

◆ m_filename

TQString KoPictureKey::m_filename
protected

Definition at line 150 of file KoPictureKey.h.

◆ m_lastModified

TQDateTime KoPictureKey::m_lastModified
protected

Definition at line 151 of file KoPictureKey.h.


The documentation for this class was generated from the following files: