]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOAdaptor.h
added missing inline pathes
[sope] / sope-gdl1 / GDLAccess / EOAdaptor.h
1 /* 
2    EOAdaptor.h
3
4    Copyright (C) 1996 Free Software Foundation, Inc.
5
6    Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
7    Date: October 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 __EOAdaptor_h__
28 #define __EOAdaptor_h__
29
30 #import <Foundation/NSObject.h>
31
32 @class NSMutableArray, NSArray, NSDictionary, NSString, NSURL;
33
34 @class EOModel;
35 @class EOAttribute;
36 @class EOAdaptorContext;
37
38 /* The EOAdaptor class could be overriden for a concrete database adaptor.
39    You have to override only those methods marked in this header with
40    `override'.
41 */
42
43 /* Don't make EOAdaptor* classes garbage collectable because we want to make
44    the instances release the database allocated resources immediately when they
45    receive the -release message. */
46
47 @interface EOAdaptor : NSObject
48 {
49 @protected
50     EOModel        *model;
51     NSString       *name;
52     NSDictionary   *connectionDictionary;
53     NSDictionary   *pkeyGeneratorDictionary;
54     NSMutableArray *contexts;       // values with contexts
55     id             delegate;       // not retained
56
57     /* Flags used to check if the delegate responds to several messages */
58     BOOL delegateWillReportError:1;
59 }
60
61 /* Creating an EOAdaptor */
62 + (id)adaptorWithModel:(EOModel *)aModel;
63 + (id)adaptorWithName:(NSString *)aName;
64 + (id)adaptorForURL:(id)_url;
65 - (id)initWithName:(NSString *)aName;
66
67 /* Getting an adaptor's name */
68 - (NSString*)name;
69
70 /* Setting connection information */
71 - (void)setConnectionDictionary:(NSDictionary*)aDictionary;
72 - (NSDictionary*)connectionDictionary;
73 - (BOOL)hasValidConnectionDictionary;                   // override
74
75 /* Setting pkey generation info */
76 - (void)setPkeyGeneratorDictionary:(NSDictionary*)aDictionary;
77 - (NSDictionary*)pkeyGeneratorDictionary;
78
79 /* Setting the model */
80 - (void)setModel:(EOModel*)aModel;
81 - (EOModel*)model;
82
83 /* Creating and removing an adaptor context */
84 - (EOAdaptorContext*)createAdaptorContext;              // override
85 - (NSArray *)contexts;
86
87 /* Checking connection status */
88 - (BOOL)hasOpenChannels;
89
90 /* Getting adaptor-specific information */
91 - (Class)expressionClass;                               // override
92 - (Class)adaptorContextClass;                           // override
93 - (Class)adaptorChannelClass;                           // override
94 - (BOOL)isValidQualifierType:(NSString*)aTypeName;      // override
95
96 /* Formatting SQL */
97 - (id)formatAttribute:(EOAttribute*)attribute;          // override
98 - (id)formatValue:value forAttribute:(EOAttribute*)attribute; // override
99
100 /* Reporting errors */
101 - (void)reportError:(NSString*)anError;
102
103 /* Setting the delegate */
104 - (id)delegate;
105 - (void)setDelegate:(id)aDelegate;
106
107 @end /* EOAdaptor */
108
109
110 @interface EOAdaptor(Private)
111 - (void)contextDidInit:(id)aContext;
112 - (void)contextWillDealloc:(id)aContext;
113 @end
114
115
116 @interface NSObject(EOAdaptorDelegate)
117
118 - (BOOL)adaptor:(EOAdaptor*)anAdaptor willReportError:(NSString*)anError;
119
120 @end /* NSObject(EOAdaptorDelegate) */
121
122 @interface EOAdaptor(MDlinkExtensions)
123 - (NSString *)charConvertExpressionForAttributeNamed:(NSString *)_attrName;
124 - (NSString *)lowerExpressionForTextAttributeNamed:(NSString *)_attrName;
125 - (NSString *)expressionForTextValue:(id)_value;
126 - (BOOL)attributeAllowedInDistinctSelects:(EOAttribute *)attribute;
127 @end
128
129 @interface EOAdaptor(EOF2Additions)
130
131 - (BOOL)canServiceModel:(EOModel *)_model;
132
133 @end
134
135 #endif /* __EOAdaptor_h__*/