-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConditionController.h
98 lines (70 loc) · 2.35 KB
/
ConditionController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// ConditionController.h
// SproutedInterface
//
// Created by Philip Dow on xx.
// Copyright Sprouted. All rights reserved.
// Inquiries should be directed to [email protected]
//
#import <Cocoa/Cocoa.h>
#define kConditionViewHeight 26
#define PDConditionContains 0
#define PDConditionNotContains 1
#define PDConditionBeginsWith 2
#define PDConditionEndsWith 3
#define PDConditionIs 4
#define PDConditionBefore 0
#define PDConditionAfter 1
#define PDConditionBetween 2
#define PDConditionInTheLast 3
#define PDConditionInTheNext 4
#define PDConditionDay 0
#define PDConditionWeek 1
#define PDConditionMonth 2
@interface ConditionController : NSObject
{
IBOutlet NSView *conditionView;
IBOutlet NSView *specifiedConditionView;
IBOutlet NSPopUpButton *keyPop;
IBOutlet NSButton *removeButton;
int tag;
id target;
BOOL _allowsEmptyCondition;
BOOL _autogeneratesDynamicDates;
BOOL _sendsLiveUpdate;
}
- (id) initWithTarget:(id)anObject;
- (void) setInitialPredicate:(NSPredicate*)aPredicate;
- (void) setInitialCondition:(NSString*)condition;
- (NSView*) conditionView;
- (NSPredicate*) predicate;
- (NSString*) predicateString;
- (int) tag;
- (void) setTag:(int)newTag;
- (id) target;
- (void) setTarget:(id)anObject;
- (BOOL) sendsLiveUpdate;
- (void) setSendsLiveUpdate:(BOOL)updates;
- (BOOL) autogeneratesDynamicDates;
- (void) setAutogeneratesDynamicDates:(BOOL)autogenerate;
- (BOOL) allowsEmptyCondition;
- (void) setAllowsEmptyCondition:(BOOL)allowsEmpty;
- (BOOL) removeButtonEnabled;
- (void) setRemoveButtonEnabled:(BOOL)enabled;
- (IBAction) addCondition:(id)sender;
- (IBAction) removeCondition:(id)sender;
- (IBAction) changeCondition:(id)sender;
- (IBAction) changeConditionKey:(id)sender;
- (id) selectableView;
- (void) appropriateFirstResponder:(NSWindow*)aWindow;
- (void) removeFromSuper;
- (void) _sendUpdateIfRequested;
// utility for creating spotlight based conditions - subclasses feel free to use
- (NSString*) _spotlightConditionStringWithAttribute:(NSString*)anAttribute condition:(NSString*)aCondition operation:(int)anOperation;
- (NSString*) _spotlightConditionStringWithAttributes:(NSArray*)theAttributes condition:(NSString*)aCondition operation:(int)anOperation;
- (BOOL) validatePredicate;
@end
#pragma mark -
@interface NSObject (ConditionControllerDelegate)
- (void) conditionDidChange:(id)condition;
@end