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 #import <Contacts/SOGoContactObject.h>
23 #import <Contacts/SOGoContactFolder.h>
24 #import <Contacts/SOGoContactFolders.h>
28 #import "UIxContactsListView.h"
30 @implementation UIxContactsListView
34 if ((self = [super init]))
36 selectorComponentClass = nil;
51 - (void) setCurrentContact: (NSDictionary *) _contact
53 currentContact = _contact;
56 - (NSDictionary *) currentContact
58 return currentContact;
61 - (void) setSearchText: (NSString *) _txt
63 ASSIGNCOPY (searchText, _txt);
69 [self setSearchText: [self queryParameterForKey:@"search"]];
74 - (NSString *) selectorComponentClass
76 return selectorComponentClass;
79 - (id) mailerContactsAction
81 selectorComponentClass = @"UIxContactsMailerSelection";
86 - (id) calendarsContactsAction
88 selectorComponentClass = @"UIxContactsCalendarsSelection";
93 - (id) addressBooksContactsAction
95 selectorComponentClass = @"UIxContactsAddressBooksSelection";
100 - (id) aclsContactsAction
102 selectorComponentClass = @"UIxContactsAclsSelection";
107 - (NSString *) defaultSortKey
112 - (NSString *) displayName
114 NSString *displayName;
116 displayName = [currentContact objectForKey: @"displayName"];
117 if (!(displayName && [displayName length] > 0))
118 displayName = [currentContact objectForKey: @"cn"];
123 - (NSString *) sortKey
127 s = [self queryParameterForKey: @"sort"];
129 s = [self defaultSortKey];
134 - (NSComparisonResult) sortOrdering
136 return ([[self queryParameterForKey:@"desc"] boolValue]
137 ? NSOrderedDescending
138 : NSOrderedAscending);
141 - (NSArray *) contactInfos
143 id <SOGoContactFolder> folder;
145 folder = [self clientObject];
147 return [folder lookupContactsWithFilter: [self searchText]
148 sortBy: [self sortKey]
149 ordering: [self sortOrdering]];
158 [searchText release];
161 currentContact = nil;
162 // [allRecords release];
164 // [filteredRecords release];
165 // filteredRecords = nil;
171 - (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
172 inContext: (WOContext*) _c
177 @end /* UIxContactsListView */