Okular

generator.h
1/*
2 SPDX-FileCopyrightText: 2004-5 Enrico Ros <eros.kde@email.it>
3 SPDX-FileCopyrightText: 2005 Piotr Szymanski <niedakh@gmail.com>
4 SPDX-FileCopyrightText: 2008 Albert Astals Cid <aacid@kde.org>
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 <info@kdab.com>
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
37class QByteArray;
38class QMutex;
39class QPrinter;
40class QIcon;
41
42namespace Okular
43{
44class BackendOpaqueAction;
45class DocumentFonts;
46class DocumentInfo;
47class DocumentObserver;
48class DocumentSynopsis;
49class EmbeddedFile;
50class ExportFormatPrivate;
51class FontInfo;
52class GeneratorPrivate;
53class Page;
54class PixmapRequest;
55class PixmapRequestPrivate;
56class TextPage;
57class TextRequest;
58class TextRequestPrivate;
59class 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 */
78class OKULARCORE_EXPORT ExportFormat
79{
80public:
82
83 /**
84 * Creates an empty export format.
85 *
86 * @see isNull()
87 */
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 */
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
164private:
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 */
187class OKULARCORE_EXPORT Generator : public QObject
188{
189 /// @cond PRIVATE
190 friend class PixmapGenerationThread;
191 friend class TextPageGenerationThread;
192 /// @endcond
193
194 Q_OBJECT
195
196public:
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 Document::PrintError print(QPrinter &printer);
403
404 /**
405 * This method returns the meta data of the given @p key with the given @p option
406 * of the document.
407 */
408 virtual QVariant metaData(const QString &key, const QVariant &option) const;
409
410 /**
411 * Returns the list of additional supported export formats.
412 */
413 virtual ExportFormat::List exportFormats() const;
414
415 /**
416 * This method is called to export the document in the given @p format and save it
417 * under the given @p fileName. The format must be one of the supported export formats.
418 */
419 virtual bool exportTo(const QString &fileName, const ExportFormat &format);
420
421 /**
422 * This method is called to know which wallet data should be used for the given file name.
423 * Unless you have very special requirements to where wallet data should be stored you
424 * don't need to reimplement this method.
425 */
426 virtual void walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const;
427
428 /**
429 * Query for the specified @p feature.
430 */
431 bool hasFeature(GeneratorFeature feature) const;
432
433 /**
434 * Update DPI of the generator
435 *
436 * @since 0.19 (old signature)
437 * @since 22.04 (new signature)
438 */
439 void setDPI(const QSizeF dpi);
440
441 /**
442 * Returns the 'layers model' object of the document or NULL if
443 * layers model is not available.
444 *
445 * @since 0.24
446 */
447 virtual QAbstractItemModel *layersModel() const;
448
449 /**
450 * Calls the backend to execute an BackendOpaqueAction
451 */
452 virtual void opaqueAction(const BackendOpaqueAction *action);
453
454 /**
455 * Frees the contents of the opaque action (if any);
456 *
457 * @since 22.04
458 */
459 virtual void freeOpaqueActionContents(const BackendOpaqueAction &action);
460
461 /**
462 * Retrieves the additional document action for the specified @p type .
463 *
464 * @since 24.08
465 */
466 virtual Okular::Action *additionalDocumentAction(Document::DocumentAdditionalActionType type);
467
468Q_SIGNALS:
469 /**
470 * This signal should be emitted whenever an error occurred in the generator.
471 *
472 * @param message The message which should be shown to the user.
473 * @param duration The time that the message should be shown to the user.
474 */
475 void error(const QString &message, int duration);
476
477 /**
478 * This signal should be emitted whenever the user should be warned.
479 *
480 * @param message The message which should be shown to the user.
481 * @param duration The time that the message should be shown to the user.
482 */
483 void warning(const QString &message, int duration);
484
485 /**
486 * This signal should be emitted whenever the user should be noticed.
487 *
488 * @param message The message which should be shown to the user.
489 * @param duration The time that the message should be shown to the user.
490 */
491 void notice(const QString &message, int duration);
492
493protected:
494 /**
495 * This method must be called when the pixmap request triggered by generatePixmap()
496 * has been finished.
497 */
498 void signalPixmapRequestDone(PixmapRequest *request);
499
500 /**
501 * This method must be called when a text generation has been finished.
502 */
503 void signalTextGenerationDone(Page *page, TextPage *textPage);
504
505 /**
506 * This method is called when the document is closed and not used
507 * any longer.
508 *
509 * @returns true on success, false otherwise.
510 */
511 virtual bool doCloseDocument() = 0;
512
513 /**
514 * Returns the image of the page as specified in
515 * the passed pixmap @p request.
516 *
517 * Must return a null image if the request was cancelled and the generator supports cancelling
518 *
519 * @warning this method may be executed in its own separated thread if the
520 * @ref Threaded is enabled!
521 */
522 virtual QImage image(PixmapRequest *request);
523
524 /**
525 * Returns the text page for the given @p request.
526 *
527 * Must return a null pointer if the request was cancelled and the generator supports cancelling
528 *
529 * @warning this method may be executed in its own separated thread if the
530 * @ref Threaded is enabled!
531 *
532 * @since 1.4
533 */
534 virtual TextPage *textPage(TextRequest *request);
535
536 /**
537 * Returns a pointer to the document.
538 */
539 const Document *document() const;
540
541 /**
542 * Toggle the @p feature .
543 */
544 void setFeature(GeneratorFeature feature, bool on = true);
545
546 /**
547 * Internal document setting
548 */
550 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)
551 TextAntialiasMetaData, ///< Returns (bool) text antialias from Settings (option is not used)
552 GraphicsAntialiasMetaData, ///< Returns (bool)graphic antialias from Settings (option is not used)
553 TextHintingMetaData ///< Returns (bool)text hinting from Settings (option is not used)
554 };
555
556 /**
557 * Request a meta data of the Document, if available, like an internal
558 * setting.
559 *
560 * @since 1.1
561 */
562 QVariant documentMetaData(const DocumentMetaDataKey key, const QVariant &option = QVariant()) const;
563
564 /**
565 * Return the pointer to a mutex the generator can use freely.
566 */
567 QMutex *userMutex() const;
568
569 /**
570 * Set the bounding box of a page after the page has already been handed
571 * to the Document. Call this instead of Page::setBoundingBox() to ensure
572 * that all observers are notified.
573 *
574 * @since 0.7 (KDE 4.1)
575 */
576 void updatePageBoundingBox(int page, const NormalizedRect &boundingBox);
577
578 /**
579 * Returns DPI, previously set via setDPI()
580 * @since 0.19 (KDE 4.13)
581 */
582 QSizeF dpi() const;
583
584 /**
585 * Gets the font data for the given font
586 *
587 * @since 0.8 (old signature)
588 * @since 22.04 (new signature)
589 */
590 virtual QByteArray requestFontData(const Okular::FontInfo &font);
591
592protected Q_SLOTS:
593 /**
594 * This method can be called to trigger a partial pixmap update for the given request
595 * Make sure you call it in a way it's executed in the main thread.
596 * @since 1.3
597 */
598 void signalPartialPixmapRequest(Okular::PixmapRequest *request, const QImage &image);
599
600protected:
601 /// @cond PRIVATE
602 Generator(GeneratorPrivate &dd, QObject *parent, const QVariantList &args);
603 Q_DECLARE_PRIVATE(Generator)
604 GeneratorPrivate *d_ptr;
605
606 friend class Document;
607 friend class DocumentPrivate;
608 /// @endcond PRIVATE
609
610private:
611 Q_DISABLE_COPY(Generator)
612};
613
614/**
615 * @short Describes a pixmap type request.
616 */
617class OKULARCORE_EXPORT PixmapRequest
618{
619 friend class Document;
620 friend class DocumentPrivate;
621
622public:
623 enum PixmapRequestFeature { NoFeature = 0, Asynchronous = 1, Preload = 2 };
624 Q_DECLARE_FLAGS(PixmapRequestFeatures, PixmapRequestFeature)
625
626 /**
627 * Creates a new pixmap request.
628 *
629 * @param observer The observer.
630 * @param pageNumber The page number.
631 * @param width The width of the page in logical pixels.
632 * @param height The height of the page in logical pixels.
633 * @param dpr Device pixel ratio of the screen that the pixmap is intended for.
634 * @param priority The priority of the request.
635 * @param features The features of generation.
636 */
637 PixmapRequest(DocumentObserver *observer, int pageNumber, int width, int height, qreal dpr, int priority, PixmapRequestFeatures features);
638
639 /**
640 * Destroys the pixmap request.
641 */
643
644 /**
645 * Returns the observer of the request.
646 */
647 DocumentObserver *observer() const;
648
649 /**
650 * Returns the page number of the request.
651 */
652 int pageNumber() const;
653
654 /**
655 * Returns the page width of the requested pixmap.
656 */
657 int width() const;
658
659 /**
660 * Returns the page height of the requested pixmap.
661 */
662 int height() const;
663
664 /**
665 * Returns the priority (less it better, 0 is maximum) of the
666 * request.
667 */
668 int priority() const;
669
670 /**
671 * Returns whether the generation should be done synchronous or
672 * asynchronous.
673 *
674 * If asynchronous, the pixmap is created in a thread and the observer
675 * is notified when the job is done.
676 */
677 bool asynchronous() const;
678
679 /**
680 * Returns whether the generation request is for a page that is not important
681 * i.e. it's just for speeding up future rendering
682 */
683 bool preload() const;
684
685 /**
686 * Returns a pointer to the page where the pixmap shall be generated for.
687 */
688 Page *page() const;
689
690 /**
691 * Sets whether the generator should render only the given normalized
692 * rect or the entire page
693 *
694 * @since 0.16 (KDE 4.10)
695 */
696 void setTile(bool tile);
697
698 /**
699 * Returns whether the generator should render just the region given by
700 * normalizedRect() or the entire page.
701 *
702 * @since 0.16 (KDE 4.10)
703 */
704 bool isTile() const;
705
706 /**
707 * Sets the region of the page to request.
708 *
709 * @since 0.16 (KDE 4.10)
710 */
711 void setNormalizedRect(const NormalizedRect &rect);
712
713 /**
714 * Returns the normalized region of the page to request.
715 *
716 * @since 0.16 (KDE 4.10)
717 */
718 const NormalizedRect &normalizedRect() const;
719
720 /**
721 * Sets whether the request should report back updates if possible
722 *
723 * @since 1.3
724 */
725 void setPartialUpdatesWanted(bool partialUpdatesWanted);
726
727 /**
728 * Should the request report back updates if possible?
729 *
730 * @since 1.3
731 */
732 bool partialUpdatesWanted() const;
733
734 /**
735 * Should the request be aborted if possible?
736 *
737 * @since 1.4
738 */
739 bool shouldAbortRender() const;
740
741private:
742 Q_DISABLE_COPY(PixmapRequest)
743
744 friend class PixmapRequestPrivate;
745 PixmapRequestPrivate *const d;
746};
747
748/**
749 * @short Describes a text request.
750 *
751 * @since 1.4
752 */
753class OKULARCORE_EXPORT TextRequest
754{
755public:
756 /**
757 * Creates a new text request.
758 */
759 explicit TextRequest(Page *page);
760
761 TextRequest();
762
763 /**
764 * Destroys the pixmap request.
765 */
766 ~TextRequest();
767
768 /**
769 * Returns a pointer to the page where the pixmap shall be generated for.
770 */
771 Page *page() const;
772
773 /**
774 * Should the request be aborted if possible?
775 */
776 bool shouldAbortExtraction() const;
777
778private:
779 Q_DISABLE_COPY(TextRequest)
780
781 friend TextRequestPrivate;
782 TextRequestPrivate *const d;
783};
784
785}
786
787Q_DECLARE_METATYPE(Okular::PixmapRequest *)
788
789#define OkularGeneratorInterface_iid "org.kde.okular.Generator"
790Q_DECLARE_INTERFACE(Okular::Generator, OkularGeneratorInterface_iid)
791
792#ifndef QT_NO_DEBUG_STREAM
793OKULARCORE_EXPORT QDebug operator<<(QDebug str, const Okular::PixmapRequest &req);
794#endif
795
796#endif
797
798/* kate: replace-tabs on; indent-width 4; */
Encapsulates data that describes an action.
Definition action.h:41
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:76
Base class for objects being notified when something changes.
Definition observer.h:29
A DOM tree that describes the Table of Contents.
Definition document.h:1504
The Document.
Definition document.h:192
DocumentAdditionalActionType
Describes the additional actions available in the Document.
Definition document.h:760
OpenResult
Describes the result of an open document operation.
Definition document.h:210
Defines an entry for the export menu.
Definition generator.h:79
StandardExportFormat
Type of standard export format.
Definition generator.h:148
@ PDF
PDF, aka Portable Document Format.
Definition generator.h:150
@ OpenDocumentText
OpenDocument Text format.
Definition generator.h:151
@ PlainText
Plain text.
Definition generator.h:149
A small class that represents the information of a font.
Definition fontinfo.h:25
[Abstract Class] The information generator.
Definition generator.h:188
void error(const QString &message, int duration)
This signal should be emitted whenever an error occurred in the generator.
SwapBackingFileResult
Describes the result of an swap file operation.
Definition generator.h:278
DocumentMetaDataKey
Internal document setting.
Definition generator.h:549
@ GraphicsAntialiasMetaData
Returns (bool)graphic antialias from Settings (option is not used)
Definition generator.h:552
@ TextAntialiasMetaData
Returns (bool) text antialias from Settings (option is not used)
Definition generator.h:551
@ PaperColorMetaData
Returns (QColor) the paper color if set in Settings or the default color (white) if option is true (o...
Definition generator.h:550
void notice(const QString &message, int duration)
This signal should be emitted whenever the user should be noticed.
GeneratorFeature
Describe the possible optional features that a Generator can provide.
Definition generator.h:201
@ Threaded
Whether the Generator supports asynchronous generation of pictures or text pages.
Definition generator.h:202
@ PrintToFile
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition generator.h:209
@ ReadRawData
Whether the Generator can read a document directly from its raw data.
Definition generator.h:204
@ TextExtraction
Whether the Generator can extract text from the document in the form of TextPage's.
Definition generator.h:203
@ TiledRendering
Whether the Generator can render tiles.
Definition generator.h:210
@ SwapBackingFile
Whether the Generator can hot-swap the file it's reading from.
Definition generator.h:211
@ PrintNative
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition generator.h:207
@ FontInfo
Whether the Generator can provide information about the fonts used in the document.
Definition generator.h:205
@ PageSizes
Whether the Generator can change the size of the document pages.
Definition generator.h:206
@ PrintPostscript
Whether the Generator supports postscript-based file printing.
Definition generator.h:208
PageSizeMetric
This enum identifies the metric of the page size.
Definition generator.h:367
@ Points
The page size is given in 1/72 inches.
Definition generator.h:369
@ None
The page size is not defined in a physical metric.
Definition generator.h:368
virtual bool doCloseDocument()=0
This method is called when the document is closed and not used any longer.
void warning(const QString &message, int duration)
This signal should be emitted whenever the user should be warned.
Data needed to create a new signature.
Definition document.h:1611
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition area.h:189
A small class that represents the size of a page.
Definition pagesize.h:24
Collector for all the data belonging to a page.
Definition page.h:48
Describes a pixmap type request.
Definition generator.h:618
Represents the textual information of a Page.
Definition textpage.h:102
Describes a text request.
Definition generator.h:754
global.h
Definition action.h:17
Permission
Describes the DRM capabilities.
Definition global.h:24
Rotation
A rotation.
Definition global.h:46
@ Asynchronous
Will create the object in an asynchronous way.
Definition global.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:37 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.