CPDFButtonWidgetAnnotation.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // CPDFButtonWidgetAnnotation.h
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2022 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. @class CPDFAction;
  20. /**
  21. * 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.
  22. *
  23. * @discussion CPDFButtonWidgetAnnotation inherits general annotation behavior from the CPDFWidgetAnnotation class.
  24. */
  25. @interface CPDFButtonWidgetAnnotation : CPDFWidgetAnnotation
  26. /**
  27. * Initializes CPDFButtonWidgetAnnotation object.
  28. *
  29. * @see CPDFWidgetControlType
  30. */
  31. - (instancetype)initWithDocument:(CPDFDocument *)document controlType:(CPDFWidgetControlType)controlType;
  32. /**
  33. * Returns the type of the control.
  34. *
  35. * @see CPDFWidgetControlType
  36. */
  37. - (CPDFWidgetControlType)controlType;
  38. /**
  39. * Returns the state of the control.
  40. *
  41. * @discussion Applies to CPDFWidgetRadioButtonControl or CPDFWidgetCheckBoxControl only.
  42. */
  43. - (NSInteger)state;
  44. /**
  45. * Sets the state of the control.
  46. *
  47. * @discussion Applies to CPDFWidgetRadioButtonControl or CPDFWidgetCheckBoxControl only.
  48. */
  49. - (void)setState:(NSInteger)value;
  50. /**
  51. * Returns the text of the label on a push button control.
  52. *
  53. * @discussion This method applies only to the label drawn on a control of type CPDFWidgetPushButtonControl.
  54. */
  55. - (NSString *)caption;
  56. /**
  57. * Sets the text of the label on a push button control.
  58. *
  59. * @discussion This method applies only to the label drawn on a control of type CPDFWidgetPushButtonControl.
  60. */
  61. - (void)setCaption:(NSString *)name;
  62. - (CPDFAction *)action;
  63. - (void)setAction:(CPDFAction *)action;
  64. - (BOOL)isTick;
  65. - (void)setIsTick:(NSInteger)isTick;
  66. @end