00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 2001, 2003, 2009 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_BREAK_H 00024 #define AP_COCOADIALOG_BREAK_H 00025 00026 #import <Cocoa/Cocoa.h> 00027 00028 #include "ap_Dialog_Break.h" 00029 #include "xap_CocoaDialog_Utilities.h" 00030 00031 class AP_CocoaDialog_Break; 00032 00033 @interface AP_CocoaDialog_BreakController : NSWindowController <XAP_CocoaDialogProtocol> 00034 { 00035 @public 00036 IBOutlet NSMatrix *m_insertRadioBtns; 00037 IBOutlet NSMatrix *m_sectionBreakBtns; 00038 IBOutlet NSBox *m_insertGrp; 00039 IBOutlet NSBox *m_sectionBrkGrp; 00040 IBOutlet NSButtonCell *m_pgBrkBtn; 00041 IBOutlet NSButtonCell *m_colBrkBtn; 00042 IBOutlet NSButtonCell *m_nxtPgBtn; 00043 IBOutlet NSButtonCell *m_evenPgBtn; 00044 IBOutlet NSButtonCell *m_continuousBtn; 00045 IBOutlet NSButtonCell *m_oddPgBtn; 00046 AP_CocoaDialog_Break * m_xap; // the app dialog owner 00047 } 00048 - (void)windowDidLoad; 00049 00050 - (IBAction)cancelAction:(id)sender; 00051 - (IBAction)okAction:(id)sender; 00052 - (IBAction)insertAction:(id)sender; 00053 @end 00054 00055 /*****************************************************************/ 00056 00057 class AP_CocoaDialog_Break: public AP_Dialog_Break 00058 { 00059 public: 00060 AP_CocoaDialog_Break(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00061 virtual ~AP_CocoaDialog_Break(void); 00062 00063 virtual void runModal(XAP_Frame * pFrame); 00064 00065 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00066 00067 void _setAnswer (AP_Dialog_Break::tAnswer answer) 00068 { m_answer = answer; } 00069 void _setBreakType(AP_Dialog_Break::breakType type) 00070 { m_breakType = type; } 00071 00072 private: 00073 void _populateWindowData(void); 00074 void _storeWindowData(void); 00075 00076 NSButtonCell * _findRadioByID(AP_Dialog_Break::breakType b); 00077 00078 AP_CocoaDialog_BreakController * m_dlg; 00079 AP_Dialog_Break::breakType m_breakType; 00080 }; 00081 00082 #endif /* AP_COCOADIALOG_BREAK_H */