KFileMetaData::ExtractionResult

Search for usage in LXR

KFileMetaData::ExtractionResult Class Referenceabstract

#include <KFileMetaData/ExtractionResult>

Inheritance diagram for KFileMetaData::ExtractionResult:

Public Types

enum  Flag {
  ExtractNothing = 0, ExtractMetaData = 1, ExtractPlainText = 2, ExtractImageData = 4,
  ExtractEverything = (ExtractMetaData | ExtractPlainText)
}
 
typedef QFlags< FlagFlags
 

Public Member Functions

 ExtractionResult (const ExtractionResult &rhs)
 
 ExtractionResult (const QString &url, const QString &mimetype=QString(), const Flags &flags=Flags{ExtractPlainText|ExtractMetaData})
 
virtual void add (Property::Property property, const QVariant &value)=0
 
void addImageData (QMap< EmbeddedImageData::ImageType, QByteArray > &&images)
 
virtual void addType (Type::Type type)=0
 
virtual void append (const QString &text)=0
 
QMap< EmbeddedImageData::ImageType, QByteArrayimageData () const
 
Flags inputFlags () const
 
QString inputMimetype () const
 
QString inputUrl () const
 

Detailed Description

The ExtractionResult class is where all the data extracted by the indexer is saved. This class acts as a base class which should be derived from and then passed to the relevant plugins.

The derived class needs to implement 3 pure virtual functions through which it receives the extracted data.

Author
Vishesh Handa [email protected][email protected]anda[email protected].in

Definition at line 34 of file extractionresult.h.

Member Typedef Documentation

◆ Flags

Stores a combination of Flag values.

Definition at line 53 of file extractionresult.h.

Member Enumeration Documentation

◆ Flag

See also
Flags
Enumerator
ExtractImageData 
Since
5.76
ExtractEverything 
Deprecated:
since 5.76, specify explicitly

Definition at line 40 of file extractionresult.h.

Constructor & Destructor Documentation

◆ ExtractionResult()

ExtractionResult::ExtractionResult ( const QString url,
const QString mimetype = QString(),
const Flags flags = Flags{ExtractPlainText | ExtractMetaData} 
)

Create an ExtractionResult which can be passed be to Extractors.

The extractors use the url, mimetype and flags in order to determine which file the data should be extracted from and which data should be extracted.

Definition at line 20 of file extractionresult.cpp.

Member Function Documentation

◆ add()

virtual void KFileMetaData::ExtractionResult::add ( Property::Property  property,
const QVariant value 
)
pure virtual

This function is called by the plugins when they wish to add a key value pair which should be indexed.

This function may be called multiple times for the same key.

property This specifies a property name. It should be one of the properties from the global list of properties.

value The value of the property

Implemented in KFileMetaData::SimpleExtractionResult.

◆ addImageData()

void ExtractionResult::addImageData ( QMap< EmbeddedImageData::ImageType, QByteArray > &&  images)

This function is called by the plugins.

images The images to add

See also
EmbeddedImageData
Since
5.76

Definition at line 50 of file extractionresult.cpp.

◆ addType()

virtual void KFileMetaData::ExtractionResult::addType ( Type::Type  type)
pure virtual

This function is called by the plugins.

A type is a higher level classification of the file. A file can have multiple types, but mostly when it does, those types are related. Eg - Document and Presentation.

Please choose one type from the list of available types

Implemented in KFileMetaData::SimpleExtractionResult.

◆ append()

virtual void KFileMetaData::ExtractionResult::append ( const QString text)
pure virtual

This function is called by plugins when they wish for some plain text to be indexed without any property.

This generally corresponds to the text content in a file

Implemented in KFileMetaData::SimpleExtractionResult.

◆ imageData()

QMap< EmbeddedImageData::ImageType, QByteArray > ExtractionResult::imageData ( ) const

Return embedded image data.

See also
Flags::ExtractImageData
Since
5.76

Definition at line 56 of file extractionresult.cpp.

◆ inputFlags()

ExtractionResult::Flags ExtractionResult::inputFlags ( ) const

The flags which the extraction plugin should considering following when extracting metadata from the file.

Definition at line 45 of file extractionresult.cpp.

◆ inputMimetype()

QString ExtractionResult::inputMimetype ( ) const

The input mimetype.

This mimetype should correspond with the mimetypes supported with the relevant plugin when it is being passed to the Extractor, or be a subtype thereof.

See also
ExtractorCollection::fetchExtractors
ExtractorPlugin::supportedMimeType

Definition at line 40 of file extractionresult.cpp.

◆ inputUrl()

QString ExtractionResult::inputUrl ( ) const

The input url which the plugins will use to locate the file.

Definition at line 35 of file extractionresult.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:46:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.