From f3fecadaa3061a4191e5df1a10b1b337d40fd5a2 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 28 Jul 2006 23:25:34 +0000 Subject: [PATCH] Monotone-Parent: 2ad8b0c019808014c990f51cc69c4457fdb537c6 Monotone-Revision: 61fac9029e457f9cc05094b5b33563346e02db6b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-07-28T23:25:34 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++ UI/MailerUI/UIxMailFolderMenu.h | 46 +++++++++++++++++++++ UI/MailerUI/UIxMailFolderMenu.m | 73 +++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 UI/MailerUI/UIxMailFolderMenu.h create mode 100644 UI/MailerUI/UIxMailFolderMenu.m diff --git a/ChangeLog b/ChangeLog index 6c7c60993..53d999bb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-07-28 Wolfgang Sourdeau + * UI/MailerUI/UIxMailFolderMenu.m: a descendent of UIxMailTree + which returns the nodes for the parent specified in "parentMenu". + Used to generate the javascript code for the folder dtree. + * UI/Templates/MailerUI/UIxMailPanelFrame.wox: the components using that container-template are now using UIxMailMainFrame since UIxMailPanelFrame had no real interest. File removed. diff --git a/UI/MailerUI/UIxMailFolderMenu.h b/UI/MailerUI/UIxMailFolderMenu.h new file mode 100644 index 000000000..4a0785690 --- /dev/null +++ b/UI/MailerUI/UIxMailFolderMenu.h @@ -0,0 +1,46 @@ +/* UIxMailFolderMenu.h - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXMAILFOLDERMENU_H +#define UIXMAILFOLDERMENU_H + +#import "UIxMailTree.h" + +@class NSArray; + +@interface UIxMailFolderMenu : UIxMailTree +{ + NSString *menuId; + NSString *parentMenu; +} + +- (void) setMenuId: (NSString *) newMenuId; +- (NSString *) menuId; + +- (void) setParentMenu: (NSString *) newParentMenu; +- (NSString *) parentMenu; + +- (NSArray *) levelledNodes; + +@end + +#endif /* UIXMAILFOLDERMENU_H */ diff --git a/UI/MailerUI/UIxMailFolderMenu.m b/UI/MailerUI/UIxMailFolderMenu.m new file mode 100644 index 000000000..8c440c8fc --- /dev/null +++ b/UI/MailerUI/UIxMailFolderMenu.m @@ -0,0 +1,73 @@ +/* UIxMailFolderMenu.m - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import + +#import "UIxMailTreeBlock.h" +#import "UIxMailFolderMenu.h" + +@implementation UIxMailFolderMenu + +- (void) setMenuId: (NSString *) newMenuId +{ + menuId = newMenuId; +} + +- (NSString *) menuId +{ + return menuId; +} + +- (void) setParentMenu: (NSString *) newParentMenu +{ + parentMenu = newParentMenu; +} + +- (NSString *) parentMenu +{ + return parentMenu; +} + +- (NSArray *) levelledNodes +{ + NSEnumerator *nodes; + NSMutableArray *levelledNodes; + UIxMailTreeBlock *block; + + levelledNodes = [NSMutableArray new]; + [levelledNodes autorelease]; + + nodes = [[self flattenedNodes] objectEnumerator]; + block = [nodes nextObject]; + + while (block) + { + if ([block parent] == [parentMenu intValue]) + [levelledNodes addObject: block]; + block = [nodes nextObject]; + } + + return levelledNodes; +} + +@end