00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * Copyright (C) 2003 Marc Maurer 00004 * Copyright (C) 2003-2004 Hubert Figuiere 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301 USA. 00019 */ 00020 00021 #ifndef AP_COCOADIALOG_FORMATTABLE_H 00022 #define AP_COCOADIALOG_FORMATTABLE_H 00023 00024 #import <Cocoa/Cocoa.h> 00025 00026 #include "ap_Dialog_FormatTable.h" 00027 00028 class GR_CocoaCairoGraphics; 00029 class XAP_CocoaFrame; 00030 @class AP_CocoaDialog_FormatTableController; 00031 00032 /*****************************************************************/ 00033 00034 class AP_CocoaDialog_FormatTable: public AP_Dialog_FormatTable 00035 { 00036 public: 00037 AP_CocoaDialog_FormatTable(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); 00038 virtual ~AP_CocoaDialog_FormatTable(void); 00039 00040 virtual void runModeless(XAP_Frame * pFrame); 00041 00042 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); 00043 00044 // callbacks can fire these events 00045 virtual void event_Close(void); 00046 void event_ApplyToChanged(void); 00047 void event_previewExposed(void); 00048 void event_BorderThicknessChanged(NSPopUpButton *ctrl); 00049 virtual void setSensitivity(bool bSens); 00050 virtual void setBackgroundColorInGUI(UT_RGBColor clr); 00051 virtual void setBorderThicknessInGUI(UT_UTF8String & sThick); 00052 virtual void destroy(void); 00053 virtual void activate(void); 00054 virtual void notifyActiveFrame(XAP_Frame * pFrame); 00055 char * getWindowName() 00056 { return m_WindowName; }; 00057 protected: 00058 void _populateWindowData(void); 00059 void _storeWindowData(void); 00060 00061 GR_CocoaCairoGraphics * m_pPreviewWidget; 00062 private: 00063 AP_CocoaDialog_FormatTableController* m_dlg; 00064 }; 00065 00066 00067 @interface AP_CocoaDialog_FormatTableController : NSWindowController <XAP_CocoaDialogProtocol> 00068 { 00069 @public 00070 IBOutlet NSButton *_applyBtn; 00071 IBOutlet NSBox *_bgBox; 00072 IBOutlet NSBox *_imageBgBox; 00073 IBOutlet NSTextField *_bgColorLabel; 00074 IBOutlet NSColorWell *_bgColorWell; 00075 IBOutlet NSBox *_borderBox; 00076 IBOutlet NSTextField *_borderColorLabel; 00077 IBOutlet NSColorWell *_borderColorWell; 00078 IBOutlet NSTextField *_applyToLabel; 00079 IBOutlet NSPopUpButton *_applyToPopup; 00080 IBOutlet NSButton *_bottomBorderBtn; 00081 IBOutlet NSButton *_leftBorderBtn; 00082 IBOutlet XAP_CocoaNSView *_preview; 00083 IBOutlet NSBox *_previewBox; 00084 IBOutlet NSButton *_rightBorderBtn; 00085 IBOutlet NSButton *_topBorderBtn; 00086 IBOutlet NSButton *_setImageBtn; 00087 IBOutlet NSButton *_noImageBtn; 00088 IBOutlet NSTextField *_thicknessLabel; 00089 IBOutlet NSPopUpButton *_thicknessPopup; 00090 AP_CocoaDialog_FormatTable* _xap; 00091 } 00092 - (IBAction)applyAction:(id)sender; 00093 - (IBAction)bgColorAction:(id)sender; 00094 - (IBAction)borderColorAction:(id)sender; 00095 - (IBAction)bottomBorderAction:(id)sender; 00096 - (IBAction)leftBorderAction:(id)sender; 00097 - (IBAction)removeImageAction:(id)sender; 00098 - (IBAction)rightBorderAction:(id)sender; 00099 - (IBAction)selectImageAction:(id)sender; 00100 - (IBAction)topBorderAction:(id)sender; 00101 - (IBAction)applyToAction:(id)sender; 00102 - (IBAction)borderThicknessAction:(id)sender; 00103 00104 - (XAP_CocoaNSView*)preview; 00105 - (void)setSensitivity:(bool)bSens; 00106 - (int)applyItemTag; 00107 @end 00108 00109 #endif /* AP_COCOADIALOG_FORMATTABLE_H */