Update ooo320-m1
[ooovba.git] / sw / inc / unocrsrhelper.hxx
blob27a511d969db85ba0eb6696edf1526d5930ae911
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unocrsrhelper.hxx,v $
10 * $Revision: 1.12 $
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>
35 #include <map>
37 struct SfxItemPropertySimpleEntry;
38 class SwPaM;
39 class SwDoc;
41 namespace com{ namespace sun{ namespace star{
42 namespace uno{
43 class Any;
45 namespace beans{
46 struct PropertyValue;
48 }}}
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
59 public:
60 ~SwAnyMapHelper();
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
66 , SwPaM& rPam
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,
81 const String& rURL,
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(
86 SwPaM& rPam,
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,
92 SwPaM& rPam);
94 sal_Int16 IsNodeNumStart(
95 SwPaM& rPam,
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
107 #endif