4#ifndef PDF_ANNOTATION_ACTION_BASE_H
5#define PDF_ANNOTATION_ACTION_BASE_H
7#include "PdfAnnotation.h"
9#include "PdfDictionary.h"
13 class PODOFO_API PdfAppearanceCharacteristics final :
public PdfDictionaryElement
16 friend class PdfAppearanceCharacteristicsProvider;
19 PdfAppearanceCharacteristics(PdfDocument& parent);
20 PdfAppearanceCharacteristics(PdfObject& obj);
23 void SetBorderColor(nullable<const PdfColor&> color);
25 PdfColor GetBorderColor()
const;
27 void SetBackgroundColor(nullable<const PdfColor&> color);
29 PdfColor GetBackgroundColor()
const;
31 void SetRolloverCaption(nullable<const PdfString&> text);
33 nullable<const PdfString&> GetRolloverCaption()
const;
35 void SetAlternateCaption(nullable<const PdfString&> text);
37 nullable<const PdfString&> GetAlternateCaption()
const;
39 void SetCaption(nullable<const PdfString&> text);
41 nullable<const PdfString&> GetCaption()
const;
45 class PdfAppearanceCharacteristicsProvider
47 friend class PdfAnnotationWidget;
48 friend class PdfAnnotationScreen;
51 PdfAppearanceCharacteristicsProvider()
53 auto& dict =
static_cast<T&
>(*this).GetDictionary();
54 auto mkObj = dict.FindKey(
"MK");
56 m_AppearanceCharacteristics.reset(
new PdfAppearanceCharacteristics(*mkObj));
60 PdfAppearanceCharacteristics& GetOrCreateAppearanceCharacteristics()
62 if (m_AppearanceCharacteristics ==
nullptr)
64 auto& ref =
static_cast<T&
>(*this);
65 m_AppearanceCharacteristics.reset(
new PdfAppearanceCharacteristics(ref.GetDocument()));
66 ref.GetDictionary().AddKeyIndirect(
"MK"_n, m_AppearanceCharacteristics->GetObject());
69 return *m_AppearanceCharacteristics;
72 PdfAppearanceCharacteristics* GetAppearanceCharacteristics()
74 return m_AppearanceCharacteristics.get();
77 const PdfAppearanceCharacteristics* GetAppearanceCharacteristics()
const
79 return m_AppearanceCharacteristics.get();
83 std::unique_ptr<PdfAppearanceCharacteristics> m_AppearanceCharacteristics;
86 class PODOFO_API PdfAnnotationActionBase :
public PdfAnnotation
88 friend class PdfAnnotationWidget;
89 friend class PdfAnnotationLink;
90 friend class PdfAnnotationScreen;
93 PdfAnnotationActionBase(PdfPage& page, PdfAnnotationType annotType,
const Rect& rect);
94 PdfAnnotationActionBase(PdfObject& obj, PdfAnnotationType annotType);
101 void SetAction(nullable<const PdfAction&> action);
108 nullable<PdfAction&> GetAction();
109 nullable<const PdfAction&> GetAction()
const;
112 virtual void onActionSet();
116 nullable<PdfAction&> getAction();
119 nullable<std::unique_ptr<PdfAction>> m_Action;
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13