Okular

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