Debian Codegraph @

src/af/xap/cocoa/xap_CocoaDlg_PluginManager.h

raw
1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2
3 /* AbiSource Application Framework
4 * Copyright (C) 2001 AbiSource, Inc.
5 * Copyright (C) 2001, 2003, 2007 Hubert Figuiere
6 * Copyright (C) 2004 Francis James Franklin
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA.
22 */
23
24 #ifndef XAP_COCOADIALOG_PLUGIN_MANAGER_H
25 #define XAP_COCOADIALOG_PLUGIN_MANAGER_H
26
27 #include <Cocoa/Cocoa.h>
28
29 #include "xap_App.h"
30 #include "xap_CocoaPlugin.h"
31 #include "xap_Dlg_PluginManager.h"
32 #include "xap_Module.h"
33
34 #import "xap_Cocoa_NSTableUtils.h"
35
36 class XAP_Frame;
37 class XAP_CocoaDialog_PluginManager;
38 class XAP_CocoaModule;
39
40 @interface XAP_CocoaPluginReference : NSObject
41 {
42 NSAttributedString * m_entry;
43
44 NSString * m_name;
45 NSString * m_author;
46 NSString * m_version;
47 NSString * m_description;
48 NSString * m_usage;
49
50 XAP_CocoaModule * m_module;
51 XAP_CocoaPlugin * m_plugin;
52 }
53 - (id)initWithModule:(XAP_CocoaModule *)module;
54 - (id)initWithPlugin:(XAP_CocoaPlugin *)plugin;
55 - (void)dealloc;
56
57 - (void)setActive:(BOOL)active;
58
59 - (NSAttributedString *)entry;
60
61 - (NSString *)name;
62 - (NSString *)author;
63 - (NSString *)version;
64 - (NSString *)description;
65 - (NSString *)usage;
66
67 - (XAP_CocoaModule *)module;
68 - (XAP_CocoaPlugin *)plugin;
69 @end
70
71 @interface XAP_CocoaDlg_PluginManagerController : NSWindowController <XAP_CocoaDialogProtocol>
72 {
73 IBOutlet NSButton * oInstallBtn;
74 IBOutlet NSButton * oCloseBtn;
75
76 IBOutlet NSTableView * oPluginList;
77
78 IBOutlet NSTextField * oNameData;
79 IBOutlet NSTextField * oNameLabel;
80 IBOutlet NSTextField * oAuthorData;
81 IBOutlet NSTextField * oAuthorLabel;
82 IBOutlet NSTextField * oVersionData;
83 IBOutlet NSTextField * oVersionLabel;
84 IBOutlet NSTextField * oDescriptionData;
85 IBOutlet NSTextField * oDescriptionLabel;
86 IBOutlet NSTextField * oUsageData;
87 IBOutlet NSTextField * oUsageLabel;
88
89 XAP_CocoaDialog_PluginManager* _xap;
90
91 NSMutableArray * m_PluginRefs;
92 }
93 - (id)initFromNib;
94 - (void)dealloc;
95
96 - (IBAction)closeAction:(id)sender;
97 - (IBAction)installAction:(id)sender;
98
99 /* NSTableView delegate method
100 */
101 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification;
102
103 /* NSTableDataSource methods
104 */
105 - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
106 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
107
108 @end
109
110 class XAP_CocoaDialog_PluginManager : public XAP_Dialog_PluginManager
111 {
112 public:
113 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid);
114
115 XAP_CocoaDialog_PluginManager(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid);
116
117 virtual ~XAP_CocoaDialog_PluginManager(void);
118
119 virtual void runModal (XAP_Frame * pFrame);
120
121 void event_Load ();
122
123 private:
124 XAP_Frame * m_pFrame;
125 };
126
127 #endif /* PLUGIN_MANAGER_H */