2000-08-27 19:11:42 +00:00
|
|
|
/*
|
2001-08-03 14:23:25 +00:00
|
|
|
GNUstep ProjectCenter - http://www.gnustep.org
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-15 20:41:49 +00:00
|
|
|
Copyright (C) 2000-2004 Free Software Foundation
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-12 19:23:26 +00:00
|
|
|
Authors: Philippe C.D. Robert
|
|
|
|
Serg Stoyan
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2001-08-03 14:23:25 +00:00
|
|
|
This file is part of GNUstep.
|
2000-08-27 19:11:42 +00:00
|
|
|
|
|
|
|
This application is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This application 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 General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
#ifndef _PCFileManager_h
|
|
|
|
#define _PCFileManager_h
|
2002-02-02 21:12:49 +00:00
|
|
|
|
2003-04-21 13:46:10 +00:00
|
|
|
#include <Foundation/Foundation.h>
|
2004-06-11 13:43:02 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
|
|
|
|
@class PCProject;
|
|
|
|
@class PCProjectManager;
|
2005-01-03 00:20:54 +00:00
|
|
|
@class PCAddFilesPanel;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
|
|
|
@interface PCFileManager : NSObject
|
|
|
|
{
|
2004-06-11 13:43:02 +00:00
|
|
|
PCProjectManager *projectManager;
|
|
|
|
id delegate; // PCProjectManager
|
|
|
|
|
|
|
|
NSDictionary *creators;
|
|
|
|
|
|
|
|
// New File in Project panel
|
|
|
|
IBOutlet NSPanel *newFilePanel;
|
|
|
|
IBOutlet NSImageView *nfImage;
|
|
|
|
IBOutlet NSPopUpButton *nfTypePB;
|
|
|
|
IBOutlet NSTextView *nfDescriptionTV;
|
|
|
|
IBOutlet NSTextField *nfNameField;
|
|
|
|
IBOutlet NSButton *nfCancleButton;
|
|
|
|
IBOutlet NSButton *nfCreateButton;
|
|
|
|
|
2005-01-03 00:20:54 +00:00
|
|
|
PCAddFilesPanel *addFilesPanel;
|
2000-08-27 19:11:42 +00:00
|
|
|
}
|
|
|
|
|
2002-02-16 20:46:26 +00:00
|
|
|
//==============================================================================
|
2000-09-17 12:13:10 +00:00
|
|
|
// ==== Class methods
|
2002-02-16 20:46:26 +00:00
|
|
|
//==============================================================================
|
2000-09-17 12:13:10 +00:00
|
|
|
|
|
|
|
+ (PCFileManager *)fileManager;
|
|
|
|
|
2002-02-16 20:46:26 +00:00
|
|
|
//==============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
// ==== Init and free
|
2002-02-16 20:46:26 +00:00
|
|
|
//==============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
- (id)initWithProjectManager:(PCProjectManager *)aProjectManager;
|
2000-08-27 19:11:42 +00:00
|
|
|
- (void)dealloc;
|
|
|
|
|
|
|
|
// ===========================================================================
|
|
|
|
// ==== File stuff
|
|
|
|
// ===========================================================================
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// Shows NSOpenPanel and return selected files if any
|
|
|
|
- (NSMutableArray *)filesForOpenOfType:(NSArray *)types
|
|
|
|
multiple:(BOOL)yn
|
|
|
|
title:(NSString *)title
|
|
|
|
accView:(NSView *)accessoryView;
|
|
|
|
|
|
|
|
- (NSString *)fileForSaveOfType:(NSArray *)types
|
|
|
|
title:(NSString *)title
|
|
|
|
accView:(NSView *)accessoryView;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// Return NO if coping of any file failed
|
|
|
|
- (BOOL)copyFiles:(NSArray *)files intoDirectory:(NSString *)directory;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// Return NO if removing of any file failed
|
|
|
|
- (BOOL)removeFiles:(NSArray *)files fromDirectory:(NSString *)directory;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
- (void)createFile;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
@interface PCFileManager (UInterface)
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
- (void)showNewFilePanel;
|
|
|
|
- (void)closeNewFilePanel:(id)sender;
|
|
|
|
- (void)createFile:(id)sender;
|
|
|
|
- (void)newFilePopupChanged:(id)sender;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2005-01-03 00:20:54 +00:00
|
|
|
- (NSMutableArray *)filesForAddOfTypes:(NSArray*)fileTypes;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
|
|
|
@end
|
2000-08-28 19:04:15 +00:00
|
|
|
|
2002-02-02 21:12:49 +00:00
|
|
|
#endif
|