|
Krita Source Code Documentation
|
The class containing all meta information about a document. More...
#include <KoDocumentInfo.h>
Inheritance diagram for KoDocumentInfo:Signals | |
| void | infoUpdated (const QString &info, const QString &data) |
Public Member Functions | |
| QString | aboutInfo (const QString &info) const |
| QStringList | authorContactInfo () const |
| authorContactInfo | |
| QString | authorInfo (const QString &info) const |
| KoDocumentInfo (const KoDocumentInfo &rhs, QObject *parent=0) | |
| KoDocumentInfo (QObject *parent=0) | |
| bool | load (const QDomDocument &doc) |
| QString | originalGenerator () const |
| void | resetMetaData () |
| QDomDocument | save (QDomDocument &doc) |
| void | setAboutInfo (const QString &info, const QString &data) |
| void | setAuthorInfo (const QString &info, const QString &data) |
| void | setOriginalGenerator (const QString &generator) |
| void | updateParameters () |
| ~KoDocumentInfo () override | |
Private Member Functions | |
| bool | loadAboutInfo (const QDomElement &e) |
| bool | loadAuthorInfo (const QDomElement &e) |
| QDomElement | saveAboutInfo (QDomDocument &doc) |
| QDomElement | saveAuthorInfo (QDomDocument &doc) |
| void | setActiveAuthorInfo (const QString &info, const QString &data) |
| void | updateParametersAndBumpNumCycles () |
| Bumps the editing cycles count and save date, and then calls updateParameters. | |
Private Attributes | |
| QMap< QString, QString > | m_aboutInfo |
| QStringList | m_aboutTags |
| QMap< QString, QString > | m_authorInfo |
| QMap< QString, QString > | m_authorInfoOverride |
| QStringList | m_authorTags |
| QMap< QString, QString > | m_contact |
| QStringList | m_contactTags |
| QString | m_generator |
The class containing all meta information about a document.
This class contains the meta information for a document. They are stored in two QMap and can be accessed through aboutInfo() and authorInfo(). The about info can be changed with setAboutInfo() and setAuthorInfo()
Definition at line 36 of file KoDocumentInfo.h.
|
explicit |
The constructor
| parent | a pointer to the parent object |
Definition at line 27 of file KoDocumentInfo.cpp.
References m_aboutTags, m_authorTags, m_contactTags, and setAboutInfo().
|
explicit |
Definition at line 42 of file KoDocumentInfo.cpp.
|
override |
| QString KoDocumentInfo::aboutInfo | ( | const QString & | info | ) | const |
Obtain information about the document
| info | the kind of information to obtain |
Definition at line 135 of file KoDocumentInfo.cpp.
References m_aboutInfo, and m_aboutTags.
| QStringList KoDocumentInfo::authorContactInfo | ( | ) | const |
authorContactInfo
Definition at line 121 of file KoDocumentInfo.cpp.
References m_contact.
| QString KoDocumentInfo::authorInfo | ( | const QString & | info | ) | const |
Obtain information about the author
| info | the kind of information to obtain |
Definition at line 113 of file KoDocumentInfo.cpp.
References m_authorInfo, m_authorTags, and m_contactTags.
|
signal |
| bool KoDocumentInfo::load | ( | const QDomDocument & | doc | ) |
Load the KoDocumentInfo from an Calligra-1.3 DomDocument
| doc | the QDomDocument to load from |
Definition at line 58 of file KoDocumentInfo.cpp.
References loadAboutInfo(), loadAuthorInfo(), and m_authorInfo.
|
private |
Load the information about the document from a Calligra-1.3 file
| e | the element to load from |
Definition at line 196 of file KoDocumentInfo.cpp.
References setAboutInfo().
|
private |
Load the information about the document from a Calligra-1.3 file
| e | the element to load from |
Definition at line 145 of file KoDocumentInfo.cpp.
References m_contact, setActiveAuthorInfo(), and value().
| QString KoDocumentInfo::originalGenerator | ( | ) | const |
Obtain the generator of the document, as it was loaded from the document
Definition at line 329 of file KoDocumentInfo.cpp.
References m_generator.
| void KoDocumentInfo::resetMetaData | ( | ) |
Resets part of the meta data
Definition at line 321 of file KoDocumentInfo.cpp.
References authorInfo(), and setAboutInfo().
| QDomDocument KoDocumentInfo::save | ( | QDomDocument & | doc | ) |
Save the KoDocumentInfo to an Calligra-1.3 DomDocument
Definition at line 72 of file KoDocumentInfo.cpp.
References saveAboutInfo(), saveAuthorInfo(), and updateParametersAndBumpNumCycles().
|
private |
Save the information about the document to a Calligra-1.3 file
| doc | the QDomDocument to save in |
Definition at line 210 of file KoDocumentInfo.cpp.
References aboutInfo(), and m_aboutTags.
|
private |
Save the information about the author to a Calligra-1.3 file
| doc | the QDomDocument to save in |
Definition at line 170 of file KoDocumentInfo.cpp.
References authorInfo(), m_authorTags, and m_contact.
| void KoDocumentInfo::setAboutInfo | ( | const QString & | info, |
| const QString & | data ) |
Set information about the document
| info | the kind of information to set |
| data | the data to set for this information |
Definition at line 126 of file KoDocumentInfo.cpp.
References infoUpdated(), m_aboutInfo, and m_aboutTags.
|
private |
Set information about the author This sets what is actually saved to file. The public method setAuthorInfo() can be used to set values that override what is fetched from the author profile. During saveParameters() author profile and any overrides is combined resulting in calls to this method.
| info | the kind of information to set |
| data | the data to set for this information |
Definition at line 100 of file KoDocumentInfo.cpp.
References infoUpdated(), m_authorInfo, m_authorTags, m_contact, and m_contactTags.
| void KoDocumentInfo::setAuthorInfo | ( | const QString & | info, |
| const QString & | data ) |
Set information about the author. This will override any information retrieved from the author profile But it does not change the author profile Note: authorInfo() will not return the new value until the document has been saved by the user.(autosave doesn't count)
| info | the kind of information to set |
| data | the data to set for this information |
Definition at line 91 of file KoDocumentInfo.cpp.
References m_authorInfoOverride, m_authorTags, and m_contactTags.
| void KoDocumentInfo::setOriginalGenerator | ( | const QString & | generator | ) |
Sets the original generator of the document. This does not affect what gets saved to a document in the meta:generator field, it only changes what originalGenerator() will return.
Definition at line 334 of file KoDocumentInfo.cpp.
References m_generator.
| void KoDocumentInfo::updateParameters | ( | ) |
Takes care of updating the document info from configuration correctly
Definition at line 243 of file KoDocumentInfo.cpp.
References authorInfo(), KoResourcePaths::getAppDataLocation(), KisDocument::isModified(), m_authorInfoOverride, m_authorTags, m_contact, and setActiveAuthorInfo().
|
private |
Bumps the editing cycles count and save date, and then calls updateParameters.
Definition at line 230 of file KoDocumentInfo.cpp.
References aboutInfo(), KisDocument::isAutosaving, setAboutInfo(), and updateParameters().
|
private |
The map containing information about the document
Definition at line 174 of file KoDocumentInfo.h.
|
private |
A QStringList containing all tags for the document information
Definition at line 162 of file KoDocumentInfo.h.
|
private |
The map containing information about the author
Definition at line 170 of file KoDocumentInfo.h.
|
private |
The map containing information about the author set programmatically
Definition at line 172 of file KoDocumentInfo.h.
|
private |
A QStringList containing all tags for the author information
Definition at line 164 of file KoDocumentInfo.h.
|
private |
A QMap with the contact modes and their type in the second string
Definition at line 168 of file KoDocumentInfo.h.
|
private |
A QStringList containing all valid contact tags
Definition at line 166 of file KoDocumentInfo.h.
|
private |
The original meta:generator of the document
Definition at line 176 of file KoDocumentInfo.h.