00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */ 00002 00003 /* AbiSource 00004 * 00005 * Copyright (C) 2008 Firat Kiyak <firatkiyak@gmail.com> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 * 02111-1307, USA. 00021 */ 00022 00023 #ifndef _OXML_ELEMENT_CELL_H_ 00024 #define _OXML_ELEMENT_CELL_H_ 00025 00026 // Internal includes 00027 #include <OXML_Element.h> 00028 #include <OXML_Element_Table.h> 00029 #include <OXML_Element_Row.h> 00030 #include <ie_exp_OpenXML.h> 00031 00032 // AbiWord includes 00033 #include <ut_types.h> 00034 #include <ut_string.h> 00035 #include <pd_Document.h> 00036 00037 class OXML_Element_Table; 00038 class OXML_Element_Row; 00039 00040 class OXML_Element_Cell : public OXML_Element 00041 { 00042 public: 00043 OXML_Element_Cell(const std::string & id, OXML_Element_Table* table, OXML_Element_Row* row, 00044 UT_sint32 left, UT_sint32 right, UT_sint32 top, UT_sint32 bottom); 00045 virtual ~OXML_Element_Cell(); 00046 00047 virtual UT_Error serialize(IE_Exp_OpenXML* exporter); 00048 virtual UT_Error addToPT(PD_Document * pDocument); 00049 UT_sint32 getLeft() const 00050 { 00051 return m_iLeft; 00052 } 00053 UT_sint32 getRight() const 00054 { 00055 return m_iRight; 00056 } 00057 UT_sint32 getTop() const 00058 { 00059 return m_iTop; 00060 } 00061 UT_sint32 getBottom() const 00062 { 00063 return m_iBottom; 00064 } 00065 00066 void setLeft(UT_sint32 left); 00067 void setRight(UT_sint32 right); 00068 void setTop(UT_sint32 top); 00069 void setBottom(UT_sint32 bottom); 00070 00071 void setRow(OXML_Element_Row* row) 00072 { 00073 m_row = row; 00074 } 00075 00076 void setVerticalMergeStart(bool start); 00077 void setHorizontalMergeStart(bool start); 00078 bool startsVerticalMerge() const 00079 { 00080 return m_startVerticalMerge; 00081 } 00082 bool startsHorizontalMerge() const 00083 { 00084 return m_startHorizontalMerge; 00085 } 00086 00087 void setLastHorizontalContinuationCell(OXML_Element_Cell* cell); 00088 void setLastVerticalContinuationCell(OXML_Element_Cell* cell); 00089 00090 private: 00091 virtual UT_Error serializeProperties(IE_Exp_OpenXML* exporter); 00092 UT_sint32 m_iLeft, m_iRight, m_iTop, m_iBottom; 00093 bool m_startVerticalMerge; 00094 bool m_startHorizontalMerge; 00095 OXML_Element_Table* m_table; 00096 OXML_Element_Row* m_row; 00097 00098 OXML_Element_Cell* m_horizontalTail; 00099 OXML_Element_Cell* m_verticalTail; 00100 }; 00101 00102 #endif //_OXML_ELEMENT_CELL_H_ 00103
1.5.5