]> err.no Git - sope/blob - sope-appserver/WEExtensions/WETableView/WETableViewIconConfig.m
milli => micro
[sope] / sope-appserver / WEExtensions / WETableView / WETableViewIconConfig.m
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
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 #include "WETableViewIconConfig.h"
24 #include "WETableViewDefines.h"
25 #include "common.h"
26
27 @implementation WETableViewIconConfig
28
29 - (id)initWithAssociations:(NSDictionary *)_config {
30   if ((self = [super initWithAssociations:_config])) {
31     self->downwardIcon    = WOExtGetProperty(_config, @"downwardSortIcon");
32     self->upwardIcon      = WOExtGetProperty(_config, @"upwardSortIcon");
33     self->nonSortIcon     = WOExtGetProperty(_config, @"nonSortIcon");
34
35     self->firstIcon       = WOExtGetProperty(_config, @"firstIcon");
36     self->firstBlind      = WOExtGetProperty(_config, @"firstBlindIcon");
37     self->previousIcon    = WOExtGetProperty(_config, @"previousIcon");
38     self->previousBlind   = WOExtGetProperty(_config, @"previousBlindIcon");
39     self->nextIcon        = WOExtGetProperty(_config, @"nextIcon");
40     self->nextBlind       = WOExtGetProperty(_config, @"nextBlindIcon");
41     self->lastIcon        = WOExtGetProperty(_config, @"lastIcon");
42     self->lastBlind       = WOExtGetProperty(_config, @"lastBlindIcon");
43     self->selectAllIcon   = WOExtGetProperty(_config, @"selectAllIcon");
44     self->deselectAllIcon = WOExtGetProperty(_config, @"deselectAllIcon");
45     self->plusResizeIcon  = WOExtGetProperty(_config, @"plusResizeIcon");
46     self->minusResizeIcon = WOExtGetProperty(_config, @"minusResizeIcon");
47   }
48   return self;
49 }
50
51 - (void)dealloc {
52   [self->downwardIcon  release];
53   [self->upwardIcon    release];
54   [self->nonSortIcon   release];
55   [self->firstIcon     release];
56   [self->firstBlind    release];
57   [self->previousIcon  release];
58   [self->previousBlind release];
59   [self->nextIcon      release];
60   [self->nextBlind     release];
61   [self->lastIcon      release];
62   [self->lastBlind     release];
63   [self->selectAllIcon   release];
64   [self->deselectAllIcon release];
65   [self->plusResizeIcon  release];
66   [self->minusResizeIcon release];
67   [super dealloc];
68 }
69
70 - (void)updateConfigInContext:(WOContext *)_ctx {
71   WOComponent *cmp;
72   NSString    *tmp;
73
74   cmp = [_ctx component];
75   
76 #define SetConfigInContext(_a_, _key_)                                  \
77       if (_a_ && (tmp = [_a_ valueInComponent:cmp]))                    \
78         [_ctx setObject:tmp forKey:_key_];                              \
79
80   SetConfigInContext(self->downwardIcon,    WETableView_downwardIcon);
81   SetConfigInContext(self->upwardIcon,      WETableView_upwardIcon);
82   SetConfigInContext(self->nonSortIcon,     WETableView_nonSortIcon);
83   
84   SetConfigInContext(self->firstIcon,       WETableView_first);
85   SetConfigInContext(self->firstBlind,      WETableView_first_blind);
86   SetConfigInContext(self->previousIcon,    WETableView_previous);
87   SetConfigInContext(self->previousBlind,   WETableView_previous_blind);
88   SetConfigInContext(self->nextIcon,        WETableView_next);
89   SetConfigInContext(self->nextBlind,       WETableView_next_blind);
90   SetConfigInContext(self->lastIcon,        WETableView_last);
91   SetConfigInContext(self->lastBlind,       WETableView_last_blind);
92   SetConfigInContext(self->selectAllIcon,   WETableView_select_all);
93   SetConfigInContext(self->deselectAllIcon, WETableView_deselect_all);
94 #undef SetConfigInContext
95 }
96
97 @end /* WETableViewIconConfig */