Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AP_DIALOG_FORMATTABLE_H
00022 #define AP_DIALOG_FORMATTABLE_H
00023
00024 #include "ut_types.h"
00025 #include "ut_misc.h"
00026 #include "ut_PropVector.h"
00027 #include "xap_Frame.h"
00028 #include "xap_Dialog.h"
00029 #include "xav_View.h"
00030 #include "pt_Types.h"
00031 #include "xap_Preview.h"
00032 #include "fv_View.h"
00033 #include "ie_imp.h"
00034 #include "ie_impGraphic.h"
00035 #include "ie_exp.h"
00036 #include "ie_types.h"
00037 #include "fg_Graphic.h"
00038 #include "xap_Dlg_FileOpenSaveAs.h"
00039 #define FORMAT_TABLE_NUMTHICKNESS 9
00040
00041 class UT_Timer;
00042 class XAP_Frame;
00043 class fp_TableContainer;
00044 class AP_Dialog_FormatTable;
00045
00046 class ABI_EXPORT AP_FormatTable_preview_drawer
00047 {
00048 public:
00049
00050 void draw(GR_Graphics *gc, UT_Rect &rect);
00051 };
00052
00053 class ABI_EXPORT AP_FormatTable_preview : public XAP_Preview
00054 {
00055 public:
00056
00057 AP_FormatTable_preview(GR_Graphics * gc, AP_Dialog_FormatTable * pFormatTable);
00058 virtual ~AP_FormatTable_preview(void);
00059
00060
00061 void draw(const UT_Rect *clip=NULL);
00062 GR_Graphics * getGraphics(void) const { return m_gc;}
00063
00064
00065
00066
00067
00068
00069 private:
00070 AP_FormatTable_preview_drawer m_previewDrawer;
00071 AP_Dialog_FormatTable * m_pFormatTable;
00072 protected:
00073
00074 };
00075
00076 class ABI_EXPORT AP_Dialog_FormatTable : public XAP_Dialog_Modeless
00077 {
00078 public:
00079 AP_Dialog_FormatTable(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00080 virtual ~AP_Dialog_FormatTable(void);
00081
00082 virtual void runModeless(XAP_Frame * pFrame) = 0;
00083
00084 typedef enum { a_OK, a_CLOSE } tAnswer;
00085 typedef enum { toggle_left, toggle_right, toggle_top, toggle_bottom } toggle_button;
00086
00087 AP_Dialog_FormatTable::tAnswer getAnswer(void) const;
00088 virtual void startUpdater(void);
00089 virtual void stopUpdater(void);
00090 static void autoUpdateMC(UT_Worker * pTimer);
00091
00092 virtual void setSensitivity(bool bSens) = 0;
00093 virtual void setActiveFrame(XAP_Frame *pFrame);
00094 void ConstructWindowName(void);
00095 void event_update(void);
00096 void finalize(void);
00097
00098 void setAllSensitivities(void);
00099 void setCurCellProps(void);
00100 void setApplyFormatTo(FormatTable applyTo);
00101 void applyChanges(void);
00102 void toggleLineType(toggle_button btn, bool enabled);
00103 void setBorderColor(UT_RGBColor clr);
00104 void setBackgroundColor(UT_RGBColor clr);
00105 virtual void setBackgroundColorInGUI(UT_RGBColor clr) = 0;
00106 void setBorderThickness(UT_UTF8String & sThick);
00107 virtual void setBorderThicknessInGUI(UT_UTF8String & sThick) = 0;
00108 void clearImage(void);
00109 void askForGraphicPathName(void);
00110 void ShowErrorBox(UT_String & sFile, UT_Error errorCode);
00111 void _createPreviewFromGC(GR_Graphics * gc,
00112 UT_uint32 width,
00113 UT_uint32 height);
00114 UT_PropVector & getPropVector() { return m_vecProps; }
00115
00116
00117 bool getTopToggled();
00118 bool getBottomToggled();
00119 bool getRightToggled();
00120 bool getLeftToggled();
00121 GR_Image * getImage(void) { return m_pImage;}
00122 FG_Graphic * getGraphic(void) { return m_pGraphic;}
00123
00124 UT_RGBColor m_borderColor;
00125 UT_sint32 m_lineStyle;
00126 gchar * m_bgFillStyle;
00127 UT_PropVector m_vecProps;
00128 UT_UTF8String m_sBorderThickness;
00129 protected:
00130 guint _findClosestThickness(const char *) const;
00131 AP_Dialog_FormatTable::tAnswer m_answer;
00132 char m_WindowName[100];
00133 AP_FormatTable_preview *m_pFormatTablePreview;
00134 AP_FormatTable_preview_drawer m_previewDrawer;
00135 double m_dThickness[FORMAT_TABLE_NUMTHICKNESS];
00136
00137 private:
00138 bool _getToggleButtonStatus(const char * lineStyle);
00139
00140 bool m_bSettingsChanged;
00141
00142 UT_PropVector m_vecPropsAdjRight;
00143 UT_PropVector m_vecPropsAdjBottom;
00144
00145 UT_Timer * m_pAutoUpdaterMC;
00146
00147 bool m_borderToggled;
00148
00149 FormatTable m_ApplyTo;
00150
00151
00152 bool m_bDestroy_says_stopupdating;
00153 bool m_bAutoUpdate_happening_now;
00154
00155 PT_DocPosition m_iOldPos;
00156 UT_String m_sImagePath;
00157 IEGraphicFileType m_iGraphicType;
00158 GR_Image * m_pImage;
00159 FG_Graphic * m_pGraphic;
00160 };
00161
00162 #endif