ProjectManager  0.2
ProjectModule.h
00001 /*
00002     ProjectModule.h
00003 
00004     Interface declaration of the ProjectModule class for the
00005     ProjectManager application.
00006 
00007     Copyright (C) 2005, 2006  Saso Kiselkov
00008 
00009     This program is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022 */
00023 
00024 #import <Foundation/NSObject.h>
00025 #import <AppKit/NSMenu.h>
00026 
00027 @class NSString, NSToolbarItem, ProjectDocument, NSView;
00028 
00029 extern NSString * const CurrentProjectModuleDidChangeNotification;
00030 
00044 @protocol ProjectModule <NSObject, NSMenuValidation>
00045 
00049 + (NSString *) moduleName;
00050 
00051 + (NSString *) humanReadableModuleName;
00052 
00056 - initWithDocument: (ProjectDocument *) document
00057     infoDictionary: (NSDictionary *) infoDict;
00058 
00072 - (void) finishInit;
00073 
00078 - (ProjectDocument *) document;
00079 
00084 - (NSView *) view;
00085 
00094 - (NSDictionary *) infoDictionary;
00095 
00102 - (BOOL) regenerateDerivedFiles;
00103 
00108 - (NSArray *) moduleMenuItems;
00109 
00114 - (NSArray *) toolbarItemIdentifiers;
00115 
00122 - (NSToolbarItem *) toolbarItemForItemIdentifier: (NSString *) itemIdentifier;
00123 
00128 - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem;
00129 
00130 @end
00131 
00132 static inline NSMenuItem *
00133 PMMakeMenuItem (NSString * title, SEL action, NSString * keyEquivalent,
00134                 id target)
00135 {
00136   NSMenuItem * item;
00137 
00138   item = [[[NSMenuItem alloc]
00139     initWithTitle: title action: action keyEquivalent: keyEquivalent]
00140     autorelease];
00141   [item setTarget: target];
00142 
00143   return item;
00144 }