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 {
37  } GotoDestType;
38 
39 
52  explicit ActionDestinationInfo(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom) :
54  type(type),
55  left(left),
56  right(right),
57  top(top),
58  bottom(bottom),
59  zoom(zoom) {}
60 
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 
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 
123 
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 {
182  } ActionType;
183 
189  typedef enum _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 
251 
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 
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 
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 {
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 
647 
655 
663  void SetResourceID(foxit::uint32 resource_id);
664 
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 
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_
Definition: fs_ofdaction.h:274
bool operator !=(const Action &other) const
不等操作符。
操作类型:继续。
Definition: fs_ofdaction.h:579
ActionDestinationInfo & operator=(const ActionDestinationInfo &other)
赋值操作符。
Definition: fs_ofdaction.h:83
操作类型:播放。
Definition: fs_ofdaction.h:573
URIAction()
构造函数。
bool IsEmpty() const
检查当前对象是否为空。
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
~SoundAction()
析构函数。
动作类型:声音。
Definition: fs_ofdaction.h:177
Action AddAction(Action::ActionType type)
添加动作对象。
void Set(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom)
设置值。
Definition: fs_ofdaction.h:108
bool operator==(const URIAction &other) const
相等操作符。
~Action()
析构函数。
目标类型:XYZ。
Definition: fs_ofdaction.h:28
GotoDestType type
目标类型。请参考从 GotoDestType::e_GotoDestTypeXYZ 开始的值, 这应该是这些值中的一个。
Definition: fs_ofdaction.h:128
目标类型:适合页面。
Definition: fs_ofdaction.h:30
bool operator !=(const GoToAction &other) const
不相等操作符。
动作触发类型:页面打开。
Definition: fs_ofdaction.h:193
void SetOperator(MovieOperatorType op)
设置操作类型。
动作类型:视频。
Definition: fs_ofdaction.h:179
目标类型:未知。
Definition: fs_ofdaction.h:26
bool IsEmpty() const
检查当前对象是否为空。
void EnableRepeat(bool repeat)
设置是否重复播放。
Actions & operator=(const Actions &other)
赋值操作符。
void SetEventTrigger(ActionEventTriggerType event_trigger)
设置事件触发器。
bool operator==(const Actions &other) const
相等操作符。
void SetURI(const String &uri)
设置URI。
ActionEventTriggerType GetEventTrigger()
获取事件触发器。
~MovieAction()
析构函数。
bool IsEmpty() const
检查当前对象是否为空。
void SetVolume(int volume)
设置音量。
int GetActionCount()
获取动作的数量。
动作类型:URI。
Definition: fs_ofdaction.h:175
float top
上边距,单位为毫米。
Definition: fs_ofdaction.h:146
bool operator==(const SoundAction &other) const
相等操作符。
动作类型:未知。
Definition: fs_ofdaction.h:171
bool RemoveAction(int index)
移除指定索引的动作对象。
bool IsEmpty() const
检查当前对象是否为空。
Definition: fs_ofdaction.h:436
~GoToAction()
析构函数。
Actions(const Actions &other)
构造函数,通过另一个动作集合对象。
MovieOperatorType
OFD视频动作的操作类型枚举类型。
Definition: fs_ofdaction.h:571
MovieAction & operator=(const MovieAction &other)
赋值操作符。
float right
右边距,单位为毫米。
Definition: fs_ofdaction.h:140
float left
左边距,单位为毫米。
Definition: fs_ofdaction.h:134
Definition: fs_ofdaction.h:679
GoToAction()
构造函数。
ActionEventTriggerType
OFD动作触发事件枚举类型。
Definition: fs_ofdaction.h:189
Action & operator=(const Action &other)
赋值操作符。
GoToAction & operator=(const GoToAction &other)
赋值操作符。
URIAction & operator=(const URIAction &other)
赋值操作符。
void SetDestination(float x, float y, foxit::uint32 page_id)
设置跳转目标信息。
foxit::uint32 page_id
页面ID。
Definition: fs_ofdaction.h:122
动作类型:跳转。
Definition: fs_ofdaction.h:173
MovieAction()
构造函数。
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
foxit::ofd::Action::ActionType GetType()
获取动作类型。
通用定义和类的头文件。
~Actions()
析构函数。
int GetVolume()
获取音量。
Definition: fs_ofdaction.h:564
bool operator !=(const Actions &other) const
不相等操作符。
bool IsSynchronous()
检查是否同步播放。
Definition: fs_basictypes.h:465
bool operator !=(const MovieAction &other) const
不相等操作符。
bool operator==(const Action &other) const
相等操作符。
GotoDestType
OFD跳转动作的目标类型枚举类型。
Definition: fs_ofdaction.h:24
ActionType
OFD动作类型定义枚举类型。
Definition: fs_ofdaction.h:169
SoundAction()
构造函数。
目标类型:适合宽度。
Definition: fs_ofdaction.h:32
float bottom
下边距,单位为毫米。
Definition: fs_ofdaction.h:152
float zoom
缩放比例,取值范围为0.1-64。
Definition: fs_ofdaction.h:158
Definition: fs_ofdaction.h:162
void SetResourceID(foxit::uint32 resource_id)
设置资源ID。
目标类型:适合高度。
Definition: fs_ofdaction.h:34
Action GetAction(int index)
获取指定索引的动作对象。
bool IsEmpty() const
检查当前对象是否为空。
Foxit命名空间。
Definition: fs_pdf3d.h:26
bool operator==(const MovieAction &other) const
相等操作符。
Action(const Action &other)
用另一个动作对象构造当前动作对象。
bool operator==(const GoToAction &other) const
相等操作符。
字节字符串类
Definition: fx_string.h:317
bool operator !=(const SoundAction &other) const
不相等操作符。
SoundAction & operator=(const SoundAction &other)
赋值操作符。
void EnableSynchronous(bool synchronous)
设置是否同步播放。
动作触发类型:文档打开。
Definition: fs_ofdaction.h:191
foxit::uint32 GetResourceID()
获取资源ID。
Definition: fs_ofdaction.h:356
void SetResourceID(foxit::uint32 resource_id)
设置资源ID。
foxit::uint32 GetResourceID()
获取资源ID。
bool IsRepeat()
检查是否重复播放。
bool IsEmpty() const
检查当前对象是否为空。
动作触发类型:鼠标点击。
Definition: fs_ofdaction.h:195
~URIAction()
析构函数。
ActionDestinationInfo(const ActionDestinationInfo &other)
构造函数,通过另一个动作跳转目标信息对象。
Definition: fs_ofdaction.h:66
String GetURI()
获取URI。
ActionDestinationInfo(foxit::uint32 page_id, GotoDestType type, float left, float right, float top, float bottom, float zoom)
带参数的构造函数。
Definition: fs_ofdaction.h:52
MovieOperatorType GetOperator()
获取操作类型。
目标类型:适合区域。
Definition: fs_ofdaction.h:36
bool operator !=(const URIAction &other) const
不相等操作符。
动作类型:跳转到动作。
Definition: fs_ofdaction.h:181
操作类型:暂停。
Definition: fs_ofdaction.h:577
Definition: fs_ofdaction.h:17
操作类型:停止。
Definition: fs_ofdaction.h:575
foxit::ofd::ActionDestinationInfo GetDestination()
获取跳转目标信息。