]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOAttribute.h
added missing inline pathes
[sope] / sope-gdl1 / GDLAccess / EOAttribute.h
1 /* 
2    EOAttribute.h
3
4    Copyright (C) 1996 Free Software Foundation, Inc.
5
6    Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
7    Date: August 1996
8
9    This file is part of the GNUstep Database Library.
10
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Library General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Library General Public License for more details.
20
21    You should have received a copy of the GNU Library General Public
22    License along with this library; see the file COPYING.LIB.
23    If not, write to the Free Software Foundation,
24    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27 #ifndef __EOAttribute_h__
28 #define __EOAttribute_h__
29
30 #import <Foundation/NSString.h>
31 #import <Foundation/NSDictionary.h>
32 #import <Foundation/NSDate.h>
33
34 @class NSString, NSTimeZone, NSDate, NSException;
35 @class NSMutableArray;
36 @class EOEntity;
37
38 @interface EOAttribute : NSObject
39 {
40     NSString     *name;
41     NSString     *calendarFormat;
42     NSTimeZone   *clientTimeZone;
43     NSTimeZone   *serverTimeZone;
44     NSString     *columnName;
45     NSString     *externalType;
46     NSString     *valueClassName;
47     NSString     *valueType;
48     NSDictionary *userDictionary;
49     EOEntity     *entity;             /* non-retained */
50     unsigned     width;
51
52     struct {
53         int allowsNull:1;
54         int reserved:31;
55     } flags;
56 }
57
58 /* Initializing new instances */
59 - (id)initWithName:(NSString *)name;
60
61 /* Accessing the entity */
62 - (void)setEntity:(EOEntity*)entity;
63 - (EOEntity*)entity;
64 - (void)resetEntity;
65 - (BOOL)hasEntity;
66
67 /* Accessing the name */
68 - (BOOL)setName:(NSString *)name;
69 - (NSString *)name;
70 + (BOOL)isValidName:(NSString *)name;
71
72 /* Accessing date information */
73 + (NSString *)defaultCalendarFormat;
74 - (void)setCalendarFormat:(NSString *)format;
75 - (NSString *)calendarFormat;
76 - (void)setClientTimeZone:(NSTimeZone*)tz;
77 - (NSTimeZone*)clientTimeZone;
78 - (void)setServerTimeZone:(NSTimeZone*)tz;
79 - (NSTimeZone*)serverTimeZone;
80
81 /* Accessing external definitions */
82 - (void)setColumnName:(NSString *)columnName;
83 - (NSString *)columnName;
84 - (void)setExternalType:(NSString *)type;
85 - (NSString *)externalType;
86
87 /* Accessing value type information */
88 - (void)setValueClassName:(NSString *)name;
89 - (NSString *)valueClassName;
90 - (void)setValueType:(NSString *)type;
91 - (NSString *)valueType;
92
93 /* Checking type information */
94 - (BOOL)referencesProperty:property;
95
96 /* Accessing the user dictionary */
97 - (void)setUserDictionary:(NSDictionary*)dictionary;
98 - (NSDictionary*)userDictionary;
99
100 /* Obsolete. This method always return NO, because you should always release
101    a property. */
102 - (BOOL)referencesProperty:property;
103
104 @end
105
106
107 @interface EOAttribute (EOAttributePrivate)
108
109 + (EOAttribute*)attributeFromPropertyList:(id)propertyList;
110 - (void)replaceStringsWithObjects;
111 - (id)propertyList;
112
113 @end /* EOAttribute (EOAttributePrivate) */
114
115 @interface EOAttribute(ValuesConversion)
116
117 - (id)convertValue:(id)aValue
118   toClass:(Class)aClass
119   forType:(NSString *)aValueType;
120 - (id)convertValueToModel:(id)aValue;
121
122 @end /* EOAttribute (ValuesConversion) */
123
124 @interface NSString (EOAttributeTypeCheck)
125
126 - (BOOL)isNameOfARelationshipPath;
127
128 @end
129
130 @class NSMutableDictionary;
131
132 @interface EOAttribute(PropertyListCoding)
133
134 - (void)encodeIntoPropertyList:(NSMutableDictionary *)_plist;
135
136 @end
137
138 @interface EOAttribute(EOF2Additions)
139
140 - (void)beautifyName;
141
142 /* constraints */
143
144 - (void)setAllowsNull:(BOOL)_flag;
145 - (BOOL)allowsNull;
146 - (void)setWidth:(unsigned)_width;
147 - (unsigned)width;
148
149 - (NSException *)validateValue:(id *)_value;
150
151 @end
152
153 #endif /* __EOAttribute_h__ */
154
155 /*
156   Local Variables:
157   c-basic-offset: 4
158   tab-width: 8
159   End:
160 */