2 Copyright (C) 2004-2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
22 #include <NGObjWeb/SoComponent.h>
25 UIxSortableTableHeader
29 Note: needs to inherit from SoComponent so that resource lookup properly
33 @interface UIxSortableTableHeader : SoComponent
38 NSDictionary *queryDictionary;
46 @implementation UIxSortableTableHeader
49 [self->label release];
50 [self->sortKey release];
52 [self->queryDictionary release];
58 - (void)setLabel:(NSString *)_label {
59 ASSIGNCOPY(self->label, _label);
65 - (void)setSortKey:(NSString *)_sortKey {
66 ASSIGNCOPY(self->sortKey, _sortKey);
69 - (NSString *)sortKey {
73 - (void)setHref:(NSString *)_href {
74 ASSIGNCOPY(self->href, _href);
80 - (void)setQueryDictionary:(NSDictionary *)_queryDictionary {
81 ASSIGN(self->queryDictionary, _queryDictionary);
83 - (NSDictionary *)queryDictionary {
84 return self->queryDictionary;
87 - (id)singleQueryValueForKey:(NSString *)_key {
90 so = [self->queryDictionary objectForKey:_key];
91 if (![so isNotNull]) return nil;
93 if (![so isKindOfClass:[NSArray class]])
96 return ([so count] > 0) ? [so objectAtIndex:0] : nil;
99 - (void)setIsDefault:(BOOL)_isDefault {
100 self->isDefault = _isDefault;
103 return self->isDefault;
106 /* derived accessors */
112 so = [self singleQueryValueForKey:@"sort"];
115 ? [so isEqualToString:self->sortKey]
119 - (BOOL)isSortedDescending
123 desc = [[[self context] request] formValueForKey:@"desc"];
130 @end /* UIxSortableTableHeader */