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

OXML_Element_Row.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
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_ROW_H_
00024 #define _OXML_ELEMENT_ROW_H_
00025 
00026 // Internal includes
00027 #include <OXML_Element.h>
00028 #include <OXML_Element_Table.h>
00029 #include <OXML_Element_Cell.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 
00039 class OXML_Element_Row : public OXML_Element
00040 {
00041 public:
00042     OXML_Element_Row(const std::string & id, OXML_Element_Table* table);
00043     virtual ~OXML_Element_Row();
00044 
00045     virtual UT_Error serialize(IE_Exp_OpenXML* exporter);
00046     virtual UT_Error addToPT(PD_Document * pDocument);
00047     UT_Error addChildrenToPT(PD_Document * pDocument);
00048     virtual void setNumCols(UT_sint32 numCols);
00049 
00050     void setRowNumber(int row);
00051     int getRowNumber() const
00052         {
00053             return m_rowNumber;
00054         }
00055     int getCurrentColumnNumber() const
00056         {
00057             return m_currentColumnNumber;
00058         }
00059 
00060     void addCell(OXML_Element_Cell* cell);
00061 
00062     //this method increments the vertical merge start cell's bottom by one.
00063     //It traverses the cells in the row and finds the vertical merge starting cell
00064     //and increments its bottom value by one. Should be called for the vertMerge=continue cells.
00065     //return true if successful
00066     bool incrementBottomVerticalMergeStart(OXML_Element_Cell* cell);
00067 
00068     //this method increments the horizontal merge start cell's right by one.
00069     //It traverses the cells in the row and finds the horizontal merge starting cell
00070     //and increments its right value by one. Should be called for the hMerge=continue cells.
00071     //return true if successful
00072     bool incrementRightHorizontalMergeStart(OXML_Element_Cell* cell);
00073 
00074     void addMissingCell(OXML_Element_Cell* cell);
00075 
00076 protected:
00077     UT_Error serializeChildren(IE_Exp_OpenXML* exporter);
00078 
00079 private:
00080     virtual UT_Error serializeProperties(IE_Exp_OpenXML* exporter);
00081     UT_sint32 numCols;
00082     OXML_Element_Table* table;
00083     std::vector<OXML_Element_Cell*> m_cells;
00084     int m_rowNumber;
00085     int m_currentColumnNumber;
00086     std::vector<OXML_Element_Cell*> m_missingCells;
00087 };
00088 
00089 #endif //_OXML_ELEMENT_ROW_H_
00090 

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1