Source

sage-iphone-app / Classes / AlephCell.h

Full commit
//
//  AlephCell.h
//  iSage
//
//  Created by Ivan Andrus on 4/29/11.
//  Copyright 2011 Ivan Andrus. All rights reserved.
//

#import <CoreData/CoreData.h>

typedef enum {
    // Final condition
    AlephCellStatusHasOutput = 0, // No work to be done
    AlephCellStatusSyntaxError,
    // Intermediate conditions
    AlephCellStatusHasInput,
    AlephCellStatusHasAlephID,    // currently means the same as isWorking
    // Shouldn't be here
    AlephCellStatusUninitialized,
    // Error conditions
    AlephCellStatusJSONParseError, // no longer used
    AlephCellStatusNetworkError,   // no longer used
} AlephCellStatus;


@interface AlephCell :  NSManagedObject
{
    BOOL isWorking;
    int numRequests;
}

- (NSDictionary*)needsRequest:(BOOL)retryErrors;

- (void)clearError;
- (void)setError:(BOOL)wasNetworkError;
- (BOOL)updateWithResponse:(id)response;
- (BOOL)isWorking;
- (BOOL)canDisplayOutput;
- (NSString*)alephURL;

@property (nonatomic, retain) NSNumber * status;
@property (nonatomic, retain) NSString * alephid;
@property (nonatomic, retain) NSDate * creation_time;
@property (nonatomic, retain) NSString * input;
@property (nonatomic, retain) NSString * output;
@property (nonatomic, retain) NSString * html_output;
@property (nonatomic, retain) NSData * image;
@property (nonatomic) int numRequests;
@property (nonatomic) BOOL isWorking;

@end