CPDFButtonWidgetAnnotation.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // CPDFButtonWidgetAnnotation.h
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. #import <ComPDFKit/CPDFWidgetAnnotation.h>
  13. typedef NS_ENUM(NSInteger, CPDFWidgetControlType) {
  14. CPDFWidgetUnknownControl = -1,
  15. CPDFWidgetPushButtonControl = 0,
  16. CPDFWidgetRadioButtonControl = 1,
  17. CPDFWidgetCheckBoxControl = 2
  18. };
  19. typedef NS_ENUM(NSInteger, CPDFWidgetButtonStyle) {
  20. CPDFWidgetButtonStyleNone = -1,
  21. CPDFWidgetButtonStyleCheck = 0,
  22. CPDFWidgetButtonStyleCircle,
  23. CPDFWidgetButtonStyleCross,
  24. CPDFWidgetButtonStyleDiamond,
  25. CPDFWidgetButtonStyleSquare,
  26. CPDFWidgetButtonStyleStar
  27. };
  28. @class CPDFAction;
  29. /**
  30. * A CPDFButtonWidgetAnnotation object provides user interactivity on a page of a PDF document. There are three types of buttons available: push button, radio button, and checkbox.
  31. *
  32. * @discussion CPDFButtonWidgetAnnotation inherits general annotation behavior from the CPDFWidgetAnnotation class.
  33. */
  34. @interface CPDFButtonWidgetAnnotation : CPDFWidgetAnnotation
  35. /**
  36. * Initializes CPDFButtonWidgetAnnotation object.
  37. *
  38. * @see CPDFWidgetControlType
  39. */
  40. - (instancetype)initWithDocument:(CPDFDocument *)document controlType:(CPDFWidgetControlType)controlType;
  41. /**
  42. * Returns the type of the control.
  43. *
  44. * @see CPDFWidgetControlType
  45. */
  46. - (CPDFWidgetControlType)controlType;
  47. /**
  48. * Returns the state of the control.
  49. *
  50. * @discussion Applies to CPDFWidgetRadioButtonControl or CPDFWidgetCheckBoxControl only.
  51. */
  52. - (NSInteger)state;
  53. /**
  54. * Sets the state of the control.
  55. *
  56. * @discussion Applies to CPDFWidgetRadioButtonControl or CPDFWidgetCheckBoxControl only.
  57. */
  58. - (void)setState:(NSInteger)value;
  59. /**
  60. * Returns the text of the label on a push button control.
  61. *
  62. * @discussion This method applies only to the label drawn on a control of type CPDFWidgetPushButtonControl.
  63. */
  64. - (NSString *)caption;
  65. /**
  66. * Sets the text of the label on a push button control.
  67. *
  68. * @discussion This method applies only to the label drawn on a control of type CPDFWidgetPushButtonControl.
  69. */
  70. - (void)setCaption:(NSString *)name;
  71. - (CPDFAction *)action;
  72. - (void)setAction:(CPDFAction *)action;
  73. - (BOOL)isTick;
  74. - (void)setIsTick:(NSInteger)isTick;
  75. /**
  76. * Gets the fill style of CheckBox or Radiobutton;
  77. *
  78. * @see CPDFWidgetButtonStyle
  79. */
  80. - (CPDFWidgetButtonStyle)widgetCheckStyle;
  81. /**
  82. * Sets the fill style of CheckBox or Radiobutton
  83. *
  84. * @see CPDFWidgetButtonStyle
  85. */
  86. - (void)setWidgetCheckStyle:(CPDFWidgetButtonStyle)widgetCheckStyle;
  87. @end