Guest User

Untitled

a guest
May 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.99 KB | None | 0 0
  1. /*
  2. * Things.h
  3. */
  4.  
  5. #import <AppKit/AppKit.h>
  6. #import <ScriptingBridge/ScriptingBridge.h>
  7.  
  8.  
  9. @class ThingsWindow, ThingsApplication, ThingsList, ThingsArea, ThingsPerson, ThingsTag, ThingsToDo, ThingsProject, ThingsSelectedToDo;
  10.  
  11. enum ThingsPrintingErrorHandling {
  12. ThingsPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */,
  13. ThingsPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */
  14. };
  15. typedef enum ThingsPrintingErrorHandling ThingsPrintingErrorHandling;
  16.  
  17. enum ThingsStatus {
  18. ThingsStatusOpen = 'tdio' /* To do is open. */,
  19. ThingsStatusCompleted = 'tdcm' /* To do has been completed. */,
  20. ThingsStatusCanceled = 'tdcl' /* To do has been canceled. */
  21. };
  22. typedef enum ThingsStatus ThingsStatus;
  23.  
  24.  
  25.  
  26. /*
  27. * Standard Suite
  28. */
  29.  
  30. // A window.
  31. @interface ThingsWindow : SBObject
  32.  
  33. @property (copy, readonly) NSString *name; // The full title of the window.
  34. - (NSInteger) id; // The unique identifier of the window.
  35. @property NSInteger index; // The index of the window, ordered front to back.
  36. @property NSRect bounds; // The bounding rectangle of the window.
  37. @property (readonly) BOOL closeable; // Whether the window has a close box.
  38. @property (readonly) BOOL minimizable; // Whether the window can be minimized.
  39. @property BOOL minimized; // Whether the window is currently minimized.
  40. @property (readonly) BOOL resizable; // Whether the window can be resized.
  41. @property BOOL visible; // Whether the window is currently visible.
  42. @property (readonly) BOOL zoomable; // Whether the window can be zoomed.
  43. @property BOOL zoomed; // Whether the window is currently zoomed.
  44.  
  45. - (void) close; // Close a window.
  46. - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document.
  47. - (void) delete; // Delete an object.
  48. - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
  49. - (void) show; // Show Things item in the UI
  50. - (void) moveTo:(ThingsList *)to; // Move a to do to a different list.
  51. - (void) scheduleFor:(NSDate *)for_; // Schedules a Things to do
  52.  
  53. @end
  54.  
  55.  
  56.  
  57. /*
  58. * Things Suite
  59. */
  60.  
  61. // The application's top-level scripting object.
  62. @interface ThingsApplication : SBApplication
  63.  
  64. - (SBElementArray *) windows;
  65. - (SBElementArray *) lists;
  66. - (SBElementArray *) toDos;
  67. - (SBElementArray *) projects;
  68. - (SBElementArray *) areas;
  69. - (SBElementArray *) people;
  70. - (SBElementArray *) tags;
  71. - (SBElementArray *) selectedToDos;
  72.  
  73. @property (copy, readonly) NSString *name; // The name of the application.
  74. @property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
  75. @property (copy, readonly) NSString *version; // The version of the application.
  76.  
  77. - (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document.
  78. - (void) quit; // Quit the application.
  79. - (BOOL) exists:(id)x; // Verify if an object exists.
  80. - (void) showQuickEntryPanelWithAutofill:(BOOL)withAutofill withProperties:(NSDictionary *)withProperties; // Show Things Quick Entry panel
  81. - (void) logCompletedNow; // Log completed items now
  82. - (void) emptyTrash; // Empty Things trash
  83. - (ThingsPerson *) addTeammateNamed:(NSString *)x; // Add a teammate to Things from your Address Book
  84. - (ThingsToDo *) parseQuicksilverInput:(NSString *)x; // Add new Things to do from input in Quicksilver syntax
  85.  
  86. @end
  87.  
  88. // Represents a Things list.
  89. @interface ThingsList : SBObject
  90.  
  91. - (SBElementArray *) toDos;
  92.  
  93. - (NSString *) id; // The unique identifier of the list.
  94. @property (copy) NSString *name; // Name of the list
  95.  
  96. - (void) close; // Close a window.
  97. - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document.
  98. - (void) delete; // Delete an object.
  99. - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
  100. - (void) show; // Show Things item in the UI
  101. - (void) moveTo:(ThingsList *)to; // Move a to do to a different list.
  102. - (void) scheduleFor:(NSDate *)for_; // Schedules a Things to do
  103.  
  104. @end
  105.  
  106. // Represents a Things area of responsibility.
  107. @interface ThingsArea : ThingsList
  108.  
  109. - (SBElementArray *) toDos;
  110. - (SBElementArray *) tags;
  111.  
  112. @property (copy) NSString *tagNames; // Tag names separated by comma
  113. @property BOOL suspended; // Status of the area
  114.  
  115.  
  116. @end
  117.  
  118. // Represents a Things teammate.
  119. @interface ThingsPerson : ThingsList
  120.  
  121. - (SBElementArray *) toDos;
  122.  
  123.  
  124. @end
  125.  
  126. // Represents a Things tag.
  127. @interface ThingsTag : SBObject
  128.  
  129. - (SBElementArray *) tags;
  130. - (SBElementArray *) toDos;
  131.  
  132. - (NSString *) id; // The unique identifier of the tag.
  133. @property (copy) NSString *name; // Name of the tag
  134. @property (copy) NSString *keyboardShortcut; // Keyboard shortcut for the tag
  135. @property (copy) ThingsTag *parentTag; // Parent tag
  136.  
  137. - (void) close; // Close a window.
  138. - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document.
  139. - (void) delete; // Delete an object.
  140. - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
  141. - (void) show; // Show Things item in the UI
  142. - (void) moveTo:(ThingsList *)to; // Move a to do to a different list.
  143. - (void) scheduleFor:(NSDate *)for_; // Schedules a Things to do
  144.  
  145. @end
  146.  
  147. // Represents a Things to do.
  148. @interface ThingsToDo : SBObject
  149.  
  150. - (SBElementArray *) tags;
  151.  
  152. - (NSString *) id; // The unique identifier of the to do.
  153. @property (copy) NSString *name; // Name of the to do
  154. @property (copy) NSDate *creationDate; // Creation date of the to do
  155. @property (copy) NSDate *dueDate; // Due date of the to do
  156. @property (copy, readonly) NSDate *activationDate; // Activation date of the scheduled to do
  157. @property (copy) NSDate *completionDate; // Completion date of the to do
  158. @property (copy) NSDate *cancellationDate; // Cancellation date of the to do
  159. @property ThingsStatus status; // Status of the to do
  160. @property (copy) NSString *tagNames; // Tag names separated by comma
  161. @property (copy) NSString *notes; // Notes of the to do
  162. @property (copy) ThingsProject *project; // Project the to do belongs to
  163. @property (copy) ThingsArea *area; // Area the to do belongs to
  164. @property (copy) ThingsPerson *delegate; // To do delegate
  165.  
  166. - (void) close; // Close a window.
  167. - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document.
  168. - (void) delete; // Delete an object.
  169. - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
  170. - (void) show; // Show Things item in the UI
  171. - (void) edit; // Edit Things to do
  172. - (void) moveTo:(ThingsList *)to; // Move a to do to a different list.
  173. - (void) scheduleFor:(NSDate *)for_; // Schedules a Things to do
  174.  
  175. @end
  176.  
  177. // Represents a Things project.
  178. @interface ThingsProject : ThingsToDo
  179.  
  180. - (SBElementArray *) toDos;
  181.  
  182.  
  183. @end
  184.  
  185. // Represents a to do selected in Things UI.
  186. @interface ThingsSelectedToDo : ThingsToDo
  187.  
  188.  
  189. @end
Add Comment
Please, Sign In to add comment