1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2 
3 /* AbiSource Application Framework
4  * Copyright (C) 1998 AbiSource, Inc.
5  * Copyright (C) 2001, 2003, 2009 Hubert Figuiere
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301 USA.
21  */
22 
23 #ifndef XAP_COCOADIALOG_ZOOM_H
24 #define XAP_COCOADIALOG_ZOOM_H
25 
26 #import <Cocoa/Cocoa.h>
27 
28 #include "xap_Dlg_Zoom.h"
29 
30 class XAP_CocoaFrame;
31 class XAP_CocoaDialog_Zoom;
32 
33 @interface XAP_CocoaDlg_ZoomController : NSWindowController <XAP_CocoaDialogProtocol>
34 {
35     IBOutlet NSButtonCell *_pageWidthBtn;
36     IBOutlet NSButtonCell *_percentBtn;
37     IBOutlet NSTextField *_percentField;
38 	IBOutlet NSStepper *_percentStepper;
39     IBOutlet NSButtonCell *_wholePageBtn;
40     IBOutlet NSButtonCell *_zoom100Btn;
41     IBOutlet NSButtonCell *_zoom200Btn;
42     IBOutlet NSButtonCell *_zoom75Btn;
43     IBOutlet NSBox *_zoomBox;
44 	IBOutlet NSMatrix	*_zoomMatrix;
45 	IBOutlet NSButton *_closeBtn;
46 	XAP_CocoaDialog_Zoom*	_xap;
47 }
48 - (IBAction)closeAction:(id)sender;
49 - (IBAction)stepperAction:(id)sender;
50 - (IBAction)zoom100Action:(id)sender;
51 - (IBAction)zoom200Action:(id)sender;
52 - (IBAction)zoom75Action:(id)sender;
53 - (IBAction)zoomPageWidthAction:(id)sender;
54 - (IBAction)zoomWholePageAction:(id)sender;
55 - (IBAction)zoomPercentAction:(id)sender;
56 - (IBAction)zoomChangedAction:(id)sender;
57 
58 - (NSMatrix*)zoomMatrix;
59 - (int)percentValue;
60 - (void)setPercentValue:(int)value;
61 - (void)_enablePercentSpin:(BOOL)enable;
62 @end
63 
64 /*****************************************************************/
65 
66 class XAP_CocoaDialog_Zoom: public XAP_Dialog_Zoom
67 {
68 public:
69 	XAP_CocoaDialog_Zoom(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid);
70 	virtual ~XAP_CocoaDialog_Zoom(void);
71 
72 	virtual void			runModal(XAP_Frame * pFrame);
73 
74 	static XAP_Dialog *		static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid);
75 
76 	virtual void			event_Close(void);
77 
78 	virtual void			event_Radio200Clicked(void);
79 	virtual void			event_Radio100Clicked(void);
80 	virtual void			event_Radio75Clicked(void);
81 	virtual void			event_RadioPageWidthClicked(void);
82 	virtual void			event_RadioWholePageClicked(void);
83 
84 	virtual void			event_RadioPercentClicked(void);
85 	virtual void			event_SpinPercentChanged(void);
86 private:
87 	void		_populateWindowData(void);
88 	void 		_storeWindowData(void);
89 	XAP_CocoaDlg_ZoomController*	m_dlg;
90 };
91 
92 #endif /* XAP_COCOADIALOG_ZOOM_H */
93