/*
**  Criterion.h
**
**  Copyright (c) 2004
**
**  Author: Yen-Ju Chen <yjchenx@hotmail.com>
**
**  This program is free software; you can redistribute it and/or modify
**  it under the terms of the GNU General Public License as published by
**  the Free Software Foundation; either version 2 of the License, or
**  (at your option) any later version.
**
**  This program is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef __Criterion__
#define __Criterion__

#include <AppKit/AppKit.h>
#include "CriterionView.h"

@interface Criterion: NSObject
{
  NSMutableArray *criterions;
  NSMutableDictionary *selections;
  BOOL matchAll;
  NSMutableSet *anyStringSet, *stringSet, *dateSet;
  NSMutableSet *numberSet, *selectionSet, *contentSet;
}

- (void) setCriterion: (Criterion *) another;

- (void) removeAllAvailableSubjects;
- (void) addAvailableSubject: (NSString *) subject 
                     forType: (CriterionType) type;
- (CriterionType) typeOfSubject: (NSString *) subject;

- (void) setAvailableSelections: (NSArray *) selection
                     forSubject: (NSString *) subject;

- (id) propertyList;
- (void) loadPropertyList: (id) propertyList;

- (unsigned int) count;

/* match criterion */
- (void) setMatchAll: (BOOL) match;
- (BOOL) matchAll;

/* use this to decide what information to put in */
- (NSArray *) subjectsToMatch;

- (BOOL) match: (NSDictionary *) information;

@end

#endif /* __Criterion__ */
