Monotone-Parent: db3a7e7fdd8662a109a9a31c651b6cfa55d16775

Monotone-Revision: 1ad1591bbfc0da7a0d91988bcc08fbcb3cfc359f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-03T22:05:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-03 22:05:11 +00:00
parent 2ff6576f36
commit 298514ba47
2 changed files with 113 additions and 108 deletions
+113
View File
@@ -20,8 +20,121 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import <NGObjWeb/SoObjects.h>
#import <SoObjects/Contacts/SOGoContactFolder.h>
#import "UIxContactsListViewContainer.h"
@class SOGoContactFolders;
@implementation UIxContactsListViewContainer
- (id) init
{
if ((self = [super init]))
{
foldersPrefix = nil;
selectorComponentClass = nil;
}
return self;
}
- (void) setSelectorComponentClass: (NSString *) aComponentClass
{
selectorComponentClass = aComponentClass;
}
- (NSString *) selectorComponentName
{
return selectorComponentClass;
}
- (WOElement *) selectorComponent
{
WOElement *newComponent;
// Class componentClass;
// componentClass = NSClassFromString(selectorComponentClass);
// if (componentClass)
// {
newComponent = [self pageWithName: selectorComponentClass];
// }
// else
// newComponent = nil;
return newComponent;
}
- (void) setCurrentFolder: (id) folder
{
currentFolder = folder;
}
- (NSString *) foldersPrefix
{
NSMutableArray *folders;
SOGoObject *currentObject;
if (!foldersPrefix)
{
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 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]];
}
- (BOOL) hasContactSelectionButtons
{
return (selectorComponentClass != nil);
}
@end