This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
forked from becka11y/callback-ios
/
PluginResult.h
64 lines (52 loc) · 2.82 KB
/
PluginResult.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
* Copyright (c) 2005-2011, Nitobi Software Inc.
* Copyright 2011, IBM.
*/
#import <Foundation/Foundation.h>
typedef enum {
PGCommandStatus_NO_RESULT = 0,
PGCommandStatus_OK,
PGCommandStatus_CLASS_NOT_FOUND_EXCEPTION,
PGCommandStatus_ILLEGAL_ACCESS_EXCEPTION,
PGCommandStatus_INSTANTIATION_EXCEPTION,
PGCommandStatus_MALFORMED_URL_EXCEPTION,
PGCommandStatus_IO_EXCEPTION,
PGCommandStatus_INVALID_ACTION,
PGCommandStatus_JSON_EXCEPTION,
PGCommandStatus_ERROR
} PGCommandStatus;
@interface PluginResult : NSObject {
NSNumber* status;
id message;
NSNumber* keepCallback;
NSString* cast;
}
@property (nonatomic, retain, readonly) NSNumber* status;
@property (nonatomic, retain, readonly) id message;
@property (nonatomic, retain) NSNumber* keepCallback;
@property (nonatomic, retain, readonly) NSString* cast;
-(PluginResult*) init;
+(void) releaseStatus;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsString: (NSString*) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsArray: (NSArray*) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsBool: (BOOL) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsInt: (int) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsDouble: (double) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsDictionary: (NSDictionary*) theMessage;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsString: (NSString*) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsArray: (NSArray*) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsBool: (BOOL) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsInt: (int) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsDouble: (double) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageAsDictionary: (NSDictionary*) theMessage cast: (NSString*) theCast;
+(PluginResult*) resultWithStatus: (PGCommandStatus) statusOrdinal messageToErrorObject: (int) errorCode;
-(void) setKeepCallbackAsBool: (BOOL) bKeepCallback;
-(NSString*) toJSONString;
-(NSString*) toSuccessCallbackString: (NSString*) callbackId;
-(NSString*) toErrorCallbackString: (NSString*) callbackId;
-(void) dealloc;
@end