00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 2001, 2003 Hubert Figuiere 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 * 02110-1301 USA. 00021 */ 00022 00023 #ifndef AP_COCOADIALOG_FIELD_H 00024 #define AP_COCOADIALOG_FIELD_H 00025 00026 #include "ap_Dialog_Field.h" 00027 00028 #import "xap_Cocoa_NSTableUtils.h" 00029 00030 class XAP_CocoaFrame; 00031 @class AP_CocoaDialog_FieldController; 00032 @protocol XAP_CocoaDialogProtocol; 00033 00034 /*****************************************************************/ 00035 00036 class AP_CocoaDialog_Field: public AP_Dialog_Field 00037 { 00038 public: 00039 AP_CocoaDialog_Field(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00040 00041 static XAP_Dialog * static_constructor(XAP_DialogFactory *pFactory , XAP_Dialog_Id dlgid); 00042 virtual ~AP_CocoaDialog_Field(void); 00043 00044 virtual void runModal(XAP_Frame * pFrame); 00045 00046 void event_OK(void); 00047 void event_Cancel(void); 00048 void types_changed(int row); 00049 void setTypesList(void); 00050 void setFieldsList(void); 00051 00052 private: 00053 void _populateCategories(void); 00054 XAP_StringListDataSource *m_typeList; 00055 XAP_StringListDataSource *m_fieldList; 00056 AP_CocoaDialog_FieldController* m_dlg; 00057 }; 00058 00059 00060 00061 @interface AP_CocoaDialog_FieldController 00062 : NSWindowController <XAP_CocoaDialogProtocol, NSTableViewDelegate> 00063 { 00064 IBOutlet NSButton *_cancelBtn; 00065 IBOutlet NSTextField *_extraParamData; 00066 IBOutlet NSTextField *_extraParamLabel; 00067 IBOutlet NSTextField *_fieldsLabel; 00068 IBOutlet NSTableView *_fieldsList; 00069 IBOutlet NSButton *_okBtn; 00070 IBOutlet NSTextField *_typesLabel; 00071 IBOutlet NSTableView *_typesList; 00072 AP_CocoaDialog_Field *_xap; 00073 } 00074 - (int)selectedType; 00075 - (int)selectedField; 00076 - (NSString*)extraParam; 00077 - (void)setTypeList:(XAP_StringListDataSource*)tl andFieldList:(XAP_StringListDataSource*)fl; 00078 - (void)typesAction:(id)sender; 00079 - (IBAction)cancelAction:(id)sender; 00080 - (IBAction)okAction:(id)sender; 00081 00082 /* NSTableView delegate methods 00083 */ 00084 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; 00085 @end 00086 00087 #endif /* AP_COCOADIALOG_FIELD_H */ 00088 00089 00090 00091 00092 00093