2000-12-15 11:12:42 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* $RCSfile: unocrsrhelper.hxx,v $
|
2008-04-18 11:37:41 +00:00
|
|
|
* $Revision: 1.12 $
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
2008-04-10 10:56:21 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-12-15 11:12:42 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _UNOCRSRHELPER_HXX
|
|
|
|
#define _UNOCRSRHELPER_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/beans/XPropertyState.hpp>
|
|
|
|
#include <unocrsr.hxx>
|
2009-06-03 11:26:39 +00:00
|
|
|
#include <map>
|
2000-12-15 11:12:42 +00:00
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
struct SfxItemPropertySimpleEntry;
|
2000-12-15 11:12:42 +00:00
|
|
|
class SwPaM;
|
2004-08-11 14:39:37 +00:00
|
|
|
class SwDoc;
|
2000-12-15 11:12:42 +00:00
|
|
|
|
|
|
|
namespace com{ namespace sun{ namespace star{
|
|
|
|
namespace uno{
|
|
|
|
class Any;
|
|
|
|
}
|
2008-01-29 08:22:26 +00:00
|
|
|
namespace beans{
|
|
|
|
struct PropertyValue;
|
|
|
|
}
|
2000-12-15 11:12:42 +00:00
|
|
|
}}}
|
2009-06-03 11:26:39 +00:00
|
|
|
|
2000-12-15 11:12:42 +00:00
|
|
|
/* -----------------------------14.12.00 15:06--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
namespace SwUnoCursorHelper
|
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
// keep Any's mapped by (WhichId << 16 ) + (MemberId)
|
|
|
|
typedef std::map< sal_uInt32, com::sun::star::uno::Any *> AnyMapHelper_t;
|
|
|
|
class SwAnyMapHelper : public AnyMapHelper_t
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~SwAnyMapHelper();
|
|
|
|
|
|
|
|
void SetValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any& rAny );
|
|
|
|
bool FillValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any*& pAny );
|
|
|
|
};
|
|
|
|
sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
|
2000-12-15 11:12:42 +00:00
|
|
|
, SwPaM& rPam
|
2001-06-07 06:46:42 +00:00
|
|
|
, com::sun::star::uno::Any *pAny
|
2001-05-09 08:28:33 +00:00
|
|
|
, com::sun::star::beans::PropertyState& eState
|
|
|
|
, const SwTxtNode* pNode = 0 );
|
2000-12-15 11:12:42 +00:00
|
|
|
|
2001-10-09 14:03:23 +00:00
|
|
|
void GetCurPageStyle(SwPaM& rPaM, String &rString);
|
2000-12-15 11:12:42 +00:00
|
|
|
|
2000-12-15 11:22:50 +00:00
|
|
|
inline sal_Bool IsStartOfPara(SwPaM& rUnoCrsr)
|
2000-12-15 11:12:42 +00:00
|
|
|
{ return rUnoCrsr.GetPoint()->nContent == 0;}
|
2000-12-15 11:22:50 +00:00
|
|
|
inline sal_Bool IsEndOfPara(SwPaM& rUnoCrsr)
|
2000-12-15 11:12:42 +00:00
|
|
|
{ return rUnoCrsr.GetCntntNode() &&
|
|
|
|
rUnoCrsr.GetPoint()->nContent == rUnoCrsr.GetCntntNode()->Len();}
|
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam);
|
2000-12-15 11:12:42 +00:00
|
|
|
void InsertFile(SwUnoCrsr* pUnoCrsr,
|
2008-01-29 08:22:26 +00:00
|
|
|
const String& rURL,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rOptions
|
|
|
|
) throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException );
|
2000-12-15 11:12:42 +00:00
|
|
|
|
2001-10-09 14:03:23 +00:00
|
|
|
void getNumberingProperty(
|
2000-12-15 11:12:42 +00:00
|
|
|
SwPaM& rPam,
|
2001-10-09 14:03:23 +00:00
|
|
|
com::sun::star::beans::PropertyState& eState,
|
|
|
|
com::sun::star::uno::Any *pAny );
|
2000-12-15 11:12:42 +00:00
|
|
|
|
|
|
|
void setNumberingProperty(
|
|
|
|
const com::sun::star::uno::Any& rValue,
|
|
|
|
SwPaM& rPam);
|
|
|
|
|
|
|
|
sal_Int16 IsNodeNumStart(
|
|
|
|
SwPaM& rPam,
|
|
|
|
com::sun::star::beans::PropertyState& eState);
|
|
|
|
|
2004-08-11 14:39:37 +00:00
|
|
|
sal_Bool DocInsertStringSplitCR( SwDoc &rDoc,
|
|
|
|
const SwPaM &rNewCursor, const String &rText );
|
2008-04-18 11:37:41 +00:00
|
|
|
void makeRedline( SwPaM& rPaM, const ::rtl::OUString& RedlineType,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties )
|
|
|
|
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
|
2004-08-11 14:39:37 +00:00
|
|
|
|
2007-09-27 07:15:22 +00:00
|
|
|
} // namespace SwUnoCursorHelper
|
2000-12-15 11:12:42 +00:00
|
|
|
|
|
|
|
#endif
|