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 
216  Action& operator = (const Action& other);
217 
225  bool operator == (const Action& other) const;
226 
234  bool operator != (const Action& other) const;
235 
243  bool IsEmpty() const;
244 
252 
260 
269  void SetEventTrigger(ActionEventTriggerType event_trigger);
270 
271  explicit Action(FS_HANDLE handle);
272 };
273 
275 class GoToAction FS_FINAL : public Action {
276  public:
282  explicit GoToAction(Action object);
283 
285  ~GoToAction();
286 
292  GoToAction(const GoToAction& other);
293 
301  GoToAction& operator = (const GoToAction& other);
302 
310  bool operator == (const GoToAction& other) const;
311 
319  bool operator != (const GoToAction& other) const;
320 
328  bool IsEmpty() const;
329 
336 
346  void SetDestination(float x, float y, foxit::uint32 page_id);
347 
348  explicit GoToAction(FS_HANDLE handle);
349 };
350 
352 class GotoAAction FS_FINAL : public Action {
353  public:
359  explicit GotoAAction(Action object);
360 
362  ~GotoAAction();
363 
369  GotoAAction(const GotoAAction& other);
370 
378  GotoAAction& operator = (const GotoAAction& other);
379 
387  bool operator == (const GotoAAction& other) const;
388 
396  bool operator != (const GotoAAction& other) const;
397 
405  bool IsEmpty() const;
406 
416  void SetAttachmentID(foxit::uint32 attachment_id);
417 
418  explicit GotoAAction(FS_HANDLE handle);
419 };
420 
422 class URIAction FS_FINAL : public Action {
423  public:
429  explicit URIAction(Action object);
430 
432  ~URIAction();
433 
439  URIAction(const URIAction& other);
440 
448  URIAction& operator = (const URIAction& other);
449 
457  bool operator == (const URIAction& other) const;
458 
466  bool operator != (const URIAction& other) const;
467 
475  bool IsEmpty() const;
476 
482  String GetURI();
483 
491  void SetURI(const String& uri);
492 
493  explicit URIAction(FS_HANDLE handle);
494 };
495 
497 class SoundAction FS_FINAL : public Action {
498  public:
504  explicit SoundAction(Action object);
505 
507  ~SoundAction();
508 
514  SoundAction(const SoundAction& other);
515 
523  SoundAction& operator = (const SoundAction& other);
524 
532  bool operator == (const SoundAction& other) const;
533 
541  bool operator != (const SoundAction& other) const;
542 
550  bool IsEmpty() const;
551 
558 
564  int GetVolume();
565 
571  bool IsRepeat();
572 
578  bool IsSynchronous();
579 
587  void SetResourceID(foxit::uint32 resource_id);
588 
596  void SetVolume(int volume);
597 
605  void EnableRepeat(bool repeat);
606 
614  void EnableSynchronous(bool synchronous);
615 
616  explicit SoundAction(FS_HANDLE handle);
617 };
618 
620 class MovieAction FS_FINAL : public Action {
621  public:
627  typedef enum _MovieOperatorType {
637 
638 
644  explicit MovieAction(Action object);
645 
647  ~MovieAction();
648 
654  MovieAction(const MovieAction& other);
655 
663  MovieAction& operator = (const MovieAction& other);
664 
672  bool operator == (const MovieAction& other) const;
673 
681  bool operator != (const MovieAction& other) const;
682 
690  bool IsEmpty() const;
691 
698 
706 
714  void SetResourceID(foxit::uint32 resource_id);
715 
725 
726  explicit MovieAction(FS_HANDLE handle);
727 };
728 
730 class Actions FS_FINAL : public Base {
731  public:
733  ~Actions();
734 
740  Actions(const Actions& other);
741 
749  Actions& operator = (const Actions& other);
750 
758  bool operator == (const Actions& other) const;
759 
767  bool operator != (const Actions& other) const;
768 
776  bool IsEmpty() const;
777 
783  int GetActionCount();
784 
793  Action GetAction(int index);
794 
804 
814  Action InsertAction(Action::ActionType type, int index);
815 
824  bool RemoveAction(int index);
825 
826  explicit Actions(FS_HANDLE handle);
827 };
828 
829 } // namespace ofd
830 } // namespace foxit
831 
832 #endif // FS_OFD_ACTION_H_
Definition: fs_ofdaction.h:275
bool operator !=(const Action &other) const
不等操作符。
操作类型:继续。
Definition: fs_ofdaction.h:635
bool operator !=(const GotoAAction &other) const
不相等操作符。
void SetAttachmentID(foxit::uint32 attachment_id)
设置关联ID。
ActionDestinationInfo & operator=(const ActionDestinationInfo &other)
赋值操作符。
Definition: fs_ofdaction.h:83
操作类型:播放。
Definition: fs_ofdaction.h:629
bool IsEmpty() const
检查当前对象是否为空。
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
Action InsertAction(Action::ActionType type, int index)
插入动作对象。
~SoundAction()
析构函数。
动作类型:声音(当前不支持)。
Definition: fs_ofdaction.h:177
Action AddAction(Action::ActionType type)
添加动作对象。
GoToAction(Action object)
构造函数,从现有foxit::ofd::Action对象。
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
相等操作符。
bool IsEmpty() const
检查当前对象是否为空。
~Action()
析构函数。
目标类型:XYZ。
Definition: fs_ofdaction.h:28
SoundAction(Action object)
构造函数,从现有foxit::ofd::Action对象。
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)
移除指定索引的动作对象。
MovieAction(Action object)
构造函数,从现有foxit::ofd::Action对象。
bool operator==(const GotoAAction &other) const
相等操作符。
bool IsEmpty() const
检查当前对象是否为空。
Definition: fs_ofdaction.h:497
~GoToAction()
析构函数。
Actions(const Actions &other)
构造函数,通过另一个动作集合对象。
URIAction(Action object)
构造函数,从现有foxit::ofd::Action对象。
MovieOperatorType
OFD视频动作的操作类型枚举类型。
Definition: fs_ofdaction.h:627
MovieAction & operator=(const MovieAction &other)
赋值操作符。
float right
右边距,单位为毫米。
Definition: fs_ofdaction.h:140
float left
左边距,单位为毫米。
Definition: fs_ofdaction.h:134
~GotoAAction()
析构函数。
Definition: fs_ofdaction.h:730
Definition: fs_ofdaction.h:352
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
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:620
bool operator !=(const Actions &other) const
不相等操作符。
GotoAAction & operator=(const GotoAAction &other)
赋值操作符。
bool IsSynchronous()
检查是否同步播放。
Definition: fs_basictypes.h:471
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
目标类型:适合宽度。
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_accessibility.h:28
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:422
void SetResourceID(foxit::uint32 resource_id)
设置资源ID。
foxit::uint32 GetResourceID()
获取资源ID。
bool IsRepeat()
检查是否重复播放。
GotoAAction(Action object)
构造函数,从现有foxit::ofd::Action对象。
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:633
Definition: fs_ofdaction.h:17
操作类型:停止。
Definition: fs_ofdaction.h:631
foxit::ofd::ActionDestinationInfo GetDestination()
获取跳转目标信息。