00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * Copyright (c) 2010 Maleesh Prasan 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_BORDER_SHADING_H 00021 #define AP_UNIXDIALOG_BORDER_SHADING_H 00022 00023 #include "ap_Dialog_Border_Shading.h" 00024 00025 00026 class XAP_UnixFrame; 00027 class GR_UnixCairoGraphics; 00028 00029 /*****************************************************************/ 00030 00031 class AP_UnixDialog_Border_Shading: public AP_Dialog_Border_Shading 00032 { 00033 public: 00034 AP_UnixDialog_Border_Shading(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00035 virtual ~AP_UnixDialog_Border_Shading(void); 00036 00037 virtual void runModeless(XAP_Frame * pFrame); 00038 00039 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00040 00041 // callbacks can fire these events 00042 virtual void event_Close(void); 00043 void event_previewExposed(void); 00044 void event_BorderThicknessChanged(void); 00045 void event_BorderStyleChanged(void); 00046 void event_ShadingOffsetChanged(void); 00047 void event_shadingPatternChange(void); 00048 00049 virtual void setBorderThicknessInGUI(const std::string & sThick); 00050 virtual void setBorderColorInGUI(const UT_RGBColor & clr); 00051 virtual void setBorderStyleInGUI(const std::string & sStyle); 00052 virtual void setShadingColorInGUI(const UT_RGBColor & clr); 00053 virtual void setShadingPatternInGUI(const std::string & sPattern); 00054 virtual void setShadingOffsetInGUI(const std::string & sOffset); 00055 00056 virtual void setSensitivity(bool bsens); 00057 virtual void destroy(void); 00058 virtual void activate(void); 00059 virtual void notifyActiveFrame(XAP_Frame * pFrame); 00060 const GtkWidget * getWindow (void) const { return m_windowMain; } 00061 00062 protected: 00063 typedef enum 00064 { 00065 BUTTON_APPLY = GTK_RESPONSE_APPLY, 00066 BUTTON_CLOSE = GTK_RESPONSE_CLOSE 00067 } ResponseId ; 00068 00069 virtual GtkWidget * _constructWindow(void); 00070 void _populateWindowData(void); 00071 void _connectSignals(void); 00072 void _setShadingEnable(bool enable); 00073 GR_UnixCairoGraphics * m_pPreviewWidget; 00074 00075 // pointers to widgets we need to query/set 00076 GtkWidget * m_windowMain; 00077 GtkWidget * m_wApplyButton; 00078 GtkWidget * m_wCloseButton; 00079 00080 GtkWidget * m_wBorderColorButton; 00081 GtkWidget * m_wShadingColorLabel; 00082 GtkWidget * m_wShadingColorButton; 00083 GtkWidget * m_wLineLeft; 00084 GtkWidget * m_wLineRight; 00085 GtkWidget * m_wLineTop; 00086 GtkWidget * m_wLineBottom; 00087 00088 GtkWidget * m_wPreviewArea; 00089 GtkWidget * m_wBorderThickness; 00090 GtkWidget * m_wBorderStyle; 00091 GtkWidget * m_wShadingOffsetLabel; 00092 GtkWidget * m_wShadingOffset; 00093 GtkWidget * m_wShadingEnable; 00094 00095 guint m_iBorderThicknessConnect; 00096 guint m_iBorderStyleConnect; 00097 guint m_iShadingOffsetConnect; 00098 guint m_iShadingEnableConnect; 00099 guint m_iLineLeftConnect; 00100 guint m_iLineRightConnect; 00101 guint m_iLineTopConnect; 00102 guint m_iLineBotConnect; 00103 }; 00104 00105 #endif /* AP_UNIXDIALOG_BORDER_SHADING_H */