00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef AP_UNIXDIALOG_PARAGRAPH_H 00021 #define AP_UNIXDIALOG_PARAGRAPH_H 00022 00023 #include "ap_Dialog_Paragraph.h" 00024 00025 class XAP_UnixFrame; 00026 class GR_CairoGraphics; 00027 00028 /*****************************************************************/ 00029 00030 class AP_UnixDialog_Paragraph: public AP_Dialog_Paragraph 00031 { 00032 public: 00033 AP_UnixDialog_Paragraph(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00034 virtual ~AP_UnixDialog_Paragraph(void); 00035 00036 virtual void runModal(XAP_Frame * pFrame); 00037 00038 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00039 00040 // callbacks can fire these events 00041 virtual void event_OK(void); 00042 virtual void event_Cancel(void); 00043 virtual void event_Tabs(void); 00044 00045 // all data controls are of three types in this dialog; the static 00046 // functions pass in widget pointers which are mapped into 00047 // base class "tControl" IDs for data operations. 00048 00049 // menus take a "changed" event 00050 virtual void event_MenuChanged(GtkWidget * widget); 00051 virtual void event_ComboBoxChanged(GtkWidget * widget); 00052 00053 // spin buttons can take "increment", "decrement", and "changed" 00054 virtual void event_SpinIncrement(GtkWidget * widget); 00055 virtual void event_SpinDecrement(GtkWidget * widget); 00056 virtual void event_SpinFocusOut(GtkWidget * widget); 00057 virtual void event_SpinChanged(GtkWidget * widget); 00058 00059 // checks are just "toggled" 00060 virtual void event_CheckToggled(GtkWidget * widget); 00061 00062 // Preview 00063 virtual void event_PreviewAreaExposed(void); 00064 00065 protected: 00066 00067 // Gtk sets up escape key to close a GtkDialog only when 00068 // the one of the button responses is GTK_RESPONSE_CANCEL 00069 enum 00070 { 00071 BUTTON_OK = GTK_RESPONSE_OK, 00072 BUTTON_CANCEL = GTK_RESPONSE_CANCEL, 00073 BUTTON_TABS = 0 00074 } ResponseId; 00075 00076 GR_CairoGraphics * m_unixGraphics; 00077 bool m_bEditChanged; 00078 00079 // private construction functions 00080 virtual GtkWidget * _constructWindow(void); 00081 GtkWidget * _constructWindowContents(GtkWidget *); 00082 void _connectCallbackSignals(void); 00083 00084 void _populateWindowData(void); 00085 00086 virtual void _syncControls(tControl changed, bool bAll = false); 00087 00088 // pointers to widgets we need to query/set 00089 // there are a ton of them in this dialog 00090 00091 GtkWidget * m_windowMain; 00092 GtkWidget * m_windowContents; 00093 00094 GtkWidget * m_listAlignment; 00095 00096 GtkWidget * m_spinbuttonLeft; 00097 GtkWidget * m_spinbuttonRight; 00098 GtkWidget * m_spinbuttonBy; 00099 00100 GtkWidget * m_listSpecial; 00101 00102 GtkWidget * m_spinbuttonBefore; 00103 GtkWidget * m_spinbuttonAfter; 00104 GtkWidget * m_spinbuttonAt; 00105 00106 GtkWidget * m_listLineSpacing; 00107 00108 GtkWidget * m_drawingareaPreview; 00109 00110 GtkWidget * m_checkbuttonWidowOrphan; 00111 GtkWidget * m_checkbuttonKeepLines; 00112 GtkWidget * m_checkbuttonPageBreak; 00113 GtkWidget * m_checkbuttonSuppress; 00114 GtkWidget * m_checkbuttonHyphenate; 00115 GtkWidget * m_checkbuttonKeepNext; 00116 00117 GtkWidget * m_buttonOK; 00118 GtkWidget * m_buttonCancel; 00119 GtkWidget * m_buttonTabs; 00120 00121 GtkWidget * m_checkbuttonDomDirection; 00122 }; 00123 00124 #endif /* XAP_UNIXDIALOG_PARAGRAPH_H */