LeechCraft Monocle  0.6.70-18450-gabe19ee3b0
Modular document viewer for LeechCraft
isaveabledocument.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <QtPlugin>
12 
13 namespace LC
14 {
15 namespace Monocle
16 {
31  {
32  protected:
33  virtual ~ISaveableDocument () = default;
34  public:
39  {
42  bool CanSave_;
43 
50  QString Reason_;
51  };
52 
61  virtual SaveQueryResult CanSave () const = 0;
62 
72  virtual bool Save (const QString& path) = 0;
73  };
74 }
75 }
76 
77 Q_DECLARE_INTERFACE (LC::Monocle::ISaveableDocument,
78  "org.LeechCraft.Monocle.ISaveableDocument/1.0")
Interface for documents that can be saved.
virtual ~ISaveableDocument()=default
QString Reason_
Human-readable reason string.
bool CanSave_
Whether the document can be saved.
Describes the result of check for the possibility of saving.
virtual bool Save(const QString &path)=0
Saves the document at the given path.
virtual SaveQueryResult CanSave() const =0
Checks whether this document can be saved.