Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdfsdk_appstream.h
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef FPDFSDK_CPDFSDK_APPSTREAM_H_
8#define FPDFSDK_CPDFSDK_APPSTREAM_H_
9
10#include <optional>
11
12#include "core/fxcrt/fx_string.h"
13#include "core/fxcrt/retain_ptr.h"
14#include "core/fxcrt/unowned_ptr.h"
15
16class CPDFSDK_Widget;
17class CPDF_Dictionary;
18class CPDF_Stream;
19
21 public:
22 CPDFSDK_AppStream(CPDFSDK_Widget* widget, CPDF_Dictionary* dict);
24
25 void SetAsPushButton();
26 void SetAsCheckBox();
27 void SetAsRadioButton();
28 void SetAsComboBox(std::optional<WideString> sValue);
29 void SetAsListBox();
30 void SetAsTextField(std::optional<WideString> sValue);
31
32 private:
33 void AddImage(const ByteString& sAPType, const CPDF_Stream* pImage);
34 void Write(const ByteString& sAPType,
35 const ByteString& sContents,
36 const ByteString& sAPState);
37 void Remove(ByteStringView sAPType);
38
39 ByteString GetBackgroundAppStream() const;
40 ByteString GetBorderAppStream() const;
41
42 UnownedPtr<CPDFSDK_Widget> const widget_;
43 RetainPtr<CPDF_Dictionary> const dict_;
44};
45
46#endif // FPDFSDK_CPDFSDK_APPSTREAM_H_
fxcrt::ByteString ByteString
Definition bytestring.h:180
BorderStyle
CFX_FloatRect GetCenterSquare() const
constexpr CFX_FloatRect(float l, float b, float r, float t)
float Width() const
bool IsEmpty() const
void ScaleFromCenterPoint(float fScale)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
float Height() const
CFX_FloatRect GetDeflated(float x, float y) const
constexpr CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
void SetAsComboBox(std::optional< WideString > sValue)
void SetAsTextField(std::optional< WideString > sValue)
CPDFSDK_AppStream(CPDFSDK_Widget *widget, CPDF_Dictionary *dict)
RetainPtr< CPDF_Font > GetPDFFont(int32_t nFontIndex) override
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
bool IsModifiedAPStream(const CPDF_Stream *stream) const
RetainPtr< CPDF_Stream > CreateModifiedAPStream(RetainPtr< CPDF_Dictionary > dict)
int GetControlAlignment() const
bool HasMKEntry(const ByteString &csEntry) const
WideString GetDownCaption() const
HighlightingMode GetHighlightingMode() const
WideString GetRolloverCaption() const
CFX_Color GetOriginalBackgroundColor()
CPDF_FormField * GetField() const
WideString GetNormalCaption() const
ByteString GetCheckedAPState() const
CPDF_IconFit GetIconFit() const
CPDF_DefaultAppearance GetDefaultAppearance() const
CFX_Color GetOriginalBorderColor()
int GetTextPosition() const
int GetSelectedIndex(int index) const
int CountOptions() const
WideString GetValue() const
uint32_t GetFieldFlags() const
int GetMaxLen() const
WideString GetOptionLabel(int index) const
int CountSelectedItems() const
int GetTopVisibleIndex() const
bool GetFittingBounds() const
RetainPtr< const CPDF_Dictionary > GetDict() const
uint16_t Word
Definition cpvt_word.h:19
int32_t nFontIndex
Definition cpvt_word.h:26
float fFontSize
Definition cpvt_word.h:27
void SetAt(int32_t nWordIndex)
bool GetWord(CPVT_Word &word) const
bool GetLine(CPVT_Line &line) const
const CPVT_WordPlace & GetAt() const
Iterator * GetIterator()
ByteString GetPDFWordString(int32_t nFontIndex, uint16_t Word, uint16_t SubWord)
IPVT_FontMap * GetFontMap()
static float GetCharArrayAutoFontSize(const CPDF_Font *pFont, const CFX_FloatRect &rcPlate, int32_t nCharArray)
CreateParams(CFX_Timer::HandlerIface *timer_handler, IPWL_FillerNotify *filler_notify, ProviderIface *provider)
Definition cpwl_wnd.cpp:36
virtual ByteString GetPDFFontAlias(int32_t nFontIndex)=0
ByteString & operator+=(const ByteString &str)
ByteString()=default
ByteString & operator=(const ByteString &that)
ByteString & operator=(ByteString &&that) noexcept
WideString & operator=(WideString &&that) noexcept
WideString & operator=(const WideString &that)
#define TEXTPOS_ICON
#define TEXTPOS_RIGHT
#define TEXTPOS_LEFT
#define TEXTPOS_BELOW
#define TEXTPOS_OVERLAID
#define TEXTPOS_ABOVE
#define PWS_VISIBLE
Definition cpwl_wnd.h:33
CFX_VTemplate< float > CFX_VectorF
CFX_PTemplate< float > CFX_PointF
CFX_STemplate< float > CFX_SizeF
#define FXSYS_BEZIER
Definition fx_system.h:45
#define FXSYS_PI
Definition fx_system.h:44
#define FXSYS_IsFloatBigger(fa, fb)
Definition fx_system.h:37
#define FXSYS_IsFloatZero(f)
Definition fx_system.h:36
ByteString operator+(const ByteString &str1, const ByteString &str2)
Definition bytestring.h:146
const char kRC[]
const char kIX[]
const char kAC[]
const char kCA[]
const char kI[]
const char kRI[]
constexpr uint32_t kTextPassword
Definition form_flags.h:27
constexpr uint32_t kTextComb
Definition form_flags.h:31
constexpr uint32_t kTextMultiline
Definition form_flags.h:26
fxcrt::ByteStringView ByteStringView
CFX_Color operator/(float fColorDivide) const
CFX_Color operator-(float fColorSub) const
float fColor4
Definition cfx_color.h:58
float fColor3
Definition cfx_color.h:57
Type nColorType
Definition cfx_color.h:54
CFX_Color & operator=(const CFX_Color &that)=default
constexpr CFX_Color(Type type=CFX_Color::Type::kTransparent, float color1=0.0f, float color2=0.0f, float color3=0.0f, float color4=0.0f)
Definition cfx_color.h:27
float fColor2
Definition cfx_color.h:56
float fColor1
Definition cfx_color.h:55
int32_t LineCmp(const CPVT_WordPlace &wp) const
CPWL_Dash(int32_t dash, int32_t gap, int32_t phase)
Definition cpwl_wnd.h:63
int32_t nPhase
Definition cpwl_wnd.h:74
int32_t nDash
Definition cpwl_wnd.h:72
int32_t nGap
Definition cpwl_wnd.h:73
fxcrt::WideString WideString
Definition widestring.h:207