Okular

document.h
1 /*
2  SPDX-FileCopyrightText: 2004-2005 Enrico Ros <[email protected]>
3  SPDX-FileCopyrightText: 2004-2008 Albert Astals Cid <[email protected]>
4 
5  Work sponsored by the LiMux project of the city of Munich:
6  SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB a KDAB Group company <[email protected]>
7 
8  SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 
11 #ifndef _OKULAR_DOCUMENT_H_
12 #define _OKULAR_DOCUMENT_H_
13 
14 #include "area.h"
15 #include "global.h"
16 #include "okularcore_export.h"
17 #include "pagesize.h"
18 
19 #include <QDomDocument>
20 #include <QObject>
21 #include <QPrinter>
22 #include <QStringList>
23 #include <QVector>
24 
25 #include <QMimeType>
26 #include <QUrl>
27 
28 class KConfigDialog;
29 class KPluginMetaData;
30 class KXMLGUIClient;
31 class DocumentItem;
32 class QAbstractItemModel;
33 
34 namespace Okular
35 {
36 class Annotation;
37 class BookmarkManager;
38 class CertificateStore;
39 class DocumentInfoPrivate;
40 class DocumentObserver;
41 class DocumentPrivate;
42 class DocumentSynopsis;
43 class DocumentViewport;
44 class EmbeddedFile;
45 class ExportFormat;
46 class FontInfo;
47 class FormField;
48 class FormFieldText;
49 class FormFieldButton;
50 class FormFieldChoice;
51 class Generator;
52 class Action;
53 class MovieAction;
54 class Page;
55 class PixmapRequest;
56 class RenditionAction;
57 class NewSignatureData;
58 struct NewSignatureDataPrivate;
59 class SourceReference;
60 class View;
61 class VisiblePageRect;
62 class SignatureInfo;
63 
64 /** IDs for seaches. Globally defined here. **/
65 #define PART_SEARCH_ID 1
66 #define PAGEVIEW_SEARCH_ID 2
67 #define SW_SEARCH_ID 3
68 #define PRESENTATION_SEARCH_ID 4
69 
70 /**
71  * The DocumentInfo structure can be filled in by generators to display
72  * metadata about the currently opened file.
73  */
74 class OKULARCORE_EXPORT DocumentInfo
75 {
76  friend class Document;
77 
78 public:
79  /**
80  * The list of predefined keys.
81  */
82  enum Key {
83  Title, ///< The title of the document
84  Subject, ///< The subject of the document
85  Description, ///< The description of the document
86  Author, ///< The author of the document
87  Creator, ///< The creator of the document (this can be different from the author)
88  Producer, ///< The producer of the document (e.g. some software)
89  Copyright, ///< The copyright of the document
90  Pages, ///< The number of pages of the document
91  CreationDate, ///< The date of creation of the document
92  ModificationDate, ///< The date of last modification of the document
93  MimeType, ///< The mime type of the document
94  Category, ///< The category of the document
95  Keywords, ///< The keywords which describe the content of the document
96  FilePath, ///< The path of the file @since 0.10 (KDE 4.4)
97  DocumentSize, ///< The size of the document @since 0.10 (KDE 4.4)
98  PagesSize, ///< The size of the pages (if all pages have the same size) @since 0.10 (KDE 4.4)
99  CustomKeys, ///< All the custom keys the generator supports @since 0.21
100  Invalid ///< An invalid key @since 0.21. It will always be the last element in the enum
101  };
102 
103  /**
104  * Creates a new document info.
105  */
106  DocumentInfo();
107  DocumentInfo(const DocumentInfo &info);
108  DocumentInfo &operator=(const DocumentInfo &);
109 
110  ~DocumentInfo();
111 
112  /**
113  * Returns all the keys present in this DocumentInfo
114  *
115  * @since 0.21
116  */
117  QStringList keys() const;
118 
119  /**
120  * Returns the value for a given key or an null string when the
121  * key doesn't exist.
122  */
123  QString get(Key key) const;
124 
125  /**
126  * Returns the value for a given key or an null string when the
127  * key doesn't exist.
128  */
129  QString get(const QString &key) const;
130 
131  /**
132  * Sets a value for a custom key. The title should be an i18n'ed
133  * string, since it's used in the document information dialog.
134  */
135  void set(const QString &key, const QString &value, const QString &title = QString());
136 
137  /**
138  * Sets a value for a special key. The title should be an i18n'ed
139  * string, since it's used in the document information dialog.
140  */
141  void set(Key key, const QString &value);
142 
143  /**
144  * Returns the user visible string for the given key
145  * Takes into account keys added by the set() that takes a QString
146  *
147  * @since 0.21
148  */
149  QString getKeyTitle(const QString &key) const;
150 
151  /**
152  * Returns the internal string for the given key
153  * @since 0.10 (KDE 4.4)
154  */
155  static QString getKeyString(Key key);
156 
157  /**
158  * Returns the user visible string for the given key
159  * @since 0.10 (KDE 4.4)
160  */
161  static QString getKeyTitle(Key key);
162 
163  /**
164  * Returns the Key from a string key
165  * @since 0.21
166  */
167  static Key getKeyFromString(const QString &key);
168 
169 private:
170  DocumentInfoPrivate *d;
171 };
172 
173 /**
174  * @short The Document. Heart of everything. Actions take place here.
175  *
176  * The Document is the main object in Okular. All views query the Document to
177  * get data/properties or even for accessing pages (in a 'const' way).
178  *
179  * It is designed to keep it detached from the document type (pdf, ps, you
180  * name it..) so whenever you want to get some data, it asks its internal
181  * generators to do the job and return results in a format-independent way.
182  *
183  * Apart from the generator (the currently running one) the document stores
184  * all the Pages ('Page' class) of the current document in a vector and
185  * notifies all the registered DocumentObservers when some content changes.
186  *
187  * For a better understanding of hierarchies @see README.internals.png
188  * @see DocumentObserver, Page
189  */
190 class OKULARCORE_EXPORT Document : public QObject
191 {
192  Q_OBJECT
193 
194 public:
195  /**
196  * Creates a new document with the given @p widget as widget to relay GUI things (messageboxes, ...).
197  */
198  explicit Document(QWidget *widget);
199 
200  /**
201  * Destroys the document.
202  */
203  ~Document() override;
204 
205  /**
206  * Describes the result of an open document operation.
207  * @since 0.20 (KDE 4.14)
208  */
209  enum OpenResult {
210  OpenSuccess, //< The document was opened successfully
211  OpenError, //< The document failed to open
212  OpenNeedsPassword //< The document needs a password to be opened or the one provided is not the correct
213  };
214 
215  /**
216  * Opens the document.
217  * @since 0.20 (KDE 4.14)
218  */
219  OpenResult openDocument(const QString &docFile, const QUrl &url, const QMimeType &mime, const QString &password = QString());
220 
221  /**
222  * Closes the document.
223  */
224  void closeDocument();
225 
226  /**
227  * Registers a new @p observer for the document.
228  */
229  void addObserver(DocumentObserver *observer);
230 
231  /**
232  * Unregisters the given @p observer for the document.
233  */
234  void removeObserver(DocumentObserver *observer);
235 
236  /**
237  * Reparses and applies the configuration.
238  */
239  void reparseConfig();
240 
241  /**
242  * Returns whether the document is currently opened.
243  */
244  bool isOpened() const;
245 
246  /**
247  * Returns the meta data of the document.
248  */
249  DocumentInfo documentInfo() const;
250 
251  /**
252  * Returns the asked set of meta data of the document. The result may contain more
253  * metadata than the one asked for.
254  */
255  DocumentInfo documentInfo(const QSet<DocumentInfo::Key> &keys) const;
256 
257  /**
258  * Returns the table of content of the document or 0 if no
259  * table of content is available.
260  */
261  const DocumentSynopsis *documentSynopsis() const;
262 
263  /**
264  * Starts the reading of the information about the fonts in the
265  * document, if available.
266  *
267  * The results as well the end of the reading is notified using the
268  * signals gotFont(), fontReadingProgress() and fontReadingEnded()
269  */
270  void startFontReading();
271 
272  /**
273  * Force the termination of the reading of the information about the
274  * fonts in the document, if running.
275  */
276  void stopFontReading();
277 
278  /**
279  * Whether the current document can provide information about the
280  * fonts used in it.
281  */
282  bool canProvideFontInformation() const;
283 
284  /**
285  * Whether the current document can perform digital signing.
286  */
287  bool canSign() const;
288 
289  /**
290  * Returns the list of embedded files or 0 if no embedded files
291  * are available.
292  */
293  const QList<EmbeddedFile *> *embeddedFiles() const;
294 
295  /**
296  * Returns the page object for the given page @p number or 0
297  * if the number is out of range.
298  */
299  const Page *page(int number) const;
300 
301  /**
302  * Returns the current viewport of the document.
303  */
304  const DocumentViewport &viewport() const;
305 
306  /**
307  * Sets the list of visible page rectangles.
308  * @see VisiblePageRect
309  */
310  void setVisiblePageRects(const QVector<VisiblePageRect *> &visiblePageRects, DocumentObserver *excludeObserver = nullptr);
311 
312  /**
313  * Returns the list of visible page rectangles.
314  */
315  const QVector<VisiblePageRect *> &visiblePageRects() const;
316 
317  /**
318  * Returns the number of the current page.
319  */
320  uint currentPage() const;
321 
322  /**
323  * Returns the number of pages of the document.
324  */
325  uint pages() const;
326 
327  /**
328  * Returns the url of the currently opened document.
329  */
330  QUrl currentDocument() const;
331 
332  /**
333  * Returns whether the given @p action is allowed in the document.
334  * @see @ref Permission
335  */
336  bool isAllowed(Permission action) const;
337 
338  /**
339  * Returns whether the document supports searching.
340  */
341  bool supportsSearching() const;
342 
343  /**
344  * Returns whether the document supports the listing of page sizes.
345  */
346  bool supportsPageSizes() const;
347 
348  /**
349  * Returns whether the current document supports tiles
350  *
351  * @since 0.16 (KDE 4.10)
352  */
353  bool supportsTiles() const;
354 
355  /**
356  * Returns the list of supported page sizes or an empty list if this
357  * feature is not available.
358  * @see supportsPageSizes()
359  */
360  PageSize::List pageSizes() const;
361 
362  /**
363  * Returns whether the document supports the export to ASCII text.
364  */
365  bool canExportToText() const;
366 
367  /**
368  * Exports the document as ASCII text and saves it under @p fileName.
369  */
370  bool exportToText(const QString &fileName) const;
371 
372  /**
373  * Returns the list of supported export formats.
374  * @see ExportFormat
375  */
376  QList<ExportFormat> exportFormats() const;
377 
378  /**
379  * Exports the document in the given @p format and saves it under @p fileName.
380  */
381  bool exportTo(const QString &fileName, const ExportFormat &format) const;
382 
383  /**
384  * Returns whether the document history is at the begin.
385  */
386  bool historyAtBegin() const;
387 
388  /**
389  * Returns whether the document history is at the end.
390  */
391  bool historyAtEnd() const;
392 
393  /**
394  * Returns the meta data for the given @p key and @p option or an empty variant
395  * if the key doesn't exists.
396  */
397  QVariant metaData(const QString &key, const QVariant &option = QVariant()) const;
398 
399  /**
400  * Returns the current rotation of the document.
401  */
402  Rotation rotation() const;
403 
404  /**
405  * If all pages have the same size this method returns it, if the page sizes
406  * differ an empty size object is returned.
407  */
408  QSizeF allPagesSize() const;
409 
410  /**
411  * Returns the size string for the given @p page or an empty string
412  * if the page is out of range.
413  */
414  QString pageSizeString(int page) const;
415 
416  /**
417  * Returns the gui client of the generator, if it provides one.
418  */
419  KXMLGUIClient *guiClient();
420 
421  /**
422  * Sets the current document viewport to the given @p page.
423  *
424  * @param page The number of the page.
425  * @param excludeObserver The observer ids which shouldn't be effected by this change.
426  * @param smoothMove Whether the move shall be animated smoothly.
427  */
428  void setViewportPage(int page, DocumentObserver *excludeObserver = nullptr, bool smoothMove = false);
429 
430  /**
431  * Sets the current document viewport to the given @p viewport.
432  *
433  * @param viewport The document viewport.
434  * @param excludeObserver The observer which shouldn't be effected by this change.
435  * @param smoothMove Whether the move shall be animated smoothly.
436  */
437  void setViewport(const DocumentViewport &viewport, DocumentObserver *excludeObserver = nullptr, bool smoothMove = false);
438 
439  /**
440  * Sets the current document viewport to the given @p viewport.
441  * BCI TODO: merge with setViewport, adding a parameter "bool updateHistory = true"
442  *
443  * @param viewport The document viewport.
444  * @param excludeObserver The observer which shouldn't be effected by this change.
445  * @param smoothMove Whether the move shall be animated smoothly.
446  * @param updateHistory Whether to consider the change of viewport for the history navigation
447  */
448  void setViewportWithHistory(const DocumentViewport &viewport, DocumentObserver *excludeObserver = nullptr, bool smoothMove = false, bool updateHistory = true);
449 
450  /**
451  * Sets the current document viewport to the next viewport in the
452  * viewport history.
453  */
454  void setPrevViewport();
455 
456  /**
457  * Sets the current document viewport to the previous viewport in the
458  * viewport history.
459  */
460  void setNextViewport();
461 
462  /**
463  * Sets the next @p viewport in the viewport history.
464  */
465  void setNextDocumentViewport(const DocumentViewport &viewport);
466 
467  /**
468  * Sets the next @p namedDestination in the viewport history.
469  *
470  * @since 0.9 (KDE 4.3)
471  */
472  void setNextDocumentDestination(const QString &namedDestination);
473 
474  /**
475  * Sets the zoom for the current document.
476  */
477  void setZoom(int factor, DocumentObserver *excludeObserver = nullptr);
478 
479  /**
480  * Describes the possible options for the pixmap requests.
481  */
483  NoOption = 0, ///< No options
484  RemoveAllPrevious = 1 ///< Remove all the previous requests, even for non requested page pixmaps
485  };
486  Q_DECLARE_FLAGS(PixmapRequestFlags, PixmapRequestFlag)
487 
488  /**
489  * Sends @p requests for pixmap generation.
490  *
491  * The same as requestPixmaps( requests, RemoveAllPrevious );
492  *
493  * @since 22.08
494  */
495  void requestPixmaps(const QList<PixmapRequest *> &requests);
496 
497  /**
498  * Sends @p requests for pixmap generation.
499  *
500  * @param requests the linked list of requests
501  * @param reqOptions the options for the request
502  *
503  * @since 22.08
504  */
505  void requestPixmaps(const QList<PixmapRequest *> &requests, PixmapRequestFlags reqOptions);
506 
507  /**
508  * Sends a request for text page generation for the given page @p pageNumber.
509  */
510  void requestTextPage(uint pageNumber);
511 
512  /**
513  * Adds a new @p annotation to the given @p page.
514  */
515  void addPageAnnotation(int page, Annotation *annotation);
516 
517  /**
518  * Tests if the @p annotation can be modified
519  *
520  * @since 0.15 (KDE 4.9)
521  */
522  bool canModifyPageAnnotation(const Annotation *annotation) const;
523 
524  /**
525  * Prepares to modify the properties of the given @p annotation.
526  * Must be called before the annotation's properties are modified
527  *
528  * @since 0.17 (KDE 4.11)
529  */
530  void prepareToModifyAnnotationProperties(Annotation *annotation);
531 
532  /**
533  * Modifies the given @p annotation on the given @p page.
534  * Must be preceded by a call to prepareToModifyAnnotationProperties before
535  * the annotation's properties are modified
536  *
537  * @since 0.17 (KDE 4.11)
538  */
539  void modifyPageAnnotationProperties(int page, Annotation *annotation);
540 
541  /**
542  * Translates the position of the given @p annotation on the given @p page by a distance @p delta in normalized coordinates.
543  *
544  * Consecutive translations applied to the same @p annotation are merged together on the undo stack if the
545  * BeingMoved flag is set on the @p annotation.
546  *
547  * @since 0.17 (KDE 4.11)
548  */
549  void translatePageAnnotation(int page, Annotation *annotation, const Okular::NormalizedPoint &delta);
550 
551  /**
552  * Adjusts the position of the top-left and bottom-right corners of given @p annotation on the given @p page.
553  *
554  * Can be used to implement resize functionality.
555  * @p delta1 in normalized coordinates is added to top-left.
556  * @p delta2 in normalized coordinates is added to bottom-right.
557  *
558  * Consecutive adjustments applied to the same @p annotation are merged together on the undo stack if the
559  * BeingResized flag is set on the @p annotation.
560  *
561  * @since 1.1.0
562  */
563  void adjustPageAnnotation(int page, Annotation *annotation, const Okular::NormalizedPoint &delta1, const Okular::NormalizedPoint &delta2);
564 
565  /**
566  * Edits the plain text contents of the given @p annotation on the given @p page.
567  *
568  * The contents are set to @p newContents with cursor position @p newCursorPos.
569  * The previous cursor position @p prevCursorPos and previous anchor position @p prevAnchorPos
570  * must also be supplied so that they can be restored if the edit action is undone.
571  *
572  * The Annotation's internal contents should not be modified prior to calling this method.
573  *
574  * @since 0.17 (KDE 4.11)
575  */
576  void editPageAnnotationContents(int page, Annotation *annotation, const QString &newContents, int newCursorPos, int prevCursorPos, int prevAnchorPos);
577 
578  /**
579  * Tests if the @p annotation can be removed
580  *
581  * @since 0.15 (KDE 4.9)
582  */
583  bool canRemovePageAnnotation(const Annotation *annotation) const;
584 
585  /**
586  * Removes the given @p annotation from the given @p page.
587  */
588  void removePageAnnotation(int page, Annotation *annotation);
589 
590  /**
591  * Removes the given @p annotations from the given @p page.
592  */
593  void removePageAnnotations(int page, const QList<Annotation *> &annotations);
594 
595  /**
596  * Clears the text selection highlights for the given @p page,
597  * creates new ones if @p rect is not nullptr,
598  * and deletes @p rect.
599  *
600  * @param page The number of the page.
601  * @param rect The rectangle of the selection.
602  * @param color The color of the selection.
603  */
604  void setPageTextSelection(int page, RegularAreaRect *rect, const QColor &color);
605 
606  /**
607  * Returns true if there is an undo command available; otherwise returns false.
608  * @since 0.17 (KDE 4.11)
609  */
610  bool canUndo() const;
611 
612  /**
613  * Returns true if there is a redo command available; otherwise returns false.
614  * @since 0.17 (KDE 4.11)
615  */
616  bool canRedo() const;
617 
618  /**
619  * Describes the possible search types.
620  */
621  enum SearchType {
622  NextMatch, ///< Search next match
623  PreviousMatch, ///< Search previous match
624  AllDocument, ///< Search complete document
625  GoogleAll, ///< Search complete document (all words in google style)
626  GoogleAny ///< Search complete document (any words in google style)
627  };
628 
629  /**
630  * Describes how search ended
631  */
633  MatchFound, ///< Any match was found
634  NoMatchFound, ///< No match was found
635  SearchCancelled ///< The search was cancelled
636  };
637 
638  /**
639  * Searches the given @p text in the document.
640  *
641  * @param searchID The unique id for this search request.
642  * @param text The text to be searched.
643  * @param fromStart Whether the search should be started at begin of the document.
644  * @param caseSensitivity Whether the search is case sensitive.
645  * @param type The type of the search. @ref SearchType
646  * @param moveViewport Whether the viewport shall be moved to the position of the matches.
647  * @param color The highlighting color of the matches.
648  */
649  void searchText(int searchID, const QString &text, bool fromStart, Qt::CaseSensitivity caseSensitivity, SearchType type, bool moveViewport, const QColor &color);
650 
651  /**
652  * Continues the search for the given @p searchID.
653  */
654  void continueSearch(int searchID);
655 
656  /**
657  * Continues the search for the given @p searchID, optionally specifying
658  * a new type for the search.
659  *
660  * @since 0.7 (KDE 4.1)
661  */
662  void continueSearch(int searchID, SearchType type);
663 
664  /**
665  * Resets the search for the given @p searchID.
666  */
667  void resetSearch(int searchID);
668 
669  /**
670  * Returns the bookmark manager of the document.
671  */
672  BookmarkManager *bookmarkManager() const;
673 
674  /**
675  * Processes the given @p action.
676  */
677  void processAction(const Action *action);
678 
679  /**
680  * Processes the given format @p action on @p fft.
681  *
682  * @since 1.9
683  */
684  void processFormatAction(const Action *action, Okular::FormFieldText *fft);
685 
686  /**
687  * Processes the given keystroke @p action on @p fft.
688  *
689  * @since 1.9
690  */
691  void processKeystrokeAction(const Action *action, Okular::FormFieldText *fft, const QVariant &newValue);
692 
693  /**
694  * Processes the given keystroke @p action on @p fft.
695  * This will set event.willCommit=true
696  *
697  * @since 22.04
698  */
699  void processKeystrokeCommitAction(const Action *action, Okular::FormFieldText *fft);
700 
701  /**
702  * Processes the given focus action on the field.
703  *
704  * @since 1.9
705  */
706  void processFocusAction(const Action *action, Okular::FormField *field);
707 
708  /**
709  * Processes the given keystroke @p action on @p fft.
710  *
711  * @since 1.9
712  */
713  void processValidateAction(const Action *action, Okular::FormFieldText *fft, bool &returnCode);
714 
715  /**
716  * Returns a list of the bookmarked.pages
717  */
718  QList<int> bookmarkedPageList() const;
719 
720  /**
721  * Returns the range of the bookmarked.pages
722  */
723  QString bookmarkedPageRange() const;
724 
725  /**
726  * Processes/Executes the given source @p reference.
727  */
728  void processSourceReference(const SourceReference *reference);
729 
730  /**
731  * Returns whether the document can configure the printer itself.
732  */
733  bool canConfigurePrinter() const;
734 
735  /**
736  * What type of printing a document supports
737  */
739  NoPrinting, ///< Printing Not Supported
740  NativePrinting, ///< Native Cross-Platform Printing
741  PostscriptPrinting ///< Postscript file printing
742  };
743 
744  /**
745  * Returns what sort of printing the document supports:
746  * Native, Postscript, None
747  */
748  PrintingType printingSupport() const;
749 
750  /**
751  * Returns whether the document supports printing to both PDF and PS files.
752  */
753  bool supportsPrintToFile() const;
754 
755  /// @since 22.04
756  enum PrintError {
757  NoPrintError, ///< Printing succeeded
758  UnknownPrintError,
759  TemporaryFileOpenPrintError,
760  FileConversionPrintError,
761  PrintingProcessCrashPrintError,
762  PrintingProcessStartPrintError,
763  PrintToFilePrintError,
764  InvalidPrinterStatePrintError,
765  UnableToFindFilePrintError,
766  NoFileToPrintError,
767  NoBinaryToPrintError,
768  InvalidPageSizePrintError
769  };
770 
771  /**
772  * Prints the document to the given @p printer.
773  */
774  Document::PrintError print(QPrinter &printer);
775 
776  /// @since 22.04
777  static QString printErrorString(PrintError error);
778 
779  /**
780  * Returns a custom printer configuration page or 0 if no
781  * custom printer configuration page is available.
782  *
783  * The returned object should be of a PrintOptionsWidget subclass
784  * (which is not officially enforced by the signature for binary
785  * compatibility reasons).
786  */
787  QWidget *printConfigurationWidget() const;
788 
789  /**
790  * Fill the KConfigDialog @p dialog with the setting pages of the
791  * generators.
792  */
793  void fillConfigDialog(KConfigDialog *dialog);
794 
795  /**
796  * Returns the number of generators that have a configuration widget.
797  */
798  int configurableGenerators() const;
799 
800  /**
801  * Returns the list with the supported MIME types.
802  */
803  QStringList supportedMimeTypes() const;
804 
805  /**
806  * Returns the metadata associated with the generator. May be invalid.
807  */
808  KPluginMetaData generatorInfo() const;
809 
810  /**
811  * Returns whether the generator supports hot-swapping the current file
812  * with another identical file
813  *
814  * @since 1.3
815  */
816  bool canSwapBackingFile() const;
817 
818  /**
819  * Reload the document from a new location, without any visible effect
820  * to the user.
821  *
822  * The new file must be identical to the current one or, if the document
823  * has been modified (eg the user edited forms and annotations), the new
824  * document must have these changes too. For example, you can call
825  * saveChanges first to write changes to a file and then swapBackingFile
826  * to switch to the new location.
827  *
828  * @since 1.3
829  */
830  bool swapBackingFile(const QString &newFileName, const QUrl &url);
831 
832  /**
833  * Same as swapBackingFile, but newFileName must be a .okular file.
834  *
835  * The new file must be identical to the current one or, if the document
836  * has been modified (eg the user edited forms and annotations), the new
837  * document must have these changes too. For example, you can call
838  * saveDocumentArchive first to write changes to a file and then
839  * swapBackingFileArchive to switch to the new location.
840  *
841  * @since 1.3
842  */
843  bool swapBackingFileArchive(const QString &newFileName, const QUrl &url);
844 
845  /**
846  * Sets the history to be clean
847  *
848  * @since 1.3
849  */
850  void setHistoryClean(bool clean);
851 
852  bool isHistoryClean() const;
853 
854  /**
855  * Saving capabilities. Their availability varies according to the
856  * underlying generator and/or the document type.
857  *
858  * @see canSaveChanges (SaveCapability)
859  * @since 0.15 (KDE 4.9)
860  */
862  SaveFormsCapability = 1, ///< Can save form changes
863  SaveAnnotationsCapability = 2 ///< Can save annotation changes
864  };
865 
866  /**
867  * Returns whether it's possible to save a given category of changes to
868  * another document.
869  *
870  * @since 0.15 (KDE 4.9)
871  */
872  bool canSaveChanges(SaveCapability cap) const;
873 
874  /**
875  * Returns whether the changes to the document (modified annotations,
876  * values in form fields, etc) can be saved to another document.
877  *
878  * Equivalent to the logical OR of canSaveChanges(SaveCapability) for
879  * each capability.
880  *
881  * @since 0.7 (KDE 4.1)
882  */
883  bool canSaveChanges() const;
884 
885  /**
886  * Save the document and the optional changes to it to the specified
887  * @p fileName.
888  *
889  * @since 0.7 (KDE 4.1)
890  */
891  bool saveChanges(const QString &fileName);
892 
893  /**
894  * Save the document and the optional changes to it to the specified
895  * @p fileName and returns a @p errorText if fails.
896  *
897  * @since 0.10 (KDE 4.4)
898  */
899  bool saveChanges(const QString &fileName, QString *errorText);
900 
901  /**
902  * Register the specified @p view for the current document.
903  *
904  * It is unregistered from the previous document, if any.
905  *
906  * @since 0.7 (KDE 4.1)
907  */
908  void registerView(View *view);
909 
910  /**
911  * Unregister the specified @p view from the current document.
912  *
913  * @since 0.7 (KDE 4.1)
914  */
915  void unregisterView(View *view);
916 
917  /**
918  * Gets the font data for the given font
919  *
920  * @since 0.8 (KDE 4.2)
921  */
922  QByteArray fontData(const FontInfo &font) const;
923 
924  /**
925  * Opens a document archive.
926  *
927  * @since 0.20 (KDE 4.14)
928  */
929  OpenResult openDocumentArchive(const QString &docFile, const QUrl &url, const QString &password = QString());
930 
931  /**
932  * Saves a document archive.
933  *
934  * @since 0.8 (KDE 4.2)
935  */
936  bool saveDocumentArchive(const QString &fileName);
937 
938  /**
939  * Extract the document file from the current archive.
940  *
941  * @warning This function only works if the current file is a document archive
942  *
943  * @since 1.3
944  */
945  bool extractArchivedFile(const QString &destFileName);
946 
947  /**
948  * Asks the generator to dynamically generate a SourceReference for a given
949  * page number and absolute X and Y position on this page.
950  *
951  * @attention Ownership of the returned SourceReference is transferred to the caller.
952  * @note This method does not call processSourceReference( const SourceReference * )
953  *
954  * @since 0.10 (KDE 4.4)
955  */
956  const SourceReference *dynamicSourceReference(int pageNr, double absX, double absY);
957 
958  /**
959  * Returns the orientation of the document (for printing purposes). This
960  * is used in the KPart to initialize the print dialog and in the
961  * generators to check whether the document needs to be rotated or not.
962  *
963  * @since 0.14 (KDE 4.8)
964  */
965  QPrinter::Orientation orientation() const;
966 
967  /**
968  * Control annotation editing (creation, modification and removal),
969  * which is enabled by default.
970  *
971  * @since 0.15 (KDE 4.9)
972  */
973  void setAnnotationEditingEnabled(bool enable);
974 
975  /**
976  * Returns which wallet data to use to read/write the password for the given fileName
977  *
978  * @since 0.20 (KDE 4.14)
979  */
980  void walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const;
981 
982  /**
983  * Since version 0.21, okular does not allow editing annotations and
984  * form data if they are stored in the docdata directory (like older
985  * okular versions did by default).
986  * If this flag is set, then annotations and forms cannot be edited.
987  *
988  * @since 1.3
989  */
990  bool isDocdataMigrationNeeded() const;
991 
992  /**
993  * Delete annotations and form data from the docdata folder. Call it if
994  * isDocdataMigrationNeeded() was true and you've just saved them to an
995  * external file.
996  *
997  * @since 1.3
998  */
999  void docdataMigrationDone();
1000 
1001  /**
1002  * Returns the model for rendering layers (NULL if the document has no layers)
1003  *
1004  * @since 0.24
1005  */
1006  QAbstractItemModel *layersModel() const;
1007 
1008  /**
1009  * Returns the reason why the file opening failed, if any.
1010  *
1011  * @since 1.10
1012  */
1013  QString openError() const;
1014 
1015  /**
1016  * Digitally sign document
1017  *
1018  * @since 21.04
1019  */
1020  bool sign(const NewSignatureData &data, const QString &newPath);
1021 
1022  /**
1023  * Returns the generator's certificate store (if any)
1024  *
1025  * @since 21.04
1026  */
1027  CertificateStore *certificateStore() const;
1028 
1029  /** sets the editor command to the command \p editCmd, as
1030  * given at the commandline.
1031  *
1032  * @since 22.04
1033  */
1034  void setEditorCommandOverride(const QString &editCmd);
1035 
1036  /** returns the overriding editor command.
1037  *
1038  * If the editor command was not overriden, the string is empty.
1039  *
1040  * @since 22.04
1041  */
1042  QString editorCommandOverride() const;
1043 
1044 public Q_SLOTS:
1045  /**
1046  * This slot is called whenever the user changes the @p rotation of
1047  * the document.
1048  */
1049  void setRotation(int rotation);
1050 
1051  /**
1052  * This slot is called whenever the user changes the page @p size
1053  * of the document.
1054  */
1055  void setPageSize(const Okular::PageSize &size);
1056 
1057  /**
1058  * Cancels the current search
1059  */
1060  void cancelSearch();
1061 
1062  /**
1063  * Undo last edit command
1064  * @since 0.17 (KDE 4.11)
1065  */
1066  void undo();
1067 
1068  /**
1069  * Redo last undone edit command
1070  * @since 0.17 (KDE 4.11)
1071  */
1072  void redo();
1073 
1074  /**
1075  * Edit the text contents of the specified @p form on page @p page to be @p newContents.
1076  * The new text cursor position (@p newCursorPos), previous text cursor position (@p prevCursorPos),
1077  * and previous cursor anchor position will be restored by the undo / redo commands.
1078  * @since 0.17 (KDE 4.11)
1079  */
1080  void editFormText(int pageNumber, Okular::FormFieldText *form, const QString &newContents, int newCursorPos, int prevCursorPos, int prevAnchorPos);
1081 
1082  /**
1083  * Edit the selected list entries in @p form on page @p page to be @p newChoices.
1084  * @since 0.17 (KDE 4.11)
1085  */
1086  void editFormList(int pageNumber, Okular::FormFieldChoice *form, const QList<int> &newChoices);
1087 
1088  /**
1089  * Set the active choice in the combo box @p form on page @p page to @p newText
1090  * The new cursor position (@p newCursorPos), previous cursor position
1091  * (@p prevCursorPos), and previous anchor position (@p prevAnchorPos)
1092  * will be restored by the undo / redo commands.
1093  *
1094  * @since 0.17 (KDE 4.11)
1095  */
1096  void editFormCombo(int pageNumber, Okular::FormFieldChoice *form, const QString &newText, int newCursorPos, int prevCursorPos, int prevAnchorPos);
1097 
1098  /**
1099  * Set the states of the group of form buttons @p formButtons on page @p page to @p newButtonStates.
1100  * The lists @p formButtons and @p newButtonStates should be the same length and true values
1101  * in @p newButtonStates indicate that the corresponding entry in @p formButtons should be enabled.
1102  */
1103  void editFormButtons(int pageNumber, const QList<Okular::FormFieldButton *> &formButtons, const QList<bool> &newButtonStates);
1104 
1105  /**
1106  * Reloads the pixmaps for whole document
1107  *
1108  * @since 0.24
1109  */
1110  void reloadDocument() const;
1111 
1112  /**
1113  * Returns the part of document covered by the given signature @p info.
1114  *
1115  * @since 1.7
1116  */
1117  QByteArray requestSignedRevisionData(const Okular::SignatureInfo &info);
1118 
1119  /**
1120  * Refresh the pixmaps for the given @p pageNumber.
1121  *
1122  * @since 1.10
1123  */
1124  void refreshPixmaps(int pageNumber);
1125 
1126 Q_SIGNALS:
1127  /**
1128  * This signal is emitted whenever the document is about to close.
1129  * @since 1.5.3
1130  */
1131  void aboutToClose();
1132 
1133  /**
1134  * This signal is emitted whenever an action requests a
1135  * document close operation.
1136  */
1137  void close();
1138 
1139  /**
1140  * This signal is emitted whenever an action requests a
1141  * document print operation.
1142  * @since 22.04
1143  */
1144  void requestPrint();
1145 
1146  /**
1147  * This signal is emitted whenever an action requests a
1148  * document save as operation.
1149  * @since 22.04
1150  */
1151  void requestSaveAs();
1152 
1153  /**
1154  * This signal is emitted whenever an action requests an
1155  * application quit operation.
1156  */
1157  void quit();
1158 
1159  /**
1160  * This signal is emitted whenever an action requests a
1161  * find operation.
1162  */
1163  void linkFind();
1164 
1165  /**
1166  * This signal is emitted whenever an action requests a
1167  * goto operation.
1168  */
1169  void linkGoToPage();
1170 
1171  /**
1172  * This signal is emitted whenever an action requests a
1173  * start presentation operation.
1174  */
1175  void linkPresentation();
1176 
1177  /**
1178  * This signal is emitted whenever an action requests an
1179  * end presentation operation.
1180  */
1181  void linkEndPresentation();
1182 
1183  /**
1184  * This signal is emitted whenever an action requests an
1185  * open url operation for the given document @p url.
1186  */
1187  void openUrl(const QUrl &url);
1188 
1189  /**
1190  * This signal is emitted whenever an error occurred.
1191  *
1192  * @param text The description of the error.
1193  * @param duration The time in milliseconds the message should be shown to the user.
1194  */
1195  void error(const QString &text, int duration);
1196 
1197  /**
1198  * This signal is emitted to signal a warning.
1199  *
1200  * @param text The description of the warning.
1201  * @param duration The time in milliseconds the message should be shown to the user.
1202  */
1203  void warning(const QString &text, int duration);
1204 
1205  /**
1206  * This signal is emitted to signal a notice.
1207  *
1208  * @param text The description of the notice.
1209  * @param duration The time in milliseconds the message should be shown to the user.
1210  */
1211  void notice(const QString &text, int duration);
1212 
1213  /**
1214  * Emitted when a new font is found during the reading of the fonts of
1215  * the document.
1216  */
1217  void gotFont(const Okular::FontInfo &font);
1218 
1219  /**
1220  * Reports the progress when reading the fonts in the document.
1221  *
1222  * \param page is the page that was just finished to scan for fonts
1223  */
1224  void fontReadingProgress(int page);
1225 
1226  /**
1227  * Reports that the reading of the fonts in the document is finished.
1228  */
1229  void fontReadingEnded();
1230 
1231  /**
1232  * Reports that the current search finished
1233  */
1234  void searchFinished(int searchID, Okular::Document::SearchStatus endStatus);
1235 
1236  /**
1237  * This signal is emitted whenever a source reference with the given parameters has been
1238  * activated.
1239  *
1240  * \param absFileName absolute name of the file.
1241  * \param line line number.
1242  * \param col column number.
1243  * \param handled should be set to 'true' if a slot handles this source reference; the
1244  * default action to launch the configured editor will then not be performed
1245  * by the document
1246  *
1247  * @since 0.14 (KDE 4.8)
1248  */
1249  void sourceReferenceActivated(const QString &absFileName, int line, int col, bool *handled);
1250 
1251  /**
1252  * This signal is emitted whenever an movie action is triggered and the UI should process it.
1253  */
1254  void processMovieAction(const Okular::MovieAction *action);
1255 
1256  /**
1257  * This signal is emitted whenever the availability of the undo function changes
1258  * @since 0.17 (KDE 4.11)
1259  */
1260  void canUndoChanged(bool undoAvailable);
1261 
1262  /**
1263  * This signal is emitted whenever the availability of the redo function changes
1264  * @since 0.17 (KDE 4.11)
1265  */
1266  void canRedoChanged(bool redoAvailable);
1267 
1268  /**
1269  * This signal is emitted whenever the undo history is clean (i.e. the same status the last time it was saved)
1270  * @since 1.3
1271  */
1272  void undoHistoryCleanChanged(bool clean);
1273 
1274  /**
1275  * This signal is emitted whenever an rendition action is triggered and the UI should process it.
1276  *
1277  * @since 0.16 (KDE 4.10)
1278  */
1279  void processRenditionAction(const Okular::RenditionAction *action);
1280 
1281  /**
1282  * This signal is emitted whenever the contents of the given @p annotation are changed by an undo
1283  * or redo action.
1284  *
1285  * The new contents (@p contents), cursor position (@p cursorPos), and anchor position (@p anchorPos) are
1286  * included
1287  * @since 0.17 (KDE 4.11)
1288  */
1289  void annotationContentsChangedByUndoRedo(Okular::Annotation *annotation, const QString &contents, int cursorPos, int anchorPos);
1290 
1291  /**
1292  * This signal is emitted whenever the text contents of the given text @p form on the given @p page
1293  * are changed by an undo or redo action.
1294  *
1295  * The new text contents (@p contents), cursor position (@p cursorPos), and anchor position (@p anchorPos) are
1296  * included
1297  * @since 0.17 (KDE 4.11)
1298  */
1299  void formTextChangedByUndoRedo(int page, Okular::FormFieldText *form, const QString &contents, int cursorPos, int anchorPos);
1300 
1301  /**
1302  * This signal is emitted whenever the selected @p choices for the given list @p form on the
1303  * given @p page are changed by an undo or redo action.
1304  * @since 0.17 (KDE 4.11)
1305  */
1306  void formListChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QList<int> &choices);
1307 
1308  /**
1309  * This signal is emitted whenever the active @p text for the given combo @p form on the
1310  * given @p page is changed by an undo or redo action.
1311  * @since 0.17 (KDE 4.11)
1312  */
1313  void formComboChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QString &text, int cursorPos, int anchorPos);
1314 
1315  /**
1316  * This signal is emitted whenever the state of the specified group of form buttons (@p formButtons) on the
1317  * given @p page is changed by an undo or redo action.
1318  * @since 0.17 (KDE 4.11)
1319  */
1320  void formButtonsChangedByUndoRedo(int page, const QList<Okular::FormFieldButton *> &formButtons);
1321 
1322  /**
1323  * This signal is emitted whenever a FormField was changed programmatically and the
1324  * according widget should be updated.
1325  * @since 1.4
1326  */
1327  void refreshFormWidget(Okular::FormField *field);
1328 
1329 private:
1330  /// @cond PRIVATE
1331  friend class DocumentPrivate;
1332  friend class ::DocumentItem;
1333  friend class EditAnnotationContentsCommand;
1334  friend class EditFormTextCommand;
1335  friend class EditFormListCommand;
1336  friend class EditFormComboCommand;
1337  friend class EditFormButtonsCommand;
1338  /// @endcond
1339  DocumentPrivate *const d;
1340 
1341  Q_DISABLE_COPY(Document)
1342 };
1343 
1344 /**
1345  * @short A view on the document.
1346  *
1347  * The Viewport structure is the 'current view' over the document. Contained
1348  * data is broadcasted between observers to synchronize their viewports to get
1349  * the 'I scroll one view and others scroll too' views.
1350  */
1351 class OKULARCORE_EXPORT DocumentViewport
1352 {
1353 public:
1354  /**
1355  * Creates a new viewport for the given page @p number.
1356  */
1357  explicit DocumentViewport(int number = -1);
1358 
1359  /**
1360  * Creates a new viewport from the given @p xmlDesc.
1361  */
1362  explicit DocumentViewport(const QString &xmlDesc);
1363 
1364  /**
1365  * Returns the viewport as xml description.
1366  */
1367  QString toString() const;
1368 
1369  /**
1370  * Returns whether the viewport is valid.
1371  */
1372  bool isValid() const;
1373 
1374  /**
1375  * @internal
1376  */
1377  bool operator==(const DocumentViewport &other) const;
1378  bool operator<(const DocumentViewport &other) const;
1379 
1380  /**
1381  * The number of the page nearest the center of the viewport.
1382  */
1384 
1385  /**
1386  * Describes the relative position of the viewport.
1387  */
1388  enum Position {
1389  Center = 1, ///< Relative to the center of the page.
1390  TopLeft = 2 ///< Relative to the top left corner of the page.
1391  };
1392 
1393  /**
1394  * If 'rePos.enabled == true' then this structure contains the
1395  * viewport center or top left depending on the value of pos.
1396  */
1397  struct {
1398  bool enabled;
1399  double normalizedX;
1400  double normalizedY;
1401  Position pos;
1402  } rePos;
1403 
1404  /**
1405  * If 'autoFit.enabled == true' then the page must be autofit in the viewport.
1406  */
1407  struct {
1408  bool enabled;
1409  bool width;
1410  bool height;
1411  } autoFit;
1412 };
1413 
1414 /**
1415  * @short A DOM tree that describes the Table of Contents.
1416  *
1417  * The Synopsis (TOC or Table Of Contents for friends) is represented via
1418  * a dom tree where each node has an internal name (displayed in the TOC)
1419  * and one or more attributes.
1420  *
1421  * In the tree the tag name is the 'screen' name of the entry. A tag can have
1422  * attributes. Here follows the list of tag attributes with meaning:
1423  * - Destination: A string description of the referred viewport
1424  * - DestinationName: A 'named reference' to the viewport that must be converted
1425  * using metaData( "NamedViewport", viewport_name )
1426  * - ExternalFileName: A document to be opened, whose destination is specified
1427  * with Destination or DestinationName
1428  * - Open: a boolean saying whether its TOC branch is open or not (default: false)
1429  * - URL: a URL to be open as destination; if set, no other Destination* or
1430  * ExternalFileName entry is used
1431  */
1432 class OKULARCORE_EXPORT DocumentSynopsis : public QDomDocument
1433 {
1434 public:
1435  /**
1436  * Creates a new document synopsis object.
1437  */
1438  DocumentSynopsis();
1439 
1440  /**
1441  * Creates a new document synopsis object with the given
1442  * @p document as parent node.
1443  */
1444  explicit DocumentSynopsis(const QDomDocument &document);
1445 };
1446 
1447 /**
1448  * @short An embedded file into the document.
1449  *
1450  * This class represents a sort of interface of an embedded file in a document.
1451  *
1452  * Generators \b must re-implement its members to give the all the information
1453  * about an embedded file, like its name, its description, the date of creation
1454  * and modification, and the real data of the file.
1455  */
1456 class OKULARCORE_EXPORT EmbeddedFile
1457 {
1458 public:
1459  /**
1460  * Creates a new embedded file.
1461  */
1462  EmbeddedFile();
1463 
1464  /**
1465  * Destroys the embedded file.
1466  */
1467  virtual ~EmbeddedFile();
1468 
1469  EmbeddedFile(const EmbeddedFile &) = delete;
1470  EmbeddedFile &operator=(const EmbeddedFile &) = delete;
1471 
1472  /**
1473  * Returns the name of the file
1474  */
1475  virtual QString name() const = 0;
1476 
1477  /**
1478  * Returns the description of the file, or an empty string if not
1479  * available
1480  */
1481  virtual QString description() const = 0;
1482 
1483  /**
1484  * Returns the real data representing the file contents
1485  */
1486  virtual QByteArray data() const = 0;
1487 
1488  /**
1489  * Returns the size (in bytes) of the file, if available, or -1 otherwise.
1490  *
1491  * @note this method should be a fast way to know the size of the file
1492  * with no need to extract all the data from it
1493  */
1494  virtual int size() const = 0;
1495 
1496  /**
1497  * Returns the modification date of the file, or an invalid date
1498  * if not available
1499  */
1500  virtual QDateTime modificationDate() const = 0;
1501 
1502  /**
1503  * Returns the creation date of the file, or an invalid date
1504  * if not available
1505  */
1506  virtual QDateTime creationDate() const = 0;
1507 };
1508 
1509 /**
1510  * @short An area of a specified page
1511  */
1512 class OKULARCORE_EXPORT VisiblePageRect
1513 {
1514 public:
1515  /**
1516  * Creates a new visible page rectangle.
1517  *
1518  * @param pageNumber The page number where the rectangle is located.
1519  * @param rectangle The rectangle in normalized coordinates.
1520  */
1521  explicit VisiblePageRect(int pageNumber = -1, const NormalizedRect &rectangle = NormalizedRect());
1522 
1523  /**
1524  * The page number where the rectangle is located.
1525  */
1527 
1528  /**
1529  * The rectangle in normalized coordinates.
1530  */
1532 };
1533 
1534 /**
1535  * @short Data needed to create a new signature
1536  *
1537  * @since 21.04
1538  */
1539 class OKULARCORE_EXPORT NewSignatureData
1540 {
1541 public:
1542  NewSignatureData();
1543  ~NewSignatureData();
1544  NewSignatureData(const NewSignatureData &) = delete;
1545  NewSignatureData &operator=(const NewSignatureData &) = delete;
1546 
1547  QString certNickname() const;
1548  void setCertNickname(const QString &certNickname);
1549 
1550  QString certSubjectCommonName() const;
1551  void setCertSubjectCommonName(const QString &certSubjectCommonName);
1552 
1553  QString password() const;
1554  void setPassword(const QString &password);
1555 
1556  int page() const;
1557  void setPage(int page);
1558 
1559  NormalizedRect boundingRectangle() const;
1560  void setBoundingRectangle(const NormalizedRect &rect);
1561 
1562  /// @since 22.04
1563  QString documentPassword() const;
1564 
1565  /// @since 22.04
1566  void setDocumentPassword(const QString &password);
1567 
1568 private:
1569  NewSignatureDataPrivate *const d;
1570 };
1571 
1572 }
1573 
1574 Q_DECLARE_METATYPE(Okular::DocumentInfo::Key)
1575 Q_DECLARE_OPERATORS_FOR_FLAGS(Okular::Document::PixmapRequestFlags)
1576 
1577 #endif
1578 
1579 /* kate: replace-tabs on; indent-width 4; */
@ Author
The author of the document.
Definition: document.h:86
Collector for all the data belonging to a page.
Definition: page.h:47
@ MatchFound
Any match was found.
Definition: document.h:633
The Document.
Definition: document.h:190
The base interface of a form field.
Definition: form.h:39
@ AllDocument
Search complete document.
Definition: document.h:624
A helper class to store information about x509 certificate.
CaseSensitivity
The documentation to the global Okular namespace.
Definition: action.h:16
PixmapRequestFlag
Describes the possible options for the pixmap requests.
Definition: document.h:482
The Rendition action executes an operation on a video or executes some JavaScript code on activation.
Definition: action.h:499
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:95
@ Producer
The producer of the document (e.g. some software)
Definition: document.h:88
Encapsulates data that describes an action.
Definition: action.h:40
@ Creator
The creator of the document (this can be different from the author)
Definition: document.h:87
Data needed to create a new signature.
Definition: document.h:1539
PrintingType
What type of printing a document supports.
Definition: document.h:738
A DOM tree that describes the Table of Contents.
Definition: document.h:1432
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:116
@ Title
The title of the document.
Definition: document.h:83
@ Copyright
The copyright of the document.
Definition: document.h:89
Base class for objects being notified when something changes.
Definition: observer.h:28
Interface of a choice form field.
Definition: form.h:347
Key
The list of predefined keys.
Definition: document.h:82
Defines an entry for the export menu.
Definition: generator.h:78
An area of a specified page.
Definition: document.h:1512
SearchType
Describes the possible search types.
Definition: document.h:621
Position
Describes the relative position of the viewport.
Definition: document.h:1388
@ DocumentSize
The size of the document.
Definition: document.h:97
@ NoMatchFound
No match was found.
Definition: document.h:634
@ PreviousMatch
Search previous match.
Definition: document.h:623
The Movie action executes an operation on a video on activation.
Definition: action.h:445
This is a list of NormalizedRect, to describe an area consisting of multiple rectangles using normali...
Definition: area.h:932
@ Description
The description of the document.
Definition: document.h:85
SaveCapability
Saving capabilities.
Definition: document.h:861
Bookmarks manager utility.
int pageNumber
The number of the page nearest the center of the viewport.
Definition: document.h:1383
@ GoogleAll
Search complete document (all words in google style)
Definition: document.h:625
@ PagesSize
The size of the pages (if all pages have the same size)
Definition: document.h:98
OpenResult
Describes the result of an open document operation.
Definition: document.h:209
@ NoPrinting
Printing Not Supported.
Definition: document.h:739
@ NextMatch
Search next match.
Definition: document.h:622
@ CustomKeys
All the custom keys the generator supports.
Definition: document.h:99
Interface of a text form field.
Definition: form.h:260
@ Keywords
The keywords which describe the content of the document.
Definition: document.h:95
@ Subject
The subject of the document.
Definition: document.h:84
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition: area.h:188
Permission
Describes the DRM capabilities.
Definition: global.h:23
@ Category
The category of the document.
Definition: document.h:94
NormalizedRect rect
The rectangle in normalized coordinates.
Definition: document.h:1531
A view on the document.
Definition: document.h:1351
@ Pages
The number of pages of the document.
Definition: document.h:90
@ NoPrintError
Printing succeeded.
Definition: document.h:757
View on the document.
Definition: view.h:29
@ CreationDate
The date of creation of the document.
Definition: document.h:91
Defines a source reference.
SearchStatus
Describes how search ended.
Definition: document.h:632
@ FilePath
The path of the file.
Definition: document.h:96
@ NativePrinting
Native Cross-Platform Printing.
Definition: document.h:740
A helper class to store information about digital signature.
@ ModificationDate
The date of last modification of the document.
Definition: document.h:92
A small class that represents the information of a font.
Definition: fontinfo.h:24
A small class that represents the size of a page.
Definition: pagesize.h:23
int pageNumber
The page number where the rectangle is located.
Definition: document.h:1526
The DocumentInfo structure can be filled in by generators to display metadata about the currently ope...
Definition: document.h:74
virtual QVariant get(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
@ MimeType
The mime type of the document.
Definition: document.h:93
Rotation
A rotation.
Definition: global.h:45
An embedded file into the document.
Definition: document.h:1456
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:09:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.