• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ap_Dialog_FormatFrame.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiWord
00004  * Copyright (C) 1998 AbiSource, Inc.
00005  * Copyright (C) 2003 Marc Maurer
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 #ifndef AP_DIALOG_FORMATFRAME_H
00023 #define AP_DIALOG_FORMATFRAME_H
00024 
00025 #include <string>
00026 
00027 #include "ut_types.h"
00028 #include "ut_misc.h"
00029 #include "xap_Frame.h"
00030 #include "xap_Dialog.h"
00031 #include "xav_View.h"
00032 #include "pt_Types.h"
00033 #include "pp_Property.h"
00034 #include "xap_Preview.h"
00035 #include "fv_View.h"
00036 #include "ie_imp.h"
00037 #include "ie_impGraphic.h"
00038 #include "ie_exp.h"
00039 #include "ie_types.h"
00040 #include "fg_Graphic.h"
00041 #include "xap_Dlg_FileOpenSaveAs.h"
00042 #define FORMAT_FRAME_NUMTHICKNESS 9
00043 
00044 class UT_Timer;
00045 class XAP_Frame;
00046 class fp_TableContainer;
00047 class AP_Dialog_FormatFrame;
00048 
00049 class ABI_EXPORT AP_FormatFrame_preview_drawer
00050 {
00051 public:
00052 
00053     void            draw(GR_Graphics *gc, UT_Rect &rect);
00054 };
00055 
00056 class ABI_EXPORT AP_FormatFrame_preview : public XAP_Preview
00057 {
00058 public:
00059 
00060     AP_FormatFrame_preview(GR_Graphics * gc, AP_Dialog_FormatFrame * pFormatFrame);
00061     virtual ~AP_FormatFrame_preview(void);
00062 
00063     // data twiddlers
00064     void            draw(const UT_Rect *clip=NULL);
00065     GR_Graphics *   getGraphics(void) const { return m_gc;}
00066     /*void          set(UT_uint32 iColumns, bool bLines)
00067                     {
00068                         m_iColumns = iColumns;
00069                         m_bLineBetween = bLines;
00070                         draw();
00071                     }*/
00072 private:
00073     AP_Dialog_FormatFrame *  m_pFormatFrame;
00074 protected:
00075 
00076 };
00077 
00078 class ABI_EXPORT AP_Dialog_FormatFrame : public XAP_Dialog_Modeless
00079 {
00080 public:
00081     AP_Dialog_FormatFrame(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00082     virtual ~AP_Dialog_FormatFrame(void);
00083 
00084     virtual void                    runModeless(XAP_Frame * pFrame) = 0;
00085 
00086     typedef enum { a_OK, a_CLOSE } tAnswer;
00087     typedef enum { toggle_left, toggle_right, toggle_top, toggle_bottom } toggle_button;
00088 
00089     AP_Dialog_FormatFrame::tAnswer      getAnswer(void) const;
00090     virtual void                        startUpdater(void);
00091     virtual void                        stopUpdater(void);
00092     static void                         autoUpdateMC(UT_Worker * pTimer);
00093 
00094     virtual void                        setSensitivity(bool bSens) = 0;
00095     virtual void                        setActiveFrame(XAP_Frame *pFrame);
00096     void                                ConstructWindowName(void);
00097     void                                event_update(void);
00098     void                                finalize(void);
00099 
00100     void                                setWrapping(bool bWrap);
00101     bool                                getWrapping(void) const { return m_bSetWrapping; }
00102 
00103     void                                setAllSensitivities(void);
00104     void                                setCurFrameProps(void);
00105     void                                applyChanges(void);
00106     void                                toggleLineType(toggle_button btn, bool enabled);
00107     void                                clearImage(void);
00108     void                                askForGraphicPathName(void);
00109     void                                ShowErrorBox(const std::string & sFile,
00110                                                      UT_Error errorCode);
00111     void                                _createPreviewFromGC(GR_Graphics * gc,
00112                                                              UT_uint32 width,
00113                                                              UT_uint32 height);
00114     PP_PropertyVector &                 getPropVector() { return m_vecProps; }
00115 
00116     GR_Image *                          getImage(void) { return m_pImage;}
00117     const FG_ConstGraphicPtr &          getGraphic(void) const { return m_pGraphic;}
00118 
00119     UT_RGBColor                         m_borderColor;
00120     UT_sint32                           m_lineStyle;
00121 
00122     PP_PropertyVector                   m_vecProps;
00123 
00124     void                    setBGColor (const UT_RGBColor & clr);
00125 
00126     const UT_RGBColor &     backgroundColor () const { return m_backgroundColor; }
00127 
00128     void                    setBorderColor (UT_RGBColor clr);
00129 
00130     void                    setBorderColorAll (UT_RGBColor clr);
00131 
00132     void                    setBorderColorRight  (const UT_RGBColor & rgb);
00133     void                    setBorderColorLeft   (const UT_RGBColor & rgb);
00134     void                    setBorderColorTop    (const UT_RGBColor & rgb);
00135     void                    setBorderColorBottom (const UT_RGBColor & rgb);
00136 
00137     const UT_RGBColor &     borderColorRight ()  const { return m_borderColorRight;  }
00138     const UT_RGBColor &     borderColorLeft ()   const { return m_borderColorLeft;   }
00139     const UT_RGBColor &     borderColorTop ()    const { return m_borderColorTop;    }
00140     const UT_RGBColor &     borderColorBottom () const { return m_borderColorBottom; }
00141 
00142     void                    setBorderLineStyleRight  (UT_sint32 linestyle);
00143     void                    setBorderLineStyleLeft   (UT_sint32 linestyle);
00144     void                    setBorderLineStyleTop    (UT_sint32 linestyle);
00145     void                    setBorderLineStyleBottom (UT_sint32 linestyle);
00146 
00147     UT_sint32               borderLineStyleRight ()  const { return m_borderLineStyleRight;  }
00148     UT_sint32               borderLineStyleLeft ()   const { return m_borderLineStyleLeft;   }
00149     UT_sint32               borderLineStyleTop ()    const { return m_borderLineStyleTop;    }
00150     UT_sint32               borderLineStyleBottom () const { return m_borderLineStyleBottom; }
00151 
00152     bool                    getRightToggled ()  const { return (m_borderLineStyleRight  ? true : false); }
00153     bool                    getLeftToggled ()   const { return (m_borderLineStyleLeft   ? true : false); }
00154     bool                    getTopToggled ()    const { return (m_borderLineStyleTop    ? true : false); }
00155     bool                    getBottomToggled () const { return (m_borderLineStyleBottom ? true : false); }
00156 
00157     virtual void            setBorderThicknessInGUI (UT_UTF8String & sThick) = 0;
00158 
00159     void                    setBorderThickness (const UT_UTF8String & sThick);
00160 
00161     void                    setBorderThicknessAll (const UT_UTF8String & sThick);
00162 
00163     void                    setBorderThicknessRight  (const UT_UTF8String & sThick);
00164     void                    setBorderThicknessLeft   (const UT_UTF8String & sThick);
00165     void                    setBorderThicknessTop    (const UT_UTF8String & sThick);
00166     void                    setBorderThicknessBottom (const UT_UTF8String & sThick);
00167 
00168     const UT_UTF8String &   getBorderThicknessRight ()  const { return m_sBorderThicknessRight;  }
00169     const UT_UTF8String &   getBorderThicknessLeft ()   const { return m_sBorderThicknessLeft;   }
00170     const UT_UTF8String &   getBorderThicknessTop ()    const { return m_sBorderThicknessTop;    }
00171     const UT_UTF8String &   getBorderThicknessBottom () const { return m_sBorderThicknessBottom; }
00172 
00173     void                    setBorderThicknessAll (float thickness); // border line thickness in pt [0.01pt .. 99.99pt]
00174 
00175     void                    setBorderThicknessRight  (float thickness);
00176     void                    setBorderThicknessLeft   (float thickness);
00177     void                    setBorderThicknessTop    (float thickness);
00178     void                    setBorderThicknessBottom (float thickness);
00179 
00180     float                   borderThicknessRight ()  const { return m_borderThicknessRight;  }
00181     float                   borderThicknessLeft ()   const { return m_borderThicknessLeft;   }
00182     float                   borderThicknessTop ()    const { return m_borderThicknessTop;    }
00183     float                   borderThicknessBottom () const { return m_borderThicknessBottom; }
00184 
00185     void                    setPositionMode (FL_FrameFormatMode mode);
00186 
00187     FL_FrameFormatMode      positionMode () const { return m_iFramePositionTo; }
00188 
00189 protected:
00190     AP_Dialog_FormatFrame::tAnswer      m_answer;
00191     char                                m_WindowName[100];
00192     AP_FormatFrame_preview              *m_pFormatFramePreview;
00193     AP_FormatFrame_preview_drawer       m_previewDrawer;
00194 private:
00195     GR_Image * _makeImageForRaster(const std::string & name,
00196                                    GR_Graphics * pGraphics,
00197                                    const FG_ConstGraphicPtr & pG);
00198     bool                    _getToggleButtonStatus(const char * lineStyle);
00199 
00200     bool                    m_bSettingsChanged;
00201 
00202     UT_RGBColor             m_backgroundColor;
00203 
00204     UT_RGBColor             m_borderColorRight;
00205     UT_RGBColor             m_borderColorLeft;
00206     UT_RGBColor             m_borderColorTop;
00207     UT_RGBColor             m_borderColorBottom;
00208 
00209     UT_sint32               m_borderLineStyleRight;
00210     UT_sint32               m_borderLineStyleLeft;
00211     UT_sint32               m_borderLineStyleTop;
00212     UT_sint32               m_borderLineStyleBottom;
00213 
00214     float                   m_borderThicknessRight;
00215     float                   m_borderThicknessLeft;
00216     float                   m_borderThicknessTop;
00217     float                   m_borderThicknessBottom;
00218 
00219     UT_UTF8String           m_sBorderThickness;
00220 
00221     UT_UTF8String           m_sBorderThicknessRight;
00222     UT_UTF8String           m_sBorderThicknessLeft;
00223     UT_UTF8String           m_sBorderThicknessTop;
00224     UT_UTF8String           m_sBorderThicknessBottom;
00225 
00226     UT_Timer *                          m_pAutoUpdaterMC;
00227 
00228     // Handshake variables
00229     bool m_bDestroy_says_stopupdating;
00230     bool m_bAutoUpdate_happening_now;
00231 
00232     PT_DocPosition                      m_iOldPos;
00233     std::string                         m_sImagePath;
00234     IEGraphicFileType                   m_iGraphicType;
00235     GR_Image *                          m_pImage;
00236     FG_ConstGraphicPtr                  m_pGraphic;
00237 
00238     bool                    m_bSensitive;
00239     bool                    m_bSetWrapping;
00240     bool                    m_bLineToggled;
00241 
00242     FL_FrameFormatMode      m_iFramePositionTo;
00243 };
00244 
00245 #endif /* AP_DIALOG_FORMATFRAME_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1