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 __WETableView_H__
23 #define __WETableView_H__
25 #include <NGObjWeb/WODynamicElement.h>
29 WETableView attributes:
31 list - list to iterate through (NSArray)
32 batchSize - size of a page (unsigned)
33 currentBatch - current page (unsigned)
35 item - current item (id)
36 index - current item index (unsigned)
37 identifier - unique id for element (id)
38 previousItem - previous item // used to calculate groupBy (id)
39 previousIndex - previous item index // used to calculate groupBy (unsigned)
41 indexOfFirst - index of first item of current page (unsigned)
42 indexOfLast - index of last item of current page (unsigend)
44 sortedKey - (NSString)
45 isDescending - sort descending (BOOL)
49 collapseOnClient - use JavaScript for collapsing (only IE) (BOOL)
50 scrollOnClient - use JavaScript for scrolling (only IE) (BOOL)
51 autoScroll - use overflow-scrolling (only IE) (int)
52 showBatchResizeButtons - default = YES (BOOL)
54 WETableHeader attributes:
56 sortKey - unique key; if set, a sorticon will be displayed (NSString)
57 negateSortDir - if YES, default sort dir is NSDescending (BOOL)
58 bgColor - background color (NSString)
61 WETableData attributes:
63 sortKey - unique key; if set, a sorticon will be displayed (NSString)
64 negateSortDir - if YES, default sort dir is NSDescending (BOOL)
65 bgColor - background color (NSString)
66 title - title of header -> no header cell is needed (NSString)
69 WETableView config attributes:
112 WETableHeader, WETableData config attributes:
120 @class WETableViewLabelConfig, WETableViewIconConfig;
121 @class WETableViewColorConfig, WETableViewIconConfig;
122 @class WETableViewState;
124 @interface WETableView : WODynamicElement
126 // WODynamicElement: extraAttributes
127 // WODynamicElement: otherTagString
129 WOAssociation *list; // list of objects
130 WOAssociation *batchSize; // batch size
131 WOAssociation *currentBatch; // index of the displayed batch
133 WOAssociation *item; // current item in the array
134 WOAssociation *index; // current index
135 WOAssociation *identifier; // unique id for element
136 WOAssociation *previousItem; // predecessor of item (used by isGroup)
137 WOAssociation *previousIndex; // predecessor of index (used by isGroup)
139 WOAssociation *indexOfFirst; // index of first displayed object
140 WOAssociation *indexOfLast; // index of last displayed object
142 WOAssociation *sortedKey; //
143 WOAssociation *isDescending; //
144 WOAssociation *groups; //
145 WOAssociation *showGroup; //
147 WOAssociation *selection; //
149 WOAssociation *collapseOnClient; // use JS for collapsing default = NO
150 WOAssociation *scrollOnClient; // use JS for scrolling default = NO
151 WOAssociation *autoScroll; // use overflow-scrolling (only IE)
152 WOAssociation *showBatchResizeButtons; //
154 WOAssociation *sortAction; // called if sort button is clicked
155 WOAssociation *firstAction; // called if first button is clicked
156 WOAssociation *previousAction; // called if previous button is clicked
157 WOAssociation *nextAction; // called if next button is clicked
158 WOAssociation *lastAction; // called if last button is clicked
161 WETableViewColorConfig *colors;
162 WOAssociation *groupColor;
163 WOAssociation *fontColor;
164 WOAssociation *fontFace;
165 WOAssociation *fontSize;
167 WETableViewIconConfig *icons;
168 WOAssociation *groupOpenedIcon;
169 WOAssociation *groupClosedIcon;
171 WETableViewLabelConfig *labels;
173 WOAssociation *border;
174 WOAssociation *cellspacing;
175 WOAssociation *cellpadding;
177 WOAssociation *showGroupTitle;
181 BOOL doScript; // generate JavaScript
182 NSString *scriptID; // to unify the JavaScript
183 WETableViewState *state;
187 - (void)_appendHeader:(WOResponse *)_response inContext:(WOContext *)_ctx;
188 - (void)_appendData:(WOResponse *)_response inContext:(WOContext *)_ctx;
189 - (void)_appendFooter:(WOResponse *)_response inContext:(WOContext *)_ctx;
191 - (void)updateStateInContext:(WOContext *)_ctx; // returns isAutoScroll
193 @end /* WETableView */
195 #include "WETableViewDefines.h"
196 #include "WETableViewState.h"
197 #include "WETableViewInfo.h"
199 static inline NSString *WETableLabelForKey(NSString *_key, WOContext *_ctx)
200 __attribute__((unused));
202 #include <NGObjWeb/WOContext.h>
203 #import <Foundation/NSString.h>
205 static NSString *WETableLabelForKey(NSString *_key, WOContext *_ctx) {
209 key = [[NSString alloc] initWithFormat:@"WETableView_%@Label", _key];
210 tmp = [_ctx objectForKey:key];
215 @interface WETableView(Private)
216 - (void)_appendBatchResizeButtons:(WOResponse *)_response
217 rowSpan:(unsigned int)_rowSpan
218 actionUrl:(NSString *)_actionUrl
219 inContext:(WOContext *)_ctx;
220 @end /* WETableView(Private) */
222 #endif /* __WETableView_H__ */