Okular

generator.h
1 /*
2  SPDX-FileCopyrightText: 2004-5 Enrico Ros <[email protected]>
3  SPDX-FileCopyrightText: 2005 Piotr Szymanski <[email protected]>
4  SPDX-FileCopyrightText: 2008 Albert Astals Cid <[email protected]>
5 
6  Work sponsored by the LiMux project of the city of Munich:
7  SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB a KDAB Group company <[email protected]>
8 
9  SPDX-License-Identifier: GPL-2.0-or-later
10 */
11 
12 #ifndef _OKULAR_GENERATOR_H_
13 #define _OKULAR_GENERATOR_H_
14 
15 #include "document.h"
16 #include "fontinfo.h"
17 #include "global.h"
18 #include "okularcore_export.h"
19 #include "pagesize.h"
20 #include "signatureutils.h"
21 
22 #include <QList>
23 #include <QObject>
24 #include <QSharedDataPointer>
25 #include <QSizeF>
26 #include <QString>
27 #include <QVariant>
28 #include <QVector>
29 
30 #include <KPluginFactory>
31 #include <QMimeType>
32 
33 #define OKULAR_EXPORT_PLUGIN(classname, json) \
34  static_assert(json[0] != '\0', "arg2 must be a string literal"); \
35  K_PLUGIN_CLASS_WITH_JSON(classname, json)
36 
37 class QByteArray;
38 class QMutex;
39 class QPrinter;
40 class QIcon;
41 
42 namespace Okular
43 {
44 class BackendOpaqueAction;
45 class DocumentFonts;
46 class DocumentInfo;
47 class DocumentObserver;
48 class DocumentSynopsis;
49 class EmbeddedFile;
50 class ExportFormatPrivate;
51 class FontInfo;
52 class GeneratorPrivate;
53 class Page;
54 class PixmapRequest;
55 class PixmapRequestPrivate;
56 class TextPage;
57 class TextRequest;
58 class TextRequestPrivate;
59 class NormalizedRect;
60 
61 /* Note: on contents generation and asynchronous queries.
62  * Many observers may want to request data synchronously or asynchronously.
63  * - Sync requests. These should be done in-place.
64  * - Async request must be done in real background. That usually means a
65  * thread, such as QThread derived classes.
66  * Once contents are available, they must be immediately stored in the
67  * Page they refer to, and a signal is emitted as soon as storing
68  * (even for sync or async queries) has been done.
69  */
70 
71 /**
72  * @short Defines an entry for the export menu
73  *
74  * This class encapsulates information about an export format.
75  * Every Generator can support 0 or more export formats which can be
76  * queried with @ref Generator::exportFormats().
77  */
78 class OKULARCORE_EXPORT ExportFormat
79 {
80 public:
81  typedef QList<ExportFormat> List;
82 
83  /**
84  * Creates an empty export format.
85  *
86  * @see isNull()
87  */
88  ExportFormat();
89 
90  /**
91  * Creates a new export format.
92  *
93  * @param description The i18n'ed description of the format.
94  * @param mimeType The supported mime type of the format.
95  */
96  ExportFormat(const QString &description, const QMimeType &mimeType);
97 
98  /**
99  * Creates a new export format.
100  *
101  * @param icon The icon used in the GUI for this format.
102  * @param description The i18n'ed description of the format.
103  * @param mimeType The supported mime type of the format.
104  */
105  ExportFormat(const QIcon &icon, const QString &description, const QMimeType &mimeType);
106 
107  /**
108  * Destroys the export format.
109  */
110  ~ExportFormat();
111 
112  /**
113  * @internal
114  */
115  ExportFormat(const ExportFormat &other);
116 
117  /**
118  * @internal
119  */
120  ExportFormat &operator=(const ExportFormat &other);
121 
122  /**
123  * Returns the description of the format.
124  */
125  QString description() const;
126 
127  /**
128  * Returns the mime type of the format.
129  */
130  QMimeType mimeType() const;
131 
132  /**
133  * Returns the icon for GUI representations of the format.
134  */
135  QIcon icon() const;
136 
137  /**
138  * Returns whether the export format is null/valid.
139  *
140  * An ExportFormat is null if the mimetype is not valid or the
141  * description is empty, or both.
142  */
143  bool isNull() const;
144 
145  /**
146  * Type of standard export format.
147  */
149  PlainText, ///< Plain text
150  PDF, ///< PDF, aka Portable Document Format
151  OpenDocumentText, ///< OpenDocument Text format @since 0.8 (KDE 4.2)
152  HTML ///< OpenDocument Text format @since 0.8 (KDE 4.2)
153  };
154 
155  /**
156  * Builds a standard format for the specified @p type .
157  */
158  static ExportFormat standardFormat(StandardExportFormat type);
159 
160  bool operator==(const ExportFormat &other) const;
161 
162  bool operator!=(const ExportFormat &other) const;
163 
164 private:
165  /// @cond PRIVATE
166  friend class ExportFormatPrivate;
167  /// @endcond
169 };
170 
171 /**
172  * @short [Abstract Class] The information generator.
173  *
174  * Most of class members are virtuals and some of them pure virtual. The pure
175  * virtuals provide the minimal functionalities for a Generator, that is being
176  * able to generate QPixmap for the Page 's of the Document.
177  *
178  * Implementing the other functions will make the Generator able to provide
179  * more contents and/or functionalities (like text extraction).
180  *
181  * Generation/query is requested by the Document class only, and that
182  * class stores the resulting data into Page s. The data will then be
183  * displayed by the GUI components (PageView, ThumbnailList, etc..).
184  *
185  * @see PrintInterface, ConfigInterface, GuiInterface
186  */
187 class OKULARCORE_EXPORT Generator : public QObject
188 {
189  /// @cond PRIVATE
190  friend class PixmapGenerationThread;
191  friend class TextPageGenerationThread;
192  /// @endcond
193 
194  Q_OBJECT
195 
196 public:
197  /**
198  * Describe the possible optional features that a Generator can
199  * provide.
200  */
202  Threaded, ///< Whether the Generator supports asynchronous generation of pictures or text pages
203  TextExtraction, ///< Whether the Generator can extract text from the document in the form of TextPage's
204  ReadRawData, ///< Whether the Generator can read a document directly from its raw data.
205  FontInfo, ///< Whether the Generator can provide information about the fonts used in the document
206  PageSizes, ///< Whether the Generator can change the size of the document pages.
207  PrintNative, ///< Whether the Generator supports native cross-platform printing (QPainter-based).
208  PrintPostscript, ///< Whether the Generator supports postscript-based file printing.
209  PrintToFile, ///< Whether the Generator supports export to PDF & PS through the Print Dialog
210  TiledRendering, ///< Whether the Generator can render tiles @since 0.16 (KDE 4.10)
211  SwapBackingFile, ///< Whether the Generator can hot-swap the file it's reading from @since 1.3
212  SupportsCancelling ///< Whether the Generator can cancel requests @since 1.4
213  };
214 
215  /**
216  * Creates a new generator.
217  */
218  explicit Generator(QObject *parent = nullptr, const QVariantList &args = QVariantList());
219 
220  /**
221  * Destroys the generator.
222  */
223  ~Generator() override;
224 
225  /**
226  * Loads the document with the given @p fileName and fills the
227  * @p pagesVector with the parsed pages.
228  *
229  * @note If you implement the WithPassword variants you don't need to implement this one
230  *
231  * @returns true on success, false otherwise.
232  */
233  virtual bool loadDocument(const QString &fileName, QVector<Page *> &pagesVector);
234 
235  /**
236  * Loads the document from the raw data @p fileData and fills the
237  * @p pagesVector with the parsed pages.
238  *
239  * @note If you implement the WithPassword variants you don't need to implement this one
240  *
241  * @note the Generator has to have the feature @ref ReadRawData enabled
242  *
243  * @returns true on success, false otherwise.
244  */
245  virtual bool loadDocumentFromData(const QByteArray &fileData, QVector<Page *> &pagesVector);
246 
247  /**
248  * Loads the document with the given @p fileName and @p password and fills the
249  * @p pagesVector with the parsed pages.
250  *
251  * @note Do not implement this if your format doesn't support passwords, it'll cleanly call loadDocument()
252  *
253  * @since 0.20 (KDE 4.14)
254  *
255  * @returns a LoadResult defining the result of the operation
256  */
257  virtual Document::OpenResult loadDocumentWithPassword(const QString &fileName, QVector<Page *> &pagesVector, const QString &password);
258 
259  /**
260  * Loads the document from the raw data @p fileData and @p password and fills the
261  * @p pagesVector with the parsed pages.
262  *
263  * @note Do not implement this if your format doesn't support passwords, it'll cleanly call loadDocumentFromData()
264  *
265  * @note the Generator has to have the feature @ref ReadRawData enabled
266  *
267  * @since 0.20 (KDE 4.14)
268  *
269  * @returns a LoadResult defining the result of the operation
270  */
271  virtual Document::OpenResult loadDocumentFromDataWithPassword(const QByteArray &fileData, QVector<Page *> &pagesVector, const QString &password);
272 
273  /**
274  * Describes the result of an swap file operation.
275  *
276  * @since 1.3
277  */
279  SwapBackingFileError, //< The document could not be swapped
280  SwapBackingFileNoOp, //< The document was swapped and nothing needs to be done
281  SwapBackingFileReloadInternalData //< The document was swapped and internal data (forms, annotations, etc) needs to be reloaded
282  };
283 
284  /**
285  * Changes the path of the file we are reading from. The new path must
286  * point to a copy of the same document.
287  *
288  * @note the Generator has to have the feature @ref SwapBackingFile enabled
289  *
290  * @since 1.3
291  */
292  virtual SwapBackingFileResult swapBackingFile(const QString &newFileName, QVector<Okular::Page *> &newPagesVector);
293 
294  /**
295  * This method is called when the document is closed and not used
296  * any longer.
297  *
298  * @returns true on success, false otherwise.
299  */
300  bool closeDocument();
301 
302  /**
303  * This method returns whether the generator is ready to
304  * handle a new pixmap request.
305  */
306  virtual bool canGeneratePixmap() const;
307 
308  virtual bool canSign() const;
309 
310  virtual bool sign(const NewSignatureData &data, const QString &rFilename);
311 
312  virtual CertificateStore *certificateStore() const;
313 
314  /**
315  * This method can be called to trigger the generation of
316  * a new pixmap as described by @p request.
317  */
318  virtual void generatePixmap(PixmapRequest *request);
319 
320  /**
321  * This method returns whether the generator is ready to
322  * handle a new text page request.
323  */
324  virtual bool canGenerateTextPage() const;
325 
326  /**
327  * This method can be called to trigger the generation of
328  * a text page for the given @p page.
329  *
330  * The generation is done in the calling thread.
331  *
332  * @see TextPage
333  */
334  void generateTextPage(Page *page);
335 
336  /**
337  * Returns the general information object of the document.
338  *
339  * Changed signature in okular version 0.21
340  */
341  virtual DocumentInfo generateDocumentInfo(const QSet<DocumentInfo::Key> &keys) const;
342 
343  /**
344  * Returns the 'table of content' object of the document or 0 if
345  * no table of content is available.
346  */
347  virtual const DocumentSynopsis *generateDocumentSynopsis();
348 
349  /**
350  * Returns the 'list of embedded fonts' object of the specified \p page
351  * of the document.
352  *
353  * \param page a page of the document, starting from 0 - -1 indicates all
354  * the other fonts
355  */
356  virtual FontInfo::List fontsForPage(int page);
357 
358  /**
359  * Returns the 'list of embedded files' object of the document or 0 if
360  * no list of embedded files is available.
361  */
362  virtual const QList<EmbeddedFile *> *embeddedFiles() const;
363 
364  /**
365  * This enum identifies the metric of the page size.
366  */
368  None, ///< The page size is not defined in a physical metric.
369  Points, ///< The page size is given in 1/72 inches.
370  Pixels ///< The page size is given in screen pixels @since 0.19 (KDE 4.13)
371  };
372 
373  /**
374  * This method returns the metric of the page size. Default is @ref None.
375  */
376  virtual PageSizeMetric pagesSizeMetric() const;
377 
378  /**
379  * Returns whether the given @p action is allowed in the document.
380  * @see @ref Okular::Permission
381  */
382  virtual bool isAllowed(Permission action) const;
383 
384  /**
385  * This method is called when the orientation has been changed by the user.
386  */
387  virtual void rotationChanged(Rotation orientation, Rotation oldOrientation);
388 
389  /**
390  * Returns the list of supported page sizes.
391  */
392  virtual PageSize::List pageSizes() const;
393 
394  /**
395  * This method is called when the page size has been changed by the user.
396  */
397  virtual void pageSizeChanged(const PageSize &pageSize, const PageSize &oldPageSize);
398 
399  /**
400  * This method is called to print the document to the given @p printer.
401  */
402  virtual bool print(QPrinter &printer);
403 
404  /**
405  * Possible print errors
406  * @since 0.11 (KDE 4.5)
407  */
408  enum PrintError {
409  NoPrintError, ///< There was no print error
410  UnknownPrintError,
411  TemporaryFileOpenPrintError,
412  FileConversionPrintError,
413  PrintingProcessCrashPrintError,
414  PrintingProcessStartPrintError,
415  PrintToFilePrintError,
416  InvalidPrinterStatePrintError,
417  UnableToFindFilePrintError,
418  NoFileToPrintError,
419  NoBinaryToPrintError,
420  InvalidPageSizePrintError ///< @since 0.18.2 (KDE 4.12.2)
421  };
422 
423  /**
424  * This method returns the meta data of the given @p key with the given @p option
425  * of the document.
426  */
427  virtual QVariant metaData(const QString &key, const QVariant &option) const;
428 
429  /**
430  * Returns the list of additional supported export formats.
431  */
432  virtual ExportFormat::List exportFormats() const;
433 
434  /**
435  * This method is called to export the document in the given @p format and save it
436  * under the given @p fileName. The format must be one of the supported export formats.
437  */
438  virtual bool exportTo(const QString &fileName, const ExportFormat &format);
439 
440  /**
441  * This method is called to know which wallet data should be used for the given file name.
442  * Unless you have very special requirements to where wallet data should be stored you
443  * don't need to reimplement this method.
444  */
445  virtual void walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const;
446 
447  /**
448  * Query for the specified @p feature.
449  */
450  bool hasFeature(GeneratorFeature feature) const;
451 
452  /**
453  * Update DPI of the generator
454  *
455  * @since 0.19 (KDE 4.13)
456  */
457  void setDPI(const QSizeF &dpi); // TODO remove the & when we do a BIC change elsewhere
458 
459  /**
460  * Returns the 'layers model' object of the document or NULL if
461  * layers model is not available.
462  *
463  * @since 0.24
464  */
465  virtual QAbstractItemModel *layersModel() const;
466 
467  /**
468  * Calls the backend to execute an BackendOpaqueAction
469  */
470  virtual void opaqueAction(const BackendOpaqueAction *action);
471 
472 Q_SIGNALS:
473  /**
474  * This signal should be emitted whenever an error occurred in the generator.
475  *
476  * @param message The message which should be shown to the user.
477  * @param duration The time that the message should be shown to the user.
478  */
479  void error(const QString &message, int duration);
480 
481  /**
482  * This signal should be emitted whenever the user should be warned.
483  *
484  * @param message The message which should be shown to the user.
485  * @param duration The time that the message should be shown to the user.
486  */
487  void warning(const QString &message, int duration);
488 
489  /**
490  * This signal should be emitted whenever the user should be noticed.
491  *
492  * @param message The message which should be shown to the user.
493  * @param duration The time that the message should be shown to the user.
494  */
495  void notice(const QString &message, int duration);
496 
497 protected:
498  /**
499  * This method must be called when the pixmap request triggered by generatePixmap()
500  * has been finished.
501  */
502  void signalPixmapRequestDone(PixmapRequest *request);
503 
504  /**
505  * This method must be called when a text generation has been finished.
506  */
507  void signalTextGenerationDone(Page *page, TextPage *textPage);
508 
509  /**
510  * This method is called when the document is closed and not used
511  * any longer.
512  *
513  * @returns true on success, false otherwise.
514  */
515  virtual bool doCloseDocument() = 0;
516 
517  /**
518  * Returns the image of the page as specified in
519  * the passed pixmap @p request.
520  *
521  * Must return a null image if the request was cancelled and the generator supports cancelling
522  *
523  * @warning this method may be executed in its own separated thread if the
524  * @ref Threaded is enabled!
525  */
526  virtual QImage image(PixmapRequest *request);
527 
528  /**
529  * Returns the text page for the given @p request.
530  *
531  * Must return a null pointer if the request was cancelled and the generator supports cancelling
532  *
533  * @warning this method may be executed in its own separated thread if the
534  * @ref Threaded is enabled!
535  *
536  * @since 1.4
537  */
538  virtual TextPage *textPage(TextRequest *request);
539 
540  /**
541  * Returns a pointer to the document.
542  */
543  const Document *document() const;
544 
545  /**
546  * Toggle the @p feature .
547  */
548  void setFeature(GeneratorFeature feature, bool on = true);
549 
550  /**
551  * Internal document setting
552  */
554  PaperColorMetaData, ///< Returns (QColor) the paper color if set in Settings or the default color (white) if option is true (otherwise returns a non initialized QColor)
555  TextAntialiasMetaData, ///< Returns (bool) text antialias from Settings (option is not used)
556  GraphicsAntialiasMetaData, ///< Returns (bool)graphic antialias from Settings (option is not used)
557  TextHintingMetaData ///< Returns (bool)text hinting from Settings (option is not used)
558  };
559 
560  /**
561  * Request a meta data of the Document, if available, like an internal
562  * setting.
563  *
564  * @since 1.1
565  */
566  QVariant documentMetaData(const DocumentMetaDataKey key, const QVariant &option = QVariant()) const;
567 
568  /**
569  * Request a meta data of the Document, if available, like an internal
570  * setting.
571  */
572  OKULARCORE_DEPRECATED QVariant documentMetaData(const QString &key, const QVariant &option = QVariant()) const;
573 
574  /**
575  * Return the pointer to a mutex the generator can use freely.
576  */
577  QMutex *userMutex() const;
578 
579  /**
580  * Set the bounding box of a page after the page has already been handed
581  * to the Document. Call this instead of Page::setBoundingBox() to ensure
582  * that all observers are notified.
583  *
584  * @since 0.7 (KDE 4.1)
585  */
586  void updatePageBoundingBox(int page, const NormalizedRect &boundingBox);
587 
588  /**
589  * Returns DPI, previously set via setDPI()
590  * @since 0.19 (KDE 4.13)
591  */
592  QSizeF dpi() const;
593 
594 protected Q_SLOTS:
595  /**
596  * Gets the font data for the given font
597  *
598  * @since 0.8 (KDE 4.1)
599  */
600  // TODO Make it return a QByteArray and be virtual when a BIC change happens somewhere else
601  void requestFontData(const Okular::FontInfo &font, QByteArray *data);
602 
603  /**
604  * This method can be called to trigger a partial pixmap update for the given request
605  * Make sure you call it in a way it's executed in the main thread.
606  * @since 1.3
607  */
608  void signalPartialPixmapRequest(Okular::PixmapRequest *request, const QImage &image);
609 
610 protected:
611  /**
612  * Returns the last print error in case print() failed
613  * @since 0.11 (KDE 4.5)
614  */
615  // TODO Make print() return a PrintError instead of bool and remove this function when a BIC change happens somewhere else
616  Q_INVOKABLE Okular::Generator::PrintError printError() const;
617 
618  /// @cond PRIVATE
619  Generator(GeneratorPrivate &dd, QObject *parent, const QVariantList &args);
620  Q_DECLARE_PRIVATE(Generator)
621  GeneratorPrivate *d_ptr;
622 
623  friend class Document;
624  friend class DocumentPrivate;
625  /// @endcond PRIVATE
626 
627 private:
628  Q_DISABLE_COPY(Generator)
629 };
630 
631 /**
632  * @short Describes a pixmap type request.
633  */
634 class OKULARCORE_EXPORT PixmapRequest
635 {
636  friend class Document;
637  friend class DocumentPrivate;
638 
639 public:
640  enum PixmapRequestFeature { NoFeature = 0, Asynchronous = 1, Preload = 2 };
641  Q_DECLARE_FLAGS(PixmapRequestFeatures, PixmapRequestFeature)
642 
643  /**
644  * Creates a new pixmap request.
645  *
646  * @param observer The observer.
647  * @param pageNumber The page number.
648  * @param width The width of the page in logical pixels.
649  * @param height The height of the page in logical pixels.
650  * @param priority The priority of the request.
651  * @param features The features of generation.
652  */
653  [[deprecated("This PixmapRequest constructor is deprecated, use the one including the device pixel ratio")]] PixmapRequest(DocumentObserver *observer, int pageNumber, int width, int height, int priority, PixmapRequestFeatures features);
654 
655  /**
656  * Creates a new pixmap request.
657  *
658  * @param observer The observer.
659  * @param pageNumber The page number.
660  * @param width The width of the page in logical pixels.
661  * @param height The height of the page in logical pixels.
662  * @param dpr Device pixel ratio of the screen that the pixmap is intended for.
663  * @param priority The priority of the request.
664  * @param features The features of generation.
665  */
666  PixmapRequest(DocumentObserver *observer, int pageNumber, int width, int height, qreal dpr, int priority, PixmapRequestFeatures features);
667 
668  /**
669  * Destroys the pixmap request.
670  */
671  ~PixmapRequest();
672 
673  /**
674  * Returns the observer of the request.
675  */
676  DocumentObserver *observer() const;
677 
678  /**
679  * Returns the page number of the request.
680  */
681  int pageNumber() const;
682 
683  /**
684  * Returns the page width of the requested pixmap.
685  */
686  int width() const;
687 
688  /**
689  * Returns the page height of the requested pixmap.
690  */
691  int height() const;
692 
693  /**
694  * Returns the priority (less it better, 0 is maximum) of the
695  * request.
696  */
697  int priority() const;
698 
699  /**
700  * Returns whether the generation should be done synchronous or
701  * asynchronous.
702  *
703  * If asynchronous, the pixmap is created in a thread and the observer
704  * is notified when the job is done.
705  */
706  bool asynchronous() const;
707 
708  /**
709  * Returns whether the generation request is for a page that is not important
710  * i.e. it's just for speeding up future rendering
711  */
712  bool preload() const;
713 
714  /**
715  * Returns a pointer to the page where the pixmap shall be generated for.
716  */
717  Page *page() const;
718 
719  /**
720  * Sets whether the generator should render only the given normalized
721  * rect or the entire page
722  *
723  * @since 0.16 (KDE 4.10)
724  */
725  void setTile(bool tile);
726 
727  /**
728  * Returns whether the generator should render just the region given by
729  * normalizedRect() or the entire page.
730  *
731  * @since 0.16 (KDE 4.10)
732  */
733  bool isTile() const;
734 
735  /**
736  * Sets the region of the page to request.
737  *
738  * @since 0.16 (KDE 4.10)
739  */
740  void setNormalizedRect(const NormalizedRect &rect);
741 
742  /**
743  * Returns the normalized region of the page to request.
744  *
745  * @since 0.16 (KDE 4.10)
746  */
747  const NormalizedRect &normalizedRect() const;
748 
749  /**
750  * Sets whether the request should report back updates if possible
751  *
752  * @since 1.3
753  */
754  void setPartialUpdatesWanted(bool partialUpdatesWanted);
755 
756  /**
757  * Should the request report back updates if possible?
758  *
759  * @since 1.3
760  */
761  bool partialUpdatesWanted() const;
762 
763  /**
764  * Should the request be aborted if possible?
765  *
766  * @since 1.4
767  */
768  bool shouldAbortRender() const;
769 
770 private:
771  Q_DISABLE_COPY(PixmapRequest)
772 
773  friend class PixmapRequestPrivate;
774  PixmapRequestPrivate *const d;
775 };
776 
777 /**
778  * @short Describes a text request.
779  *
780  * @since 1.4
781  */
782 class OKULARCORE_EXPORT TextRequest
783 {
784 public:
785  /**
786  * Creates a new text request.
787  */
788  explicit TextRequest(Page *page);
789 
790  TextRequest();
791 
792  /**
793  * Destroys the pixmap request.
794  */
795  ~TextRequest();
796 
797  /**
798  * Returns a pointer to the page where the pixmap shall be generated for.
799  */
800  Page *page() const;
801 
802  /**
803  * Should the request be aborted if possible?
804  */
805  bool shouldAbortExtraction() const;
806 
807 private:
808  Q_DISABLE_COPY(TextRequest)
809 
810  friend TextRequestPrivate;
811  TextRequestPrivate *const d;
812 };
813 
814 }
815 
816 Q_DECLARE_METATYPE(Okular::Generator::PrintError)
817 Q_DECLARE_METATYPE(Okular::PixmapRequest *)
818 
819 #define OkularGeneratorInterface_iid "org.kde.okular.Generator"
820 Q_DECLARE_INTERFACE(Okular::Generator, OkularGeneratorInterface_iid)
821 
822 #ifndef QT_NO_DEBUG_STREAM
823 OKULARCORE_EXPORT QDebug operator<<(QDebug str, const Okular::PixmapRequest &req);
824 #endif
825 
826 #endif
827 
828 /* kate: replace-tabs on; indent-width 4; */
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition: generator.h:209
DocumentMetaDataKey
Internal document setting.
Definition: generator.h:553
Rotation
A rotation.
Definition: global.h:45
Represents the textual information of a Page.
Definition: textpage.h:105
PageSizeMetric
This enum identifies the metric of the page size.
Definition: generator.h:367
Whether the Generator can read a document directly from its raw data.
Definition: generator.h:204
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition: area.h:189
Returns (bool) text antialias from Settings (option is not used)
Definition: generator.h:555
Whether the Generator can provide information about the fonts used in the document.
Definition: generator.h:205
Describes a text request.
Definition: generator.h:782
Whether the Generator supports postscript-based file printing.
Definition: generator.h:208
global.h
Definition: action.h:16
The page size is given in 1/72 inches.
Definition: generator.h:369
OpenResult
Describes the result of an open document operation.
Definition: document.h:209
Whether the Generator can hot-swap the file it&#39;s reading from.
Definition: generator.h:211
Whether the Generator supports asynchronous generation of pictures or text pages. ...
Definition: generator.h:202
A small class that represents the information of a font.
Definition: fontinfo.h:24
There was no print error.
Definition: generator.h:409
OpenDocument Text format.
Definition: generator.h:151
The Document.
Definition: document.h:190
Collector for all the data belonging to a page.
Definition: page.h:49
Whether the Generator can change the size of the document pages.
Definition: generator.h:206
Will create the object in an asynchronous way.
Definition: global.h:57
Returns (QColor) the paper color if set in Settings or the default color (white) if option is true (o...
Definition: generator.h:554
StandardExportFormat
Type of standard export format.
Definition: generator.h:148
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition: generator.h:207
A helper class to store information about x509 certificate.
The DocumentInfo structure can be filled in by generators to display metadata about the currently ope...
Definition: document.h:74
PDF, aka Portable Document Format.
Definition: generator.h:150
Data needed to create a new signature.
Definition: document.h:1489
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Returns (bool)graphic antialias from Settings (option is not used)
Definition: generator.h:556
The page size is not defined in a physical metric.
Definition: generator.h:368
Defines an entry for the export menu.
Definition: generator.h:78
A small class that represents the size of a page.
Definition: pagesize.h:23
PrintError
Possible print errors.
Definition: generator.h:408
Base class for objects being notified when something changes.
Definition: observer.h:28
Whether the Generator can render tiles.
Definition: generator.h:210
Permission
Describes the DRM capabilities.
Definition: global.h:23
Whether the Generator can extract text from the document in the form of TextPage&#39;s.
Definition: generator.h:203
SwapBackingFileResult
Describes the result of an swap file operation.
Definition: generator.h:278
A DOM tree that describes the Table of Contents.
Definition: document.h:1382
Describes a pixmap type request.
Definition: generator.h:634
[Abstract Class] The information generator.
Definition: generator.h:187
GeneratorFeature
Describe the possible optional features that a Generator can provide.
Definition: generator.h:201
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 22:32:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.