//
//  CCHNumberItemFilter.h
//  Shared
//
//  Created by Robinson on 18.07.2014.
//  Copyright (c) 2014 Coding Turtle. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Shared/CCHAbstractComparisonItemFilter.h>
#import <Shared/CODPropertyListRepresentationProtocol.h>


typedef NS_ENUM(NSUInteger, CCHNumberItemFilterOperator) {
  CCHNumberItemFilterOperatorIsEqualTo = 0, //the UI relies on this starting at zero...
  CCHNumberItemFilterOperatorIsNotEqualTo,
  CCHNumberItemFilterOperatorIsLessThan,
  CCHNumberItemFilterOperatorIsGreaterThan,
  CCHNumberItemFilterOperatorIsLessThanOrEqualTo,
  CCHNumberItemFilterOperatorIsGreaterThanOrEqualTo //...and this being 5
};


//This class assumes that “leftHandSideRepresentedObject” returns a string.
//It also assumes that “valueForKey:” called on an item with that string returns either nil or a number.

@interface CCHNumberItemFilter : CCHAbstractComparisonItemFilter <CODPropertyListRepresentationProtocol>

- (id)initWithLeftHandSideRepresentedObject:(NSString *)leftHandSideRepresentedObject;

@property(readwrite) CCHNumberItemFilterOperator operator; //defaults to “is equal to”
@property(readwrite) id rightHandSide; //must be nil or NSNumber. defaults to nil.

@end
