1 /***************************************************************************
2 * Copyright (C) 2008 by Pino Toscano <pino@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _OKULAR_SAVEINTERFACE_H_
11 #define _OKULAR_SAVEINTERFACE_H_
13 #include <okular/core/okular_export.h>
15 #include <QtCore/QObject>
19 class AnnotationProxy
;
22 * @short Abstract interface for saving
24 * This interface defines a way to save (or help saving) the document opened
27 * How to use it in a custom Generator:
29 class MyGenerator : public Okular::Generator, public Okular::SaveInterface
32 Q_INTERFACES( Okular::SaveInterface )
37 * and - of course - implementing its methods.
39 class OKULAR_EXPORT SaveInterface
43 * The possible options for the saving.
48 SaveChanges
= 1 ///< The possibility to save with the current changes to the document.
50 Q_DECLARE_FLAGS( SaveOptions
, SaveOption
)
53 * Destroys the save interface.
55 virtual ~SaveInterface() {}
58 * Query for the supported saving options.
60 * @note NoOption is never queried
62 virtual bool supportsOption( SaveOption option
) const = 0;
65 * Save to the specified @p fileName with the specified @p options.
67 virtual bool save( const QString
&fileName
, SaveOptions options
) = 0;
72 Q_DECLARE_INTERFACE( Okular::SaveInterface
, "org.kde.okular.SaveInterface/0.1" )
73 Q_DECLARE_OPERATORS_FOR_FLAGS( Okular::SaveInterface::SaveOptions
)