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