LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - unocrsrhelper.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 6 50.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             : #ifndef _UNOCRSRHELPER_HXX
      20             : #define _UNOCRSRHELPER_HXX
      21             : 
      22             : #include <map>
      23             : 
      24             : #include <com/sun/star/beans/XPropertyState.hpp>
      25             : #include <com/sun/star/beans/XPropertySet.hpp>
      26             : 
      27             : #include <swtypes.hxx>
      28             : #include <pam.hxx>
      29             : 
      30             : 
      31             : class String;
      32             : class SfxItemSet;
      33             : class SfxItemPropertySet;
      34             : struct SfxItemPropertySimpleEntry;
      35             : class SwTxtNode;
      36             : class SwPaM;
      37             : class SwCursor;
      38             : class SwUnoCrsr;
      39             : class SwFmtColl;
      40             : struct SwSortOptions;
      41             : class SwDoc;
      42             : 
      43             : namespace com{ namespace sun{ namespace star{
      44             :     namespace uno{
      45             :         class Any;
      46             :     }
      47             :     namespace beans{
      48             :         struct PropertyValue;
      49             :     }
      50             :     namespace text {
      51             :         class XTextContent;
      52             :     }
      53             : }}}
      54             : 
      55             : enum SwGetPropertyStatesCaller
      56             : {
      57             :     SW_PROPERTY_STATE_CALLER_DEFAULT,
      58             :     SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION,
      59             :     SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY,
      60             :     SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT
      61             : };
      62             : 
      63             : namespace SwUnoCursorHelper
      64             : {
      65             :     //  keep Any's mapped by (WhichId << 16 ) + (MemberId)
      66             :     typedef std::map< sal_uInt32, com::sun::star::uno::Any *> AnyMapHelper_t;
      67         193 :     class SwAnyMapHelper : public AnyMapHelper_t
      68             :     {
      69             :         public:
      70             :             ~SwAnyMapHelper();
      71             : 
      72             :             void    SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const com::sun::star::uno::Any& rAny );
      73             :             bool    FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const com::sun::star::uno::Any*& pAny );
      74             :     };
      75             : 
      76             :     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
      77             :         GetNestedTextContent(SwTxtNode & rTextNode, xub_StrLen const nIndex,
      78             :             bool const bParent);
      79             : 
      80             :     bool                    getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
      81             :                                         , SwPaM& rPam
      82             :                                         , com::sun::star::uno::Any *pAny
      83             :                                         , com::sun::star::beans::PropertyState& eState
      84             :                                         , const SwTxtNode* pNode = 0 );
      85             : 
      86             :     void                        GetCurPageStyle(SwPaM& rPaM, String &rString);
      87             : 
      88          20 :     inline sal_Bool             IsStartOfPara(SwPaM& rUnoCrsr)
      89          20 :                                         { return rUnoCrsr.GetPoint()->nContent == 0;}
      90           0 :     inline sal_Bool             IsEndOfPara(SwPaM& rUnoCrsr)
      91           0 :                                         { return rUnoCrsr.GetCntntNode() &&
      92           0 :                                             rUnoCrsr.GetPoint()->nContent == rUnoCrsr.GetCntntNode()->Len();}
      93             : 
      94             :     void                        resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam);
      95             :     void                        InsertFile(SwUnoCrsr* pUnoCrsr,
      96             :                                     const String& rURL,
      97             :                                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rOptions
      98             :                                     ) throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException );
      99             : 
     100             :     void                        getNumberingProperty(
     101             :                                     SwPaM& rPam,
     102             :                                     com::sun::star::beans::PropertyState& eState,
     103             :                                     com::sun::star::uno::Any *pAny );
     104             : 
     105             :     void                        setNumberingProperty(
     106             :                                     const com::sun::star::uno::Any& rValue,
     107             :                                     SwPaM& rPam);
     108             : 
     109             :     sal_Int16                   IsNodeNumStart(
     110             :                                     SwPaM& rPam,
     111             :                                     com::sun::star::beans::PropertyState& eState);
     112             : 
     113             :     bool    DocInsertStringSplitCR(  SwDoc &rDoc,
     114             :                     const SwPaM &rNewCursor, const String &rText,
     115             :                     const bool bForceExpandHints );
     116             :     void    makeRedline( SwPaM& rPaM, const ::rtl::OUString& RedlineType,
     117             :             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties )
     118             :                 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
     119             : 
     120             : 
     121             :     /// @param bTableMode: attributes should be applied to a table selection
     122             :     void SetCrsrAttr(SwPaM & rPam, const SfxItemSet & rSet,
     123             :                      const SetAttrMode nAttrMode,
     124             :                      const bool bTableMode = false);
     125             :     void GetCrsrAttr(SwPaM & rPam, SfxItemSet & rSet,
     126             :                      const bool bOnlyTxtAttr = false,
     127             :                      const bool bGetFromChrFmt = true);
     128             :     void GetTextFromPam(SwPaM & rPam, ::rtl::OUString & rBuffer);
     129             :     SwFmtColl * GetCurTxtFmtColl(SwPaM & rPam, const bool bConditional);
     130             : 
     131             :     void SelectPam(SwPaM & rPam, const bool bExpand);
     132             :     void SetString(SwCursor & rCursor, const ::rtl::OUString & rString);
     133             : 
     134             :     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
     135             :            CreateSortDescriptor(const bool bFromTable);
     136             :     sal_Bool ConvertSortProperties(
     137             :             const ::com::sun::star::uno::Sequence<
     138             :                 ::com::sun::star::beans::PropertyValue >& rDescriptor,
     139             :             SwSortOptions & rSortOpt);
     140             : 
     141             :     /// @param bTableMode: attributes should be applied to a table selection
     142             :     void SetPropertyValue(
     143             :             SwPaM& rPaM,
     144             :             const SfxItemPropertySet & rPropSet,
     145             :             const ::rtl::OUString & rPropertyName,
     146             :             const ::com::sun::star::uno::Any & rValue,
     147             :             const SetAttrMode nAttrMode = nsSetAttrMode::SETATTR_DEFAULT,
     148             :             const bool bTableMode = false)
     149             :         throw (::com::sun::star::beans::UnknownPropertyException,
     150             :                 ::com::sun::star::beans::PropertyVetoException,
     151             :                 ::com::sun::star::lang::IllegalArgumentException,
     152             :                 ::com::sun::star::lang::WrappedTargetException,
     153             :                 ::com::sun::star::uno::RuntimeException);
     154             :     ::com::sun::star::uno::Any  GetPropertyValue(
     155             :             SwPaM& rPaM,
     156             :             const SfxItemPropertySet & rPropSet,
     157             :             const ::rtl::OUString & rPropertyName)
     158             :         throw (::com::sun::star::beans::UnknownPropertyException,
     159             :                 ::com::sun::star::lang::WrappedTargetException,
     160             :                 ::com::sun::star::uno::RuntimeException);
     161             :     ::com::sun::star::uno::Sequence<
     162             :                 ::com::sun::star::beans::PropertyState > GetPropertyStates(
     163             :             SwPaM & rPaM,
     164             :             const SfxItemPropertySet & rPropSet,
     165             :             const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
     166             :                 rPropertyNames,
     167             :             const SwGetPropertyStatesCaller eCaller =
     168             :                 SW_PROPERTY_STATE_CALLER_DEFAULT)
     169             :         throw (::com::sun::star::beans::UnknownPropertyException,
     170             :                 ::com::sun::star::uno::RuntimeException);
     171             :     ::com::sun::star::beans::PropertyState GetPropertyState(
     172             :             SwPaM & rPaM,
     173             :             const SfxItemPropertySet & rPropSet,
     174             :             const ::rtl::OUString & rPropertyName)
     175             :         throw (::com::sun::star::beans::UnknownPropertyException,
     176             :                 ::com::sun::star::uno::RuntimeException);
     177             :     void SetPropertyToDefault(
     178             :             SwPaM & rPaM,
     179             :             const SfxItemPropertySet & rPropSet,
     180             :             const ::rtl::OUString & rPropertyName)
     181             :         throw (::com::sun::star::beans::UnknownPropertyException,
     182             :                 ::com::sun::star::uno::RuntimeException);
     183             :     ::com::sun::star::uno::Any  GetPropertyDefault(
     184             :             SwPaM & rPaM,
     185             :             const SfxItemPropertySet & rPropSet,
     186             :             const ::rtl::OUString & rPropertyName)
     187             :         throw (::com::sun::star::beans::UnknownPropertyException,
     188             :                 ::com::sun::star::lang::WrappedTargetException,
     189             :                 ::com::sun::star::uno::RuntimeException);
     190             : 
     191             :     bool SetPageDesc(
     192             :             const ::com::sun::star::uno::Any& rValue,
     193             :             SwDoc & rDoc, SfxItemSet & rSet);
     194             :     void SetTxtFmtColl(const ::com::sun::star::uno::Any & rAny, SwPaM & rPaM)
     195             :         throw (::com::sun::star::lang::IllegalArgumentException);
     196             :     bool SetCursorPropertyValue(
     197             :             SfxItemPropertySimpleEntry const& rEntry,
     198             :             ::com::sun::star::uno::Any const& rValue,
     199             :             SwPaM & rPam, SfxItemSet & rItemSet)
     200             :         throw (::com::sun::star::lang::IllegalArgumentException);
     201             : 
     202             : } // namespace SwUnoCursorHelper
     203             : 
     204             : #endif
     205             : 
     206             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10