2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGObjWeb_WODisplayGroup_H__
23 #define __NGObjWeb_WODisplayGroup_H__
25 #import <Foundation/NSObject.h>
27 @class NSDictionary, NSArray, NSNotification, NSMutableDictionary;
28 @class EODataSource, EOQualifier;
30 @interface WODisplayGroup : NSObject < NSCoding >
32 id delegate; /* non-retained ! */
33 EODataSource *dataSource;
34 NSArray *sortOrderings;
35 NSDictionary *insertedObjectDefaults;
36 unsigned numberOfObjectsPerBatch;
37 NSArray *selectionIndexes;
39 NSArray *displayObjects;
40 EOQualifier *qualifier;
41 NSString *defaultStringMatchFormat;
42 NSString *defaultStringMatchOperator;
43 unsigned currentBatchIndex;
45 NSMutableDictionary *_queryBindings;
46 NSMutableDictionary *_queryMatch;
47 NSMutableDictionary *_queryMin;
48 NSMutableDictionary *_queryMax;
49 NSMutableDictionary *_queryOperator;
53 BOOL selectFirstAfterFetch:1;
54 BOOL validatesChangesImmediatly:1;
62 - (void)setDelegate:(id)_delegate;
65 - (void)setDataSource:(EODataSource *)_ds;
66 - (EODataSource *)dataSource;
68 - (void)setSortOrderings:(NSArray *)_orderings;
69 - (NSArray *)sortOrderings;
71 - (void)setFetchesOnLoad:(BOOL)_flag;
72 - (BOOL)fetchesOnLoad;
74 - (void)setInsertedObjectDefaultValues:(NSDictionary *)_values;
75 - (NSDictionary *)insertedObjectDefaultValues;
77 - (void)setNumberOfObjectsPerBatch:(unsigned)_count;
78 - (unsigned)numberOfObjectsPerBatch;
80 - (void)setSelectsFirstObjectAfterFetch:(BOOL)_flag;
81 - (BOOL)selectsFirstObjectAfterFetch;
83 - (void)setValidatesChangesImmediatly:(BOOL)_flag;
84 - (BOOL)validatesChangesImmediatly;
92 - (BOOL)hasMultipleBatches;
93 - (unsigned)batchCount;
94 - (void)setCurrentBatchIndex:(unsigned)_currentBatchIndex;
95 - (unsigned)currentBatchIndex;
96 - (unsigned)indexOfFirstDisplayedObject;
97 - (unsigned)indexOfLastDisplayedObject;
98 - (id)displayNextBatch;
99 - (id)displayPreviousBatch;
100 - (id)displayBatchContainingSelectedObject;
104 - (BOOL)setSelectionIndexes:(NSArray *)_selection;
105 - (NSArray *)selectionIndexes;
106 - (BOOL)clearSelection;
109 - (id)selectPrevious;
111 - (void)setSelectedObject:(id)_obj;
112 - (id)selectedObject;
113 - (void)setSelectedObjects:(NSArray *)_objs;
114 - (NSArray *)selectedObjects;
116 - (BOOL)selectObject:(id)_obj;
117 - (BOOL)selectObjectsIdenticalTo:(NSArray *)_objs;
118 - (BOOL)selectObjectsIdenticalTo:(NSArray *)_objs
119 selectFirstOnNoMatch:(BOOL)_flag;
123 - (void)setObjectArray:(NSArray *)_objects;
124 - (NSArray *)allObjects;
125 - (NSArray *)displayedObjects;
128 - (void)updateDisplayedObjects;
132 - (void)setInQueryMode:(BOOL)_flag;
135 - (EOQualifier *)qualifierFromQueryValues;
136 - (NSMutableDictionary *)queryBindings;
137 - (NSMutableDictionary *)queryMatch;
138 - (NSMutableDictionary *)queryMin;
139 - (NSMutableDictionary *)queryMax;
140 - (NSMutableDictionary *)queryOperator;
142 - (void)setDefaultStringMatchFormat:(NSString *)_tmp;
143 - (NSString *)defaultStringMatchFormat;
144 - (void)setDefaultStringMatchOperator:(NSString *)_tmp;
145 - (NSString *)defaultStringMatchOperator;
146 + (NSString *)globalDefaultStringMatchFormat;
147 + (NSString *)globalDefaultStringMatchOperator;
151 - (void)setQualifier:(EOQualifier *)_q;
152 - (EOQualifier *)qualifier;
154 - (NSArray *)allQualifierOperators;
155 - (NSArray *)stringQualifierOperators;
156 - (NSArray *)relationalQualifierOperators;
158 - (void)qualifyDisplayGroup;
159 - (void)qualifyDataSource;
163 @interface NSObject(WODisplayGroupDelegate)
165 - (void)displayGroup:(WODisplayGroup *)_dg
166 createObjectFailedForDataSource:(EODataSource *)_ds;
168 - (BOOL)displayGroupShouldFetch:(WODisplayGroup *)_dg;
169 - (void)displayGroup:(WODisplayGroup *)_dg
170 didFetchObjects:(NSArray *)_objects;
172 - (BOOL)displayGroup:(WODisplayGroup *)_dg
173 shouldInsertObject:(id)_object
174 atIndex:(unsigned int)_idx;
175 - (void)displayGroup:(WODisplayGroup *)_dg
176 didInsertObject:(id)_object;
178 - (BOOL)displayGroup:(WODisplayGroup *)_dg
179 shouldDeleteObject:(id)_object;
180 - (void)displayGroup:(WODisplayGroup *)_dg
181 didDeleteObject:(id)_object;
183 - (void)displayGroup:(WODisplayGroup *)_dg
184 didSetValue:(id)_value forObject:(id)_object key:(NSString *)_key;
186 - (void)displayGroupDidChangeDataSource:(WODisplayGroup *)_dg;
187 - (BOOL)displayGroup:(WODisplayGroup *)_dg
188 shouldRedisplayForEditingContextChangeNotification:(NSNotification *)_not;
190 - (BOOL)displayGroup:(WODisplayGroup *)_dg
191 shouldChangeSelectionToIndexes:(NSArray *)_idxs;
192 - (void)displayGroupDidChangeSelectedObjects:(WODisplayGroup *)_dg;
193 - (void)displayGroupDidChangeSelection:(WODisplayGroup *)_dg;
195 - (NSArray *)displayGroup:(WODisplayGroup *)_dg
196 displayArrayForObjects:(NSArray *)_objects;
200 #endif /* __NGObjWeb_WODisplayGroup_H__ */