LeechCraft Monocle  0.6.70-13729-g7046a9d2a7
Modular document viewer for LeechCraft
LC::Monocle::IRedirectProxy Class Referenceabstract

Interface for redirecting document opening requests. More...

#include "iredirectproxy.h"

Public Member Functions

virtual ~IRedirectProxy ()
 
virtual QObject * GetQObject ()=0
 Returns this object as a QObject. More...
 
virtual QString GetRedirectSource () const =0
 Returns the source filename of the document. More...
 
virtual QString GetRedirectTarget () const =0
 Returns the filename of the converted document. More...
 
virtual QString GetRedirectedMime () const =0
 Returns the MIME type of the converted document. More...
 

Protected Member Functions

virtual void ready (const QString &target)=0
 Emitted when the document has finished converting. More...
 

Detailed Description

Interface for redirecting document opening requests.

This interface is used when a backend can't open a document, but can convert it to a format probably openable by another Monocle plugin.

The GetRedirectedMime() method returns the MIME of the converted document.

GetRedirectSource() returns the filename of the source document, and GetRedirectTarget() returns the filename of the converted document.

The redirect proxy should start converting after a small delay after construction (like after spinning the main event loop via QTimer with a zero timeout). This is because temporary IRedirectProxy objects can be requested by Monocle to get the MIME type of the redirected document without actually converting it.

See also
IBackendPlugin
IBackendPlugin::GetRedirection()

Definition at line 61 of file iredirectproxy.h.

Constructor & Destructor Documentation

◆ ~IRedirectProxy()

virtual LC::Monocle::IRedirectProxy::~IRedirectProxy ( )
inlinevirtual

Definition at line 64 of file iredirectproxy.h.

Member Function Documentation

◆ GetQObject()

virtual QObject* LC::Monocle::IRedirectProxy::GetQObject ( )
pure virtual

Returns this object as a QObject.

Returns
This object as a QObject.

◆ GetRedirectedMime()

virtual QString LC::Monocle::IRedirectProxy::GetRedirectedMime ( ) const
pure virtual

Returns the MIME type of the converted document.

This function should return valid data even before ready() is emitted.

Returns
The MIME type of the converted document.

◆ GetRedirectSource()

virtual QString LC::Monocle::IRedirectProxy::GetRedirectSource ( ) const
pure virtual

Returns the source filename of the document.

The source filename is what's been passed to the IBackendPlugin::GetRedirection() method.

This function should return valid data even before ready() is emitted.

Returns
The file name of the source document being converted.

◆ GetRedirectTarget()

virtual QString LC::Monocle::IRedirectProxy::GetRedirectTarget ( ) const
pure virtual

Returns the filename of the converted document.

This function should return valid data even before ready() is emitted.

Returns
The file name of the converted document.

◆ ready()

virtual void LC::Monocle::IRedirectProxy::ready ( const QString &  target)
protectedpure virtual

Emitted when the document has finished converting.

This signal should be emitted both when document is converted successfully and when it failed to be converted.

Note
This function is expected to be a signal.
Parameters
[out]targetThe target document.

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