1 /* Interface for NSCompoundPredicate for GNUStep
2    Copyright (C) 2005 Free Software Foundation, Inc.
3 
4    Written by:  Dr. H. Nikolaus Schaller
5    Created: 2005
6 
7    This file is part of the GNUstep Base Library.
8 
9    This library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Lesser General Public
11    License as published by the Free Software Foundation; either
12    version 2 of the License, or (at your option) any later version.
13 
14    This library is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17    Lesser General Public License for more details.
18 
19    You should have received a copy of the GNU Lesser General Public
20    License along with this library; if not, write to the Free
21    Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22    Boston, MA 02110 USA.
23    */
24 
25 #ifndef __NSCompoundPredicate_h_GNUSTEP_BASE_INCLUDE
26 #define __NSCompoundPredicate_h_GNUSTEP_BASE_INCLUDE
27 #import	<GNUstepBase/GSVersionMacros.h>
28 
29 #if	OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
30 
31 #import	<Foundation/NSPredicate.h>
32 
33 #if	defined(__cplusplus)
34 extern "C" {
35 #endif
36 
37 enum
38 {
39   NSNotPredicateType = 0,
40   NSAndPredicateType,
41   NSOrPredicateType
42 };
43 typedef NSUInteger NSCompoundPredicateType;
44 
45 @interface NSCompoundPredicate : NSPredicate
46 {
47 #if	GS_EXPOSE(NSCompoundPredicate)
48   NSCompoundPredicateType _type;
49   NSArray	*_subs;
50 #endif
51 }
52 
53 + (NSPredicate *) andPredicateWithSubpredicates: (NSArray *)list;
54 + (NSPredicate *) notPredicateWithSubpredicate: (NSPredicate *)predicate;
55 + (NSPredicate *) orPredicateWithSubpredicates: (NSArray *)list;
56 
57 - (NSCompoundPredicateType) compoundPredicateType;
58 - (id) initWithType: (NSCompoundPredicateType)type
59       subpredicates: (NSArray *)list;
60 - (NSArray *) subpredicates;
61 
62 @end
63 
64 #if	defined(__cplusplus)
65 }
66 #endif
67 
68 #endif	/* 100400 */
69 #endif
70 
71