00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 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_INSERTTABLE_H 00024 #define AP_COCOADIALOG_INSERTTABLE_H 00025 00026 #import <Cocoa/Cocoa.h> 00027 00028 #include "ap_Dialog_InsertTable.h" 00029 00030 class XAP_CocoaFrame; 00031 @class AP_CocoaDialog_InsertTableController; 00032 00033 /*****************************************************************/ 00034 00035 class AP_CocoaDialog_InsertTable: public AP_Dialog_InsertTable 00036 { 00037 public: 00038 AP_CocoaDialog_InsertTable(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00039 virtual ~AP_CocoaDialog_InsertTable(void); 00040 00041 virtual void runModal(XAP_Frame * pFrame); 00042 00043 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00044 00045 void event_OK(); 00046 void event_Cancel(); 00047 protected: 00048 void _populateWindowData(void); 00049 void _storeWindowData(void); 00050 AP_Dialog_InsertTable::columnType _getActiveRadioItem(void); 00051 private: 00052 AP_CocoaDialog_InsertTableController* m_dlg; 00053 }; 00054 00055 00056 00057 @interface AP_CocoaDialog_InsertTableController : NSWindowController <XAP_CocoaDialogProtocol> 00058 { 00059 IBOutlet NSButtonCell *_autoColBtn; 00060 IBOutlet NSBox *_autofitBox; 00061 IBOutlet NSButton *_cancelBtn; 00062 IBOutlet NSButtonCell *_fixedColSizeBtn; 00063 IBOutlet NSTextField *_fixedColSizeData; 00064 IBOutlet NSStepper *_fixedColSizeStepper; 00065 IBOutlet NSTextField *_numOfColData; 00066 IBOutlet NSTextField *_numOfColLabel; 00067 IBOutlet NSStepper *_numOfColStepper; 00068 IBOutlet NSMatrix *_radioMatrix; 00069 IBOutlet NSTextField *_numOfRowData; 00070 IBOutlet NSTextField *_numOfRowLabel; 00071 IBOutlet NSStepper *_numOfRowStepper; 00072 IBOutlet NSButton *_okBtn; 00073 IBOutlet NSBox *_tableSizeBox; 00074 IBOutlet NSTextField *_unitLabel; 00075 AP_CocoaDialog_InsertTable *_xap; 00076 } 00077 - (IBAction)cancelAction:(id)sender; 00078 - (IBAction)colSizeAction:(id)sender; 00079 - (IBAction)fixedColSizeAction:(id)sender; 00080 - (IBAction)fixedColSizeStepperAction:(id)sender; 00081 - (IBAction)numColAction:(id)sender; 00082 - (IBAction)numColStepperAction:(id)sender; 00083 - (IBAction)numRowAction:(id)sender; 00084 - (IBAction)numRowStepperAction:(id)sender; 00085 - (IBAction)okAction:(id)sender; 00086 00087 - (int)numRows; 00088 - (int)numCols; 00089 - (float)colWidth; 00090 - (AP_Dialog_InsertTable::columnType)autoSizeType; 00091 @end 00092 00093 00094 #endif /* AP_COCOADIALOG_INSERTTABLE_H */