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

Interface for documents that can be saved. More...

#include "isaveabledocument.h"

Classes

struct  SaveQueryResult
 Describes the result of check for the possibility of saving. More...
 

Public Member Functions

virtual ~ISaveableDocument ()
 Virtual destructor. More...
 
virtual SaveQueryResult CanSave () const =0
 Checks whether this document can be saved. More...
 
virtual bool Save (const QString &path)=0
 Saves the document at the given path. More...
 

Detailed Description

Interface for documents that can be saved.

This interface should be implemented by documents for formats that allow saving the document after its editable elements (like forms or annotations) were modified.

Not all documents of the same format support saving: for example, encrypted PDF documents cannot be saved, while regular ones can. Thus the CanSave() method checks whether this particular document can be saved.

See also
ISupportForms, ISupportAnnotations

Definition at line 51 of file isaveabledocument.h.

Constructor & Destructor Documentation

◆ ~ISaveableDocument()

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

Virtual destructor.

Definition at line 56 of file isaveabledocument.h.

Member Function Documentation

◆ CanSave()

virtual SaveQueryResult LC::Monocle::ISaveableDocument::CanSave ( ) const
pure virtual

Checks whether this document can be saved.

This method should check if the document can be saved and return a proper SaveQueryResult.

Returns
Whether this document can be saved, and reason string if it can't.

◆ Save()

virtual bool LC::Monocle::ISaveableDocument::Save ( const QString &  path)
pure virtual

Saves the document at the given path.

The path can be equal to the original document path, plugins should take this into account.

Parameters
[in]pathThe full path to the target file including the file name.
Returns
Whether the document is saved successfully.

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