home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------------------
- // Copyright (c) 1996 Next Software, Inc., All Rights Reserved
- //
- // No part of this code may be reproduced in any form, compiled
- // or source code, nor used for any purpose without the express
- // written permission of the copyright holder.
- //
- // $Id: SCMController.h,v 1.2 1997/02/25 03:47:09 mmonegan Exp $
- //--------------------------------------------------------------------------
-
- #import <AppKit/AppKit.h>
-
- #import <ProjectBuilder/PBBundleHost.h>
-
- #import "ProjectBuilderSCMDefines.h"
-
- @class SCMAdaptor;
- @class SCMPreferences;
-
- //private filter which puts files selected in PB into SCM panel
- PBSCM_EXTERN NSString *_SCMFilterSelectedFilesInPB;
-
- //dictionary file containing default UI string mapppings for the SCM filters and //operations
- #define DEFAULT_SCM_INFO_FILE @"Default.scminfo"
-
- //tags used to identify menu items-must be unique in menu - don't use elsewhere
- #define NEW_WORK_AREA_PROJECT_MENU_TAG 2234
- #define UPDATE_PROJECT_MENU_TAG 2235
- #define TAG_PROJECT_MENU_TAG 2236
- #define CHECK_IN_PROJECT_MENU_TAG 2237
- #define UPDATE_FILE_MENU_TAG 2238
- #define CHECK_IN_FILE_MENU_TAG 2239
- #define LOCK_FILE_MENU_TAG 2240
- #define UNLOCK_FILE_MENU_TAG 2241
- #define TAG_FILE_MENU_TAG 2242
- #define SHOW_CHANGES_FILE_MENU_TAG 2243
-
- //IB hack
- #define IBOutlet
-
- @interface SCMController : NSObject <PBConfigManager>
- {
- //outlets
-
- //new work area
- IBOutlet NSWindow *repositoryWindow;
- IBOutlet NSTextField *directory;
- IBOutlet NSTextField *repository;
- IBOutlet NSPopUpButton *repositoryType;
- IBOutlet NSPanel *alertPanel;
- IBOutlet NSTextField *alertRepository;
- IBOutlet NSTextField *alertWorkDirectory;
-
- //SCM console
- IBOutlet NSTextView *console;
-
- //SCM panel
- IBOutlet NSTableView *tableview;
- IBOutlet NSButton *refreshButton;
- IBOutlet NSPopUpButton *filterButton;
- IBOutlet NSButton *showChangesButton;
- IBOutlet NSButton *displayHistoryButton;
- IBOutlet NSPopUpButton *operationPopup;
- IBOutlet NSButton *executeButton;
-
- //SCM log (comments) entry
- IBOutlet NSTextView *logPrompt;
- IBOutlet NSWindow *logWindow;
- IBOutlet NSTextView *logText;
- IBOutlet NSButton *logOKButton;
-
- //preferences panel
- IBOutlet SCMPreferences *scmPreferences;
-
- //internal variables
-
- @private
- NSMutableDictionary *_projects; //dict whose keys are project paths and
- //whose values are dictionaries containing
- //keys: adaptor,consoleLog,displayRecords.
- NSMutableArray *_adaptorClasses;
- SCMAdaptor *_currentAdaptor;
- NSArray *_displayRecords;
- NSString *_fileFilter;
- BOOL _commitCancelled;
- }
-
- + (SCMController *)sharedInstance;
-
- - (void)awakeFromNib;
-
- //Adaptors must register themselves with the controller
- - (void)registerAdaptorClass:(Class)class;
-
- //Returns the dict in Default.scminfo file. Adaptors can use this to obtain
- //the interface mappings. This dictionary contains two subdictionaries:
- //Filters & Operations.
- - (NSDictionary *)defaultSCMInfo;
-
- //the following method displays an error (usually used for error on asynchronous
- //adaptor operations). the error is put in the adaptor console, and optionally
- //printed in a modal alert panel shown to the user.
- - (void)displayErrorWithMessage:(NSString *)message
- title:(NSString *)title
- forAdaptor:(SCMAdaptor *)adaptor
- showAlert:(BOOL)alert;
-
- @end
-
- @interface SCMController(ActionMethods)
- //project menu operations
- - (void)showProjectPanel:(id)sender;
- - (void)showConsole:(id)sender;
- - (void)newWorkArea:(id)sender;
- - (void)updateProject:(id)sender;
- - (void)tagProject:(id)sender;
- - (void)commitChangedFiles:(id)sender;
-
- //file menu operations
- - (void)showFilePanel:(id)sender;
- - (void)updateSelectedFiles:(id)sender;
- - (void)commitSelectedFiles:(id)sender;
- - (void)lockSelectedFiles:(id)sender;
- - (void)unlockSelectedFiles:(id)sender;
- - (void)tagSelectedFiles:(id)sender;
- - (void)showChangesForSelectedFiles:(id)sender;
-
- //new work area
- - (void)cancelWorkArea:(id)sender;
- - (void)createWorkArea:(id)sender;
- - (void)setRepositoryPath:(id)sender;
- - (void)setWorkDirectory:(id)sender;
-
- //SCM panel
- - (void)refresh:(id)sender;
- - (void)showChanges:(id)sender;
- - (void)displayHistory:(id)sender;
- - (void)execute:(id)sender;
- - (void)cancel:(id)sender;
- - (void)setFilter:(id)sender;
-
- //log window
- - (void)okLogWindow:(id)sender;
- - (void)cancelLogWindow:(id)sender;
-
- //history window
- - (void)clearHistory:(id)sender;
- @end
-