2000-08-27 19:11:42 +00:00
|
|
|
/*
|
2006-12-26 10:58:39 +00:00
|
|
|
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
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 _PCProjectManager_h_
|
|
|
|
#define _PCProjectManager_h_
|
2002-02-02 21:12:49 +00:00
|
|
|
|
2008-12-30 13:47:27 +00:00
|
|
|
#import <AppKit/AppKit.h>
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2009-01-26 22:56:03 +00:00
|
|
|
#import <Protocols/Preferences.h>
|
|
|
|
|
2006-12-26 10:58:39 +00:00
|
|
|
@class PCBundleManager;
|
2004-06-11 13:43:02 +00:00
|
|
|
@class PCFileManager;
|
2008-01-21 22:26:36 +00:00
|
|
|
@class PCEditorManager;
|
2002-11-24 12:20:54 +00:00
|
|
|
@class PCProject;
|
2004-06-11 13:43:02 +00:00
|
|
|
@class PCProjectInspector;
|
|
|
|
@class PCProjectBuilder;
|
|
|
|
@class PCProjectLauncher;
|
|
|
|
@class PCProjectLoadedFiles;
|
|
|
|
@class PCProjectFinder;
|
|
|
|
|
|
|
|
@class NewSubprojectController;
|
2002-11-24 12:20:54 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
extern NSString *PCActiveProjectDidChangeNotification;
|
|
|
|
|
2004-06-15 20:41:49 +00:00
|
|
|
@interface PCProjectManager : NSObject
|
2000-08-27 19:11:42 +00:00
|
|
|
{
|
2004-06-11 13:43:02 +00:00
|
|
|
id delegate;
|
2009-01-26 22:56:03 +00:00
|
|
|
id <PCPreferences> prefController;
|
2004-06-11 13:43:02 +00:00
|
|
|
|
2006-12-26 10:58:39 +00:00
|
|
|
PCBundleManager *bundleManager;
|
2004-06-11 13:43:02 +00:00
|
|
|
NSMutableDictionary *projectTypes;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
PCFileManager *fileManager;
|
2008-01-21 22:26:36 +00:00
|
|
|
PCEditorManager *editorManager;
|
2004-06-11 13:43:02 +00:00
|
|
|
PCProjectInspector *projectInspector;
|
|
|
|
|
|
|
|
NSPanel *buildPanel;
|
|
|
|
NSPanel *launchPanel;
|
|
|
|
NSPanel *loadedFilesPanel;
|
|
|
|
NSPanel *findPanel;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2003-05-23 09:11:07 +00:00
|
|
|
NSMutableDictionary *loadedProjects;
|
|
|
|
PCProject *activeProject;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2003-05-23 09:11:07 +00:00
|
|
|
NSTimer *saveTimer;
|
2001-12-29 15:29:08 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
NSBox *projectTypeAccessaryView;
|
|
|
|
id projectTypePopup;
|
|
|
|
|
|
|
|
NSBox *fileTypeAccessaryView;
|
|
|
|
id fileTypePopup;
|
|
|
|
|
|
|
|
IBOutlet NSPanel *nsPanel;
|
|
|
|
IBOutlet NSImageView *nsImage;
|
|
|
|
IBOutlet NSTextField *nsTitle;
|
|
|
|
IBOutlet NSTextField *projectNameField;
|
|
|
|
IBOutlet NSTextField *nsNameField;
|
|
|
|
IBOutlet NSPopUpButton *nsTypePB;
|
|
|
|
IBOutlet NSButton *nsCancelButton;
|
|
|
|
IBOutlet NSButton *nsCreateButton;
|
|
|
|
|
2000-08-27 19:11:42 +00:00
|
|
|
@private
|
2004-06-11 13:43:02 +00:00
|
|
|
BOOL _needsReleasing;
|
2000-08-27 19:11:42 +00:00
|
|
|
}
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
// ==== Intialization & deallocation
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
- (id)init;
|
2009-02-16 00:10:59 +00:00
|
|
|
- (BOOL)close;
|
2000-08-27 19:11:42 +00:00
|
|
|
- (void)dealloc;
|
|
|
|
- (void)setDelegate:(id)aDelegate;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (id)delegate;
|
|
|
|
- (void)setPrefController:(id)aController;
|
2009-01-26 22:56:03 +00:00
|
|
|
- (id <PCPreferences>)prefController;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2006-12-26 10:58:39 +00:00
|
|
|
- (void)createProjectTypeAccessaryView;
|
|
|
|
- (NSMutableDictionary *)loadProjectTypesInfo;
|
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2001-12-29 15:29:08 +00:00
|
|
|
// ==== Timer handling
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
|
|
|
- (BOOL)startSaveTimer;
|
|
|
|
- (BOOL)resetSaveTimer:(NSNotification *)notif;
|
|
|
|
- (BOOL)stopSaveTimer;
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// ==== Accessory methods
|
|
|
|
// ============================================================================
|
2006-12-26 10:58:39 +00:00
|
|
|
- (PCBundleManager *)bundleManager;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (PCFileManager *)fileManager;
|
2008-02-04 23:51:28 +00:00
|
|
|
- (PCEditorManager *)editorManager;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (PCProjectInspector *)projectInspector;
|
|
|
|
- (NSPanel *)inspectorPanel;
|
|
|
|
- (void)showProjectInspector:(id)sender;
|
|
|
|
- (NSPanel *)loadedFilesPanel;
|
|
|
|
- (void)showProjectLoadedFiles:(id)sender;
|
|
|
|
- (NSPanel *)buildPanel;
|
|
|
|
- (NSPanel *)launchPanel;
|
|
|
|
- (NSPanel *)projectFinderPanel;
|
2001-12-29 15:29:08 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
// ==== Project management
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2009-02-15 00:24:12 +00:00
|
|
|
// Returns all currently loaded projects. They are stored with their absolute
|
|
|
|
// paths as keys.
|
2000-08-27 19:11:42 +00:00
|
|
|
- (NSMutableDictionary *)loadedProjects;
|
|
|
|
- (PCProject *)activeProject;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (PCProject *)rootActiveProject;
|
2000-08-27 19:11:42 +00:00
|
|
|
- (void)setActiveProject:(PCProject *)aProject;
|
2001-12-29 15:29:08 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
// ==== Project actions
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2006-12-26 10:58:39 +00:00
|
|
|
- (PCProject *)convertLegacyProject:(NSMutableDictionary *)pDict
|
|
|
|
atPath:(NSString *)aPath;
|
2009-06-23 22:21:10 +00:00
|
|
|
- (PCProject *)openProjectAt:(NSString *)aPath makeActive: (BOOL)flag;
|
2009-02-11 00:21:23 +00:00
|
|
|
- (void)openProject;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (PCProject *)createProjectOfType:(NSString *)projectType
|
|
|
|
path:(NSString *)aPath;
|
2014-03-03 04:24:05 +00:00
|
|
|
- (void)newProject: (id)sender;
|
2000-08-27 19:11:42 +00:00
|
|
|
- (BOOL)saveProject;
|
2003-05-23 09:11:07 +00:00
|
|
|
|
|
|
|
// Calls saveAllProjects if the preferences are setup accordingly.
|
|
|
|
- (void)saveAllProjectsIfNeeded;
|
|
|
|
|
|
|
|
// Saves all projects if needed.
|
2004-06-11 13:43:02 +00:00
|
|
|
- (BOOL)saveAllProjects;
|
|
|
|
- (BOOL)addProjectFiles;
|
|
|
|
- (BOOL)saveProjectFiles;
|
|
|
|
- (BOOL)removeProjectFiles;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
|
|
|
- (void)closeProject:(PCProject *)aProject;
|
|
|
|
- (void)closeProject;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (BOOL)closeAllProjects;
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
// ==== File actions
|
2004-06-11 13:43:02 +00:00
|
|
|
// ============================================================================
|
2000-08-27 19:11:42 +00:00
|
|
|
|
2008-02-04 23:51:28 +00:00
|
|
|
// Also called by PCAppController
|
|
|
|
- (void)openFileAtPath:(NSString *)filePath;
|
2021-08-01 21:01:58 +00:00
|
|
|
- (void)openFileAtPath:(NSString *)filePath windowed: (BOOL)windowed;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (void)openFile;
|
|
|
|
- (void)newFile;
|
2000-08-27 19:11:42 +00:00
|
|
|
- (BOOL)saveFile;
|
2008-01-21 22:26:36 +00:00
|
|
|
- (BOOL)saveFileAs;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (BOOL)saveFileTo;
|
2003-05-23 09:11:07 +00:00
|
|
|
- (BOOL)revertFileToSaved;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (BOOL)renameFile;
|
2003-05-23 09:11:07 +00:00
|
|
|
- (void)closeFile;
|
|
|
|
|
2000-08-27 19:11:42 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject (PCProjectManagerDelegates)
|
|
|
|
|
|
|
|
- (void)projectManager:(id)sender willCloseProject:(PCProject *)aProject;
|
|
|
|
- (void)projectManager:(id)sender didCloseProject:(PCProject *)aProject;
|
|
|
|
- (void)projectManager:(id)sender didOpenProject:(PCProject *)aProject;
|
|
|
|
- (BOOL)projectManager:(id)sender shouldOpenProject:(PCProject *)aProject;
|
|
|
|
|
|
|
|
@end
|
2000-09-17 12:13:10 +00:00
|
|
|
|
2004-06-11 13:43:02 +00:00
|
|
|
@interface NewSubprojectController : NSWindowController
|
|
|
|
{
|
|
|
|
id image;
|
|
|
|
id nameTextField;
|
|
|
|
id typePopup;
|
|
|
|
id createButton;
|
|
|
|
id cancelButton;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface PCProjectManager (Subprojects)
|
|
|
|
|
2009-02-11 00:21:23 +00:00
|
|
|
- (BOOL)openNewSubprojectPanel;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (void)closeNewSubprojectPanel:(id)sender;
|
2009-02-11 00:21:23 +00:00
|
|
|
|
|
|
|
- (void)createSubproject:(id)sender;
|
2004-06-11 13:43:02 +00:00
|
|
|
- (PCProject *)createSubprojectOfType:(NSString *)projectType
|
|
|
|
path:(NSString *)aPath;
|
2009-02-11 00:21:23 +00:00
|
|
|
- (BOOL)addSubproject;
|
2004-06-11 13:43:02 +00:00
|
|
|
@end
|
2000-09-17 12:13:10 +00:00
|
|
|
|
2002-02-02 21:12:49 +00:00
|
|
|
#endif
|