00001 /* AbiWord 00002 * Copyright (C) 2002 Patrick Lam <plam@mit.edu> 00003 * Copyright (C) 2003 Martin Sevior <msevior@physics.unimelb.edu.au> 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * 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., 59 Temple Place - Suite 330, Boston, MA 00019 * 02111-1307, USA. 00020 * 00021 */ 00022 00023 #ifndef FRAMECONTAINER_H 00024 #define FRAMECONTAINER_H 00025 00026 #ifdef FMT_TEST 00027 #include <stdio.h> 00028 #endif 00029 00030 #include "ut_misc.h" 00031 #include "ut_types.h" 00032 #include "ut_vector.h" 00033 #include "pt_Types.h" 00034 #include "fp_Page.h" 00035 #include "fp_ContainerObject.h" 00036 #include "fp_Column.h" 00037 #include "gr_Graphics.h" 00038 #include "pp_PropertyMap.h" 00039 00040 class fl_TableLayout; 00041 class fl_DocSectionLayout; 00042 class fl_BlockLayout; 00043 00044 #define FRAME_HANDLE_SIZE 6 00045 00046 class ABI_EXPORT fp_FrameContainer : public fp_VerticalContainer 00047 { 00048 public: 00049 fp_FrameContainer(fl_SectionLayout* pSectionLayout); 00050 virtual ~fp_FrameContainer(); 00051 void layout(void); 00052 virtual void clearScreen(void); 00053 virtual void draw(dg_DrawArgs*); 00054 virtual void draw(GR_Graphics*) {} 00055 void drawHandles(dg_DrawArgs * pDA); 00056 void drawBoundaries(dg_DrawArgs * pDA); 00057 virtual void setContainer(fp_Container * pContainer); 00058 virtual fp_Container * getNextContainerInSection(void) const; 00059 virtual fp_Container * getPrevContainerInSection(void) const; 00060 virtual fp_Page * getPage(void) { return m_pPage;} 00061 virtual UT_sint32 getX() const; 00062 virtual UT_sint32 getY() const; 00063 virtual UT_sint32 getWidth() const; 00064 virtual UT_sint32 getHeight() const; 00065 UT_sint32 getLeftPad(UT_sint32 y, UT_sint32 height); 00066 UT_sint32 getRightPad(UT_sint32 y, UT_sint32 height); 00067 virtual bool isVBreakable(void) 00068 { return false;} 00069 UT_sint32 getFullX() const; 00070 UT_sint32 getFullY() const; 00071 UT_sint32 getFullWidth() const; 00072 UT_sint32 getFullHeight() const; 00073 void setXpad(UT_sint32 xPad) 00074 {m_iXpad = xPad;} 00075 void setYpad(UT_sint32 yPad) 00076 {m_iYpad = yPad;} 00077 UT_sint32 getXPad(void) { return m_iXpad;} 00078 UT_sint32 getYPad(void) { return m_iYpad;} 00079 void setPage(fp_Page * pPage); 00080 fl_DocSectionLayout * getDocSectionLayout(void); 00081 void getBlocksAroundFrame(UT_GenericVector<fl_BlockLayout *> & vecBlocks); 00082 PP_PropertyMap::Background getBackground () const; 00083 void setPreferedPageNo(UT_sint32 i); 00084 UT_sint32 getPreferedPageNo(void) 00085 { return m_iPreferedPageNo;} 00086 00087 void setBackground (const PP_PropertyMap::Background & style); 00088 00089 void setBottomStyle (const PP_PropertyMap::Line & style) { m_lineBottom = style; } 00090 void setLeftStyle (const PP_PropertyMap::Line & style) { m_lineLeft = style; } 00091 void setRightStyle (const PP_PropertyMap::Line & style) { m_lineRight = style; } 00092 void setTopStyle (const PP_PropertyMap::Line & style) { m_lineTop = style; } 00093 void setOverWrote(void) 00094 {m_bOverWrote = true;} 00095 void setWrapping(bool bWrapping) 00096 {m_bIsWrapped = bWrapping;} 00097 bool isWrappingSet(void) const 00098 { return m_bIsWrapped;} 00099 void setTightWrapping( bool bTight) 00100 { m_bIsTightWrapped = bTight;} 00101 bool isTightWrapped(void) const 00102 { return m_bIsTightWrapped;} 00103 bool isTopBot(void) const 00104 { return m_bIsTopBot; } 00105 void setTopBot(bool b) 00106 { m_bIsTopBot = b;} 00107 bool isLeftWrapped(void) const 00108 { return m_bIsLeftWrapped;} 00109 void setLeftWrapped(bool b) 00110 { m_bIsLeftWrapped = b;} 00111 bool isRightWrapped(void) const 00112 { return m_bIsRightWrapped;} 00113 void setRightWrapped(bool b) 00114 { m_bIsRightWrapped = b;} 00115 00116 bool overlapsRect(UT_Rect & rec); 00117 bool isAbove(void) 00118 { return m_bIsAbove;} 00119 void setAbove(bool bAbove) 00120 { m_bIsAbove = bAbove;} 00121 bool isRelocate(void) const; 00122 private: 00123 void _drawLine (const PP_PropertyMap::Line & style, 00124 UT_sint32 left, UT_sint32 top, 00125 UT_sint32 right, UT_sint32 bot, 00126 GR_Graphics * pGr); 00127 fp_Page * m_pPage; 00128 UT_sint32 m_iXpad; 00129 UT_sint32 m_iYpad; 00130 bool m_bNeverDrawn; 00131 00132 // cell-background properties 00133 PP_PropertyMap::Background m_background; 00134 00135 // cell-border properties 00136 PP_PropertyMap::Line m_lineBottom; 00137 PP_PropertyMap::Line m_lineLeft; 00138 PP_PropertyMap::Line m_lineRight; 00139 PP_PropertyMap::Line m_lineTop; 00140 bool m_bOverWrote; 00141 bool m_bIsWrapped; 00142 bool m_bIsTightWrapped; 00143 bool m_bIsAbove; 00144 bool m_bIsTopBot; 00145 bool m_bIsLeftWrapped; 00146 bool m_bIsRightWrapped; 00147 UT_sint32 m_iPreferedPageNo; 00148 }; 00149 00150 00151 #endif /* FRAMECONTAINER_H */
1.5.5