Foxit PDF SDK

fs_ofdaction.h
1 #ifndef FS_OFD_ACTION_H_
2 #define FS_OFD_ACTION_H_
3
4 #include "common/fs_common.h"
5
11 namespace foxit {
15 namespace ofd {
17 class ActionDestinationInfo FS_FINAL : public Object {
18 public:
24 typedef enum _GotoDestType {
26 e_GotoDestTypeUnknown = 0,
28 e_GotoDestTypeXYZ = 1,
30 e_GotoDestTypeFit = 2,
32 e_GotoDestTypeFitH = 3,
34 e_GotoDestTypeFitV = 4,
36 e_GotoDestTypeFitR = 5
37 } GotoDestType;
38
39
52 explicit ActionDestinationInfo(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom) :
53 page_id(page_id),
54 type(type),
55 left(left),
56 right(right),
57 top(top),
58 bottom(bottom),
59 zoom(zoom) {}
60
66 ActionDestinationInfo(const ActionDestinationInfo& other) {
67 this->page_id = other.page_id;
68 this->type = other.type;
69 this->left = other.left;
70 this->right = other.right;
71 this->top = other.top;
72 this->bottom = other.bottom;
73 this->zoom = other.zoom;
74 }
75
83 ActionDestinationInfo& operator = (const ActionDestinationInfo& other) {
84 this->page_id = other.page_id;
85 this->type = other.type;
86 this->left = other.left;
87 this->right = other.right;
88 this->top = other.top;
89 this->bottom = other.bottom;
90 this->zoom = other.zoom;
91 return *this;
92 }
93
108 void Set(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom) {
109 this->page_id = page_id;
110 this->type = type;
111 this->left = left;
112 this->right = right;
113 this->top = top;
114 this->bottom = bottom;
115 this->zoom = zoom;
116 }
117
122 foxit::uint32 page_id;
123
128 GotoDestType type;
129
134 float left;
135
140 float right;
141
146 float top;
147
152 float bottom;
153
158 float zoom;
159 };
160
162 class Action : public Base {
163 public:
169 typedef enum _ActionType {
171 e_ActionTypeUnknown = 0,
173 e_ActionTypeGoto = 1,
175 e_ActionTypeUri = 2,
177 e_ActionTypeSound = 3,
179 e_ActionTypeMovie = 4,
181 e_ActionTypeGotoA = 5
182 } ActionType;
183
189 typedef enum _ActionEventTriggerType {
191 e_ActionEventTriggerTypeDocumentOpen = 0,
193 e_ActionEventTriggerTypePageOpen = 1,
195 e_ActionEventTriggerTypeClick = 2
196 } ActionEventTriggerType;
197
198
200 ~Action();
201
207 Action(const Action& other);
208
215 Action& operator = (const Action& other);
216
224 bool operator == (const Action& other) const;
225
233 bool operator != (const Action& other) const;
234
242 bool IsEmpty() const;
243
250 foxit::ofd::Action::ActionType GetType();
251
258 ActionEventTriggerType GetEventTrigger();
259
268 void SetEventTrigger(ActionEventTriggerType event_trigger);
269
270 explicit Action(FS_HANDLE handle);
271 };
272
274 class GoToAction FS_FINAL : public Action {
275 public:
279 GoToAction();
280
286 explicit GoToAction(Action object);
287
289 ~GoToAction();
290
296 GoToAction(const GoToAction& other);
297
305 GoToAction& operator = (const GoToAction& other);
306
314 bool operator == (const GoToAction& other) const;
315
323 bool operator != (const GoToAction& other) const;
324
332 bool IsEmpty() const;
333
339 foxit::ofd::ActionDestinationInfo GetDestination();
340
350 void SetDestination(float x, float y, foxit::uint32 page_id);
351
352 explicit GoToAction(FS_HANDLE handle);
353 };
354
356 class URIAction FS_FINAL : public Action {
357 public:
361 URIAction();
362
368 explicit URIAction(Action object);
369
371 ~URIAction();
372
378 URIAction(const URIAction& other);
379
387 URIAction& operator = (const URIAction& other);
388
396 bool operator == (const URIAction& other) const;
397
405 bool operator != (const URIAction& other) const;
406
414 bool IsEmpty() const;
415
421 String GetURI();
422
430 void SetURI(const String& uri);
431
432 explicit URIAction(FS_HANDLE handle);
433 };
434
436 class SoundAction FS_FINAL : public Action {
437 public:
441 SoundAction();
442
448 explicit SoundAction(Action object);
449
451 ~SoundAction();
452
458 SoundAction(const SoundAction& other);
459
467 SoundAction& operator = (const SoundAction& other);
468
476 bool operator == (const SoundAction& other) const;
477
485 bool operator != (const SoundAction& other) const;
486
494 bool IsEmpty() const;
495
501 foxit::uint32 GetResourceID();
502
508 int GetVolume();
509
515 bool IsRepeat();
516
522 bool IsSynchronous();
523
531 void SetResourceID(foxit::uint32 resource_id);
532
540 void SetVolume(int volume);
541
549 void EnableRepeat(bool repeat);
550
558 void EnableSynchronous(bool synchronous);
559
560 explicit SoundAction(FS_HANDLE handle);
561 };
562
564 class MovieAction FS_FINAL : public Action {
565 public:
571 typedef enum _MovieOperatorType {
573 e_MovieOperatorTypePlay = 0,
575 e_MovieOperatorTypeStop = 1,
577 e_MovieOperatorTypePause = 2,
579 e_MovieOperatorTypeResume = 3
580 } MovieOperatorType;
581
582
586 MovieAction();
587
593 explicit MovieAction(Action object);
594
596 ~MovieAction();
597
603 MovieAction(const MovieAction& other);
604
612 MovieAction& operator = (const MovieAction& other);
613
621 bool operator == (const MovieAction& other) const;
622
630 bool operator != (const MovieAction& other) const;
631
639 bool IsEmpty() const;
640
646 foxit::uint32 GetResourceID();
647
654 MovieOperatorType GetOperator();
655
663 void SetResourceID(foxit::uint32 resource_id);
664
673 void SetOperator(MovieOperatorType op);
674
675 explicit MovieAction(FS_HANDLE handle);
676 };
677
679 class Actions FS_FINAL : public Base {
680 public:
682 ~Actions();
683
689 Actions(const Actions& other);
690
698 Actions& operator = (const Actions& other);
699
707 bool operator == (const Actions& other) const;
708
716 bool operator != (const Actions& other) const;
717
725 bool IsEmpty() const;
726
732 int GetActionCount();
733
742 Action GetAction(int index);
743
752 Action AddAction(Action::ActionType type);
753
762 bool RemoveAction(int index);
763
764 explicit Actions(FS_HANDLE handle);
765 };
766
767 } // namespace ofd
768 } // namespace foxit
769
770 #endif // FS_OFD_ACTION_H_
foxit::ofd::GoToAction
Definition: fs_ofdaction.h:274
foxit::ofd::Action::operator !=
bool operator !=(const Action &other) const
不等操作符。
foxit::ofd::MovieAction::e_MovieOperatorTypeResume
操作类型：继续。
Definition: fs_ofdaction.h:579
foxit::ofd::ActionDestinationInfo::operator=
ActionDestinationInfo & operator=(const ActionDestinationInfo &other)
赋值操作符。
Definition: fs_ofdaction.h:83
foxit::ofd::MovieAction::e_MovieOperatorTypePlay
操作类型：播放。
Definition: fs_ofdaction.h:573
foxit::ofd::URIAction::URIAction
URIAction()
构造函数。
foxit::ofd::URIAction::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::ofd::SoundAction::~SoundAction
~SoundAction()
析构函数。
foxit::ofd::Action::e_ActionTypeSound
动作类型：声音。
Definition: fs_ofdaction.h:177
foxit::ofd::Actions::AddAction
Action AddAction(Action::ActionType type)
添加动作对象。
foxit::ofd::ActionDestinationInfo::Set
void Set(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom)
设置值。
Definition: fs_ofdaction.h:108
foxit::ofd::URIAction::operator==
bool operator==(const URIAction &other) const
相等操作符。
foxit::ofd::Action::~Action
~Action()
析构函数。
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeXYZ
目标类型：XYZ。
Definition: fs_ofdaction.h:28
foxit::ofd::ActionDestinationInfo::type
GotoDestType type
目标类型。请参考从 GotoDestType::e_GotoDestTypeXYZ 开始的值， 这应该是这些值中的一个。
Definition: fs_ofdaction.h:128
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeFit
目标类型：适合页面。
Definition: fs_ofdaction.h:30
foxit::ofd::GoToAction::operator !=
bool operator !=(const GoToAction &other) const
不相等操作符。
foxit::ofd::Action::e_ActionEventTriggerTypePageOpen
动作触发类型：页面打开。
Definition: fs_ofdaction.h:193
foxit::ofd::MovieAction::SetOperator
void SetOperator(MovieOperatorType op)
设置操作类型。
foxit::ofd::Action::e_ActionTypeMovie
动作类型：视频。
Definition: fs_ofdaction.h:179
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeUnknown
目标类型：未知。
Definition: fs_ofdaction.h:26
foxit::ofd::MovieAction::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::SoundAction::EnableRepeat
void EnableRepeat(bool repeat)
设置是否重复播放。
foxit::ofd::Actions::operator=
Actions & operator=(const Actions &other)
赋值操作符。
foxit::ofd::Action::SetEventTrigger
void SetEventTrigger(ActionEventTriggerType event_trigger)
设置事件触发器。
foxit::ofd::Actions::operator==
bool operator==(const Actions &other) const
相等操作符。
foxit::ofd::URIAction::SetURI
void SetURI(const String &uri)
设置URI。
foxit::ofd::Action::GetEventTrigger
ActionEventTriggerType GetEventTrigger()
获取事件触发器。
foxit::ofd::MovieAction::~MovieAction
~MovieAction()
析构函数。
foxit::ofd::Action::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::SoundAction::SetVolume
void SetVolume(int volume)
设置音量。
foxit::ofd::Actions::GetActionCount
int GetActionCount()
获取动作的数量。
foxit::ofd::Action::e_ActionTypeUri
动作类型：URI。
Definition: fs_ofdaction.h:175
foxit::ofd::ActionDestinationInfo::top
float top
上边距，单位为毫米。
Definition: fs_ofdaction.h:146
foxit::ofd::SoundAction::operator==
bool operator==(const SoundAction &other) const
相等操作符。
foxit::ofd::Action::e_ActionTypeUnknown
动作类型：未知。
Definition: fs_ofdaction.h:171
foxit::ofd::Actions::RemoveAction
bool RemoveAction(int index)
移除指定索引的动作对象。
foxit::ofd::SoundAction::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::SoundAction
Definition: fs_ofdaction.h:436
foxit::ofd::GoToAction::~GoToAction
~GoToAction()
析构函数。
foxit::ofd::Actions::Actions
Actions(const Actions &other)
构造函数，通过另一个动作集合对象。
foxit::ofd::MovieAction::MovieOperatorType
MovieOperatorType
OFD视频动作的操作类型枚举类型。
Definition: fs_ofdaction.h:571
foxit::ofd::MovieAction::operator=
MovieAction & operator=(const MovieAction &other)
赋值操作符。
foxit::ofd::ActionDestinationInfo::right
float right
右边距，单位为毫米。
Definition: fs_ofdaction.h:140
foxit::ofd::ActionDestinationInfo::left
float left
左边距，单位为毫米。
Definition: fs_ofdaction.h:134
foxit::ofd::Actions
Definition: fs_ofdaction.h:679
foxit::ofd::GoToAction::GoToAction
GoToAction()
构造函数。
foxit::ofd::Action::ActionEventTriggerType
ActionEventTriggerType
OFD动作触发事件枚举类型。
Definition: fs_ofdaction.h:189
foxit::ofd::Action::operator=
Action & operator=(const Action &other)
赋值操作符。
foxit::ofd::GoToAction::operator=
GoToAction & operator=(const GoToAction &other)
赋值操作符。
foxit::ofd::URIAction::operator=
URIAction & operator=(const URIAction &other)
赋值操作符。
foxit::ofd::GoToAction::SetDestination
void SetDestination(float x, float y, foxit::uint32 page_id)
设置跳转目标信息。
foxit::ofd::ActionDestinationInfo::page_id
foxit::uint32 page_id
页面ID。
Definition: fs_ofdaction.h:122
foxit::ofd::Action::e_ActionTypeGoto
动作类型：跳转。
Definition: fs_ofdaction.h:173
foxit::ofd::MovieAction::MovieAction
MovieAction()
构造函数。
foxit::uint32
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
foxit::ofd::Action::GetType
foxit::ofd::Action::ActionType GetType()
获取动作类型。
fs_common.h
通用定义和类的头文件。
foxit::ofd::Actions::~Actions
~Actions()
析构函数。
foxit::ofd::SoundAction::GetVolume
int GetVolume()
获取音量。
foxit::ofd::MovieAction
Definition: fs_ofdaction.h:564
foxit::ofd::Actions::operator !=
bool operator !=(const Actions &other) const
不相等操作符。
foxit::ofd::SoundAction::IsSynchronous
bool IsSynchronous()
检查是否同步播放。
foxit::Base
Definition: fs_basictypes.h:465
foxit::ofd::MovieAction::operator !=
bool operator !=(const MovieAction &other) const
不相等操作符。
foxit::ofd::Action::operator==
bool operator==(const Action &other) const
相等操作符。
foxit::ofd::ActionDestinationInfo::GotoDestType
GotoDestType
OFD跳转动作的目标类型枚举类型。
Definition: fs_ofdaction.h:24
foxit::ofd::Action::ActionType
ActionType
OFD动作类型定义枚举类型。
Definition: fs_ofdaction.h:169
foxit::ofd::SoundAction::SoundAction
SoundAction()
构造函数。
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeFitH
目标类型：适合宽度。
Definition: fs_ofdaction.h:32
foxit::ofd::ActionDestinationInfo::bottom
float bottom
下边距，单位为毫米。
Definition: fs_ofdaction.h:152
foxit::ofd::ActionDestinationInfo::zoom
float zoom
缩放比例，取值范围为0.1-64。
Definition: fs_ofdaction.h:158
foxit::ofd::Action
Definition: fs_ofdaction.h:162
foxit::ofd::MovieAction::SetResourceID
void SetResourceID(foxit::uint32 resource_id)
设置资源ID。
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeFitV
目标类型：适合高度。
Definition: fs_ofdaction.h:34
foxit::ofd::Actions::GetAction
Action GetAction(int index)
获取指定索引的动作对象。
foxit::ofd::Actions::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::ofd::MovieAction::operator==
bool operator==(const MovieAction &other) const
相等操作符。
foxit::ofd::Action::Action
Action(const Action &other)
用另一个动作对象构造当前动作对象。
foxit::ofd::GoToAction::operator==
bool operator==(const GoToAction &other) const
相等操作符。
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::ofd::SoundAction::operator !=
bool operator !=(const SoundAction &other) const
不相等操作符。
foxit::ofd::SoundAction::operator=
SoundAction & operator=(const SoundAction &other)
赋值操作符。
foxit::ofd::SoundAction::EnableSynchronous
void EnableSynchronous(bool synchronous)
设置是否同步播放。
foxit::ofd::Action::e_ActionEventTriggerTypeDocumentOpen
动作触发类型：文档打开。
Definition: fs_ofdaction.h:191
foxit::ofd::MovieAction::GetResourceID
foxit::uint32 GetResourceID()
获取资源ID。
foxit::ofd::URIAction
Definition: fs_ofdaction.h:356
foxit::ofd::SoundAction::SetResourceID
void SetResourceID(foxit::uint32 resource_id)
设置资源ID。
foxit::ofd::SoundAction::GetResourceID
foxit::uint32 GetResourceID()
获取资源ID。
foxit::ofd::SoundAction::IsRepeat
bool IsRepeat()
检查是否重复播放。
foxit::ofd::GoToAction::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::Action::e_ActionEventTriggerTypeClick
动作触发类型：鼠标点击。
Definition: fs_ofdaction.h:195
foxit::ofd::URIAction::~URIAction
~URIAction()
析构函数。
foxit::ofd::ActionDestinationInfo::ActionDestinationInfo
ActionDestinationInfo(const ActionDestinationInfo &other)
构造函数，通过另一个动作跳转目标信息对象。
Definition: fs_ofdaction.h:66
foxit::ofd::URIAction::GetURI
String GetURI()
获取URI。
foxit::ofd::ActionDestinationInfo::ActionDestinationInfo
ActionDestinationInfo(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom)
带参数的构造函数。
Definition: fs_ofdaction.h:52
foxit::ofd::MovieAction::GetOperator
MovieOperatorType GetOperator()
获取操作类型。
foxit::ofd::ActionDestinationInfo::e_GotoDestTypeFitR
目标类型：适合区域。
Definition: fs_ofdaction.h:36
foxit::ofd::URIAction::operator !=
bool operator !=(const URIAction &other) const
不相等操作符。
foxit::ofd::Action::e_ActionTypeGotoA
动作类型：跳转到动作。
Definition: fs_ofdaction.h:181
foxit::ofd::MovieAction::e_MovieOperatorTypePause
操作类型：暂停。
Definition: fs_ofdaction.h:577
foxit::ofd::ActionDestinationInfo
Definition: fs_ofdaction.h:17
foxit::ofd::MovieAction::e_MovieOperatorTypeStop
操作类型：停止。
Definition: fs_ofdaction.h:575
foxit::ofd::GoToAction::GetDestination
foxit::ofd::ActionDestinationInfo GetDestination()
获取跳转目标信息。