1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unocrsrhelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _UNOCRSRHELPER_HXX
31 #define _UNOCRSRHELPER_HXX
33 #include <com/sun/star/beans/XPropertyState.hpp>
34 #include <unocrsr.hxx>
37 struct SfxItemPropertySimpleEntry
;
41 namespace com
{ namespace sun
{ namespace star
{
50 /* -----------------------------14.12.00 15:06--------------------------------
52 ---------------------------------------------------------------------------*/
53 namespace SwUnoCursorHelper
55 // keep Any's mapped by (WhichId << 16 ) + (MemberId)
56 typedef std::map
< sal_uInt32
, com::sun::star::uno::Any
*> AnyMapHelper_t
;
57 class SwAnyMapHelper
: public AnyMapHelper_t
62 void SetValue( USHORT nWhichId
, USHORT nMemberId
, const com::sun::star::uno::Any
& rAny
);
63 bool FillValue( USHORT nWhichId
, USHORT nMemberId
, const com::sun::star::uno::Any
*& pAny
);
65 sal_Bool
getCrsrPropertyValue(const SfxItemPropertySimpleEntry
& rEntry
67 , com::sun::star::uno::Any
*pAny
68 , com::sun::star::beans::PropertyState
& eState
69 , const SwTxtNode
* pNode
= 0 );
71 void GetCurPageStyle(SwPaM
& rPaM
, String
&rString
);
73 inline sal_Bool
IsStartOfPara(SwPaM
& rUnoCrsr
)
74 { return rUnoCrsr
.GetPoint()->nContent
== 0;}
75 inline sal_Bool
IsEndOfPara(SwPaM
& rUnoCrsr
)
76 { return rUnoCrsr
.GetCntntNode() &&
77 rUnoCrsr
.GetPoint()->nContent
== rUnoCrsr
.GetCntntNode()->Len();}
79 void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry
& rEntry
, SwPaM
& rPam
);
80 void InsertFile(SwUnoCrsr
* pUnoCrsr
,
82 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rOptions
83 ) throw( com::sun::star::lang::IllegalArgumentException
, com::sun::star::io::IOException
, com::sun::star::uno::RuntimeException
);
85 void getNumberingProperty(
87 com::sun::star::beans::PropertyState
& eState
,
88 com::sun::star::uno::Any
*pAny
);
90 void setNumberingProperty(
91 const com::sun::star::uno::Any
& rValue
,
94 sal_Int16
IsNodeNumStart(
96 com::sun::star::beans::PropertyState
& eState
);
98 sal_Bool
DocInsertStringSplitCR( SwDoc
&rDoc
,
99 const SwPaM
&rNewCursor
, const String
&rText
,
100 const bool bForceExpandHints
);
101 void makeRedline( SwPaM
& rPaM
, const ::rtl::OUString
& RedlineType
,
102 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& RedlineProperties
)
103 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
105 } // namespace SwUnoCursorHelper