ProjectManager  0.2
FileManagerDelegate.h
00001 /*
00002     FileManagerDelegate.h
00003 
00004     File manager delegate protocol declaration for the ProjectManager app.
00005 
00006     Copyright (C) 2006  Saso Kiselkov
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021 */
00022 
00023 #import <Foundation/NSObject.h>
00024 
00025 @class NSImage, NSString, NSError;
00026 
00027 typedef enum {
00028   FileOpenCannotHandle = -1,
00029   FileOpenFailure,
00030   FileOpenSuccess
00031 } FileOpenResult;
00032 
00033 typedef enum {
00034   FileImportCannotHandle = -1,
00035   FileImportFailure,
00036   FileImportSuccess
00037 } FileImportResult;
00038 
00043 @protocol FileManagerDelegate
00044 
00049 - (BOOL) canCreateCategoriesAtPath: (NSString *) aPath;
00050 
00055 - (BOOL) canCreatePlainFilesAtPath: (NSString *) aPath;
00056 
00061 - (BOOL) canCreateLinksAtPath: (NSString *) aPath;
00062 
00067 - (BOOL) canCreateVirtualFilesAtPath: (NSString *) aPath;
00068 
00073 - (BOOL) canDeletePath: (NSString *) aPath;
00074 
00085 - (FileOpenResult) openFile: (NSString *) aPath;
00086 
00097 - (NSString *) pathToFile: (NSString *) aPath isCategory: (BOOL) isCategory;
00098 
00104 - (NSImage *) iconForPath: (NSString *) aPath;
00105 
00111 - (NSArray *) permissibleFileExtensionsInCategory: (NSString *) aCategory;
00112 
00130 - (FileImportResult) importFile: (NSString *) aFile
00131                    intoCategory: (NSString *) aCategory
00132                           error: (NSError **) error;
00133 
00180 - (NSString *) pathToFileTemplatesDirectoryForCategory: (NSString *) aCategory;
00181 
00197 - (NSDictionary *) filesAssociatedWithTemplateFile: (NSString *) aFile
00198                             fromTemplatesDirectory: (NSString *) templatesDir
00199                                        forCategory: (NSString *) targetCategory;
00200 
00201 @end