Monotone-Parent: 5ce544e4196355529d09f53ee1f29a26e0df0733

Monotone-Revision: 2cf3be019f697c04a2f19de8e9693b7b7a1ddf8d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-08-09T21:37:35
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-08-09 21:37:35 +00:00
parent bff9753ee3
commit 17d7ab187e
10 changed files with 292 additions and 173 deletions

View File

@@ -25,29 +25,84 @@
#import <NGObjWeb/SoObjects.h>
#import <SoObjects/Contacts/SOGoContactFolders.h>
#import <SoObjects/Contacts/SOGoContactFolder.h>
#import "UIxContactsListViewContainer.h"
@class SOGoContactFolders;
@implementation UIxContactsListViewContainer
- (NSString *) contactFolderName
- (id) init
{
if ((self = [super init]))
{
foldersPrefix = nil;
}
return self;
}
- (void) setCurrentFolder: (id) folder
{
currentFolder = folder;
}
- (NSString *) foldersPrefix
{
NSMutableArray *folders;
SOGoObject *currentObject;
folders = [NSMutableArray new];
[folders autorelease];
currentObject = [self clientObject];
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
if (!foldersPrefix)
{
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
currentObject = [currentObject container];
folders = [NSMutableArray new];
[folders autorelease];
currentObject = [[self clientObject] container];
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
{
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
currentObject = [currentObject container];
}
foldersPrefix = [folders componentsJoinedByString: @"/"];
[foldersPrefix retain];
}
return [NSString stringWithFormat: @"/%@",
[folders componentsJoinedByString: @"/"]];
return foldersPrefix;
}
- (NSString *) contactFolderId
{
return [NSString stringWithFormat: @"%@/%@",
[self foldersPrefix],
[[self clientObject] nameInContainer]];
}
- (NSArray *) contactFolders
{
SOGoContactFolders *folderContainer;
folderContainer = [[self clientObject] container];
return [folderContainer contactFolders];
}
- (NSString *) currentContactFolderId
{
return [NSString stringWithFormat: @"%@/%@",
[self foldersPrefix],
[currentFolder nameInContainer]];
}
- (NSString *) currentContactFolderName
{
return [self labelForKey: [currentFolder displayName]];
}
- (BOOL) isFolderCurrent
{
return [[self currentContactFolderId] isEqualToString: [self contactFolderId]];
}
@end