LCOV - code coverage report
Current view: top level - sc/inc - editsrc.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-08-25 Functions: 2 3 66.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_EDITSRC_HXX
      30                 :            : #define SC_EDITSRC_HXX
      31                 :            : 
      32                 :            : #include "address.hxx"
      33                 :            : #include <editeng/unoedsrc.hxx>
      34                 :            : #include <svl/lstner.hxx>
      35                 :            : 
      36                 :            : #include <memory>
      37                 :            : 
      38                 :            : class ScEditEngineDefaulter;
      39                 :            : class SvxEditEngineForwarder;
      40                 :            : 
      41                 :            : class ScDocShell;
      42                 :            : class ScCellTextData;
      43                 :            : class ScHeaderFooterTextData;
      44                 :            : class ScAccessibleTextData;
      45                 :            : class SdrObject;
      46                 :            : 
      47         [ -  + ]:      12028 : class ScEditSource : public SvxEditSource
      48                 :            : {
      49                 :            : public:
      50                 :            :     virtual ScEditEngineDefaulter* GetEditEngine() = 0;
      51                 :            : };
      52                 :            : 
      53                 :            : /**
      54                 :            :  * ScHeaderFooterTextObj keeps the authoritative copy of
      55                 :            :  * ScHeaderFooterTextData that this class holds reference to.  It's a
      56                 :            :  * reference instead of a copy to avoid broadcasting changes to the
      57                 :            :  * authoritative copy.
      58                 :            :  */
      59                 :            : class ScHeaderFooterEditSource : public ScEditSource
      60                 :            : {
      61                 :            : private:
      62                 :            :     ScHeaderFooterTextData& mrTextData;
      63                 :            : 
      64                 :            : public:
      65                 :            :     ScHeaderFooterEditSource(ScHeaderFooterTextData& rData);
      66                 :            :     virtual ~ScHeaderFooterEditSource();
      67                 :            : 
      68                 :            :     //  GetEditEngine is needed because the forwarder doesn't have field functions
      69                 :            :     virtual ScEditEngineDefaulter* GetEditEngine();
      70                 :            : 
      71                 :            :     virtual SvxEditSource*      Clone() const;
      72                 :            :     virtual SvxTextForwarder*   GetTextForwarder();
      73                 :            :     virtual void                UpdateData();
      74                 :            : };
      75                 :            : 
      76                 :            : /**
      77                 :            :  * Data (incl. EditEngine) for cell EditSource is now shared in
      78                 :            :  * ScCellTextData.
      79                 :            :  *
      80                 :            :  * ScCellEditSource with local copy of ScCellTextData is used by
      81                 :            :  * ScCellFieldsObj, ScCellFieldObj.
      82                 :            :  */
      83                 :            : class ScCellEditSource : public ScEditSource
      84                 :            : {
      85                 :            : private:
      86                 :            :     ScCellTextData* pCellTextData;
      87                 :            : 
      88                 :            : public:
      89                 :            :     ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP);
      90                 :            :     virtual ~ScCellEditSource();
      91                 :            : 
      92                 :            :     //  GetEditEngine is needed because the forwarder doesn't have field functions
      93                 :            :     virtual ScEditEngineDefaulter* GetEditEngine();
      94                 :            : 
      95                 :            :     virtual SvxEditSource* Clone() const;
      96                 :            :     virtual SvxTextForwarder* GetTextForwarder();
      97                 :            : 
      98                 :            :     virtual void UpdateData();
      99                 :            : 
     100                 :            :     void SetDoUpdateData(bool bValue);
     101                 :            :     bool IsDirty() const;
     102                 :            : };
     103                 :            : 
     104                 :            : class ScAnnotationEditSource : public SvxEditSource, public SfxListener
     105                 :            : {
     106                 :            : private:
     107                 :            :     ScDocShell*             pDocShell;
     108                 :            :     ScAddress               aCellPos;
     109                 :            :     ScEditEngineDefaulter*  pEditEngine;
     110                 :            :     SvxEditEngineForwarder* pForwarder;
     111                 :            :     sal_Bool                    bDataValid;
     112                 :            : 
     113                 :            :     SdrObject*                  GetCaptionObj();
     114                 :            : public:
     115                 :            :                                 ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
     116                 :            :     virtual                     ~ScAnnotationEditSource();
     117                 :            : 
     118                 :            :     virtual SvxEditSource*      Clone() const ;
     119                 :            :     virtual SvxTextForwarder*   GetTextForwarder();
     120                 :            :     virtual void                UpdateData();
     121                 :            : 
     122                 :            :     virtual void                Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     123                 :            : };
     124                 :            : 
     125                 :            : 
     126                 :            : //  EditSource with a shared forwarder for all children of one text object
     127                 :            : 
     128                 :            : class ScSimpleEditSource : public SvxEditSource
     129                 :            : {
     130                 :            : private:
     131                 :            :     SvxTextForwarder*   pForwarder;
     132                 :            : 
     133                 :            : public:
     134                 :            :                         ScSimpleEditSource( SvxTextForwarder* pForw );
     135                 :            :     virtual             ~ScSimpleEditSource();
     136                 :            : 
     137                 :            :     virtual SvxEditSource*      Clone() const ;
     138                 :            :     virtual SvxTextForwarder*   GetTextForwarder();
     139                 :            :     virtual void                UpdateData();
     140                 :            : 
     141                 :            : };
     142                 :            : 
     143                 :            : class ScAccessibilityEditSource : public SvxEditSource
     144                 :            : {
     145                 :            : private:
     146                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     147                 :            :     ::std::auto_ptr < ScAccessibleTextData > mpAccessibleTextData;
     148                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     149                 :            : 
     150                 :            : public:
     151                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     152                 :            :                         ScAccessibilityEditSource( ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData );
     153                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     154                 :            :     virtual             ~ScAccessibilityEditSource();
     155                 :            : 
     156                 :            :     virtual SvxEditSource*      Clone() const;
     157                 :            :     virtual SvxTextForwarder*   GetTextForwarder();
     158                 :            :     virtual SvxViewForwarder*   GetViewForwarder();
     159                 :            :     virtual SvxEditViewForwarder*   GetEditViewForwarder( sal_Bool bCreate = false );
     160                 :            :     virtual void                UpdateData();
     161                 :            :     virtual SfxBroadcaster&     GetBroadcaster() const;
     162                 :            : };
     163                 :            : 
     164                 :            : #endif
     165                 :            : 
     166                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10