LCOV - code coverage report
Current view: top level - libreoffice/sc/inc - editsrc.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-12-27 Functions: 2 3 66.7 %
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 SC_EDITSRC_HXX
      21             : #define SC_EDITSRC_HXX
      22             : 
      23             : #include "address.hxx"
      24             : #include <editeng/unoedsrc.hxx>
      25             : #include <svl/lstner.hxx>
      26             : 
      27             : #include <memory>
      28             : 
      29             : class ScEditEngineDefaulter;
      30             : class SvxEditEngineForwarder;
      31             : 
      32             : class ScDocShell;
      33             : class ScCellTextData;
      34             : class ScHeaderFooterTextData;
      35             : class ScAccessibleTextData;
      36             : class SdrObject;
      37             : 
      38        3464 : class ScEditSource : public SvxEditSource
      39             : {
      40             : public:
      41             :     virtual ScEditEngineDefaulter* GetEditEngine() = 0;
      42             : };
      43             : 
      44             : /**
      45             :  * ScHeaderFooterTextObj keeps the authoritative copy of
      46             :  * ScHeaderFooterTextData that this class holds reference to.  It's a
      47             :  * reference instead of a copy to avoid broadcasting changes to the
      48             :  * authoritative copy.
      49             :  */
      50             : class ScHeaderFooterEditSource : public ScEditSource
      51             : {
      52             : private:
      53             :     ScHeaderFooterTextData& mrTextData;
      54             : 
      55             : public:
      56             :     ScHeaderFooterEditSource(ScHeaderFooterTextData& rData);
      57             :     virtual ~ScHeaderFooterEditSource();
      58             : 
      59             :     //  GetEditEngine is needed because the forwarder doesn't have field functions
      60             :     virtual ScEditEngineDefaulter* GetEditEngine();
      61             : 
      62             :     virtual SvxEditSource*      Clone() const;
      63             :     virtual SvxTextForwarder*   GetTextForwarder();
      64             :     virtual void                UpdateData();
      65             : };
      66             : 
      67             : /**
      68             :  * Data (incl. EditEngine) for cell EditSource is now shared in
      69             :  * ScCellTextData.
      70             :  *
      71             :  * ScCellEditSource with local copy of ScCellTextData is used by
      72             :  * ScCellFieldsObj, ScCellFieldObj.
      73             :  */
      74             : class ScCellEditSource : public ScEditSource
      75             : {
      76             : private:
      77             :     ScCellTextData* pCellTextData;
      78             : 
      79             : public:
      80             :     ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP);
      81             :     virtual ~ScCellEditSource();
      82             : 
      83             :     //  GetEditEngine is needed because the forwarder doesn't have field functions
      84             :     virtual ScEditEngineDefaulter* GetEditEngine();
      85             : 
      86             :     virtual SvxEditSource* Clone() const;
      87             :     virtual SvxTextForwarder* GetTextForwarder();
      88             : 
      89             :     virtual void UpdateData();
      90             : 
      91             :     void SetDoUpdateData(bool bValue);
      92             :     bool IsDirty() const;
      93             : };
      94             : 
      95             : class ScAnnotationEditSource : public SvxEditSource, public SfxListener
      96             : {
      97             : private:
      98             :     ScDocShell*             pDocShell;
      99             :     ScAddress               aCellPos;
     100             :     ScEditEngineDefaulter*  pEditEngine;
     101             :     SvxEditEngineForwarder* pForwarder;
     102             :     sal_Bool                    bDataValid;
     103             : 
     104             :     SdrObject*                  GetCaptionObj();
     105             : public:
     106             :                                 ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
     107             :     virtual                     ~ScAnnotationEditSource();
     108             : 
     109             :     virtual SvxEditSource*      Clone() const ;
     110             :     virtual SvxTextForwarder*   GetTextForwarder();
     111             :     virtual void                UpdateData();
     112             : 
     113             :     virtual void                Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     114             : };
     115             : 
     116             : 
     117             : //  EditSource with a shared forwarder for all children of one text object
     118             : 
     119             : class ScSimpleEditSource : public SvxEditSource
     120             : {
     121             : private:
     122             :     SvxTextForwarder*   pForwarder;
     123             : 
     124             : public:
     125             :                         ScSimpleEditSource( SvxTextForwarder* pForw );
     126             :     virtual             ~ScSimpleEditSource();
     127             : 
     128             :     virtual SvxEditSource*      Clone() const ;
     129             :     virtual SvxTextForwarder*   GetTextForwarder();
     130             :     virtual void                UpdateData();
     131             : 
     132             : };
     133             : 
     134             : class ScAccessibilityEditSource : public SvxEditSource
     135             : {
     136             : private:
     137             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     138             :     ::std::auto_ptr < ScAccessibleTextData > mpAccessibleTextData;
     139             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     140             : 
     141             : public:
     142             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     143             :                         ScAccessibilityEditSource( ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData );
     144             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     145             :     virtual             ~ScAccessibilityEditSource();
     146             : 
     147             :     virtual SvxEditSource*      Clone() const;
     148             :     virtual SvxTextForwarder*   GetTextForwarder();
     149             :     virtual SvxViewForwarder*   GetViewForwarder();
     150             :     virtual SvxEditViewForwarder*   GetEditViewForwarder( sal_Bool bCreate = false );
     151             :     virtual void                UpdateData();
     152             :     virtual SfxBroadcaster&     GetBroadcaster() const;
     153             : };
     154             : 
     155             : #endif
     156             : 
     157             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10