PageRenderTime 35ms CodeModel.GetById 12ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 22#import <Cocoa/Cocoa.h>
 23#import "RTMDelegate.h"
 24#import "NSRTMResponse.h"
 25#import "NSRTMTimeline.h"
 26#import "NSRTMCriteria.h"
 27#import "NSRTMPredicate.h"
 28#import "NSRTMRecurrence.h"
 29#import "NSRTMLocation.h"
 30#import "NSRTMNote.h"
 31#import "NSRTMSettings.h"
 32#import "NSRTMLocator.h"
 33
 34#define RTMAuthDelete @"delete"
 35#define RTMAuthRead @"read"
 36#define RTMAuthWrite @"write"
 37
 38typedef enum _NSRTMPriorityDirection{
 39    NSRTMDirectionUp = 1,
 40    NSRTMDirectionDown = 0
 41} NSRTMPriorityDirection;
 42
 43typedef enum _NSRTMPriority{
 44    NSRTMPriorityN = 0,
 45    NSRTMPriorityOne = 1,
 46    NSRTMPriorityTwo = 2,
 47    NSRTMPriorityTree = 3
 48} NSRTMPriority;
 49
 50@class NSRTMInvoker,NSRTMService,NSRTMController;
 51@interface NSRTM : NSObject {
 52	NSRTMInvoker *mainInvoker;
 53	NSRTMService *mainService;
 54	NSString *api_key;
 55	NSString *sicret;
 56	NSString *frob;
 57	NSString *token;
 58	NSString *lastTimeline;
 59	
 60	NSString *levelAuth;
 61	NSRTMController *dialogController;
 62	NSUserDefaults *defaults;
 63	
 64	id<RTMDelegate,NSObject> rtmDelegate;
 65}
 66
 67-(id)initWithApikey:(NSString *)apikey andSicret:(NSString *)sicretvalue;
 68- (BOOL)loadMyNibFile;
 69
 70-(NSRTMResponse *)getMethods;
 71
 72-(void)setDelegate:(id)val;
 73-(id)delegate;
 74-(void)manageError:(NSRTMError *)error;
 75
 76-(BOOL)isRegistrated;
 77-(void)authenticate:(NSString *)level;
 78-(BOOL)saveToken;
 79
 80-(NSString *)testEcho:(NSMutableArray *)params;
 81
 82-(NSString *)generateFrob;
 83-(BOOL)checkToken;
 84-(NSString *)getToken;
 85#pragma mark -
 86
 87#pragma mark Extra
 88-(NSMutableArray *)getFullTaskLists;
 89-(NSMutableArray *)getFullTaskLists:(BOOL)completed;
 90	//-(NSMutableArray *)getAllTasks;
 91#pragma mark -
 92#pragma mark MethodsContacts
 93-(NSString *)addContact:(NSString *)contact;
 94-(BOOL)deleteContact:(NSString *)contactId;
 95-(NSMutableArray *)getContactsList;
 96#pragma mark -
 97
 98#pragma mark Timeline
 99-(NSString *)createTimeline;
100-(NSString *)getLastTimeline;
101-(BOOL)undo:(NSString *)transactionid;
102#pragma mark -
103
104#pragma mark ListMethods
105-(NSRTMList *)addList:(NSString *)name filter:(NSRTMPredicate *)predicate; // *timeline
106-(BOOL)archiveList:(NSInteger)listId; // *timeline
107-(BOOL)unarchiveList:(NSInteger)listId; // *timeline
108-(BOOL)deleteList:(NSInteger)listId; // *timeline
109-(NSMutableArray *)getLists;
110-(BOOL)setDefaultList:(NSInteger)listId; // *timeline
111-(NSRTMList *)setListName:(NSString *)name withId:(NSInteger)listId; // *timeline
112#pragma mark -
113
114#pragma mark LocationMethods
115-(NSMutableArray *)getLocationsList;
116-(NSRTMSettings *)getSettingsList;
117-(NSMutableArray *)getTinmezones;
118#pragma mark -
119
120#pragma mark TaskMethods
121-(NSRTMList *)addNewTask:(NSString *)name atList:(NSInteger)listId parse:(BOOL)option; // *timeline
122-(NSRTMList *)addTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
123-(NSRTMList *)completeTask:(NSRTMLocator *)locator; // *timeline
124-(NSRTMList *)deleteTask:(NSRTMLocator *)locator; // *timeline
125-(NSMutableArray *)getTaskList;
126-(NSMutableArray *)getTaskListWithId:(NSInteger)listId;
127-(NSRTMList *)getTaskListWithId:(NSInteger)listId filter:(NSRTMPredicate *)predicate lastSync:(NSDate *)time;
128-(NSMutableArray *)getTaskListWithPredicate:(NSRTMPredicate *)predicate lastSync:(NSDate *)time;
129-(NSRTMList *)movePriority:(NSRTMPriorityDirection)direction withLocator:(NSRTMLocator *)locator; // *timeline
130-(NSRTMList *)moveToList:(NSInteger)fromId withLocator:(NSRTMLocator *)locator; // *timeline
131-(NSRTMList *)posponeTask:(NSRTMLocator *)locator; // *timeline
132-(NSRTMList *)removeTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
133-(NSRTMList *)setDueDate:(NSDate *)date withLocator:(NSRTMLocator *)locator; // *timeline
134-(NSRTMList *)setDueDateWithString:(NSString *)date withLocator:(NSRTMLocator *)locator; // *timeline
135-(NSRTMList *)removeDueDate:(NSRTMLocator *)locator; // *timeline
136-(NSRTMList *)setEstimate:(NSInteger)time withLocator:(NSRTMLocator *)locator; // *timeline
137-(NSRTMList *)removeEstimate:(NSRTMLocator *)locator; // *timeline
138-(NSRTMList *)setLocation:(NSRTMLocation *)location withLocator:(NSRTMLocator *)locator; // *timeline
139-(NSRTMList *)setName:(NSString *)name withLocator:(NSRTMLocator *)locator; // *timeline
140-(NSRTMList *)setPriority:(NSRTMPriority)priority withLocator:(NSRTMLocator *)locator; // *timeline
141-(NSRTMList *)removePriority:(NSRTMLocator *)locator; // *timeline
142-(NSRTMList *)setRecurrence:(NSRTMRecurrence *)recurrence withLocator:(NSRTMLocator *)locator; // *timeline
143-(NSRTMList *)setTags:(NSMutableArray *)tags withLocator:(NSRTMLocator *)locator; // *timeline
144-(NSRTMList *)setUrl:(NSURL *)url withLocator:(NSRTMLocator *)locator; // *timeline
145-(NSRTMList *)removeUrl:(NSRTMLocator *)locator; // *timeline
146-(NSRTMList *)uncompleteTask:(NSRTMLocator *)locator; // *timeline
147#pragma mark -
148
149#pragma mark NoteMethods
150-(NSRTMNote *)addNoteWithTitle:(NSString *)title andText:(NSString *)text withLocator:(NSRTMLocator *)locator; // *timeline
151-(BOOL)removeNote:(NSInteger)noteId; // *timeline
152-(NSRTMNote *)editNote:(NSInteger)noteId title:(NSString *)titlevalue andText:(NSString *)text; // *timeline
153#pragma mark -
154
155@end