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 ***************************************************************************/
13 #include "okular_export.h"
21 class DocumentPrivate
;
25 * @short View on the document
27 * The View class represents a "view" on a document.
28 * A view can be registered with only a document at a time.
30 * @since 0.7 (KDE 4.1)
32 class OKULAR_EXPORT View
35 friend class Document
;
36 friend class DocumentPrivate
;
41 * The capabilities of a view
45 Zoom
, ///< Possibility to get/set the zoom of the view
46 ZoomModality
///< Possibility to get/set the zoom mode of the view
50 * The access type of a capability
55 CapabilityRead
= 0x01, ///< Possibility to read a capability
56 CapabilityWrite
= 0x02, ///< Possibility to write a capability
57 CapabilitySerializable
= 0x04 ///< The capability is suitable for being serialized/deserialized
59 Q_DECLARE_FLAGS( CapabilityFlags
, CapabilityFlag
)
64 * Return the document which this view is associated to,
65 * or null if it is not associated with any document.
67 Document
* viewDocument() const;
70 * Return the name of this view.
75 * Must return an unique ID for each view.
77 virtual uint
viewId() const = 0;
80 * Query whether the view support the specified @p capability.
82 virtual bool supportsCapability( ViewCapability capability
) const;
85 * Query the flags for the specified @p capability.
87 virtual CapabilityFlags
capabilityFlags( ViewCapability capability
) const;
90 * Query the value of the specified @p capability.
92 virtual QVariant
capability( ViewCapability capability
) const;
95 * Sets a new value for the specified @p capability.
97 virtual void setCapability( ViewCapability capability
, const QVariant
&option
);
101 * Construct a new view with the specified @p name.
103 View( const QString
&name
);
106 Q_DECLARE_PRIVATE( View
)
111 Q_DISABLE_COPY( View
)
116 Q_DECLARE_OPERATORS_FOR_FLAGS( Okular::View::CapabilityFlags
)