00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 2000 AbiSource, Inc. 00005 * Copyright (C) 2001, 2003 Hubert Figuiere 00006 * Copyright (C) 2005 Francis 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 AP_COCOADIALOG_NEW_H 00025 #define AP_COCOADIALOG_NEW_H 00026 00027 #include <Cocoa/Cocoa.h> 00028 #include "ap_Dialog_New.h" 00029 #import "xap_Cocoa_NSTableUtils.h" 00030 00031 class XAP_CocoaFrame; 00032 class AP_CocoaDialog_New; 00033 00034 @interface AP_CocoaDialog_NewController : NSWindowController <XAP_CocoaDialogProtocol> 00035 { 00036 IBOutlet NSButton * _cancelBtn; 00037 IBOutlet NSButton * _chooseFileBtn; 00038 IBOutlet NSButton * _createNewBtn; 00039 IBOutlet NSButton * _okBtn; 00040 IBOutlet NSButton * _openBtn; 00041 00042 IBOutlet NSTextField * _documentNameData; 00043 00044 IBOutlet NSTableView * _templateList; 00045 00046 AP_CocoaDialog_New * _xap; 00047 00048 XAP_StringListDataSource * _dataSource; 00049 00050 NSMutableArray * m_templates; 00051 } 00052 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; 00053 - (IBAction)cancelAction:(id)sender; 00054 - (IBAction)radioButtonAction:(id)sender; 00055 - (IBAction)chooseAction:(id)sender; 00056 - (IBAction)okAction:(id)sender; 00057 - (void)synchronizeGUI:(NSControl*)control; 00058 - (BOOL)existingBtnState; 00059 - (void)setExistingBtnState:(BOOL)state; 00060 - (NSString *)newBtnState; 00061 - (void)setFileName:(NSString*)name; 00062 @end 00063 00064 /*****************************************************************/ 00065 00066 class AP_CocoaDialog_New: public AP_Dialog_New 00067 { 00068 public: 00069 AP_CocoaDialog_New(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00070 virtual ~AP_CocoaDialog_New(void); 00071 00072 virtual void runModal(XAP_Frame * pFrame); 00073 00074 static XAP_Dialog * static_constructor(XAP_DialogFactory *, 00075 XAP_Dialog_Id dlgid); 00076 00077 void event_Ok (); 00078 void event_Cancel (); 00079 void event_ToggleUseTemplate (const char * name); 00080 void event_ToggleOpenExisting (); 00081 void event_ToggleStartNew (); 00082 00083 private: 00084 XAP_Frame * m_pFrame; 00085 AP_CocoaDialog_NewController* m_dlg; 00086 }; 00087 00088 #endif /* AP_COCOADIALOG_NEW_H */
1.7.1