]> err.no Git - sope/blob - Recycler/NGObjDOM/ODR_bind_tableview.h
added maintenance directory
[sope] / Recycler / NGObjDOM / ODR_bind_tableview.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __NGObjDOM_Dynamic_tableview_H__
24 #define __NGObjDOM_Dynamic_tableview_H__
25
26 #include <NGObjDOM/ODNodeRenderer.h>
27
28 /*
29
30 */
31
32 #define ODRTableView_              @"ODRTableView_"
33 #define ODRTableView_CollectMode   @"ODRTableView_CollectMode"
34 #define ODRTableView_TitleMode     @"ODRTableView_TitleMode"
35 #define ODRTableView_ButtonMode    @"ODRTableView_ButtonMode"
36 #define ODRTableView_HeaderMode    @"ODRTableView_HeaderMode"
37 #define ODRTableView_DataMode      @"ODRTableView_DataMode"
38 #define ODRTableView_FooterMode    @"ODRTableView_FooterMode"
39 #define ODRTableView_GroupMode     @"ODRTableView_GroupMode"
40
41 #define ODRTableView_INFOS         @"ODRTableView_INFOS"
42 #define ODRTableView_SORTEDKEY     @"ODRTableView_SORTEDKEY"
43 #define ODRTableView_ISDESCENDING  @"ODRTableView_ISDESCENDING"
44
45 #define ODRTableView_GroupItems    @"ODRTableView_GroupItems"
46 #define ODRTableView_GroupName     @"ODRTableView_GroupName"
47
48 #define ODRTableView_HasCollapseScript @"ODRTableView_HasCollapseScript"
49
50 // config stuff:
51 #define ODRTableView_titleColor    @"ODRTableView_titleColor"
52 #define ODRTableView_headerColor   @"ODRTableView_headerColor"
53 #define ODRTableView_footerColor   @"ODRTableView_footerColor"
54 #define ODRTableView_groupColor    @"ODRTableView_groupColor"
55 #define ODRTableView_evenColor     @"ODRTableView_evenColor"
56 #define ODRTableView_oddColor      @"ODRTableView_oddColor"
57 #define ODRTableView_fontColor     @"ODRTableView_fontColor"
58 #define ODRTableView_fontFace      @"ODRTableView_fontFace"
59 #define ODRTableView_fontSize      @"ODRTableView_fontSize"
60
61 // sort icons:
62 #define ODRTableView_upwardIcon    @"ODRTableView_upwardIcon"
63 #define ODRTableView_downwardIcon  @"ODRTableView_downwardIcon"
64 #define ODRTableView_nonSortIcon   @"ODRTableView_nonSortIcon"
65
66 // navigation icons
67 #define ODRTableView_first           @"ODRTableView_first"
68 #define ODRTableView_first_blind     @"ODRTableView_first_blind"
69 #define ODRTableView_previous        @"ODRTableView_previous"
70 #define ODRTableView_previous_blind  @"ODRTableView_previous_blind"
71 #define ODRTableView_next            @"ODRTableView_next"
72 #define ODRTableView_next_blind      @"ODRTableView_next_blind"
73 #define ODRTableView_last            @"ODRTableView_last"
74 #define ODRTableView_last_blind      @"ODRTableView_last_blind"
75 #define ODRTableView_openedIcon      @"ODRTableView_openedIcon"
76 #define ODRTableView_closedIcon      @"ODRTableView_closedIcon"
77 #define ODRTableView_minusIcon       @"ODRTableView_minusIcon"
78 #define ODRTableView_plusIcon        @"ODRTableView_plusIcon"
79 #define ODRTableView_select_all      @"ODRTableView_select_all"
80 #define ODRTableView_deselect_all    @"ODRTableView_deselect_all"
81
82 // labels
83 #define ODRTableView_ofLabel         @"ODRTableView_ofLabel"
84 #define ODRTableView_toLabel         @"ODRTableView_toLabel"
85 #define ODRTableView_firstLabel      @"ODRTableView_firstLabel"
86 #define ODRTableView_previousLabel   @"ODRTableView_previousLabel"
87 #define ODRTableView_nextLabel       @"ODRTableView_nextLabel"
88 #define ODRTableView_lastLabel       @"ODRTableView_lastLabel"
89 #define ODRTableView_pageLabel       @"ODRTableView_pageLabel"
90 #define ODRTableView_sortLabel       @"ODRTableView_sortLabel"
91
92 @class NSArray, NSDictionary, NSString;
93
94 @interface ODR_bind_tableview : ODNodeRenderer
95 {
96   /* caching */
97   NSArray             *list;
98   NSString            *scriptID; // to unify the JavaScript
99   struct {
100     unsigned currentBatch;
101     unsigned batchSize;
102     unsigned firstIndex;
103     unsigned lastIndex;
104     unsigned batchCount;
105     unsigned groupCount;
106   } state;
107   
108   struct {
109     BOOL     checkBoxes;
110     BOOL     overflow;           // generate overflow-scrolling
111     BOOL     scriptScrolling;    // scroll pages per JavaScript
112     BOOL     scriptCollapsing;   // collapse groups per JavaScript
113     BOOL     batchResizeButtons;
114   } use;
115
116   NSDictionary *groupedList;
117   NSArray      *indexToGrouppath;
118 }
119 - (void)updateStateOfNode:(id)_node inContext:(WOContext *)_ctx;
120 @end
121
122 static inline NSString *ODRTableLabelForKey(NSString *_key, WOContext *_ctx)
123      __attribute__((unused));
124
125 #include <NGObjWeb/WOContext.h>
126 #import <Foundation/NSString.h>
127
128 static NSString *ODRTableLabelForKey(NSString *_key, WOContext *_ctx) {
129   NSString *key;
130   key = [NSString stringWithFormat:@"ODRTableView_%@Label", _key];
131   return [_ctx objectForKey:key];
132 }
133
134 @interface ODRTableViewInfo: NSObject
135 {
136 @public
137   unsigned rowSpan;
138   BOOL     isGroup;
139   BOOL     isEven;
140   BOOL     isSorted;
141 }
142 @end
143
144 @interface ODR_bind_ttitle : ODNodeRenderer
145 @end
146
147 @interface ODR_bind_tbutton : ODNodeRenderer
148 @end
149
150 @interface ODR_bind_tfooter : ODNodeRenderer
151 @end
152
153 @interface ODR_bind_tgroup : ODNodeRenderer
154 @end
155
156
157 #endif /* __NGObjDOM_Dynamic_tableview_H__ */