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., 51 Franklin Street, Fifth Floor, Boston, MA 00021 * 02110-1301 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 00072 : NSWindowController <XAP_CocoaDialogProtocol, NSTableViewDelegate, NSTableViewDataSource> 00073 { 00074 IBOutlet NSButton * oInstallBtn; 00075 IBOutlet NSButton * oCloseBtn; 00076 00077 IBOutlet NSTableView * oPluginList; 00078 00079 IBOutlet NSTextField * oNameData; 00080 IBOutlet NSTextField * oNameLabel; 00081 IBOutlet NSTextField * oAuthorData; 00082 IBOutlet NSTextField * oAuthorLabel; 00083 IBOutlet NSTextField * oVersionData; 00084 IBOutlet NSTextField * oVersionLabel; 00085 IBOutlet NSTextField * oDescriptionData; 00086 IBOutlet NSTextField * oDescriptionLabel; 00087 IBOutlet NSTextField * oUsageData; 00088 IBOutlet NSTextField * oUsageLabel; 00089 00090 XAP_CocoaDialog_PluginManager* _xap; 00091 00092 NSMutableArray * m_PluginRefs; 00093 } 00094 - (id)initFromNib; 00095 - (void)dealloc; 00096 00097 - (IBAction)closeAction:(id)sender; 00098 - (IBAction)installAction:(id)sender; 00099 00100 /* NSTableView delegate method 00101 */ 00102 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; 00103 00104 /* NSTableDataSource methods 00105 */ 00106 - (int)numberOfRowsInTableView:(NSTableView *)aTableView; 00107 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; 00108 00109 @end 00110 00111 class XAP_CocoaDialog_PluginManager : public XAP_Dialog_PluginManager 00112 { 00113 public: 00114 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00115 00116 XAP_CocoaDialog_PluginManager(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00117 00118 virtual ~XAP_CocoaDialog_PluginManager(void); 00119 00120 virtual void runModal (XAP_Frame * pFrame); 00121 00122 void event_Load (); 00123 00124 private: 00125 XAP_Frame * m_pFrame; 00126 }; 00127 00128 #endif /* PLUGIN_MANAGER_H */