LCOV - code coverage report
Current view: top level - libreoffice/svx/source/table - tableundo.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 6 0.0 %
Date: 2012-12-27 Functions: 0 10 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _SVX_TABLEUNDO_HXX_
      21             : #define _SVX_TABLEUNDO_HXX_
      22             : 
      23             : #include <com/sun/star/container/XIndexAccess.hpp>
      24             : #include <com/sun/star/table/CellContentType.hpp>
      25             : 
      26             : #include "svx/svdotable.hxx"
      27             : #include "svx/svdobj.hxx"
      28             : #include "svx/svdundo.hxx"
      29             : 
      30             : #include "celltypes.hxx"
      31             : 
      32             : namespace sdr { namespace properties {
      33             :     class TextProperties;
      34             : } }
      35             : 
      36             : class OutlinerParaObject;
      37             : 
      38             : // -----------------------------------------------------------------------------
      39             : 
      40             : namespace sdr { namespace table {
      41             : 
      42             : class CellUndo : public SdrUndoAction, public sdr::ObjectUser
      43             : {
      44             : public:
      45             :     CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell );
      46             :     virtual ~CellUndo();
      47             : 
      48             :     virtual void            Undo();
      49             :     virtual void            Redo();
      50             :     virtual sal_Bool            Merge( SfxUndoAction *pNextAction );
      51             : 
      52             :     void dispose();
      53             :     virtual void ObjectInDestruction(const SdrObject& rObject);
      54             : 
      55             : private:
      56           0 :     struct Data
      57             :     {
      58             :         sdr::properties::TextProperties* mpProperties;
      59             :         OutlinerParaObject* mpOutlinerParaObject;
      60             : 
      61             :         ::com::sun::star::table::CellContentType mnCellContentType;
      62             : 
      63             :         ::rtl::OUString msFormula;
      64             :         double          mfValue;
      65             :         ::sal_Int32     mnError;
      66             :         ::sal_Bool      mbMerged;
      67             :         ::sal_Int32     mnRowSpan;
      68             :         ::sal_Int32     mnColSpan;
      69             : 
      70           0 :         Data() : mpProperties(NULL), mpOutlinerParaObject(NULL), mfValue(0) {};
      71             :     };
      72             : 
      73             :     void setDataToCell( const Data& rData );
      74             :     void getDataFromCell( Data& rData );
      75             : 
      76             :     SdrObjectWeakRef mxObjRef;
      77             :     CellRef mxCell;
      78             :     Data maUndoData;
      79             :     Data maRedoData;
      80             :     bool mbUndo;
      81             : };
      82             : 
      83             : // -----------------------------------------------------------------------------
      84             : 
      85             : class InsertRowUndo : public SdrUndoAction
      86             : {
      87             : public:
      88             :     InsertRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aNewRows );
      89             :     virtual ~InsertRowUndo();
      90             : 
      91             :     virtual void            Undo();
      92             :     virtual void            Redo();
      93             : 
      94             : private:
      95             :     TableModelRef mxTable;
      96             :     sal_Int32 mnIndex;
      97             :     RowVector maRows;
      98             :     bool mbUndo;
      99             : };
     100             : 
     101             : // -----------------------------------------------------------------------------
     102             : 
     103             : class RemoveRowUndo : public SdrUndoAction
     104             : {
     105             : public:
     106             :     RemoveRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aRemovedRows );
     107             :     virtual ~RemoveRowUndo();
     108             : 
     109             :     virtual void            Undo();
     110             :     virtual void            Redo();
     111             : 
     112             : private:
     113             :     TableModelRef mxTable;
     114             :     sal_Int32 mnIndex;
     115             :     RowVector maRows;
     116             :     bool mbUndo;
     117             : };
     118             : 
     119             : // -----------------------------------------------------------------------------
     120             : 
     121             : class InsertColUndo : public SdrUndoAction
     122             : {
     123             : public:
     124             :     InsertColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells );
     125             :     virtual ~InsertColUndo();
     126             : 
     127             :     virtual void            Undo();
     128             :     virtual void            Redo();
     129             : 
     130             : private:
     131             :     TableModelRef mxTable;
     132             :     sal_Int32 mnIndex;
     133             :     ColumnVector maColumns;
     134             :     CellVector maCells;
     135             :     bool mbUndo;
     136             : };
     137             : 
     138             : // -----------------------------------------------------------------------------
     139             : 
     140             : class RemoveColUndo : public SdrUndoAction
     141             : {
     142             : public:
     143             :     RemoveColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells );
     144             :     virtual ~RemoveColUndo();
     145             : 
     146             :     virtual void            Undo();
     147             :     virtual void            Redo();
     148             : 
     149             : private:
     150             :     TableModelRef mxTable;
     151             :     sal_Int32 mnIndex;
     152             :     ColumnVector maColumns;
     153             :     CellVector maCells;
     154             :     bool mbUndo;
     155             : };
     156             : 
     157             : // -----------------------------------------------------------------------------
     158             : 
     159             : class TableColumnUndo : public SdrUndoAction
     160             : {
     161             : public:
     162             :     TableColumnUndo( const TableColumnRef& xCol );
     163             :     virtual ~TableColumnUndo();
     164             : 
     165             :     virtual void            Undo();
     166             :     virtual void            Redo();
     167             :     virtual sal_Bool            Merge( SfxUndoAction *pNextAction );
     168             : 
     169             : private:
     170           0 :     struct Data
     171             :     {
     172             :         sal_Int32   mnColumn;
     173             :         sal_Int32   mnWidth;
     174             :         sal_Bool    mbOptimalWidth;
     175             :         sal_Bool    mbIsVisible;
     176             :         sal_Bool    mbIsStartOfNewPage;
     177             :         ::rtl::OUString maName;
     178             :     };
     179             : 
     180             :     void setData( const Data& rData );
     181             :     void getData( Data& rData );
     182             : 
     183             :     TableColumnRef mxCol;
     184             :     Data maUndoData;
     185             :     Data maRedoData;
     186             :     bool mbHasRedoData;
     187             : };
     188             : 
     189             : // -----------------------------------------------------------------------------
     190             : 
     191             : class TableRowUndo : public SdrUndoAction
     192             : {
     193             : public:
     194             :     TableRowUndo( const TableRowRef& xRow );
     195             :     virtual ~TableRowUndo();
     196             : 
     197             :     virtual void            Undo();
     198             :     virtual void            Redo();
     199             :     virtual sal_Bool            Merge( SfxUndoAction *pNextAction );
     200             : 
     201             : private:
     202           0 :     struct Data
     203             :     {
     204             :         CellVector  maCells;
     205             :         sal_Int32   mnRow;
     206             :         sal_Int32   mnHeight;
     207             :         sal_Bool    mbOptimalHeight;
     208             :         sal_Bool    mbIsVisible;
     209             :         sal_Bool    mbIsStartOfNewPage;
     210             :         ::rtl::OUString maName;
     211             :     };
     212             : 
     213             :     void setData( const Data& rData );
     214             :     void getData( Data& rData );
     215             : 
     216             :     TableRowRef mxRow;
     217             :     Data maUndoData;
     218             :     Data maRedoData;
     219             :     bool mbHasRedoData;
     220             : };
     221             : 
     222             : // -----------------------------------------------------------------------------
     223             : 
     224           0 : class TableStyleUndo : public SdrUndoAction
     225             : {
     226             : public:
     227             :     TableStyleUndo( const SdrTableObj& rTableObj );
     228             : 
     229             :     virtual void            Undo();
     230             :     virtual void            Redo();
     231             : 
     232             : private:
     233             :     SdrObjectWeakRef mxObjRef;
     234             : 
     235           0 :     struct Data
     236             :     {
     237             :         TableStyleSettings maSettings;
     238             :         ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxTableStyle;
     239             :     };
     240             : 
     241             :     void setData( const Data& rData );
     242             :     void getData( Data& rData );
     243             : 
     244             :     Data maUndoData;
     245             :     Data maRedoData;
     246             :     bool mbHasRedoData;
     247             : };
     248             : 
     249             : } }
     250             : 
     251             : #endif
     252             : 
     253             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10