1 /* 2 Copyright (C) 2000-2005 SKYRIX Software AG 3 4 This file is part of SOPE. 5 6 SOPE 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 SOPE 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 SOPE; 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 22 #ifndef __NGObjWeb_WOTemplate_H__ 23 #define __NGObjWeb_WOTemplate_H__ 24 25 #import <Foundation/NSObject.h> 26 #include <NGObjWeb/WOElement.h> 27 28 @class NSURL, NSDate, NSString, NSDictionary, NSMutableDictionary; 29 @class NSEnumerator; 30 @class WOTemplate, WOSubcomponentInfo, WOComponentScript; 31 32 @interface WOTemplate : WOElement 33 { 34 /* should add some info about the logic of the component ... */ 35 NSURL *url; 36 WOElement *rootElement; 37 NSDate *loadDate; 38 NSMutableDictionary *subcomponentInfos; 39 WOComponentScript *componentScript; 40 NSDictionary *kvcTemplateVars; 41 } 42 43 - (id)initWithURL:(NSURL *)_url rootElement:(WOElement *)_element; 44 45 /* component info */ 46 47 - (void)setComponentScript:(WOComponentScript *)_script; 48 - (WOComponentScript *)componentScript; 49 50 - (void)setKeyValueArchivedTemplateVariables:(NSDictionary *)_vars; 51 - (NSDictionary *)keyValueArchivedTemplateVariables; 52 53 /* subcomponent info */ 54 55 - (void)addSubcomponentWithKey:(NSString *)_key 56 name:(NSString *)_name 57 bindings:(NSDictionary *)_bindings; 58 59 - (BOOL)hasSubcomponentInfos; 60 - (NSEnumerator *)infoKeyEnumerator; 61 - (WOSubcomponentInfo *)subcomponentInfoForKey:(NSString *)_key; 62 63 /* accessors */ 64 65 - (void)setRootElement:(WOElement *)_element; 66 - (WOElement *)rootElement; 67 68 - (NSURL *)url; 69 70 @end 71 72 @interface WOSubcomponentInfo : NSObject 73 { 74 NSString *componentName; 75 NSDictionary *bindings; 76 } 77 78 - (id)initWithName:(NSString *)_name bindings:(NSDictionary *)_bindings; 79 80 /* accessors */ 81 82 - (NSString *)componentName; 83 - (NSDictionary *)bindings; 84 85 @end 86 87 #endif /* __NGObjWeb_WOTemplate_H__ */ 88