Debian Codegraph @

qt6/src/poppler-link-private.h

raw
1 /* poppler-link-private.h: qt interface to poppler
2 * Copyright (C) 2016, 2018, 2020, 2021 Albert Astals Cid <[email protected]>
3 * Copyright (C) 2018 Intevation GmbH <[email protected]>
4 * Copyright (C) 2020, 2021 Oliver Sander <[email protected]>
5 * Copyright (C) 2024 Pratham Gandhi <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22 #ifndef _POPPLER_LINK_PRIVATE_H_
23 #define _POPPLER_LINK_PRIVATE_H_
24
25 #include <vector>
26
27 #include "poppler-link.h"
28 #include "Link.h"
29
30 class LinkOCGState;
31
32 namespace Poppler {
33
34 class Link;
35
36 class LinkPrivate
37 {
38 public:
39 explicit LinkPrivate(const QRectF &area) : linkArea(area) { }
40
41 virtual ~LinkPrivate();
42
43 static LinkPrivate *get(Link *link) { return link->d_ptr; }
44
45 LinkPrivate(const LinkPrivate &) = delete;
46 LinkPrivate &operator=(const LinkPrivate &) = delete;
47
48 QRectF linkArea;
49 std::vector<std::unique_ptr<Link>> nextLinks;
50 };
51
52 class LinkOCGStatePrivate : public LinkPrivate
53 {
54 public:
55 LinkOCGStatePrivate(const QRectF &area, const std::vector<::LinkOCGState::StateList> &sList, bool pRB) : LinkPrivate(area), stateList(sList), preserveRB(pRB) { }
56 ~LinkOCGStatePrivate() override;
57
58 std::vector<::LinkOCGState::StateList> stateList;
59 bool preserveRB;
60 };
61
62 class LinkHidePrivate : public LinkPrivate
63 {
64 public:
65 LinkHidePrivate(const QRectF &area, const QString &tName, bool show) : LinkPrivate(area), targetName(tName), isShow(show) { }
66 ~LinkHidePrivate() override;
67
68 QString targetName;
69 bool isShow;
70 };
71
72 class LinkResetFormPrivate : public LinkPrivate
73 {
74 public:
75 LinkResetFormPrivate(const QRectF &area, const QStringList &fields, const bool exclude) : LinkPrivate(area), m_fields(fields), m_exclude(exclude) { }
76 ~LinkResetFormPrivate() override;
77
78 QStringList m_fields;
79 bool m_exclude;
80 };
81
82 class LinkSubmitFormPrivate : public LinkPrivate
83 {
84 public:
85 LinkSubmitFormPrivate(const QRectF &area, const QVector<int> &fieldIds, const QString &url, LinkSubmitForm::SubmitFormFlags flags) : LinkPrivate(area), m_fieldIds(fieldIds), m_url(url), m_flags(flags) { }
86 ~LinkSubmitFormPrivate() override;
87
88 QVector<int> m_fieldIds;
89 QString m_url;
90 LinkSubmitForm::SubmitFormFlags m_flags;
91 };
92
93 }
94
95 #endif