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 */
675 void processFormatAction(const Action *action, Okular::FormFieldText *fft);
676
677 /**
678 * Processes the given keystroke @p action on @p fft.
679 *
680 * @since 1.9
681 */
682 void processKeystrokeAction(const Action *action, Okular::FormFieldText *fft, const QVariant &newValue);
683
684 /**
685 * Processes the given keystroke @p action on @p fft.
686 * This will set event.willCommit=true
687 *
688 * @since 22.04
689 */
690 void processKeystrokeCommitAction(const Action *action, Okular::FormFieldText *fft);
691
692 /**
693 * Processes the given focus action on the field.
694 *
695 * @since 1.9
696 */
697 void processFocusAction(const Action *action, Okular::FormField *field);
698
699 /**
700 * Processes the given keystroke @p action on @p fft.
701 *
702 * @since 1.9
703 */
704 void processValidateAction(const Action *action, Okular::FormFieldText *fft, bool &returnCode);
705
706 /**
707 * Processes the mouse up @p action on @p ff.
708 *
709 * @since 23.12
710 */
711 void processFormMouseUpScripAction(const Action *action, Okular::FormField *ff);
712
713 /**
714 * Returns a list of the bookmarked.pages
715 */
716 QList<int> bookmarkedPageList() const;
717
718 /**
719 * Returns the range of the bookmarked.pages
720 */
721 QString bookmarkedPageRange() const;
722
723 /**
724 * Processes/Executes the given source @p reference.
725 */
726 void processSourceReference(const SourceReference *reference);
727
728 /**
729 * Returns whether the document can configure the printer itself.
730 */
731 bool canConfigurePrinter() const;
732
733 /**
734 * What type of printing a document supports
735 */
737 NoPrinting, ///< Printing Not Supported
738 NativePrinting, ///< Native Cross-Platform Printing
739 PostscriptPrinting ///< Postscript file printing
740 };
741
742 /**
743 * Returns what sort of printing the document supports:
744 * Native, Postscript, None
745 */
746 PrintingType printingSupport() const;
747
748 /**
749 * Returns whether the document supports printing to both PDF and PS files.
750 */
751 bool supportsPrintToFile() const;
752
753 /// @since 22.04
755 NoPrintError, ///< Printing succeeded
756 UnknownPrintError,
757 TemporaryFileOpenPrintError,
758 FileConversionPrintError,
759 PrintingProcessCrashPrintError,
760 PrintingProcessStartPrintError,
761 PrintToFilePrintError,
762 InvalidPrinterStatePrintError,
763 UnableToFindFilePrintError,
764 NoFileToPrintError,
765 NoBinaryToPrintError,
766 InvalidPageSizePrintError
767 };
768
769 /**
770 * Prints the document to the given @p printer.
771 */
772 Document::PrintError print(QPrinter &printer);
773
774 /// @since 22.04
775 static QString printErrorString(PrintError error);
776
777 /**
778 * Returns a custom printer configuration page or 0 if no
779 * custom printer configuration page is available.
780 *
781 * The returned object should be of a PrintOptionsWidget subclass
782 * (which is not officially enforced by the signature for binary
783 * compatibility reasons).
784 */
785 QWidget *printConfigurationWidget() const;
786
787 /**
788 * Fill the KConfigDialog @p dialog with the setting pages of the
789 * generators.
790 */
791 void fillConfigDialog(KConfigDialog *dialog);
792
793 /**
794 * Returns the number of generators that have a configuration widget.
795 */
796 int configurableGenerators() const;
797
798 /**
799 * Returns the list with the supported MIME types.
800 */
801 QStringList supportedMimeTypes() const;
802
803 /**
804 * Returns the metadata associated with the generator. May be invalid.
805 */
806 KPluginMetaData generatorInfo() const;
807
808 /**
809 * Returns whether the generator supports hot-swapping the current file
810 * with another identical file
811 *
812 * @since 1.3
813 */
814 bool canSwapBackingFile() const;
815
816 /**
817 * Reload the document from a new location, without any visible effect
818 * to the user.
819 *
820 * The new file must be identical to the current one or, if the document
821 * has been modified (eg the user edited forms and annotations), the new
822 * document must have these changes too. For example, you can call
823 * saveChanges first to write changes to a file and then swapBackingFile
824 * to switch to the new location.
825 *
826 * @since 1.3
827 */
828 bool swapBackingFile(const QString &newFileName, const QUrl &url);
829
830 /**
831 * Same as swapBackingFile, but newFileName must be a .okular file.
832 *
833 * The new file must be identical to the current one or, if the document
834 * has been modified (eg the user edited forms and annotations), the new
835 * document must have these changes too. For example, you can call
836 * saveDocumentArchive first to write changes to a file and then
837 * swapBackingFileArchive to switch to the new location.
838 *
839 * @since 1.3
840 */
841 bool swapBackingFileArchive(const QString &newFileName, const QUrl &url);
842
843 /**
844 * Sets the history to be clean
845 *
846 * @since 1.3
847 */
848 void setHistoryClean(bool clean);
849
850 bool isHistoryClean() const;
851
852 /**
853 * Saving capabilities. Their availability varies according to the
854 * underlying generator and/or the document type.
855 *
856 * @see canSaveChanges (SaveCapability)
857 * @since 0.15 (KDE 4.9)
858 */
860 SaveFormsCapability = 1, ///< Can save form changes
861 SaveAnnotationsCapability = 2 ///< Can save annotation changes
862 };
863
864 /**
865 * Returns whether it's possible to save a given category of changes to
866 * another document.
867 *
868 * @since 0.15 (KDE 4.9)
869 */
870 bool canSaveChanges(SaveCapability cap) const;
871
872 /**
873 * Returns whether the changes to the document (modified annotations,
874 * values in form fields, etc) can be saved to another document.
875 *
876 * Equivalent to the logical OR of canSaveChanges(SaveCapability) for
877 * each capability.
878 *
879 * @since 0.7 (KDE 4.1)
880 */
881 bool canSaveChanges() const;
882
883 /**
884 * Save the document and the optional changes to it to the specified
885 * @p fileName.
886 *
887 * @since 0.7 (KDE 4.1)
888 */
889 bool saveChanges(const QString &fileName);
890
891 /**
892 * Save the document and the optional changes to it to the specified
893 * @p fileName and returns a @p errorText if fails.
894 *
895 * @since 0.10 (KDE 4.4)
896 */
897 bool saveChanges(const QString &fileName, QString *errorText);
898
899 /**
900 * Register the specified @p view for the current document.
901 *
902 * It is unregistered from the previous document, if any.
903 *
904 * @since 0.7 (KDE 4.1)
905 */
906 void registerView(View *view);
907
908 /**
909 * Unregister the specified @p view from the current document.
910 *
911 * @since 0.7 (KDE 4.1)
912 */
913 void unregisterView(View *view);
914
915 /**
916 * Gets the font data for the given font
917 *
918 * @since 0.8 (KDE 4.2)
919 */
920 QByteArray fontData(const FontInfo &font) const;
921
922 /**
923 * Opens a document archive.
924 *
925 * @since 0.20 (KDE 4.14)
926 */
927 OpenResult openDocumentArchive(const QString &docFile, const QUrl &url, const QString &password = QString());
928
929 /**
930 * Saves a document archive.
931 *
932 * @since 0.8 (KDE 4.2)
933 */
934 bool saveDocumentArchive(const QString &fileName);
935
936 /**
937 * Extract the document file from the current archive.
938 *
939 * @warning This function only works if the current file is a document archive
940 *
941 * @since 1.3
942 */
943 bool extractArchivedFile(const QString &destFileName);
944
945 /**
946 * Asks the generator to dynamically generate a SourceReference for a given
947 * page number and absolute X and Y position on this page.
948 *
949 * @attention Ownership of the returned SourceReference is transferred to the caller.
950 * @note This method does not call processSourceReference( const SourceReference * )
951 *
952 * @since 0.10 (KDE 4.4)
953 */
954 const SourceReference *dynamicSourceReference(int pageNr, double absX, double absY);
955
956 /**
957 * Returns the orientation of the document (for printing purposes). This
958 * is used in the KPart to initialize the print dialog and in the
959 * generators to check whether the document needs to be rotated or not.
960 *
961 * @since 0.14 (KDE 4.8)
962 */
963 QPageLayout::Orientation orientation() const;
964
965 /**
966 * Control annotation editing (creation, modification and removal),
967 * which is enabled by default.
968 *
969 * @since 0.15 (KDE 4.9)
970 */
971 void setAnnotationEditingEnabled(bool enable);
972
973 /**
974 * Returns which wallet data to use to read/write the password for the given fileName
975 *
976 * @since 0.20 (KDE 4.14)
977 */
978 void walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const;
979
980 /**
981 * Since version 0.21, okular does not allow editing annotations and
982 * form data if they are stored in the docdata directory (like older
983 * okular versions did by default).
984 * If this flag is set, then annotations and forms cannot be edited.
985 *
986 * @since 1.3
987 */
988 bool isDocdataMigrationNeeded() const;
989
990 /**
991 * Delete annotations and form data from the docdata folder. Call it if
992 * isDocdataMigrationNeeded() was true and you've just saved them to an
993 * external file.
994 *
995 * @since 1.3
996 */
997 void docdataMigrationDone();
998
999 /**
1000 * Returns the model for rendering layers (NULL if the document has no layers)
1001 *
1002 * @since 0.24
1003 */
1004 QAbstractItemModel *layersModel() const;
1005
1006 /**
1007 * Returns the reason why the file opening failed, if any.
1008 *
1009 * @since 1.10
1010 */
1011 QString openError() const;
1012
1013 /**
1014 * Digitally sign document
1015 *
1016 * @since 21.04
1017 */
1018 bool sign(const NewSignatureData &data, const QString &newPath);
1019
1020 /**
1021 * Returns the generator's certificate store (if any)
1022 *
1023 * @since 21.04
1024 */
1025 CertificateStore *certificateStore() const;
1026
1027 /** sets the editor command to the command \p editCmd, as
1028 * given at the commandline.
1029 *
1030 * @since 22.04
1031 */
1032 void setEditorCommandOverride(const QString &editCmd);
1033
1034 /** returns the overriding editor command.
1035 *
1036 * If the editor command was not overriden, the string is empty.
1037 *
1038 * @since 22.04
1039 */
1040 QString editorCommandOverride() const;
1041
1042public Q_SLOTS:
1043 /**
1044 * This slot is called whenever the user changes the @p rotation of
1045 * the document.
1046 */
1047 void setRotation(int rotation);
1048
1049 /**
1050 * This slot is called whenever the user changes the page @p size
1051 * of the document.
1052 */
1053 void setPageSize(const Okular::PageSize &size);
1054
1055 /**
1056 * Cancels the current search
1057 */
1058 void cancelSearch();
1059
1060 /**
1061 * Undo last edit command
1062 * @since 0.17 (KDE 4.11)
1063 */
1064 void undo();
1065
1066 /**
1067 * Redo last undone edit command
1068 * @since 0.17 (KDE 4.11)
1069 */
1070 void redo();
1071
1072 /**
1073 * Edit the text contents of the specified @p form on page @p page to be @p newContents.
1074 * The new text cursor position (@p newCursorPos), previous text cursor position (@p prevCursorPos),
1075 * and previous cursor anchor position will be restored by the undo / redo commands.
1076 * @since 0.17 (KDE 4.11)
1077 */
1078 void editFormText(int pageNumber, Okular::FormFieldText *form, const QString &newContents, int newCursorPos, int prevCursorPos, int prevAnchorPos);
1079
1080 /**
1081 * Edit the selected list entries in @p form on page @p page to be @p newChoices.
1082 * @since 0.17 (KDE 4.11)
1083 */
1084 void editFormList(int pageNumber, Okular::FormFieldChoice *form, const QList<int> &newChoices);
1085
1086 /**
1087 * Set the active choice in the combo box @p form on page @p page to @p newText
1088 * The new cursor position (@p newCursorPos), previous cursor position
1089 * (@p prevCursorPos), and previous anchor position (@p prevAnchorPos)
1090 * will be restored by the undo / redo commands.
1091 *
1092 * @since 0.17 (KDE 4.11)
1093 */
1094 void editFormCombo(int pageNumber, Okular::FormFieldChoice *form, const QString &newText, int newCursorPos, int prevCursorPos, int prevAnchorPos);
1095
1096 /**
1097 * Set the states of the group of form buttons @p formButtons on page @p page to @p newButtonStates.
1098 * The lists @p formButtons and @p newButtonStates should be the same length and true values
1099 * in @p newButtonStates indicate that the corresponding entry in @p formButtons should be enabled.
1100 */
1101 void editFormButtons(int pageNumber, const QList<Okular::FormFieldButton *> &formButtons, const QList<bool> &newButtonStates);
1102
1103 /**
1104 * Reloads the pixmaps for whole document
1105 *
1106 * @since 0.24
1107 */
1108 void reloadDocument() const;
1109
1110 /**
1111 * Returns the part of document covered by the given signature @p info.
1112 *
1113 * @since 1.7
1114 */
1115 QByteArray requestSignedRevisionData(const Okular::SignatureInfo &info);
1116
1117 /**
1118 * Refresh the pixmaps for the given @p pageNumber.
1119 *
1120 * @since 1.10
1121 */
1122 void refreshPixmaps(int pageNumber);
1123
1124Q_SIGNALS:
1125 /**
1126 * This signal is emitted whenever the document is about to close.
1127 * @since 1.5.3
1128 */
1130
1131 /**
1132 * This signal is emitted whenever an action requests a
1133 * document close operation.
1134 */
1135 void close();
1136
1137 /**
1138 * This signal is emitted whenever an action requests a
1139 * document print operation.
1140 * @since 22.04
1141 */
1143
1144 /**
1145 * This signal is emitted whenever an action requests a
1146 * document save as operation.
1147 * @since 22.04
1148 */
1150
1151 /**
1152 * This signal is emitted whenever an action requests an
1153 * application quit operation.
1154 */
1155 void quit();
1156
1157 /**
1158 * This signal is emitted whenever an action requests a
1159 * find operation.
1160 */
1161 void linkFind();
1162
1163 /**
1164 * This signal is emitted whenever an action requests a
1165 * goto operation.
1166 */
1168
1169 /**
1170 * This signal is emitted whenever an action requests a
1171 * start presentation operation.
1172 */
1174
1175 /**
1176 * This signal is emitted whenever an action requests an
1177 * end presentation operation.
1178 */
1180
1181 /**
1182 * This signal is emitted whenever an action requests an
1183 * open url operation for the given document @p url.
1184 */
1185 void openUrl(const QUrl &url);
1186
1187 /**
1188 * This signal is emitted whenever an error occurred.
1189 *
1190 * @param text The description of the error.
1191 * @param duration The time in milliseconds the message should be shown to the user.
1192 */
1193 void error(const QString &text, int duration);
1194
1195 /**
1196 * This signal is emitted to signal a warning.
1197 *
1198 * @param text The description of the warning.
1199 * @param duration The time in milliseconds the message should be shown to the user.
1200 */
1201 void warning(const QString &text, int duration);
1202
1203 /**
1204 * This signal is emitted to signal a notice.
1205 *
1206 * @param text The description of the notice.
1207 * @param duration The time in milliseconds the message should be shown to the user.
1208 */
1209 void notice(const QString &text, int duration);
1210
1211 /**
1212 * Emitted when a new font is found during the reading of the fonts of
1213 * the document.
1214 */
1215 void gotFont(const Okular::FontInfo &font);
1216
1217 /**
1218 * Reports the progress when reading the fonts in the document.
1219 *
1220 * \param page is the page that was just finished to scan for fonts
1221 */
1222 void fontReadingProgress(int page);
1223
1224 /**
1225 * Reports that the reading of the fonts in the document is finished.
1226 */
1228
1229 /**
1230 * Reports that the current search finished
1231 */
1232 void searchFinished(int searchID, Okular::Document::SearchStatus endStatus);
1233
1234 /**
1235 * This signal is emitted whenever a source reference with the given parameters has been
1236 * activated.
1237 *
1238 * \param absFileName absolute name of the file.
1239 * \param line line number.
1240 * \param col column number.
1241 * \param handled should be set to 'true' if a slot handles this source reference; the
1242 * default action to launch the configured editor will then not be performed
1243 * by the document
1244 *
1245 * @since 0.14 (KDE 4.8)
1246 */
1247 void sourceReferenceActivated(const QString &absFileName, int line, int col, bool *handled);
1248
1249 /**
1250 * This signal is emitted whenever an movie action is triggered and the UI should process it.
1251 */
1253
1254 /**
1255 * This signal is emitted whenever the availability of the undo function changes
1256 * @since 0.17 (KDE 4.11)
1257 */
1258 void canUndoChanged(bool undoAvailable);
1259
1260 /**
1261 * This signal is emitted whenever the availability of the redo function changes
1262 * @since 0.17 (KDE 4.11)
1263 */
1264 void canRedoChanged(bool redoAvailable);
1265
1266 /**
1267 * This signal is emitted whenever the undo history is clean (i.e. the same status the last time it was saved)
1268 * @since 1.3
1269 */
1270 void undoHistoryCleanChanged(bool clean);
1271
1272 /**
1273 * This signal is emitted whenever an rendition action is triggered and the UI should process it.
1274 *
1275 * @since 0.16 (KDE 4.10)
1276 */
1278
1279 /**
1280 * This signal is emitted whenever the contents of the given @p annotation are changed by an undo
1281 * or redo action.
1282 *
1283 * The new contents (@p contents), cursor position (@p cursorPos), and anchor position (@p anchorPos) are
1284 * included
1285 * @since 0.17 (KDE 4.11)
1286 */
1287 void annotationContentsChangedByUndoRedo(Okular::Annotation *annotation, const QString &contents, int cursorPos, int anchorPos);
1288
1289 /**
1290 * This signal is emitted whenever the text contents of the given text @p form on the given @p page
1291 * are changed by an undo or redo action.
1292 *
1293 * The new text contents (@p contents), cursor position (@p cursorPos), and anchor position (@p anchorPos) are
1294 * included
1295 * @since 0.17 (KDE 4.11)
1296 */
1297 void formTextChangedByUndoRedo(int page, Okular::FormFieldText *form, const QString &contents, int cursorPos, int anchorPos);
1298
1299 /**
1300 * This signal is emitted whenever the selected @p choices for the given list @p form on the
1301 * given @p page are changed by an undo or redo action.
1302 * @since 0.17 (KDE 4.11)
1303 */
1304 void formListChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QList<int> &choices);
1305
1306 /**
1307 * This signal is emitted whenever the active @p text for the given combo @p form on the
1308 * given @p page is changed by an undo or redo action.
1309 * @since 0.17 (KDE 4.11)
1310 */
1311 void formComboChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QString &text, int cursorPos, int anchorPos);
1312
1313 /**
1314 * This signal is emitted whenever the state of the specified group of form buttons (@p formButtons) on the
1315 * given @p page is changed by an undo or redo action.
1316 * @since 0.17 (KDE 4.11)
1317 */
1319
1320 /**
1321 * This signal is emitted whenever a FormField was changed programmatically and the
1322 * according widget should be updated.
1323 * @since 1.4
1324 */
1326
1327private:
1328 /// @cond PRIVATE
1329 friend class DocumentPrivate;
1330 friend class ::DocumentItem;
1331 friend class EditAnnotationContentsCommand;
1332 friend class EditFormTextCommand;
1333 friend class EditFormListCommand;
1334 friend class EditFormComboCommand;
1335 friend class EditFormButtonsCommand;
1336 /// @endcond
1337 DocumentPrivate *const d;
1338
1339 Q_DISABLE_COPY(Document)
1340};
1341
1342/**
1343 * @short A view on the document.
1344 *
1345 * The Viewport structure is the 'current view' over the document. Contained
1346 * data is broadcasted between observers to synchronize their viewports to get
1347 * the 'I scroll one view and others scroll too' views.
1348 */
1349class OKULARCORE_EXPORT DocumentViewport
1350{
1351public:
1352 /**
1353 * Creates a new viewport for the given page @p number.
1354 */
1355 explicit DocumentViewport(int number = -1);
1356
1357 /**
1358 * Creates a new viewport from the given @p xmlDesc.
1359 */
1360 explicit DocumentViewport(const QString &xmlDesc);
1361
1362 /**
1363 * Returns the viewport as xml description.
1364 */
1365 QString toString() const;
1366
1367 /**
1368 * Returns whether the viewport is valid.
1369 */
1370 bool isValid() const;
1371
1372 /**
1373 * @internal
1374 */
1375 bool operator==(const DocumentViewport &other) const;
1376 bool operator<(const DocumentViewport &other) const;
1377
1378 /**
1379 * The number of the page nearest the center of the viewport.
1380 */
1382
1383 /**
1384 * Describes the relative position of the viewport.
1385 */
1387 Center = 1, ///< Relative to the center of the page.
1388 TopLeft = 2 ///< Relative to the top left corner of the page.
1390
1391 /**
1392 * If 'rePos.enabled == true' then this structure contains the
1393 * viewport center or top left depending on the value of pos.
1394 */
1395 struct {
1396 bool enabled;
1397 double normalizedX;
1398 double normalizedY;
1399 Position pos;
1400 } rePos;
1401
1402 /**
1403 * If 'autoFit.enabled == true' then the page must be autofit in the viewport.
1404 */
1405 struct {
1406 bool enabled;
1407 bool width;
1408 bool height;
1409 } autoFit;
1410};
1411
1412/**
1413 * @short A DOM tree that describes the Table of Contents.
1414 *
1415 * The Synopsis (TOC or Table Of Contents for friends) is represented via
1416 * a dom tree where each node has an internal name (displayed in the TOC)
1417 * and one or more attributes.
1418 *
1419 * In the tree the tag name is the 'screen' name of the entry. A tag can have
1420 * attributes. Here follows the list of tag attributes with meaning:
1421 * - Destination: A string description of the referred viewport
1422 * - DestinationName: A 'named reference' to the viewport that must be converted
1423 * using metaData( "NamedViewport", viewport_name )
1424 * - ExternalFileName: A document to be opened, whose destination is specified
1425 * with Destination or DestinationName
1426 * - Open: a boolean saying whether its TOC branch is open or not (default: false)
1427 * - URL: a URL to be open as destination; if set, no other Destination* or
1428 * ExternalFileName entry is used
1429 */
1430class OKULARCORE_EXPORT DocumentSynopsis : public QDomDocument
1431{
1432public:
1433 /**
1434 * Creates a new document synopsis object.
1435 */
1437
1438 /**
1439 * Creates a new document synopsis object with the given
1440 * @p document as parent node.
1441 */
1442 explicit DocumentSynopsis(const QDomDocument &document);
1443};
1444
1445/**
1446 * @short An embedded file into the document.
1447 *
1448 * This class represents a sort of interface of an embedded file in a document.
1449 *
1450 * Generators \b must re-implement its members to give the all the information
1451 * about an embedded file, like its name, its description, the date of creation
1452 * and modification, and the real data of the file.
1453 */
1454class OKULARCORE_EXPORT EmbeddedFile
1455{
1456public:
1457 /**
1458 * Creates a new embedded file.
1459 */
1460 EmbeddedFile();
1461
1462 /**
1463 * Destroys the embedded file.
1464 */
1465 virtual ~EmbeddedFile();
1466
1467 EmbeddedFile(const EmbeddedFile &) = delete;
1468 EmbeddedFile &operator=(const EmbeddedFile &) = delete;
1469
1470 /**
1471 * Returns the name of the file
1472 */
1473 virtual QString name() const = 0;
1474
1475 /**
1476 * Returns the description of the file, or an empty string if not
1477 * available
1478 */
1479 virtual QString description() const = 0;
1480
1481 /**
1482 * Returns the real data representing the file contents
1483 */
1484 virtual QByteArray data() const = 0;
1485
1486 /**
1487 * Returns the size (in bytes) of the file, if available, or -1 otherwise.
1488 *
1489 * @note this method should be a fast way to know the size of the file
1490 * with no need to extract all the data from it
1491 */
1492 virtual int size() const = 0;
1493
1494 /**
1495 * Returns the modification date of the file, or an invalid date
1496 * if not available
1497 */
1498 virtual QDateTime modificationDate() const = 0;
1499
1500 /**
1501 * Returns the creation date of the file, or an invalid date
1502 * if not available
1503 */
1504 virtual QDateTime creationDate() const = 0;
1505};
1506
1507/**
1508 * @short An area of a specified page
1509 */
1510class OKULARCORE_EXPORT VisiblePageRect
1511{
1512public:
1513 /**
1514 * Creates a new visible page rectangle.
1515 *
1516 * @param pageNumber The page number where the rectangle is located.
1517 * @param rectangle The rectangle in normalized coordinates.
1518 */
1519 explicit VisiblePageRect(int pageNumber = -1, const NormalizedRect &rectangle = NormalizedRect());
1520
1521 /**
1522 * The page number where the rectangle is located.
1523 */
1525
1526 /**
1527 * The rectangle in normalized coordinates.
1528 */
1530};
1531
1532/**
1533 * @short Data needed to create a new signature
1534 *
1535 * @since 21.04
1536 */
1537class OKULARCORE_EXPORT NewSignatureData
1538{
1539public:
1542 NewSignatureData(const NewSignatureData &) = delete;
1543 NewSignatureData &operator=(const NewSignatureData &) = delete;
1544
1545 QString certNickname() const;
1546 void setCertNickname(const QString &certNickname);
1547
1548 QString certSubjectCommonName() const;
1549 void setCertSubjectCommonName(const QString &certSubjectCommonName);
1550
1551 QString password() const;
1552 void setPassword(const QString &password);
1553
1554 int page() const;
1555 void setPage(int page);
1556
1557 NormalizedRect boundingRectangle() const;
1558 void setBoundingRectangle(const NormalizedRect &rect);
1559
1560 /// @since 22.04
1561 QString documentPassword() const;
1562
1563 /// @since 22.04
1564 void setDocumentPassword(const QString &password);
1565
1566 /// @since 23.08
1567 QString reason() const;
1568
1569 /// @since 23.08
1570 void setReason(const QString &reason);
1571
1572 /// @since 23.08
1573 QString location() const;
1574
1575 /// @since 23.08
1576 void setLocation(const QString &location);
1577
1578 /// @since 23.08
1579 QString backgroundImagePath() const;
1580
1581 /// @since 23.08
1582 void setBackgroundImagePath(const QString &path);
1583
1584private:
1585 NewSignatureDataPrivate *const d;
1586};
1587
1588}
1589
1590Q_DECLARE_METATYPE(Okular::DocumentInfo::Key)
1591Q_DECLARE_OPERATORS_FOR_FLAGS(Okular::Document::PixmapRequestFlags)
1592
1593#endif
1594
1595/* 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:1431
A view on the document.
Definition document.h:1350
int pageNumber
The number of the page nearest the center of the viewport.
Definition document.h:1381
Position
Describes the relative position of the viewport.
Definition document.h:1386
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.
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:859
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:755
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:736
@ NativePrinting
Native Cross-Platform Printing.
Definition document.h:738
@ NoPrinting
Printing Not Supported.
Definition document.h:737
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:1455
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:348
Interface of a text form field.
Definition form.h:261
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:446
Data needed to create a new signature.
Definition document.h:1538
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:500
Defines a source reference.
View on the document.
Definition view.h:30
An area of a specified page.
Definition document.h:1511
NormalizedRect rect
The rectangle in normalized coordinates.
Definition document.h:1529
int pageNumber
The page number where the rectangle is located.
Definition document.h:1524
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 May 3 2024 11:48:22 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.