1 /*! 2 @header FTDictionaryServiceLoader 3 @abstract Module of FT 4 5 @availability OS X, GNUstep 6 @copyright 2004, 2005, 2006 Free Software Foundation, Inc. 7 8 This library is free software; you can redistribute it and/or 9 modify it under the terms of the GNU Lesser General Public 10 License as published by the Free Software Foundation; either 11 version 2.1 of the License, or (at your option) any later version. 12 13 This library is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 Lesser General Public License for more details. 17 18 You should have received a copy of the GNU Lesser General Public 19 License along with this library; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 22 <pre> 23 ------------------------------------------------------------------------- 24 Modification history 25 26 21.09.05 ola initial version 27 16.07.06 ola new implementation 28 23.08.06 ola license changed 29 ------------------------------------------------------------------------- 30 </pre> 31 */ 32 33 #if !defined(__FTDictionaryServiceLoader_H) 34 #define __FTDictionaryServiceLoader_H 35 36 #include <Foundation/Foundation.h> 37 #include <FT/FTObject.h> 38 #include <FT/FTServiceLoader.h> 39 #include <FT/FTServiceAvailability.h> 40 41 42 /*! 43 * @class FTDictionaryServiceLoader 44 * @abstract Used to integrate the service FTDictionaryService 45 */ 46 @interface FTDictionaryServiceLoader : FTObject <FTServiceLoader> { 47 @private 48 id <FTVersion> serviceVersion; 49 id <FTServiceAvailability> serviceAvailability; 50 id <FTServiceEnvironment> serviceEnvironment; 51 52 /* 53 * String containg basic name scheme used by all instances of 54 * FTDictionaryServiceForGraphImpl 55 */ 56 NSString *databaseNameScheme; 57 58 59 ECCache *graphToServiceImpl; 60 NSLock *generalLock; 61 62 } 63 64 /*! 65 * @method initialize 66 * @abstract used to set up this 67 */ 68 - init; 69 - (void) dealloc; 70 71 72 /*! 73 * @method databaseNameScheme 74 * @result the naming schema for each graph dictionary database 75 */ 76 - (NSString *) databaseNameScheme; 77 78 79 /*! 80 * @method onGraphClosed 81 * @abstract called by notification center in case a graph has been closed 82 * @param notification underlying notification 83 * @result self 84 */ 85 - onGraphClosed: (NSNotification *) notification; 86 87 88 /*! 89 * @method serviceAvailability 90 * @result information about the availability of the service 91 */ 92 - (id <FTServiceAvailability>) serviceAvailability; 93 94 95 /*! 96 * @method serviceForGraph 97 * @param aGraph graph to load the service for 98 * @result loads the service for the specified graph 99 */ 100 - (id <FTService>) serviceForGraph: (id <FTGraph>) aGraph; 101 102 103 /*! 104 * @method serviceForNode 105 * @param aGraph graph to load the service for 106 * @result loads the service for the specified graph 107 */ 108 - (id <FTService>) serviceForNode: (id <FTNode>) aNode 109 ofGraph: (id <FTGraph>) aGraph; 110 111 112 /*! 113 * @method serviceId 114 * @result identifier for this services 115 */ 116 - (NSString *) serviceId; 117 118 119 /*! 120 * @method version 121 * @result return the version of this service 122 */ 123 - (id <FTVersion>) serviceVersion; 124 125 126 /*! 127 * @method setDatabaseNameSchema 128 * @abstract specifies the naming schema for each graph dictionary database 129 * @param aDatabaseName the naming schema for each graph dictionary database 130 * @result self 131 */ 132 - setDatabaseNameSchema: (NSString *) aDatabaseName; 133 134 135 /*! 136 * @method setEnvironment 137 * @abstract called by the service manager directly after this object 138 * is being added to it 139 * @param aServiceEnvironment environment for the service 140 * @result self 141 */ 142 - setEnvironment: (id <FTServiceEnvironment>) aServiceEnvironment; 143 144 145 /*! 146 * @method switchToMode 147 * @result self 148 * @abstract used to switch to a given operation mode 149 */ 150 - switchToMode: (ft_serviceMode_t) aServiceMode; 151 152 @end 153 154 155 /*! 156 * @class FTDictionaryServiceAvailability 157 * @abstract Gives information about the availability 158 * @discussion This dictionary service is available for all graphs and nodes. 159 */ 160 @interface FTDictionaryServiceAvailability : FTObject <FTServiceAvailability> 161 /*! 162 * @method availableForGraph 163 * @abstract checks wether the service is available for the given graph 164 * @result returns YES if the service is available for the specified graph 165 */ 166 - (BOOL) availableForGraph: (id <FTGraph>) aGraph; 167 168 169 /*! 170 * @method availableForNodesOfGraph 171 * @abstract checks wether the service is available for the specified graph 172 * @result YES if the service is available for the specified graph 173 */ 174 - (BOOL) availableForNodesOfGraph: (id <FTGraph>) aGraph; 175 176 177 /*! 178 * @method availableForNode 179 * @abstract checks wether the service is available for the specified node 180 * @result YES if the service is available for the specified node 181 */ 182 - (BOOL) availableForNode: (id <FTNode>) aNode ofGraph: (id <FTGraph>) aGraph; 183 @end 184 #endif 185