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
#include "EOGrouping.h"
25
@interface EOGroupingSet(PrivateMethodes)
26
- (void)_updateDefaultNames;
30
@implementation EOGroupingSet
33
[self->groupings release];
37
- (void)setGroupings:(NSArray *)_groupings {
38
ASSIGN(self->groupings, _groupings);
39
[self _updateDefaultNames];
41
- (NSArray *)groupings {
42
return self->groupings;
45
- (void)setDefaultName:(NSString *)_defaultName {
46
[super setDefaultName:_defaultName];
47
[self _updateDefaultNames];
50
- (NSString *)groupNameForObject:(id)_object {
54
for (i = 0, cnt = [self->groupings count]; i < cnt; i++) {
57
group = [self->groupings objectAtIndex:i];
58
if ((result = [group groupNameForObject:_object]))
61
return self->defaultName;
64
- (NSArray *)orderedGroupNames {
65
NSMutableArray *result;
68
result = [NSMutableArray arrayWithCapacity:8];
70
for (i = 0, cnt = [self->groupings count]; i < cnt; i++) {
73
group = [self->groupings objectAtIndex:i];
74
[result addObjectsFromArray:[group orderedGroupNames]];
82
- (void)_updateDefaultNames {
85
for (i = 0, cnt = [self->groupings count]; i < cnt; i++) {
88
group = [self->groupings objectAtIndex:i];
89
[group setDefaultName:nil];
93
@end /* EOGroupingSet */