/NSRTM.h

http://rtm2cocoa.googlecode.com/ · C Header · 155 lines · 114 code · 20 blank · 21 comment · 0 complexity · a2d61d58c597fbe6ccfdcbee0a10dd96 MD5 · raw file

  1. /*
  2. * NSRTM.h
  3. * RTMApiTest
  4. *
  5. * Created by kkillian on 17/11/09.
  6. * Copyright 2009 shufflecodebox. All rights reserved.
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #import <Cocoa/Cocoa.h>
  22. #import "RTMDelegate.h"
  23. #import "NSRTMResponse.h"
  24. #import "NSRTMTimeline.h"
  25. #import "NSRTMCriteria.h"
  26. #import "NSRTMPredicate.h"
  27. #import "NSRTMRecurrence.h"
  28. #import "NSRTMLocation.h"
  29. #import "NSRTMNote.h"
  30. #import "NSRTMSettings.h"
  31. #import "NSRTMLocator.h"
  32. #define RTMAuthDelete @"delete"
  33. #define RTMAuthRead @"read"
  34. #define RTMAuthWrite @"write"
  35. typedef enum _NSRTMPriorityDirection{
  36. NSRTMDirectionUp = 1,
  37. NSRTMDirectionDown = 0
  38. } NSRTMPriorityDirection;
  39. typedef enum _NSRTMPriority{
  40. NSRTMPriorityN = 0,
  41. NSRTMPriorityOne = 1,
  42. NSRTMPriorityTwo = 2,
  43. NSRTMPriorityTree = 3
  44. } NSRTMPriority;
  45. @class NSRTMInvoker,NSRTMService,NSRTMController;
  46. @interface NSRTM : NSObject {
  47. NSRTMInvoker *mainInvoker;
  48. NSRTMService *mainService;
  49. NSString *api_key;
  50. NSString *sicret;
  51. NSString *frob;
  52. NSString *token;
  53. NSString *lastTimeline;
  54. NSString *levelAuth;
  55. NSRTMController *dialogController;
  56. NSUserDefaults *defaults;
  57. id<RTMDelegate,NSObject> rtmDelegate;
  58. }
  59. -(id)initWithApikey:(NSString *)apikey andSicret:(NSString *)sicretvalue;
  60. - (BOOL)loadMyNibFile;
  61. -(NSRTMResponse *)getMethods;
  62. -(void)setDelegate:(id)val;
  63. -(id)delegate;
  64. -(void)manageError:(NSRTMError *)error;
  65. -(BOOL)isRegistrated;
  66. -(void)authenticate:(NSString *)level;
  67. -(BOOL)saveToken;
  68. -(NSString *)testEcho:(NSMutableArray *)params;
  69. -(NSString *)generateFrob;
  70. -(BOOL)checkToken;
  71. -(NSString *)getToken;
  72. #pragma mark -
  73. #pragma mark Extra
  74. -(NSMutableArray *)getFullTaskLists;
  75. -(NSMutableArray *)getFullTaskLists:(BOOL)completed;
  76. //-(NSMutableArray *)getAllTasks;
  77. #pragma mark -
  78. #pragma mark MethodsContacts
  79. -(NSString *)addContact:(NSString *)contact;
  80. -(BOOL)deleteContact:(NSString *)contactId;
  81. -(NSMutableArray *)getContactsList;
  82. #pragma mark -
  83. #pragma mark Timeline
  84. -(NSString *)createTimeline;
  85. -(NSString *)getLastTimeline;
  86. -(BOOL)undo:(NSString *)transactionid;
  87. #pragma mark -
  88. #pragma mark ListMethods
  89. -(NSRTMList *)addList:(NSString *)name filter:(NSRTMPredicate *)predicate; // *timeline
  90. -(BOOL)archiveList:(NSInteger)listId; // *timeline
  91. -(BOOL)unarchiveList:(NSInteger)listId; // *timeline
  92. -(BOOL)deleteList:(NSInteger)listId; // *timeline
  93. -(NSMutableArray *)getLists;
  94. -(BOOL)setDefaultList:(NSInteger)listId; // *timeline
  95. -(NSRTMList *)setListName:(NSString *)name withId:(NSInteger)listId; // *timeline
  96. #pragma mark -
  97. #pragma mark LocationMethods
  98. -(NSMutableArray *)getLocationsList;
  99. -(NSRTMSettings *)getSettingsList;
  100. -(NSMutableArray *)getTinmezones;
  101. #pragma mark -
  102. #pragma mark TaskMethods
  103. -(NSRTMList *)addNewTask:(NSString *)name atList:(NSInteger)listId parse:(BOOL)option; // *timeline
  104. -(NSRTMList *)addTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
  105. -(NSRTMList *)completeTask:(NSRTMLocator *)locator; // *timeline
  106. -(NSRTMList *)deleteTask:(NSRTMLocator *)locator; // *timeline
  107. -(NSMutableArray *)getTaskList;
  108. -(NSMutableArray *)getTaskListWithId:(NSInteger)listId;
  109. -(NSRTMList *)getTaskListWithId:(NSInteger)listId filter:(NSRTMPredicate *)predicate lastSync:(NSDate *)time;
  110. -(NSMutableArray *)getTaskListWithPredicate:(NSRTMPredicate *)predicate lastSync:(NSDate *)time;
  111. -(NSRTMList *)movePriority:(NSRTMPriorityDirection)direction withLocator:(NSRTMLocator *)locator; // *timeline
  112. -(NSRTMList *)moveToList:(NSInteger)fromId withLocator:(NSRTMLocator *)locator; // *timeline
  113. -(NSRTMList *)posponeTask:(NSRTMLocator *)locator; // *timeline
  114. -(NSRTMList *)removeTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
  115. -(NSRTMList *)setDueDate:(NSDate *)date withLocator:(NSRTMLocator *)locator; // *timeline
  116. -(NSRTMList *)setDueDateWithString:(NSString *)date withLocator:(NSRTMLocator *)locator; // *timeline
  117. -(NSRTMList *)removeDueDate:(NSRTMLocator *)locator; // *timeline
  118. -(NSRTMList *)setEstimate:(NSInteger)time withLocator:(NSRTMLocator *)locator; // *timeline
  119. -(NSRTMList *)removeEstimate:(NSRTMLocator *)locator; // *timeline
  120. -(NSRTMList *)setLocation:(NSRTMLocation *)location withLocator:(NSRTMLocator *)locator; // *timeline
  121. -(NSRTMList *)setName:(NSString *)name withLocator:(NSRTMLocator *)locator; // *timeline
  122. -(NSRTMList *)setPriority:(NSRTMPriority)priority withLocator:(NSRTMLocator *)locator; // *timeline
  123. -(NSRTMList *)removePriority:(NSRTMLocator *)locator; // *timeline
  124. -(NSRTMList *)setRecurrence:(NSRTMRecurrence *)recurrence withLocator:(NSRTMLocator *)locator; // *timeline
  125. -(NSRTMList *)setTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
  126. -(NSRTMList *)setUrl:(NSURL *)url withLocator:(NSRTMLocator *)locator; // *timeline
  127. -(NSRTMList *)removeUrl:(NSRTMLocator *)locator; // *timeline
  128. -(NSRTMList *)uncompleteTask:(NSRTMLocator *)locator; // *timeline
  129. #pragma mark -
  130. #pragma mark NoteMethods
  131. -(NSRTMNote *)addNoteWithTitle:(NSString *)title andText:(NSString *)text withLocator:(NSRTMLocator *)locator; // *timeline
  132. -(BOOL)removeNote:(NSInteger)noteId; // *timeline
  133. -(NSRTMNote *)editNote:(NSInteger)noteId title:(NSString *)titlevalue andText:(NSString *)text; // *timeline
  134. #pragma mark -
  135. @end