00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 2001 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_PageSetup_H 00024 #define AP_CocoaDialog_PageSetup_H 00025 00026 #import <Cocoa/Cocoa.h> 00027 #include "ap_Dialog_PageSetup.h" 00028 00029 class XAP_Frame; 00030 class AP_CocoaDialog_PageSetup; 00031 00032 00033 @interface AP_CocoaDialog_PageSetup_Controller : NSObject 00034 { 00035 IBOutlet NSTextField *_adjustData; 00036 IBOutlet NSTextField *_adjustLabel; 00037 IBOutlet NSStepper *_adjustStepper; 00038 IBOutlet NSTextField *_bottomMargin; 00039 IBOutlet NSTextField *_footerMargin; 00040 IBOutlet NSTextField *_headerMargin; 00041 IBOutlet NSImageView *_icon; 00042 IBOutlet NSTextField *_leftMargin; 00043 IBOutlet NSBox *_marginBox; 00044 IBOutlet NSTextField *_percentLabel; 00045 IBOutlet NSTextField *_rightMargin; 00046 IBOutlet NSBox *_scaleBox; 00047 IBOutlet NSTextField *_topMargin; 00048 IBOutlet NSTextField *_unitLabel; 00049 IBOutlet NSPopUpButton *_unitPopup; 00050 IBOutlet NSView *_view; 00051 AP_CocoaDialog_PageSetup* _xap; 00052 UT_Dimension _last_margin_unit; 00053 } 00054 - (void)setXAPOwner:(AP_CocoaDialog_PageSetup*)owner; 00055 - (NSView*)view; 00056 - (void)fetchData; 00057 00058 - (IBAction)adjustAction:(id)sender; 00059 - (IBAction)adjustStepperAction:(id)sender; 00060 - (IBAction)unitAction:(id)sender; 00061 @end 00062 00063 00064 class AP_CocoaDialog_PageSetup : public AP_Dialog_PageSetup 00065 { 00066 public: 00067 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00068 00069 AP_CocoaDialog_PageSetup(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00070 00071 virtual ~AP_CocoaDialog_PageSetup(); 00072 00073 virtual void runModal(XAP_Frame *pFrame); 00074 00075 private: 00076 bool _validate(AP_CocoaDialog_PageSetup_Controller* ctrl, NSPrintInfo * printInfo); 00077 00078 AP_CocoaDialog_PageSetup_Controller * m_ctrl; 00079 XAP_Frame * m_pFrame; 00080 }; 00081 00082 #endif // AP_CocoaDialog_PageSetup_H