digiKam
Digikam::SearchXmlWriter Class Reference
+ Inheritance diagram for Digikam::SearchXmlWriter:

Public Member Functions

void finish ()
 
void finishField ()
 
void finishGroup ()
 
 SearchXmlWriter ()
 
void setDefaultFieldOperator (SearchXml::Operator op)
 
void setFieldOperator (SearchXml::Operator op)
 
void setGroupCaption (const QString &caption)
 
void setGroupOperator (SearchXml::Operator op)
 
void writeField (const QString &name, SearchXml::Relation relation)
 
void writeGroup ()
 
void writeValue (const QDateTime &dateTime)
 
void writeValue (const QList< double > &valueList, int precision=8)
 
void writeValue (const QList< float > &valueList, int precision=6)
 
void writeValue (const QList< int > &valueList)
 
void writeValue (const QList< QDateTime > &valueList)
 
void writeValue (const QList< qlonglong > &valueList)
 
void writeValue (const QString &value)
 
void writeValue (const QStringList &valueList)
 
void writeValue (double value, int precision=8)
 
void writeValue (float value, int precision=6)
 
void writeValue (int value)
 
void writeValue (qlonglong value)
 
QString xml () const
 

Static Public Member Functions

static QString keywordSearch (const QString &keyword)
 

Protected Member Functions

void writeOperator (const QString &, SearchXml::Operator)
 
void writeRelation (const QString &, SearchXml::Relation)
 

Protected Attributes

QString m_xml
 

Constructor & Destructor Documentation

◆ SearchXmlWriter()

Digikam::SearchXmlWriter::SearchXmlWriter ( )
explicit

Note that SearchXmlWriter and SearchXmlGroupWriter rely on you calling the methods following the restrictions set by the documentation; Otherwise you will not produce the desired output.

Member Function Documentation

◆ finish()

◆ finishField()

◆ finishGroup()

void Digikam::SearchXmlWriter::finishGroup ( )

Finish the current group. You cannot add anymore fields after calling this. Note that you will want to call this before writing another group if you want the group on the same level. You can as well add nested groups and call this to close the group afterwards.

Referenced by Digikam::ItemQueryBuilder::convertFromUrlToXml(), Digikam::SearchModificationHelper::createFuzzySearchFromDropped(), Digikam::SearchModificationHelper::createFuzzySearchFromImage(), Digikam::SearchModificationHelper::createFuzzySearchFromSketch(), keywordSearch(), Digikam::SearchModificationHelper::slotCreateTimeLineSearch(), Digikam::ItemLister::tagSearchXml(), Digikam::SearchGroup::write(), and Digikam::KeywordSearchWriter::xml().

◆ keywordSearch()

QString Digikam::SearchXmlWriter::keywordSearch ( const QString &  keyword)
static

Returns ready-made XML for a query of type "keyword" with the specified text as keyword.

References finish(), finishField(), finishGroup(), Digikam::SearchXml::Like, writeField(), writeGroup(), writeValue(), and xml().

◆ setDefaultFieldOperator()

void Digikam::SearchXmlWriter::setDefaultFieldOperator ( SearchXml::Operator  op)

Sets the default operator for fields in this group "(field1 AND field2 AND ... fieldn)". The default operator can in each field be overridden. Default value is AND.

References Digikam::SearchXml::And, and writeOperator().

Referenced by Digikam::ItemLister::tagSearchXml(), and Digikam::SearchGroup::write().

◆ setFieldOperator()

void Digikam::SearchXmlWriter::setFieldOperator ( SearchXml::Operator  op)

Adds an optional operator overriding the default field operator of the group.

References writeOperator().

◆ setGroupCaption()

void Digikam::SearchXmlWriter::setGroupCaption ( const QString &  caption)

Sets an optional caption.

◆ setGroupOperator()

void Digikam::SearchXmlWriter::setGroupOperator ( SearchXml::Operator  op)

Sets the operator applied to the group as a whole "OR (field1 ... fieldn)". Default value is OR.

References Digikam::SearchXml::Or, and writeOperator().

Referenced by Digikam::ItemQueryBuilder::convertFromUrlToXml(), and Digikam::SearchGroup::write().

◆ writeField()

◆ writeGroup()

◆ writeOperator()

void Digikam::SearchXmlWriter::writeOperator ( const QString &  attributeName,
SearchXml::Operator  op 
)
protected

◆ writeRelation()

◆ writeValue() [1/12]

void Digikam::SearchXmlWriter::writeValue ( const QDateTime &  dateTime)

◆ writeValue() [2/12]

void Digikam::SearchXmlWriter::writeValue ( const QList< double > &  valueList,
int  precision = 8 
)

◆ writeValue() [3/12]

void Digikam::SearchXmlWriter::writeValue ( const QList< float > &  valueList,
int  precision = 6 
)

◆ writeValue() [4/12]

void Digikam::SearchXmlWriter::writeValue ( const QList< int > &  valueList)

◆ writeValue() [5/12]

void Digikam::SearchXmlWriter::writeValue ( const QList< QDateTime > &  valueList)

◆ writeValue() [6/12]

void Digikam::SearchXmlWriter::writeValue ( const QList< qlonglong > &  valueList)

◆ writeValue() [7/12]

◆ writeValue() [8/12]

void Digikam::SearchXmlWriter::writeValue ( const QStringList &  valueList)

◆ writeValue() [9/12]

void Digikam::SearchXmlWriter::writeValue ( double  value,
int  precision = 8 
)

References value.

◆ writeValue() [10/12]

void Digikam::SearchXmlWriter::writeValue ( float  value,
int  precision = 6 
)

References value.

◆ writeValue() [11/12]

void Digikam::SearchXmlWriter::writeValue ( int  value)

References value.

◆ writeValue() [12/12]

void Digikam::SearchXmlWriter::writeValue ( qlonglong  value)

References value.

◆ xml()

Member Data Documentation

◆ m_xml

QString Digikam::SearchXmlWriter::m_xml
protected

Referenced by xml().


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