00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource Application Framework 00004 * Copyright (C) 2001 AbiSource, Inc. 00005 * Copyright (C) 2001, 2003, 2007 Hubert Figuiere 00006 * Copyright (C) 2004 Francis James Franklin 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (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., 59 Temple Place - Suite 330, Boston, MA 00021 * 02111-1307, USA. 00022 */ 00023 00024 #ifndef XAP_COCOADIALOG_PLUGIN_MANAGER_H 00025 #define XAP_COCOADIALOG_PLUGIN_MANAGER_H 00026 00027 #include <Cocoa/Cocoa.h> 00028 00029 #include "xap_App.h" 00030 #include "xap_CocoaPlugin.h" 00031 #include "xap_Dlg_PluginManager.h" 00032 #include "xap_Module.h" 00033 00034 #import "xap_Cocoa_NSTableUtils.h" 00035 00036 class XAP_Frame; 00037 class XAP_CocoaDialog_PluginManager; 00038 class XAP_CocoaModule; 00039 00040 @interface XAP_CocoaPluginReference : NSObject 00041 { 00042 NSAttributedString * m_entry; 00043 00044 NSString * m_name; 00045 NSString * m_author; 00046 NSString * m_version; 00047 NSString * m_description; 00048 NSString * m_usage; 00049 00050 XAP_CocoaModule * m_module; 00051 XAP_CocoaPlugin * m_plugin; 00052 } 00053 - (id)initWithModule:(XAP_CocoaModule *)module; 00054 - (id)initWithPlugin:(XAP_CocoaPlugin *)plugin; 00055 - (void)dealloc; 00056 00057 - (void)setActive:(BOOL)active; 00058 00059 - (NSAttributedString *)entry; 00060 00061 - (NSString *)name; 00062 - (NSString *)author; 00063 - (NSString *)version; 00064 - (NSString *)description; 00065 - (NSString *)usage; 00066 00067 - (XAP_CocoaModule *)module; 00068 - (XAP_CocoaPlugin *)plugin; 00069 @end 00070 00071 @interface XAP_CocoaDlg_PluginManagerController : NSWindowController <XAP_CocoaDialogProtocol> 00072 { 00073 IBOutlet NSButton * oInstallBtn; 00074 IBOutlet NSButton * oCloseBtn; 00075 00076 IBOutlet NSTableView * oPluginList; 00077 00078 IBOutlet NSTextField * oNameData; 00079 IBOutlet NSTextField * oNameLabel; 00080 IBOutlet NSTextField * oAuthorData; 00081 IBOutlet NSTextField * oAuthorLabel; 00082 IBOutlet NSTextField * oVersionData; 00083 IBOutlet NSTextField * oVersionLabel; 00084 IBOutlet NSTextField * oDescriptionData; 00085 IBOutlet NSTextField * oDescriptionLabel; 00086 IBOutlet NSTextField * oUsageData; 00087 IBOutlet NSTextField * oUsageLabel; 00088 00089 XAP_CocoaDialog_PluginManager* _xap; 00090 00091 NSMutableArray * m_PluginRefs; 00092 } 00093 - (id)initFromNib; 00094 - (void)dealloc; 00095 00096 - (IBAction)closeAction:(id)sender; 00097 - (IBAction)installAction:(id)sender; 00098 00099 /* NSTableView delegate method 00100 */ 00101 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; 00102 00103 /* NSTableDataSource methods 00104 */ 00105 - (int)numberOfRowsInTableView:(NSTableView *)aTableView; 00106 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00107 00108 @end 00109 00110 class XAP_CocoaDialog_PluginManager : public XAP_Dialog_PluginManager 00111 { 00112 public: 00113 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00114 00115 XAP_CocoaDialog_PluginManager(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00116 00117 virtual ~XAP_CocoaDialog_PluginManager(void); 00118 00119 virtual void runModal (XAP_Frame * pFrame); 00120 00121 void event_Load (); 00122 00123 private: 00124 XAP_Frame * m_pFrame; 00125 }; 00126 00127 #endif /* PLUGIN_MANAGER_H */
1.7.1