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

#import <Foundation/Foundation.h>


//Abstract class.

//Important:
// * Every filter is either a CCHCompoundItemFilter or a subclass of CCHAbstractComparisonItemFilter.
// * Subclasses of CCHAbstractComparisonItemFilter all have the “leftHandSideRepresentedObject” in common. Other than that, we can sort of regard them as being “opaque” objects.

//A useful cognition: These filter classes were created for smart lists only! These classes are a crux of the smart list mechanism. I thought I’d mention this, to avoid confusion.

@interface CCHItemFilter : NSObject

//abstract method
//maybe I’ll later add an items dictionary parameter here (if I ever want to allow users to create smart lists with respect to the item ID), but I doubt this will happen any time soon, if ever.
- (NSSet *)filterItems:(NSSet *)items;


//Abstract method.
//Should be implemented by concrete subclasses.
//
//Notes:
// * Return nil (or empty set) if there are no associated UUID strings.
// * For now, the only possible UUID strings returned will be for a) the custom attributes, and b) the type groups (since the “Type” item filter can refer to type groups).
// * In the future, in Chikoo 2.0 say, maybe we will add a new “tags” feature that is separate from the “custom attributes” feature. In this case, we will have a new third case for UUID strings.
//   This is, in fact, why we are returning all the UUID strings in a single set from this single method, instead of splitting it into multiple methods like “associatedAttributeUuidStrings”,
//   and, later, “associatedTagUuidStrings”; we wouldn’t be able to distinguish which is which in the leftHandSideRepresentedObject. (Well, we could prepend some text to the actual UUID string,
//   such as “attribute-68753A44-4D6F-1226-9C60-0050E4C00067” but that looks ugly to me.)
// * If we in the future, in Chikoo 2.0 say, add the ability to compare two *different* attributes, we would, I suppose, return those UUID strings from this method as well.
//
//Usage:
// * So, how do we actually use this? Well, when it’s time to “clean obsolete item filters” from a smart list’s compound item filter, we call
//   the appropriate method provided by the compound item filter. This method makes use of this “associatedUuidStrings” method for each filter.
- (NSSet *)associatedUuidStrings;

@end
