Debian Codegraph @

qt5/src/poppler-link.cc

raw
1 /* poppler-link.cc: qt interface to poppler
2 * Copyright (C) 2006-2007, 2013, 2016-2021, 2024, Albert Astals Cid
3 * Copyright (C) 2007-2008, Pino Toscano <[email protected]>
4 * Copyright (C) 2010 Hib Eris <[email protected]>
5 * Copyright (C) 2012, Tobias Koenig <[email protected]>
6 * Copyright (C) 2012, Guillermo A. Amaral B. <[email protected]>
7 * Copyright (C) 2018 Intevation GmbH <[email protected]>
8 * Copyright (C) 2018 Adam Reichold <[email protected]>
9 * Copyright (C) 2020 Oliver Sander <[email protected]>
10 * Copyright (C) 2024 Pratham Gandhi <[email protected]>
11 * Adapting code from
12 * Copyright (C) 2004 by Enrico Ros <[email protected]>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28
29 #include <poppler-qt5.h>
30 #include <poppler-link-private.h>
31 #include <poppler-private.h>
32 #include <poppler-media.h>
33
34 #include <QtCore/QStringList>
35
36 #include "poppler-annotation-private.h"
37
38 #include "Link.h"
39 #include "Rendition.h"
40
41 namespace Poppler {
42
43 class LinkDestinationPrivate : public QSharedData
44 {
45 public:
46 LinkDestinationPrivate();
47
48 LinkDestination::Kind kind; // destination type
49 QString name;
50 int pageNum; // page number
51 double left, bottom; // position
52 double right, top;
53 double zoom; // zoom factor
54 bool changeLeft : 1, changeTop : 1; // for destXYZ links, which position
55 bool changeZoom : 1; // components to change
56 };
57
58 LinkDestinationPrivate::LinkDestinationPrivate()
59 {
60 // sane defaults
61 kind = LinkDestination::destXYZ;
62 pageNum = 0;
63 left = 0;
64 bottom = 0;
65 right = 0;
66 top = 0;
67 zoom = 1;
68 changeLeft = true;
69 changeTop = true;
70 changeZoom = false;
71 }
72
73 LinkPrivate::~LinkPrivate()
74 {
75 qDeleteAll(nextLinks);
76 }
77
78 LinkOCGStatePrivate::~LinkOCGStatePrivate() = default;
79
80 LinkHidePrivate::~LinkHidePrivate() = default;
81
82 LinkResetFormPrivate::~LinkResetFormPrivate() = default;
83
84 LinkSubmitFormPrivate::~LinkSubmitFormPrivate() = default;
85
86 class LinkGotoPrivate : public LinkPrivate
87 {
88 public:
89 LinkGotoPrivate(const QRectF &area, const LinkDestination &dest);
90 ~LinkGotoPrivate() override;
91
92 QString extFileName;
93 LinkDestination destination;
94 };
95
96 LinkGotoPrivate::LinkGotoPrivate(const QRectF &area, const LinkDestination &dest) : LinkPrivate(area), destination(dest) { }
97 LinkGotoPrivate::~LinkGotoPrivate() = default;
98
99 class LinkExecutePrivate : public LinkPrivate
100 {
101 public:
102 explicit LinkExecutePrivate(const QRectF &area);
103 ~LinkExecutePrivate() override;
104
105 QString fileName;
106 QString parameters;
107 };
108
109 LinkExecutePrivate::LinkExecutePrivate(const QRectF &area) : LinkPrivate(area) { }
110 LinkExecutePrivate::~LinkExecutePrivate() = default;
111
112 class LinkBrowsePrivate : public LinkPrivate
113 {
114 public:
115 explicit LinkBrowsePrivate(const QRectF &area);
116 ~LinkBrowsePrivate() override;
117
118 QString url;
119 };
120
121 LinkBrowsePrivate::LinkBrowsePrivate(const QRectF &area) : LinkPrivate(area) { }
122 LinkBrowsePrivate::~LinkBrowsePrivate() = default;
123
124 class LinkActionPrivate : public LinkPrivate
125 {
126 public:
127 explicit LinkActionPrivate(const QRectF &area);
128 ~LinkActionPrivate() override;
129
130 LinkAction::ActionType type;
131 };
132
133 LinkActionPrivate::LinkActionPrivate(const QRectF &area) : LinkPrivate(area) { }
134 LinkActionPrivate::~LinkActionPrivate() = default;
135
136 class LinkSoundPrivate : public LinkPrivate
137 {
138 public:
139 explicit LinkSoundPrivate(const QRectF &area);
140 ~LinkSoundPrivate() override;
141
142 double volume;
143 bool sync : 1;
144 bool repeat : 1;
145 bool mix : 1;
146 SoundObject *sound;
147 };
148
149 LinkSoundPrivate::LinkSoundPrivate(const QRectF &area) : LinkPrivate(area), sound(nullptr) { }
150
151 LinkSoundPrivate::~LinkSoundPrivate()
152 {
153 delete sound;
154 }
155
156 class LinkRenditionPrivate : public LinkPrivate
157 {
158 public:
159 explicit LinkRenditionPrivate(const QRectF &area, std::unique_ptr<::MediaRendition> &&rendition, ::LinkRendition::RenditionOperation operation, const QString &script, const Ref ref);
160 ~LinkRenditionPrivate() override;
161
162 std::unique_ptr<MediaRendition> rendition;
163 LinkRendition::RenditionAction action;
164 QString script;
165 Ref annotationReference;
166 };
167
168 LinkRenditionPrivate::LinkRenditionPrivate(const QRectF &area, std::unique_ptr<::MediaRendition> &&r, ::LinkRendition::RenditionOperation operation, const QString &javaScript, const Ref ref)
169 : LinkPrivate(area), rendition(r ? new MediaRendition(std::move(r)) : nullptr), action(LinkRendition::PlayRendition), script(javaScript), annotationReference(ref)
170 {
171 switch (operation) {
172 case ::LinkRendition::NoRendition:
173 action = LinkRendition::NoRendition;
174 break;
175 case ::LinkRendition::PlayRendition:
176 action = LinkRendition::PlayRendition;
177 break;
178 case ::LinkRendition::StopRendition:
179 action = LinkRendition::StopRendition;
180 break;
181 case ::LinkRendition::PauseRendition:
182 action = LinkRendition::PauseRendition;
183 break;
184 case ::LinkRendition::ResumeRendition:
185 action = LinkRendition::ResumeRendition;
186 break;
187 }
188 }
189
190 LinkRenditionPrivate::~LinkRenditionPrivate() = default;
191
192 class LinkJavaScriptPrivate : public LinkPrivate
193 {
194 public:
195 explicit LinkJavaScriptPrivate(const QRectF &area);
196 ~LinkJavaScriptPrivate() override;
197
198 QString js;
199 };
200
201 LinkJavaScriptPrivate::LinkJavaScriptPrivate(const QRectF &area) : LinkPrivate(area) { }
202 LinkJavaScriptPrivate::~LinkJavaScriptPrivate() = default;
203
204 class LinkMoviePrivate : public LinkPrivate
205 {
206 public:
207 LinkMoviePrivate(const QRectF &area, LinkMovie::Operation operation, const QString &title, const Ref reference);
208 ~LinkMoviePrivate() override;
209
210 LinkMovie::Operation operation;
211 QString annotationTitle;
212 Ref annotationReference;
213 };
214
215 LinkMoviePrivate::LinkMoviePrivate(const QRectF &area, LinkMovie::Operation _operation, const QString &title, const Ref reference) : LinkPrivate(area), operation(_operation), annotationTitle(title), annotationReference(reference) { }
216
217 LinkMoviePrivate::~LinkMoviePrivate() = default;
218
219 static void cvtUserToDev(::Page *page, double xu, double yu, int *xd, int *yd)
220 {
221 double ctm[6];
222
223 page->getDefaultCTM(ctm, 72.0, 72.0, 0, false, true);
224 *xd = (int)(ctm[0] * xu + ctm[2] * yu + ctm[4] + 0.5);
225 *yd = (int)(ctm[1] * xu + ctm[3] * yu + ctm[5] + 0.5);
226 }
227
228 LinkDestination::LinkDestination(const LinkDestinationData &data) : d(new LinkDestinationPrivate)
229 {
230 bool deleteDest = false;
231 const LinkDest *ld = data.ld;
232
233 if (data.namedDest && !ld && !data.externalDest) {
234 deleteDest = true;
235 ld = data.doc->doc->findDest(data.namedDest).release();
236 }
237 // in case this destination was named one, and it was not resolved
238 if (data.namedDest && !ld) {
239 d->name = QString::fromLatin1(data.namedDest->c_str());
240 }
241
242 if (!ld) {
243 return;
244 }
245
246 if (ld->getKind() == ::destXYZ) {
247 d->kind = destXYZ;
248 } else if (ld->getKind() == ::destFit) {
249 d->kind = destFit;
250 } else if (ld->getKind() == ::destFitH) {
251 d->kind = destFitH;
252 } else if (ld->getKind() == ::destFitV) {
253 d->kind = destFitV;
254 } else if (ld->getKind() == ::destFitR) {
255 d->kind = destFitR;
256 } else if (ld->getKind() == ::destFitB) {
257 d->kind = destFitB;
258 } else if (ld->getKind() == ::destFitBH) {
259 d->kind = destFitBH;
260 } else if (ld->getKind() == ::destFitBV) {
261 d->kind = destFitBV;
262 }
263
264 if (!ld->isPageRef()) {
265 d->pageNum = ld->getPageNum();
266 } else {
267 const Ref ref = ld->getPageRef();
268 d->pageNum = data.doc->doc->findPage(ref);
269 }
270 double left = ld->getLeft();
271 double bottom = ld->getBottom();
272 double right = ld->getRight();
273 double top = ld->getTop();
274 d->zoom = ld->getZoom();
275 d->changeLeft = ld->getChangeLeft();
276 d->changeTop = ld->getChangeTop();
277 d->changeZoom = ld->getChangeZoom();
278
279 int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
280
281 if (!data.externalDest) {
282 ::Page *page;
283 if (d->pageNum > 0 && d->pageNum <= data.doc->doc->getNumPages() && (page = data.doc->doc->getPage(d->pageNum))) {
284 cvtUserToDev(page, left, top, &leftAux, &topAux);
285 cvtUserToDev(page, right, bottom, &rightAux, &bottomAux);
286
287 d->left = leftAux / (double)page->getCropWidth();
288 d->top = topAux / (double)page->getCropHeight();
289 d->right = rightAux / (double)page->getCropWidth();
290 d->bottom = bottomAux / (double)page->getCropHeight();
291 } else {
292 d->pageNum = 0;
293 }
294 }
295
296 if (deleteDest) {
297 delete ld;
298 }
299 }
300
301 LinkDestination::LinkDestination(const QString &description) : d(new LinkDestinationPrivate)
302 {
303 const QStringList tokens = description.split(QChar::fromLatin1(';'));
304 if (tokens.size() >= 10) {
305 d->kind = static_cast<Kind>(tokens.at(0).toInt());
306 d->pageNum = tokens.at(1).toInt();
307 d->left = tokens.at(2).toDouble();
308 d->bottom = tokens.at(3).toDouble();
309 d->right = tokens.at(4).toDouble();
310 d->top = tokens.at(5).toDouble();
311 d->zoom = tokens.at(6).toDouble();
312 d->changeLeft = static_cast<bool>(tokens.at(7).toInt());
313 d->changeTop = static_cast<bool>(tokens.at(8).toInt());
314 d->changeZoom = static_cast<bool>(tokens.at(9).toInt());
315 }
316 }
317
318 LinkDestination::LinkDestination(const LinkDestination &other) = default;
319
320 LinkDestination::~LinkDestination() = default;
321
322 LinkDestination::Kind LinkDestination::kind() const
323 {
324 return d->kind;
325 }
326
327 int LinkDestination::pageNumber() const
328 {
329 return d->pageNum;
330 }
331
332 double LinkDestination::left() const
333 {
334 return d->left;
335 }
336
337 double LinkDestination::bottom() const
338 {
339 return d->bottom;
340 }
341
342 double LinkDestination::right() const
343 {
344 return d->right;
345 }
346
347 double LinkDestination::top() const
348 {
349 return d->top;
350 }
351
352 double LinkDestination::zoom() const
353 {
354 return d->zoom;
355 }
356
357 bool LinkDestination::isChangeLeft() const
358 {
359 return d->changeLeft;
360 }
361
362 bool LinkDestination::isChangeTop() const
363 {
364 return d->changeTop;
365 }
366
367 bool LinkDestination::isChangeZoom() const
368 {
369 return d->changeZoom;
370 }
371
372 QString LinkDestination::toString() const
373 {
374 const QChar semicolon = QChar::fromLatin1(';');
375 QString s = QString::number((qint8)d->kind);
376 s += semicolon + QString::number(d->pageNum);
377 s += semicolon + QString::number(d->left);
378 s += semicolon + QString::number(d->bottom);
379 s += semicolon + QString::number(d->right);
380 s += semicolon + QString::number(d->top);
381 s += semicolon + QString::number(d->zoom);
382 s += semicolon + QString::number((qint8)d->changeLeft);
383 s += semicolon + QString::number((qint8)d->changeTop);
384 s += semicolon + QString::number((qint8)d->changeZoom);
385 return s;
386 }
387
388 QString LinkDestination::destinationName() const
389 {
390 return d->name;
391 }
392
393 LinkDestination &LinkDestination::operator=(const LinkDestination &other)
394 {
395 if (this == &other) {
396 return *this;
397 }
398
399 d = other.d;
400 return *this;
401 }
402
403 // Link
404 Link::~Link()
405 {
406 delete d_ptr;
407 }
408
409 Link::Link(const QRectF &linkArea) : d_ptr(new LinkPrivate(linkArea)) { }
410
411 Link::Link(LinkPrivate &dd) : d_ptr(&dd) { }
412
413 Link::LinkType Link::linkType() const
414 {
415 return None;
416 }
417
418 QRectF Link::linkArea() const
419 {
420 Q_D(const Link);
421 return d->linkArea;
422 }
423
424 QVector<Link *> Link::nextLinks() const
425 {
426 return d_ptr->nextLinks;
427 }
428
429 // LinkGoto
430 LinkGoto::LinkGoto(const QRectF &linkArea, QString extFileName, const LinkDestination &destination) // clazy:exclude=function-args-by-ref
431 : Link(*new LinkGotoPrivate(linkArea, destination))
432 {
433 Q_D(LinkGoto);
434 d->extFileName = std::move(extFileName); // TODO remove when extFileName moves to be a const &
435 }
436
437 LinkGoto::~LinkGoto() = default;
438
439 bool LinkGoto::isExternal() const
440 {
441 Q_D(const LinkGoto);
442 return !d->extFileName.isEmpty();
443 }
444
445 QString LinkGoto::fileName() const
446 {
447 Q_D(const LinkGoto);
448 return d->extFileName;
449 }
450
451 LinkDestination LinkGoto::destination() const
452 {
453 Q_D(const LinkGoto);
454 return d->destination;
455 }
456
457 Link::LinkType LinkGoto::linkType() const
458 {
459 return Goto;
460 }
461
462 // LinkExecute
463 LinkExecute::LinkExecute(const QRectF &linkArea, const QString &file, const QString &params) : Link(*new LinkExecutePrivate(linkArea))
464 {
465 Q_D(LinkExecute);
466 d->fileName = file;
467 d->parameters = params;
468 }
469
470 LinkExecute::~LinkExecute() = default;
471
472 QString LinkExecute::fileName() const
473 {
474 Q_D(const LinkExecute);
475 return d->fileName;
476 }
477 QString LinkExecute::parameters() const
478 {
479 Q_D(const LinkExecute);
480 return d->parameters;
481 }
482
483 Link::LinkType LinkExecute::linkType() const
484 {
485 return Execute;
486 }
487
488 // LinkBrowse
489 LinkBrowse::LinkBrowse(const QRectF &linkArea, const QString &url) : Link(*new LinkBrowsePrivate(linkArea))
490 {
491 Q_D(LinkBrowse);
492 d->url = url;
493 }
494
495 LinkBrowse::~LinkBrowse() = default;
496
497 QString LinkBrowse::url() const
498 {
499 Q_D(const LinkBrowse);
500 return d->url;
501 }
502
503 Link::LinkType LinkBrowse::linkType() const
504 {
505 return Browse;
506 }
507
508 // LinkAction
509 LinkAction::LinkAction(const QRectF &linkArea, ActionType actionType) : Link(*new LinkActionPrivate(linkArea))
510 {
511 Q_D(LinkAction);
512 d->type = actionType;
513 }
514
515 LinkAction::~LinkAction() = default;
516
517 LinkAction::ActionType LinkAction::actionType() const
518 {
519 Q_D(const LinkAction);
520 return d->type;
521 }
522
523 Link::LinkType LinkAction::linkType() const
524 {
525 return Action;
526 }
527
528 // LinkSound
529 LinkSound::LinkSound(const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, SoundObject *sound) : Link(*new LinkSoundPrivate(linkArea))
530 {
531 Q_D(LinkSound);
532 d->volume = volume;
533 d->sync = sync;
534 d->repeat = repeat;
535 d->mix = mix;
536 d->sound = sound;
537 }
538
539 LinkSound::~LinkSound() = default;
540
541 Link::LinkType LinkSound::linkType() const
542 {
543 return Sound;
544 }
545
546 double LinkSound::volume() const
547 {
548 Q_D(const LinkSound);
549 return d->volume;
550 }
551
552 bool LinkSound::synchronous() const
553 {
554 Q_D(const LinkSound);
555 return d->sync;
556 }
557
558 bool LinkSound::repeat() const
559 {
560 Q_D(const LinkSound);
561 return d->repeat;
562 }
563
564 bool LinkSound::mix() const
565 {
566 Q_D(const LinkSound);
567 return d->mix;
568 }
569
570 SoundObject *LinkSound::sound() const
571 {
572 Q_D(const LinkSound);
573 return d->sound;
574 }
575
576 // LinkRendition
577 LinkRendition::LinkRendition(const QRectF &linkArea, ::MediaRendition *rendition, int operation, const QString &script, const Ref &annotationReference) // clazy:exclude=function-args-by-value
578 : LinkRendition(linkArea, std::unique_ptr<::MediaRendition>(rendition), operation, script, annotationReference)
579 {
580 }
581
582 LinkRendition::LinkRendition(const QRectF &linkArea, std::unique_ptr<::MediaRendition> &&rendition, int operation, const QString &script, const Ref annotationReference)
583 : Link(*new LinkRenditionPrivate(linkArea, std::move(rendition), static_cast<enum ::LinkRendition::RenditionOperation>(operation), script, annotationReference))
584 {
585 }
586
587 LinkRendition::~LinkRendition() = default;
588
589 Link::LinkType LinkRendition::linkType() const
590 {
591 return Rendition;
592 }
593
594 MediaRendition *LinkRendition::rendition() const
595 {
596 Q_D(const LinkRendition);
597 return d->rendition.get();
598 }
599
600 LinkRendition::RenditionAction LinkRendition::action() const
601 {
602 Q_D(const LinkRendition);
603 return d->action;
604 }
605
606 QString LinkRendition::script() const
607 {
608 Q_D(const LinkRendition);
609 return d->script;
610 }
611
612 bool LinkRendition::isReferencedAnnotation(const ScreenAnnotation *annotation) const
613 {
614 Q_D(const LinkRendition);
615 if (d->annotationReference != Ref::INVALID() && d->annotationReference == annotation->d_ptr->pdfObjectReference()) {
616 return true;
617 }
618
619 return false;
620 }
621
622 // LinkJavaScript
623 LinkJavaScript::LinkJavaScript(const QRectF &linkArea, const QString &js) : Link(*new LinkJavaScriptPrivate(linkArea))
624 {
625 Q_D(LinkJavaScript);
626 d->js = js;
627 }
628
629 LinkJavaScript::~LinkJavaScript() = default;
630
631 Link::LinkType LinkJavaScript::linkType() const
632 {
633 return JavaScript;
634 }
635
636 QString LinkJavaScript::script() const
637 {
638 Q_D(const LinkJavaScript);
639 return d->js;
640 }
641
642 // LinkMovie
643 LinkMovie::LinkMovie(const QRectF &linkArea, Operation operation, const QString &annotationTitle, const Ref &annotationReference) // clazy:exclude=function-args-by-value
644 : Link(*new LinkMoviePrivate(linkArea, operation, annotationTitle, annotationReference))
645 {
646 }
647
648 LinkMovie::~LinkMovie() = default;
649
650 Link::LinkType LinkMovie::linkType() const
651 {
652 return Movie;
653 }
654
655 LinkMovie::Operation LinkMovie::operation() const
656 {
657 Q_D(const LinkMovie);
658 return d->operation;
659 }
660
661 bool LinkMovie::isReferencedAnnotation(const MovieAnnotation *annotation) const
662 {
663 Q_D(const LinkMovie);
664 if (d->annotationReference != Ref::INVALID() && d->annotationReference == annotation->d_ptr->pdfObjectReference()) {
665 return true;
666 } else if (!d->annotationTitle.isNull()) {
667 return (annotation->movieTitle() == d->annotationTitle);
668 }
669
670 return false;
671 }
672
673 LinkOCGState::LinkOCGState(LinkOCGStatePrivate *ocgp) : Link(*ocgp) { }
674
675 LinkOCGState::~LinkOCGState() = default;
676
677 Link::LinkType LinkOCGState::linkType() const
678 {
679 return OCGState;
680 }
681
682 // LinkHide
683 LinkHide::LinkHide(LinkHidePrivate *lhidep) : Link(*lhidep) { }
684
685 LinkHide::~LinkHide() = default;
686
687 Link::LinkType LinkHide::linkType() const
688 {
689 return Hide;
690 }
691
692 QVector<QString> LinkHide::targets() const
693 {
694 Q_D(const LinkHide);
695 return QVector<QString>() << d->targetName;
696 }
697
698 bool LinkHide::isShowAction() const
699 {
700 Q_D(const LinkHide);
701 return d->isShow;
702 }
703
704 // LinkResetForm
705 LinkResetForm::LinkResetForm(LinkResetFormPrivate *lrfp) : Link(*lrfp) { }
706
707 LinkResetForm::~LinkResetForm() = default;
708
709 Link::LinkType LinkResetForm::linkType() const
710 {
711 return ResetForm;
712 }
713
714 // LinkSubmitForm
715 // static assertions to ensure flags from Link.h match those from poppler-link.h
716 static_assert(static_cast<int>(LinkSubmitForm::NoOpFlag) == static_cast<int>(::LinkSubmitForm::NoOpFlag), "NoOpFlag does not match");
717 static_assert(static_cast<int>(LinkSubmitForm::ExcludeFlag) == static_cast<int>(::LinkSubmitForm::ExcludeFlag), "ExcludeFlag does not match");
718 static_assert(static_cast<int>(LinkSubmitForm::IncludeNoValueFieldsFlag) == static_cast<int>(::LinkSubmitForm::IncludeNoValueFieldsFlag), "IncludeNoValueFieldsFlag does not match");
719 static_assert(static_cast<int>(LinkSubmitForm::ExportFormatFlag) == static_cast<int>(::LinkSubmitForm::ExportFormatFlag), "ExportFormatFlag does not match");
720 static_assert(static_cast<int>(LinkSubmitForm::GetMethodFlag) == static_cast<int>(::LinkSubmitForm::GetMethodFlag), "GetMethodFlag does not match");
721 static_assert(static_cast<int>(LinkSubmitForm::SubmitCoordinatesFlag) == static_cast<int>(::LinkSubmitForm::SubmitCoordinatesFlag), "SubmitCoordinatesFlag does not match");
722 static_assert(static_cast<int>(LinkSubmitForm::XFDFFlag) == static_cast<int>(::LinkSubmitForm::XFDFFlag), "XFDFFlag does not match");
723 static_assert(static_cast<int>(LinkSubmitForm::IncludeAppendSavesFlag) == static_cast<int>(::LinkSubmitForm::IncludeAppendSavesFlag), "IncludeAppendSavesFlag does not match");
724 static_assert(static_cast<int>(LinkSubmitForm::IncludeAnnotationsFlag) == static_cast<int>(::LinkSubmitForm::IncludeAnnotationsFlag), "IncludeAnnotationsFlag does not match");
725 static_assert(static_cast<int>(LinkSubmitForm::SubmitPDFFlag) == static_cast<int>(::LinkSubmitForm::SubmitPDFFlag), "SubmitPDFFlag does not match");
726 static_assert(static_cast<int>(LinkSubmitForm::CanonicalFormatFlag) == static_cast<int>(::LinkSubmitForm::CanonicalFormatFlag), "CanonicalFormatFlag does not match");
727 static_assert(static_cast<int>(LinkSubmitForm::ExclNonUserAnnotsFlag) == static_cast<int>(::LinkSubmitForm::ExclNonUserAnnotsFlag), "ExclNonUserAnnotsFlag does not match");
728 static_assert(static_cast<int>(LinkSubmitForm::ExclFKeyFlag) == static_cast<int>(::LinkSubmitForm::ExclFKeyFlag), "ExclFKeyFlag does not match");
729 static_assert(static_cast<int>(LinkSubmitForm::EmbedFormFlag) == static_cast<int>(::LinkSubmitForm::EmbedFormFlag), "EmbedFormFlag does not match");
730
731 LinkSubmitForm::LinkSubmitForm(LinkSubmitFormPrivate *lsfp) : Link(*lsfp) { }
732
733 LinkSubmitForm::~LinkSubmitForm() = default;
734
735 Link::LinkType LinkSubmitForm::linkType() const
736 {
737 return SubmitForm;
738 }
739
740 QVector<int> LinkSubmitForm::getFieldIds() const
741 {
742 Q_D(const LinkSubmitForm);
743 return d->m_fieldIds;
744 }
745
746 QString LinkSubmitForm::getUrl() const
747 {
748 Q_D(const LinkSubmitForm);
749 return d->m_url;
750 }
751
752 LinkSubmitForm::SubmitFormFlags LinkSubmitForm::getFlags() const
753 {
754 Q_D(const LinkSubmitForm);
755 return d->m_flags;
756 }
757 }