2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __NGRuleEngine_NGRule_H__
24 #define __NGRuleEngine_NGRule_H__
26 #import <Foundation/NSObject.h>
31 This class represents a rule inside the rule-model. A rule conceptually has:
32 - a qualifier - aka lhs (the condition which must be true for the rule)
33 - an action - aka rhs (the "thing" which is performed when the rule is
35 - a priority - to select a rule if multiple ones match
37 String Representation:
38 qualifer => action [; priority]
42 "(request.isXmlRpcRequest = YES) => dispatcher = XmlRpc ;0"
47 @interface NGRule : NSObject
49 EOQualifier *qualifier;
54 + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p;
55 + (id)ruleWithQualifier:(EOQualifier *)_q action:(id)_action;
56 - (id)initWithQualifier:(EOQualifier *)_q action:(id)_action priority:(int)_p;
58 - (id)initWithPropertyList:(id)_plist;
59 - (id)initWithString:(NSString *)_s;
63 - (void)setQualifier:(EOQualifier *)_q;
64 - (EOQualifier *)qualifier;
66 - (void)setAction:(id)_action;
69 - (void)setPriority:(int)_pri;
74 - (BOOL)isCandidateForKey:(NSString *)_key;
75 - (id)fireInContext:(id)_ctx;
79 - (NSString *)stringValue;
83 @interface NSObject(RuleAction)
84 - (id)fireInContext:(id)_ctx;
87 #endif /* __NGRuleEngine_NGRule_H__ */