2002-08-04 18:00:11 +00:00
|
|
|
/** GSWPageDefElement.m - <title>GSWeb: Class GSWPageDefElement</title>
|
|
|
|
|
|
|
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
|
|
|
Date: Mar 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-08-04 18:00:11 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
static char rcsId[] = "$Id$";
|
|
|
|
|
2000-10-30 15:36:50 +00:00
|
|
|
#include <GSWeb/GSWeb.h>
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWPageDefElement
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// init
|
|
|
|
|
|
|
|
-(id)init
|
|
|
|
{
|
|
|
|
if ((self=[super init]))
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
// NSDebugFLLog(@"low",@"Dealloc GSWPageDefElement=%p",(void*)self);
|
|
|
|
// GSWLogC("Dealloc GSWPageDefElement: elementName");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_elementName);
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("Dealloc GSWPageDefElement: className");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_className);
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("Dealloc GSWPageDefElement: associations");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_associations);
|
2000-01-22 12:49:49 +00:00
|
|
|
[super dealloc];
|
|
|
|
// GSWLogC("End Dealloc GSWPageDefElement");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)copyWithZone:(NSZone*)zone
|
|
|
|
{
|
|
|
|
GSWPageDefElement* clone = [[isa allocWithZone:zone] init];
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGNCOPY(clone->_elementName,_elementName);
|
|
|
|
ASSIGNCOPY(clone->_className,_className);
|
|
|
|
ASSIGNCOPY(clone->_associations,_associations);
|
2000-01-22 12:49:49 +00:00
|
|
|
return clone;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithCoder:(NSCoder*)coder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-01-29 18:15:36 +00:00
|
|
|
if ((self = [super init]))
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_elementName];
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_className];
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_associations];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)encodeWithCoder:(NSCoder*)coder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
[coder encodeObject:_elementName];
|
|
|
|
[coder encodeObject:_className];
|
|
|
|
[coder encodeObject:_associations];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)elementName
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _elementName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setElementName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGNCOPY(_elementName,aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)className
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _className;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setClassName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGNCOPY(_className,aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDictionary*)associations
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _associations;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setAssociation:(GSWAssociation*)association
|
|
|
|
forKey:(NSString*)key
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
if (!_associations)
|
|
|
|
_associations=[NSMutableDictionary new];
|
|
|
|
[_associations setObject:association
|
|
|
|
forKey:key];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)description
|
|
|
|
{
|
|
|
|
return [NSString stringWithFormat:@"<%@ %p elementName:[%@] className:[%@] associations:\n%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
[self class],
|
|
|
|
(void*)self,
|
|
|
|
_elementName,
|
|
|
|
_className,
|
|
|
|
_associations];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
@end
|