LeechCraft Monocle  %{LEECHCRAFT_VERSION}
Modular document viewer for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
LeechCraft::Monocle::IBackendPlugin Class Referenceabstract

Basic interface for format backends plugins for Monocle. More...

#include "ibackendplugin.h"

Public Member Functions

virtual ~IBackendPlugin ()
 Virtual destructor. More...
 
virtual bool CanLoadDocument (const QString &filename)=0
 Checks whether the given document can be loaded. More...
 
virtual IDocument_ptr LoadDocument (const QString &filename)=0
 Loads the given document. More...
 
virtual bool IsThreaded () const
 Returns true whether the backend is threaded. More...
 

Detailed Description

Basic interface for format backends plugins for Monocle.

This interface should be implemented by plugins that provide format backends for Monocle document reader — that is, for those plugins that can load documents.

See Also
IDocument

Definition at line 48 of file ibackendplugin.h.

Constructor & Destructor Documentation

virtual LeechCraft::Monocle::IBackendPlugin::~IBackendPlugin ( )
inlinevirtual

Virtual destructor.

Definition at line 53 of file ibackendplugin.h.

Member Function Documentation

virtual bool LeechCraft::Monocle::IBackendPlugin::CanLoadDocument ( const QString &  filename)
pure virtual

Checks whether the given document can be loaded.

This method should return true if the document can possibly be loaded and false otherwise.

The cheaper this function is, the better. It is discouraged to check by extension, though.

It is OK to return nullptr or invalid document from LoadDocument() even if this method returns true for a given document.

Parameters
filename]in Path to the document to check.
Returns
Whether the document at filename can be loaded.
See Also
LoadDocument()
virtual bool LeechCraft::Monocle::IBackendPlugin::IsThreaded ( ) const
inlinevirtual

Returns true whether the backend is threaded.

This function returns true if the implementation supports threaded pages rendering.

The default implementation simply returns false.

Returns
Whether threaded rendering is supported by this backend.

Definition at line 106 of file ibackendplugin.h.

virtual IDocument_ptr LeechCraft::Monocle::IBackendPlugin::LoadDocument ( const QString &  filename)
pure virtual

Loads the given document.

This method should load the document at filename and return a pointer to it, or a null pointer if the document is invalid.

The ownership is passed to the caller: that is, this backend plugin should keep no strong shared references to the returned document.

It is OK for this method to return a null or invalid document even if CanLoadDocument() returned true for this filename,

Parameters
filename]in The document to load.
Returns
The document object for filename, or null pointer, or invalid document if an error has occurred.
See Also
LoadDocument(), IDocument

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