/* AbiWord * Copyright (C) 1998 AbiSource, Inc. * Copyright (C) 2001, 2003 Hubert Figuiere * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #ifndef AP_COCOADIALOG_LISTS_H #define AP_COCOADIALOG_LISTS_H #import #include "ap_Dialog_Lists.h" #include "ut_timer.h" #include "gr_CocoaGraphics.h" #include "xap_CocoaDialog_Utilities.h" class XAP_CocoaFrame; class AP_CocoaDialog_Lists; @interface AP_CocoaDialog_ListsController : NSWindowController { @public IBOutlet NSButton *_applyBtn; IBOutlet NSCell *_applyToCurrentBtn; IBOutlet NSCell *_attachToPreviousBtn; IBOutlet NSButton *_cancelBtn; IBOutlet NSTextField *_fontLabel; IBOutlet NSPopUpButton *_fontPopup; IBOutlet NSTextField *_formatData; IBOutlet NSTextField *_formatLabel; IBOutlet NSTextField *_labelAlignData; IBOutlet NSTextField *_labelAlignLabel; IBOutlet NSStepper *_labelAlignStepper; IBOutlet NSTextField *_levelDelimData; IBOutlet NSTextField *_levelDelimLabel; IBOutlet NSMatrix *_listActionMatrix; IBOutlet XAP_CocoaNSView *_preview; IBOutlet NSBox *_previewBox; IBOutlet NSButton *_setDefaultBtn; IBOutlet NSTextField *_startAtData; IBOutlet NSTextField *_startAtLabel; IBOutlet NSStepper *_startAtStepper; IBOutlet NSCell *_startNewListBtn; IBOutlet NSTextField *_styleLabel; IBOutlet NSPopUpButton *_stylePopup; IBOutlet NSTextField *_textAlignData; IBOutlet NSTextField *_textAlignLabel; IBOutlet NSStepper *_textAlignStepper; IBOutlet NSTextField *_typeLabel; IBOutlet NSPopUpButton *_typePopup; IBOutlet NSMenu* m_listStyleNone_menu; IBOutlet NSMenu* m_listStyleNumbered_menu; IBOutlet NSMenu* m_listStyleBulleted_menu; AP_CocoaDialog_Lists *_xap; } - (id)initFromNib; - (void)setXAPOwner:(XAP_Dialog *)owner; - (void)discardXAP; - (void)windowDidLoad; - (void)windowDidBecomeKey:(NSNotification *)aNotification; - (XAP_CocoaNSView*)preview; - (NSMenuItem*)selectedListStyle; - (NSMenuItem*)selectedListType; - (void)setStyleMenu:(int)type; - (int)listAction; - (IBAction)applyAction:(id)sender; - (IBAction)cancelAction:(id)sender; - (IBAction)labelAlignAction:(id)sender; - (IBAction)labelAlignActionStepper:(id)sender; - (IBAction)setDefaultAction:(id)sender; - (IBAction)startAtAction:(id)sender; - (IBAction)startAtStepperAction:(id)sender; - (IBAction)styleChangedAction:(id)sender; - (IBAction)textAlignAction:(id)sender; - (IBAction)textAlignActionStepper:(id)sender; - (IBAction)typeChangedAction:(id)sender; - (IBAction)valueChangedAction:(id)sender; @end /*****************************************************************/ class AP_CocoaDialog_Lists: public AP_Dialog_Lists { public: AP_CocoaDialog_Lists(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); virtual ~AP_CocoaDialog_Lists(void); static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); virtual void runModeless(XAP_Frame * pFrame); virtual void destroy(void); virtual void activate(void); virtual void notifyActiveFrame(XAP_Frame *pFrame); virtual void runModal(XAP_Frame * pFrame); /* CALLBACKS */ void customChanged(void); void applyClicked(void); void styleChanged(int style); void previewExposed(void); /* Just Plain Useful Functions */ void setListTypeFromWidget(void); void setXPFromLocal(void); void loadXPDataIntoLocal(void); void updateFromDocument(void); void setAllSensitivity(void); void updateDialog(void); bool dontUpdate(void); static void autoupdateLists(UT_Worker * pTimer); void _fillNumberedStyleMenu(NSMenu *listmenu); void _fillBulletedStyleMenu(NSMenu *listmenu); void _fillNoneStyleMenu(NSMenu *listmenu); void _fillFontMenu(NSPopUpButton* menu); protected: #if 0 void _connectSignals(void); #endif void _setRadioButtonLabels(void); void _gatherData(void); private: // GList * m_glFonts; GR_CocoaGraphics * m_pPreviewWidget; UT_Timer * m_pAutoUpdateLists; bool m_bDontUpdate; bool m_bDestroy_says_stopupdating; bool m_bAutoUpdate_happening_now; #if 0 bool m_bManualListStyle; bool m_bisCustomFrameHidden; GtkWidget * m_wMainWindow; GtkWidget * m_wApply; GtkWidget * m_wClose; GtkWidget * m_wContents; GtkWidget * m_wStartNewList; GtkWidget * m_wApplyCurrent; GtkWidget * m_wStartSubList; GSList * m_wRadioGroup; GtkWidget * m_wPreviewArea; GtkWidget * m_wDelimEntry; GtkWidget * m_wDecimalEntry; GtkObject * m_oAlignList_adj; GtkWidget * m_wAlignListSpin; GtkObject * m_oIndentAlign_adj; GtkWidget * m_wIndentAlignSpin; GtkObject * m_oLevelSpin_adj; GtkWidget * m_wFontOptions; GtkWidget * m_wFontOptions_menu; GtkWidget * m_wCustomFrame; GtkWidget * m_wCustomTable; GtkWidget * m_wCustomLabel; GtkWidget * m_wListStyleBox; GtkWidget * m_wListStyleNumbered_menu; GtkWidget * m_wListStyleBulleted_menu; GtkWidget * m_wListStyleNone_menu; GtkWidget * m_wListStyle_menu; GtkWidget * m_wListTypeBox; GtkWidget * m_wListType_menu; GtkObject * m_oStartSpin_adj; GtkWidget * m_wStartSpin; GtkWidget * m_wMenu_None; GtkWidget * m_wMenu_Bull; GtkWidget * m_wMenu_Num; GtkWidget * m_wStartSub_label; GtkWidget * m_wStartNew_label; gint m_iDelimEntryID; gint m_iDecimalEntryID; gint m_iStyleBoxID; gint m_iAlignListSpinID; gint m_iIndentAlignSpinID; gint m_iFontOptionsID; #endif AP_CocoaDialog_ListsController* m_dlg; }; #endif /* AP_COCOADIALOG_LISTS_H */