diff options
Diffstat (limited to 'inc/bf_sw')
201 files changed, 36160 insertions, 0 deletions
diff --git a/inc/bf_sw/RefreshListenerContainer.hxx b/inc/bf_sw/RefreshListenerContainer.hxx new file mode 100644 index 000000000..3b0057ceb --- /dev/null +++ b/inc/bf_sw/RefreshListenerContainer.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _REFRESH_LISTENER_CONTAINER_HXX_ +#define _REFRESH_LISTENER_CONTAINER_HXX_ + +#include <unoevtlstnr.hxx> +namespace binfilter { + +class SwRefreshListenerContainer : public SwEventListenerContainer +{ +public: + SwRefreshListenerContainer( ::com::sun::star::uno::XInterface* pxParent); + void Refreshed(); +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/SwGetPoolIdFromName.hxx b/inc/bf_sw/SwGetPoolIdFromName.hxx new file mode 100644 index 000000000..81a36648e --- /dev/null +++ b/inc/bf_sw/SwGetPoolIdFromName.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _GETPOOLIDFROMNAMEENUM_HXX +#define _GETPOOLIDFROMNAMEENUM_HXX +namespace binfilter { + +/* When using the NameMapper to translate pool ids to UI or programmatic + * names, this enum is used to define which family is required */ + +enum SwGetPoolIdFromName +{ + GET_POOLID_TXTCOLL = 0x01, + GET_POOLID_CHRFMT = 0x02, + GET_POOLID_FRMFMT = 0x04, + GET_POOLID_PAGEDESC = 0x08, + GET_POOLID_NUMRULE = 0x10 +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/SwStyleNameMapper.hxx b/inc/bf_sw/SwStyleNameMapper.hxx new file mode 100644 index 000000000..5457dc1fa --- /dev/null +++ b/inc/bf_sw/SwStyleNameMapper.hxx @@ -0,0 +1,243 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWSTYLENAMEMAPPER_HXX +#define _SWSTYLENAMEMAPPER_HXX + +#include <sal/types.h> +#include <SwGetPoolIdFromName.hxx> +#include <bf_tools/string.hxx> +#include <boost/unordered_map.hpp> + +class String; + +namespace binfilter { +class SvStringsDtor; + + +/* This class holds all data about the names of styles used in the user + * interface (UI names...these are localised into different languages). + * These UI names are loaded from the resource files on demand. + * + * It also holds all information about the 'Programmatic' names of styles + * which remain static (and are hardcoded in the corresponding cxx file) + * for all languages. + * + * This class also provides static functions which can be used for the + * following conversions: + * + * 1. Programmatic Name -> UI Name + * 2. Programmatic Name -> Pool ID + * 3. UI Name -> Programmatic Name + * 4. UI Name -> Pool ID + * 5. Pool ID -> UI Name + * 6. Pool ID -> Programmatic Name + * + * The relationship of these tables to the style families is as follows: + * + * 1. Paragraph contains the Text, Lists, Extra, Register, Doc and HTML + * name arrays. + * 2. Character contains the ChrFmt and HTMLChrFmt name arrays. + * 3. Page contains the PageDesc name array. + * 4. Frame contains the FrmFmt name array. + * 5. Numbering Rule contains the NumRule name array. + */ + +/* + * There is a further complication that came to light later. If someone enters + * a user-defined style name which is the same as a programmatic name, this + * name clash must be handled. + * + * Therefore, when there is a danger of a nameclash, the boolean bDisambiguate + * must be set to true in the SwStyleNameMapper call (it defaults to false). + * This will cause the following to happen: + * + * If the UI style name either equals a programmatic name or already ends + * with " (user)", then it must append " (user)" to the end. + * + * When a programmatic name is being converted to a UI name, if it ends in + * " (user)", we simply remove it. + */ + +struct SwTableEntry; +struct StringEq +{ + sal_Bool operator() ( const String *r1, + const String *r2) const + { + return r1->Equals(*r2); + } +}; + +struct StringHash +{ + size_t operator() ( const String *rString) const + { + sal_Int32 h, nLen; + h = nLen = rString->Len(); + const sal_Unicode *pStr = rString->GetBuffer(); + + if ( nLen < 16 ) + while ( nLen-- > 0 ) + h = (h*37) + *(pStr++); + else + { + sal_Int32 nSkip; + const sal_Unicode* pEndStr = pStr+nLen-5; + + /* only sample some characters */ + /* the first 3, some characters between, and the last 5 */ + h = (h*39) + *(pStr++); + h = (h*39) + *(pStr++); + h = (h*39) + *(pStr++); + + nSkip = nLen / nLen < 32 ? 4 : 8; + nLen -= 8; + while ( nLen > 0 ) + { + h = (h*39) + ( *pStr ); + pStr += nSkip; + nLen -= nSkip; + } + + h = (h*39) + *(pEndStr++); + h = (h*39) + *(pEndStr++); + h = (h*39) + *(pEndStr++); + h = (h*39) + *(pEndStr++); + h = (h*39) + *(pEndStr++); + } + return h; + } +}; + + +typedef ::boost::unordered_map < const String*, sal_uInt16, StringHash, StringEq > NameToIdHash; + +class SwStyleNameMapper +{ + friend void _InitCore(); + friend void _FinitCore(); + +protected: + // UI Name tables + static SvStringsDtor *pTextUINameArray, + *pListsUINameArray, + *pExtraUINameArray, + *pRegisterUINameArray, + *pDocUINameArray, + *pHTMLUINameArray, + *pFrmFmtUINameArray, + *pChrFmtUINameArray, + *pHTMLChrFmtUINameArray, + *pPageDescUINameArray, + *pNumRuleUINameArray, + // Programmatic Name tables + *pTextProgNameArray, + *pListsProgNameArray, + *pExtraProgNameArray, + *pRegisterProgNameArray, + *pDocProgNameArray, + *pHTMLProgNameArray, + *pFrmFmtProgNameArray, + *pChrFmtProgNameArray, + *pHTMLChrFmtProgNameArray, + *pPageDescProgNameArray, + *pNumRuleProgNameArray; + + static NameToIdHash *pParaUIMap, + *pCharUIMap, + *pPageUIMap, + *pFrameUIMap, + *pNumRuleUIMap, + + *pParaProgMap, + *pCharProgMap, + *pPageProgMap, + *pFrameProgMap, + *pNumRuleProgMap; + + static SvStringsDtor* NewUINameArray( SvStringsDtor*&, + sal_uInt16 nStt, + sal_uInt16 nEnd ); + + static SvStringsDtor* NewProgNameArray( SvStringsDtor*&, + const SwTableEntry *pTable, + sal_uInt8 nCount); + + static void fillNameFromId ( sal_uInt16 nId, String &rName, sal_Bool bProgName ); + static const String& getNameFromId ( sal_uInt16 nId, const String &rName, sal_Bool bProgName ); + static const NameToIdHash& getHashTable ( SwGetPoolIdFromName, sal_Bool bProgName ); + static sal_Bool SuffixIsUser ( const String & rString ); + static void CheckSuffixAndDelete ( String & rString ); + +public: + // This gets the UI Name from the programmatic name + static const String& GetUIName ( const String& rName, SwGetPoolIdFromName ); + static void FillUIName ( const String& rName, String& rFillName, SwGetPoolIdFromName, sal_Bool bDisambiguate = sal_False ); + // Get the programmatic Name from the UI name + static const String& GetProgName ( const String& rName, SwGetPoolIdFromName ); + static void FillProgName ( const String& rName, String& rFillName, SwGetPoolIdFromName, sal_Bool bDisambiguate = sal_False ); + + // This gets the UI Name from the Pool ID + static void FillUIName ( sal_uInt16 nId, String& rFillName ); + static const String& GetUIName ( sal_uInt16 nId, const String& rName ); + + // This gets the programmatic Name from the Pool ID + static const String& GetProgName ( sal_uInt16 nId, const String& rName ); + + // This gets the PoolId from the UI Name + static sal_uInt16 GetPoolIdFromUIName( const String& rName, SwGetPoolIdFromName ); + // Get the Pool ID from the programmatic name + static sal_uInt16 GetPoolIdFromProgName( const String& rName, SwGetPoolIdFromName ); + + // used to convert the 4 special ExtraProg/UINames for + // RES_POOLCOLL_LABEL_DRAWING, RES_POOLCOLL_LABEL_ABB, + // RES_POOLCOLL_LABEL_TABLE, RES_POOLCOLL_LABEL_FRAME + // forth and back. + // Non-matching names remain unchanged. + static const String GetSpecialExtraProgName( const String& rExtraUIName ); + static const String GetSpecialExtraUIName( const String& rExtraProgName ); + + static const SvStringsDtor& GetTextUINameArray(); + static const SvStringsDtor& GetListsUINameArray(); + static const SvStringsDtor& GetExtraUINameArray(); + static const SvStringsDtor& GetRegisterUINameArray(); + static const SvStringsDtor& GetDocUINameArray(); + static const SvStringsDtor& GetHTMLUINameArray(); + static const SvStringsDtor& GetFrmFmtUINameArray(); + static const SvStringsDtor& GetChrFmtUINameArray(); + static const SvStringsDtor& GetHTMLChrFmtUINameArray(); + static const SvStringsDtor& GetPageDescUINameArray(); + static const SvStringsDtor& GetNumRuleUINameArray(); + + static const SvStringsDtor& GetTextProgNameArray(); + static const SvStringsDtor& GetListsProgNameArray(); + static const SvStringsDtor& GetExtraProgNameArray(); + static const SvStringsDtor& GetRegisterProgNameArray(); + static const SvStringsDtor& GetDocProgNameArray(); + static const SvStringsDtor& GetHTMLProgNameArray(); + static const SvStringsDtor& GetFrmFmtProgNameArray(); + static const SvStringsDtor& GetChrFmtProgNameArray(); + static const SvStringsDtor& GetHTMLChrFmtProgNameArray(); + static const SvStringsDtor& GetPageDescProgNameArray(); + static const SvStringsDtor& GetNumRuleProgNameArray(); +}; +} //namespace binfilter +#endif // _NAME_MAPPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/TextCursorHelper.hxx b/inc/bf_sw/TextCursorHelper.hxx new file mode 100644 index 000000000..08676cb31 --- /dev/null +++ b/inc/bf_sw/TextCursorHelper.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SW_TEXTCURSORHELPER_HXX +#define _SW_TEXTCURSORHELPER_HXX + +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase1.hxx> +namespace binfilter { + +class SwDoc; +class SwUnoCrsr; +class SwPaM; +class OTextCursorHelper : public ::cppu::ImplHelper1< ::com::sun::star::lang::XUnoTunnel> +{ +protected: + OTextCursorHelper(){} + + ~OTextCursorHelper() {} + +public: + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + virtual const SwPaM* GetPaM() const = 0; + virtual SwPaM* GetPaM() = 0; + virtual const SwDoc* GetDoc() const = 0; + virtual SwDoc* GetDoc() = 0; +}; + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/access.hrc b/inc/bf_sw/access.hrc new file mode 100644 index 000000000..087452006 --- /dev/null +++ b/inc/bf_sw/access.hrc @@ -0,0 +1,27 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _ACCESS_HRC +#define _ACCESS_HRC + +#include "rcid.hrc" + + + + +#endif diff --git a/inc/bf_sw/accessibilityoptions.hxx b/inc/bf_sw/accessibilityoptions.hxx new file mode 100644 index 000000000..3bb9f402f --- /dev/null +++ b/inc/bf_sw/accessibilityoptions.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _ACCESSIBILITYOPTIONS_HXX +#define _ACCESSIBILITYOPTIONS_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { + +struct SwAccessibilityOptions +{ + BOOL bIsAlwaysAutoColor :1; + BOOL bIsStopAnimatedText :1; + BOOL bIsStopAnimatedGraphics :1; + + SwAccessibilityOptions() : + bIsAlwaysAutoColor(FALSE), + bIsStopAnimatedText(FALSE), + bIsStopAnimatedGraphics(FALSE) {} + + inline BOOL IsAlwaysAutoColor() const { return bIsAlwaysAutoColor; } + inline void SetAlwaysAutoColor( BOOL b ) { bIsAlwaysAutoColor = b; } + + inline BOOL IsStopAnimatedGraphics() const { return bIsStopAnimatedText;} + inline void SetStopAnimatedGraphics( BOOL b ) { bIsStopAnimatedText = b; } + + inline BOOL IsStopAnimatedText() const { return bIsStopAnimatedGraphics; } + inline void SetStopAnimatedText( BOOL b ) { bIsStopAnimatedGraphics = b;} +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/authfld.hxx b/inc/bf_sw/authfld.hxx new file mode 100644 index 000000000..78e83de81 --- /dev/null +++ b/inc/bf_sw/authfld.hxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _AUTHFLD_HXX +#define _AUTHFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <fldbas.hxx> +#include <toxe.hxx> + +#define _SVSTDARR_LONGS +#include <bf_svtools/svstdarr.hxx> +namespace binfilter { +class SvUShorts; +extern String& GetString( const ::com::sun::star::uno::Any& rAny, String& rStr ); + +class SwAuthDataArr; + + +class SwAuthEntry +{ + String aAuthFields[AUTH_FIELD_END]; + USHORT nRefCount; +public: + SwAuthEntry() : nRefCount(0){} + SwAuthEntry( const SwAuthEntry& rCopy ); + BOOL operator==(const SwAuthEntry& rComp); + + inline const String& GetAuthorField(ToxAuthorityField ePos)const; + inline void SetAuthorField(ToxAuthorityField ePos, + const String& rField); + + void AddRef() { ++nRefCount; } + void RemoveRef() { --nRefCount; } + USHORT GetRefCount() { return nRefCount; } +}; + + +struct SwTOXSortKey +{ + ToxAuthorityField eField; + BOOL bSortAscending; + SwTOXSortKey() : + eField(AUTH_FIELD_END), + bSortAscending(TRUE){} +}; + + + + +class SwAuthorityField; +class SortKeyArr; +class SwAuthorityFieldType : public SwFieldType +{ + SwDoc* m_pDoc; + SwAuthDataArr* m_pDataArr; + SvLongs* m_pSequArr; + SortKeyArr* m_pSortKeyArr; + sal_Unicode m_cPrefix; + sal_Unicode m_cSuffix; + BOOL m_bIsSequence :1; + BOOL m_bSortByDocument :1; + LanguageType m_eLanguage; + String m_sSortAlgorithm; + + const SwAuthorityFieldType& operator=( const SwAuthorityFieldType& ); + +public: + SwAuthorityFieldType(SwDoc* pDoc); + SwAuthorityFieldType( const SwAuthorityFieldType& ); + ~SwAuthorityFieldType(); + + virtual SwFieldType* Copy() const; + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + inline SwDoc* GetDoc() const { return m_pDoc; } + inline void SetDoc(SwDoc* pNewDoc) { m_pDoc = pNewDoc; } + + void RemoveField(long nHandle); + long AddField(const String& rFieldContents); + BOOL AddField(long nHandle); + void DelSequenceArray() + { + m_pSequArr->Remove(0, m_pSequArr->Count()); + } + + const SwAuthEntry* GetEntryByHandle(long nHandle) const; + + // import interface + USHORT AppendField(const SwAuthEntry& rInsert); + long GetHandle(USHORT nPos); + + USHORT GetEntryCount() const; + + USHORT GetSequencePos(long nHandle); + + BOOL IsSequence() const {return m_bIsSequence;} + void SetSequence(BOOL bSet) + { + DelSequenceArray(); + m_bIsSequence = bSet; + } + + void SetPreSuffix( sal_Unicode cPre, sal_Unicode cSuf) + { + m_cPrefix = cPre; + m_cSuffix = cSuf; + } + sal_Unicode GetPrefix() const { return m_cPrefix;} + sal_Unicode GetSuffix() const { return m_cSuffix;} + + BOOL IsSortByDocument() const {return m_bSortByDocument;} + void SetSortByDocument(BOOL bSet) + { + DelSequenceArray(); + m_bSortByDocument = bSet; + } + + USHORT GetSortKeyCount() const ; + const SwTOXSortKey* GetSortKey(USHORT nIdx) const ; + void SetSortKeys(USHORT nKeyCount, SwTOXSortKey nKeys[]); + static const String& GetAuthTypeName(ToxAuthorityType eType); + + LanguageType GetLanguage() const {return m_eLanguage;} + void SetLanguage(LanguageType nLang) {m_eLanguage = nLang;} + + const String& GetSortAlgorithm()const {return m_sSortAlgorithm;} + void SetSortAlgorithm(const String& rSet) {m_sSortAlgorithm = rSet;} + +}; + + +class SwAuthorityField : public SwField +{ + long nHandle; + +public: + SwAuthorityField(SwAuthorityFieldType* pType, const String& rFieldContents); + SwAuthorityField(SwAuthorityFieldType* pType, long nHandle); + ~SwAuthorityField(); + + const String& GetFieldText(ToxAuthorityField eField) const; + + virtual String Expand() const; + virtual SwField* Copy() const; + virtual void SetPar1(const String& rStr); + virtual SwFieldType* ChgTyp( SwFieldType* ); + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + long GetHandle() const { return nHandle; } +}; + +// --- inlines ----------------------------------------------------------- +inline const String& SwAuthEntry::GetAuthorField(ToxAuthorityField ePos)const +{ + DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index"); + return aAuthFields[ePos]; +} +inline void SwAuthEntry::SetAuthorField(ToxAuthorityField ePos, const String& rField) +{ + DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index"); + if(AUTH_FIELD_END > ePos) + aAuthFields[ePos] = rField; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/authratr.hxx b/inc/bf_sw/authratr.hxx new file mode 100644 index 000000000..eb0b7138e --- /dev/null +++ b/inc/bf_sw/authratr.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _AUTHRATR_HXX +#define _AUTHRATR_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { + +#define COL_NONE TRGB_COLORDATA( 0x80, 0xFF, 0xFF, 0xFF ) + +class AuthorCharAttr +{ +public: + USHORT nItemId; + USHORT nAttr; + ULONG nColor; + + AuthorCharAttr(); + + inline BOOL operator == ( const AuthorCharAttr& rAttr ) const + { + return nItemId == rAttr.nItemId && nAttr == rAttr.nAttr && + nColor == rAttr.nColor; + } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/bkmrke.hxx b/inc/bf_sw/bkmrke.hxx new file mode 100644 index 000000000..fd580878e --- /dev/null +++ b/inc/bf_sw/bkmrke.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _BKMRKE_HXX +#define _BKMRKE_HXX +namespace binfilter { + +enum BOOKMARK_TYPE { BOOKMARK, MARK, DDE_BOOKMARK, UNO_BOOKMARK }; + +} //namespace binfilter +#endif + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/bookmrk.hxx b/inc/bf_sw/bookmrk.hxx new file mode 100644 index 000000000..6398d3b6d --- /dev/null +++ b/inc/bf_sw/bookmrk.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _BOOKMRK_HXX +#define _BOOKMRK_HXX + +#include <bf_svtools/bf_solar.h> + + //die Attribut richtig angezogen werden. +#include <bf_svtools/macitem.hxx> + +#include <vcl/keycod.hxx> +#include <tools/ref.hxx> + +#include <bkmrke.hxx> +#include <calbck.hxx> +namespace binfilter { + +#ifndef SW_DECL_SWSERVEROBJECT_DEFINED +#define SW_DECL_SWSERVEROBJECT_DEFINED +SV_DECL_REF( SwServerObject ) +#endif + + +struct SwPosition; // fwd Decl. wg. UI + +class SwBookmark : public SwModify +{ + friend class SwDoc; // fuers Loeschen + friend class Sw3IoImp; // fuers Setzen der Position(en) + + SwPosition *pPos1, *pPos2; // wird im CTOR gesetzt, im DTOR geloescht + SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt + +protected: + SvxMacro aStartMacro; + SvxMacro aEndMacro; + String aName; + String aShortName; + KeyCode aCode; + BOOKMARK_TYPE eMarkType; + +public: + + SwBookmark(const SwPosition& aPos, + const KeyCode& rCode, + const String& rName, const String& rShortName); + // Beim Loeschen von Text werden Bookmarks mitgeloescht! + virtual ~SwBookmark(); + + const SwPosition& GetPos() const { return *pPos1; } + const SwPosition* GetOtherPos() const { return pPos2; } + + // nicht undofaehig + void SetName(const String& rNewName) { aName = rNewName; } + const String& GetName() const { return aName; } + // nicht undofaehig + void SetShortName(const String& rNewSName) { aShortName = rNewSName; } + const String& GetShortName() const { return aShortName; } + // nicht undofaehig + void SetKeyCode(const KeyCode& rNewCode) { aCode = rNewCode; } + const KeyCode& GetKeyCode() const { return aCode; } + + // Vergleiche auf Basis der Dokumentposition + BOOL operator < (const SwBookmark &) const; + BOOL operator ==(const SwBookmark &) const; + // falls man wirklich auf gleiche Position abfragen will. + + BOOL IsBookMark() const { return BOOKMARK == eMarkType; } + BOOL IsMark() const { return MARK == eMarkType; } + BOOL IsDDEMark() const { return DDE_BOOKMARK == eMarkType; } + BOOL IsUNOMark() const { return UNO_BOOKMARK == eMarkType; } + void SetType( BOOKMARK_TYPE eNewType ) { eMarkType = eNewType; } + BOOKMARK_TYPE GetType() const { return eMarkType; } + + void SetStartMacro(const SvxMacro& rSt) { aStartMacro = rSt; } + const SvxMacro& GetStartMacro() { return aStartMacro; } + void SetEndMacro(const SvxMacro& rSt) { aEndMacro = rSt; } + const SvxMacro& GetEndMacro() { return aEndMacro; } + + // Daten Server-Methoden + const SwServerObject* GetObject() const { return &refObj; } + SwServerObject* GetObject() { return &refObj; } + +private: + // fuer METWARE: + // es wird (vorerst) nicht kopiert und nicht zugewiesen + SwBookmark(const SwBookmark &); + SwBookmark &operator=(const SwBookmark &); +}; + + +class SwUNOMark: public SwBookmark +{ +public: + SwUNOMark(const SwPosition& aPos, + const KeyCode& rCode, + const String& rName, const String& rShortName); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/bparr.hxx b/inc/bf_sw/bparr.hxx new file mode 100644 index 000000000..048793bb5 --- /dev/null +++ b/inc/bf_sw/bparr.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _BPARR_HXX +#define _BPARR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/debug.hxx> +namespace binfilter { + +struct BlockInfo; +class BigPtrArray; + +class BigPtrEntry +{ + friend class BigPtrArray; + BlockInfo* pBlock; + USHORT nOffset; +protected: + BigPtrEntry() : pBlock(0), nOffset(0) {} + virtual ~BigPtrEntry() {} + + inline ULONG GetPos() const; + inline BigPtrArray& GetArray() const; +}; +typedef BigPtrEntry* ElementPtr; + + +typedef BOOL (*FnForEach)( const ElementPtr&, void* pArgs ); + +// 1000 Eintr�ge pro Block = etwas weniger als 4K +#define MAXENTRY 1000 + + +// Anzahl Eintraege, die bei der Kompression frei bleiben duerfen +// dieser Wert ist fuer den Worst Case, da wir MAXBLOCK mit ca 25% +// Overhead definiert haben, reichen 80% = 800 Eintraege vollkommen aus +// Will mann voellige Kompression haben, muss eben 100 angegeben werden. + +#define COMPRESSLVL 80 + +struct BlockInfo { // Block-Info: + BigPtrArray* pBigArr; // in diesem Array steht der Block + ElementPtr* pData; // Datenblock + ULONG nStart, nEnd; // Start- und EndIndex + USHORT nElem; // Anzahl Elemente +}; + +class BigPtrArray +{ + BlockInfo** ppInf; // Block-Infos + ULONG nSize; // Anzahl Elemente + USHORT nMaxBlock; // akt. max Anzahl Bloecke + USHORT nBlock; // Anzahl Bloecke + USHORT nCur; // letzter Block + + USHORT Index2Block( ULONG ) const; // Blocksuche + BlockInfo* InsBlock( USHORT ); // Block einfuegen + void BlockDel( USHORT ); // es wurden Bloecke geloescht + void UpdIndex( USHORT ); // Indexe neu berechnen + +protected: + // fuelle alle Bloecke auf. + // Der short gibt in Prozent an, wie voll die Bloecke werden sollen. + // Der ReturnWert besagt, das irgendetwas "getan" wurde + USHORT Compress( short = COMPRESSLVL ); + +public: + BigPtrArray(); + ~BigPtrArray(); + + ULONG Count() const { return nSize; } + + void Insert( const ElementPtr& r, ULONG pos ); +// void Insert( const ElementPtr* p, ULONG n, ULONG pos ); + void Remove( ULONG pos, ULONG n = 1 ); + void Replace( ULONG pos, const ElementPtr& r); + + ElementPtr operator[]( ULONG ) const; + void ForEach( FnForEach fn, void* pArgs = NULL ) + { + ForEach( 0, nSize, fn, pArgs ); + } + void ForEach( ULONG nStart, ULONG nEnd, FnForEach fn, void* pArgs = NULL ); +}; + + + +inline ULONG BigPtrEntry::GetPos() const +{ + DBG_ASSERT( this == pBlock->pData[ nOffset ], "Element nicht im Block" ); + return pBlock->nStart + nOffset; +} + +inline BigPtrArray& BigPtrEntry::GetArray() const +{ + return *pBlock->pBigArr; +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/breakit.hxx b/inc/bf_sw/breakit.hxx new file mode 100644 index 000000000..411c8b9f5 --- /dev/null +++ b/inc/bf_sw/breakit.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _BREAKIT_HXX +#define _BREAKIT_HXX + +#include <bf_svtools/bf_solar.h> +#include <i18npool/lang.h> + +/************************************************************************* + * class SwBreakIt + *************************************************************************/ + +#include <com/sun/star/uno/Reference.h> + +#include <com/sun/star/i18n/XBreakIterator.hpp> + +#include <com/sun/star/i18n/ForbiddenCharacters.hdl> +class String; +namespace binfilter { + + + +class SwBreakIt +{ +public: + ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > xBreak; +private: + ::com::sun::star::lang::Locale* pLocale; + ::com::sun::star::i18n::ForbiddenCharacters* pForbidden; + LanguageType aLast; // language of the current locale + LanguageType aForbiddenLang; // language of the current forbiddenChar struct + + void _GetLocale( const LanguageType aLang ); + void _GetForbidden( const LanguageType aLang ); +public: + SwBreakIt(); + ~SwBreakIt() { delete pLocale; delete pForbidden; } + ::com::sun::star::lang::Locale& GetLocale( const LanguageType aLang ) + { + if( aLast != aLang ) + _GetLocale( aLang ); + return *pLocale; + } + ::com::sun::star::i18n::ForbiddenCharacters& GetForbidden( const LanguageType aLang ) + { + if( !pForbidden || aForbiddenLang != aLang ) + _GetForbidden( aLang ); + return *pForbidden; + } + + USHORT GetRealScriptOfText( const String& rTxt, xub_StrLen nPos ) const; +}; + +extern SwBreakIt* pBreakIt; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/calbck.hxx b/inc/bf_sw/calbck.hxx new file mode 100644 index 000000000..4e1c916c3 --- /dev/null +++ b/inc/bf_sw/calbck.hxx @@ -0,0 +1,219 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +/************************************************************* +#* Service-Klassen + *************************************************************/ + +/* +#* Aendert sich ein Attribut in einem Format, so muss diese +#* Aenderung an alle abhaengigen Formate und ueber sie an +#* alle betroffenen Nodes propagiert werden. Dabei muss +#* festgestellt werden, ob die Aenderung einen Effekt haben +#* kann, oder ob das geaenderte Attribut von dem abhaengigen +#* Format ueberdefiniert wird (so dass ohnehin der +#* Attributwert des abhaengigen Formates den geaenderten +#* Wert verdeckt). Weiterhin kann der betroffene Node +#* feststellen, ob er von dem geaenderten Attribut Gebrauch +#* macht (Beispiel: Linienabstand fuer Unterstreichung wurde +#* geaendert, das Attribut Unterstreichung wurde aber nicht +#* verwendet). So wird bei Aenderungen der minimale Aufwand +#* zum Reformatieren erkannt. + */ +#ifndef _CALBCK_HXX +#define _CALBCK_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/rtti.hxx> +class SvStream; + +namespace binfilter { +class SfxPoolItem; +class SwModify; +class SwClientIter; + +// ---------- +// SwClient +// ---------- + +class SwClient +{ + friend class SwModify; + friend class SwClientIter; + + SwClient *pLeft, *pRight; // fuer die AVL-Sortierung + BOOL bModifyLocked : 1; // wird in SwModify::Modify benutzt, + // eigentlich ein Member des SwModify + // aber aus Platzgruenden hier. + BOOL bInModify : 1; // ist in einem Modify. (Debug!!!) + BOOL bInDocDTOR : 1; // Doc wird zerstoert, nicht "abmelden" + BOOL bInCache : 1; // Ist im BorderAttrCache des Layout, + // Traegt sich dann im Modify aus! + BOOL bInSwFntCache : 1; // Ist im SwFont-Cache der Formatierung + +protected: + SwModify *pRegisteredIn; + SwClient(SwModify *pToRegisterIn); + +public: + inline SwClient(); + virtual ~SwClient(); + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + const SwModify* GetRegisteredIn() const { return pRegisteredIn; } + + //rtti, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun + //kann ueber die Abhaengigkeitsliste eines Modify typsicher gecastet + //werden. + TYPEINFO(); + + void LockModify() { bModifyLocked = TRUE; } + void UnlockModify() { bModifyLocked = FALSE; } + void SetInCache( BOOL bNew ) { bInCache = bNew; } + void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; } + int IsModifyLocked() const { return bModifyLocked; } + int IsInDocDTOR() const { return bInDocDTOR; } + int IsInCache() const { return bInCache; } + int IsInSwFntCache() const { return bInSwFntCache; } + + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + +private: + SwClient( const SwClient& ); + SwClient &operator=( const SwClient& ); +}; + +inline SwClient::SwClient() : + pLeft(0), pRight(0), pRegisteredIn(0) +{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = FALSE; } + + +// ---------- +// SwModify +// ---------- + +// Klasse hat eine doppelt Verkette Liste fuer die Abhaengigen. + +class SwModify: public SwClient +{ + friend SvStream& operator<<( SvStream& aS, SwModify & ); + + friend class SwClientIter; + SwClient* pRoot; + + SwClient *_Remove(SwClient *pDepend); + +public: + SwModify(SwModify *pToRegisterIn ); + virtual ~SwModify(); + virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); + void Add(SwClient *pDepend); + SwClient *Remove(SwClient *pDepend) + { return bInDocDTOR ? 0 : _Remove( pDepend ); } + + const SwClient* GetDepends() const { return pRoot; } + + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + + void SetInDocDTOR() { bInDocDTOR = TRUE; } + + void CheckCaching( const USHORT nWhich ); + + BOOL IsLastDepend() const + { return pRoot && !pRoot->pLeft && !pRoot->pRight; } +}; + +// ---------- +// SwDepend +// ---------- + +/* + * Sehr sinnvolle Klasse, wenn ein Objekt von mehreren Objekten + * abhaengig ist. Diese sollte fuer jede Abhaengigkeit ein Objekt + * der Klasse SwDepend als Member haben. + */ +class SwDepend: public SwClient +{ +private: + SwClient *pToTell; +public: + SwClient* GetToTell() { return pToTell; } + virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); + SwDepend(SwClient *pTellHim, SwModify *pDepend); + + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem & ) const; +}; + + +class SwClientIter +{ + friend SwClient* SwModify::_Remove(SwClient *); // fuer Ptr-Korrektur + friend void SwModify::Add(SwClient *); // nur fuer ASSERT ! + + SwModify& rRoot; + SwClient *pAkt, *pDelNext; + // fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von + // Clients, wenn der Iterator gerade draufsteht. + SwClientIter *pNxtIter; + TypeId aSrchId; // fuer First/Next - suche diesen Type + +public: + SwClientIter( SwModify& ); + ~SwClientIter(); + + const SwModify& GetModify() const { return rRoot; } + SwModify& GetModify() { return rRoot; } + +#ifndef CFRONT + SwClient* operator++(int); // zum Naechsten + SwClient* operator--(int); // zum Vorherigen +#endif + SwClient* operator++(); // zum Naechsten + SwClient* operator--(); // zum Vorherigen + + SwClient* GoStart(); // zum Anfang + SwClient* GoEnd(); // zum Ende + + inline SwClient* GoRoot(); // wieder ab Root (==Start) anfangen + + SwClient* operator()() const + { return pDelNext == pAkt ? pAkt : pDelNext; } + + int IsChanged() const { return pDelNext != pAkt; } + + SwClient* First( TypeId nType ); + SwClient* Next(); +}; + +inline SwClient* SwClientIter::GoRoot() // wieder ab Root anfangen +{ + pAkt = rRoot.pRoot; + return (pDelNext = pAkt); +} + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/calc.hxx b/inc/bf_sw/calc.hxx new file mode 100644 index 000000000..2cb5fa487 --- /dev/null +++ b/inc/bf_sw/calc.hxx @@ -0,0 +1,235 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _CALC_HXX +#define _CALC_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/svarray.hxx> + +#ifndef __SBX_SBXVALUE //autogen +#include "bf_basic/sbxvar.hxx" +#endif +class CharClass; +class LocaleDataWrapper; + +namespace binfilter { + +class SwFieldType; +class SwDoc; + +#define TBLSZ 47 // sollte Primzahl sein, wegen HashTable + +const sal_Unicode cListDelim = '|'; + +/****************************************************************************** + * Calculate Operations + ******************************************************************************/ +enum SwCalcOper +{ + CALC_NAME, CALC_NUMBER, CALC_ENDCALC, + CALC_PLUS='+', CALC_MINUS='-', CALC_MUL='*', + CALC_DIV='/', CALC_PRINT=';', CALC_ASSIGN='=', + CALC_LP='(', CALC_RP=')', CALC_PHD='%', + CALC_POW='^', + CALC_LISTOP = cListDelim, + CALC_NOT=256, CALC_AND=257, CALC_OR=258, + CALC_XOR=259, CALC_EQ=260, CALC_NEQ=261, + CALC_LEQ=262, CALC_GEQ=263, CALC_LES=264, + CALC_GRE=265, CALC_SUM=266, CALC_MEAN=267, + CALC_SQRT=268, CALC_MIN=269, CALC_MIN_IN=270, + CALC_MAX=271, CALC_MAX_IN=272, CALC_SIN=273, + CALC_COS=274, CALC_TAN=275, CALC_ASIN=276, + CALC_ACOS=278, CALC_ATAN=279, CALC_TDIF=280, + CALC_ROUND=281 +}; + +//-- Calculate Operations Strings ----------------------------------------- + +extern const sal_Char sCalc_Add[]; +extern const sal_Char sCalc_Sub[]; +extern const sal_Char sCalc_Mul[]; +extern const sal_Char sCalc_Div[]; +extern const sal_Char sCalc_Phd[]; +extern const sal_Char sCalc_Sqrt[]; +extern const sal_Char sCalc_Pow[]; +extern const sal_Char sCalc_Or[]; +extern const sal_Char sCalc_Xor[]; +extern const sal_Char sCalc_And[]; +extern const sal_Char sCalc_Not[]; +extern const sal_Char sCalc_Eq[]; +extern const sal_Char sCalc_Neq[]; +extern const sal_Char sCalc_Leq[]; +extern const sal_Char sCalc_Geq[]; +extern const sal_Char sCalc_L[]; +extern const sal_Char sCalc_G[]; +extern const sal_Char sCalc_Sum[]; +extern const sal_Char sCalc_Mean[]; +extern const sal_Char sCalc_Min[]; +extern const sal_Char sCalc_Max[]; +extern const sal_Char sCalc_Sin[]; +extern const sal_Char sCalc_Cos[]; +extern const sal_Char sCalc_Tan[]; +extern const sal_Char sCalc_Asin[]; +extern const sal_Char sCalc_Acos[]; +extern const sal_Char sCalc_Atan[]; +extern const sal_Char sCalc_Tdif[]; +extern const sal_Char sCalc_Round[]; + +/****************************************************************************** + * Calculate ErrorCodes + ******************************************************************************/ +enum SwCalcError +{ + CALC_NOERR=0, + CALC_SYNTAX, // Syntax Fehler + CALC_ZERODIV, // Division durch Null + CALC_BRACK, // Fehlerhafte Klammerung + CALC_POWERR, // Ueberlauf in Quadratfunktion + CALC_VARNFND, // Variable wurde nicht gefunden + CALC_OVERFLOW, // Ueberlauf + CALC_WRONGTIME // falsches Zeitformat +}; + +class SwSbxValue : public SbxValue +{ +public: + //JP 03.02.99: immer auf eine Zahl defaulten, damit auch gerechnet wird. + // Ansonsten wird daraus ein SbxEMPTY und damit ist nichts + // anzufangen. + SwSbxValue( long n = 0 ) { PutLong( n ); } + SwSbxValue( const double& rD ) { PutDouble( rD ); } + SwSbxValue( const SwSbxValue& rVal ) : SvRefBase(), SbxValue( rVal ) {} + virtual ~SwSbxValue(); + + + // Strings sonderbehandeln + // Strings sonderbehandeln BOOLs sonderbehandeln + double GetDouble() const; + SwSbxValue& MakeDouble(); +}; + +/****************************************************************************** + * Calculate HashTables fuer VarTable und Operations + ******************************************************************************/ +struct SwHash +{ + SwHash( const String& rStr ); + virtual ~SwHash(); + String aStr; + SwHash *pNext; +}; + +struct SwCalcExp : public SwHash +{ + SwSbxValue nValue; + const SwFieldType* pFldType; + + SwCalcExp( const String& rStr, const SwSbxValue& rVal, + const SwFieldType* pFldType = 0 ); +}; + +SwHash* Find( const String& rSrch, SwHash** ppTable, + USHORT nTblSize, USHORT* pPos = 0 ); + +void DeleteHashTable( SwHash** ppTable, USHORT nTblSize ); + +// falls _CalcOp != 0, dann ist das ein gueltiger Operator +struct _CalcOp; +_CalcOp* FindOperator( const String& rSearch ); + +/****************************************************************************** + * class SwCalc + ******************************************************************************/ +class SwCalc +{ + SwHash* VarTable[ TBLSZ ]; + String aVarName, sCurrSym; + String sCommand; + SvPtrarr aRekurStk; + SwSbxValue nLastLeft; + SwSbxValue nNumberValue; + SwCalcExp aErrExpr; + xub_StrLen nCommandPos; + + SwDoc& rDoc; + LocaleDataWrapper* pLclData; + CharClass* pCharClass; + + USHORT nListPor; + SwCalcOper eCurrOper; + SwCalcOper eCurrListOper; + SwCalcError eError; + + + SwCalcOper GetToken(); + SwSbxValue Expr(); + SwSbxValue Term(); + SwSbxValue Prim(); + + BOOL ParseTime( USHORT*, USHORT*, USHORT* ); + + String GetColumnName( const String& rName ); + String GetDBName( const String& rName ); + + // dont call this methods + SwCalc( const SwCalc& ); + SwCalc& operator=( const SwCalc& ); + +public: + SwCalc( SwDoc& rD ); + ~SwCalc(); + + SwSbxValue Calculate( const String &rStr ); + String GetStrResult( double, BOOL bRound = TRUE ); + + SwCalcExp* VarInsert( const String& r ); + SwCalcExp* VarLook( const String &rStr, USHORT ins = 0 ); + void VarChange( const String& rStr, const SwSbxValue& rValue ); + void VarChange( const String& rStr, double ); + SwHash** GetVarTable() { return VarTable; } + + BOOL Push( const VoidPtr pPtr ); + void Pop( const VoidPtr pPtr ); + + void SetCalcError( SwCalcError eErr ) { eError = eErr; } + BOOL IsCalcError() const { return eError; } + + static bool Str2Double( const String& rStr, xub_StrLen& rPos, + double& rVal, + const LocaleDataWrapper* pData = 0 ); + static bool Str2Double( const String& rStr, xub_StrLen& rPos, + double& rVal, SwDoc* pDoc ); + +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/cellatr.hxx b/inc/bf_sw/cellatr.hxx new file mode 100644 index 000000000..e96fdb911 --- /dev/null +++ b/inc/bf_sw/cellatr.hxx @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _CELLATR_HXX +#define _CELLATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/intitem.hxx> +#include <bf_svtools/zforlist.hxx> + +#include "format.hxx" +#include "cellfml.hxx" +namespace binfilter { + + +class SwTblBoxNumFormat : public SfxUInt32Item +{ + BOOL bAuto; // automatisch vergebenes Flag +public: + SwTblBoxNumFormat( UINT32 nFormat = NUMBERFORMAT_TEXT, + BOOL bAuto = FALSE ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFileVersion) const; + + inline SwTblBoxNumFormat& operator=( const SwTblBoxNumFormat& rAttr ) + { + SetValue( rAttr.GetValue() ); + SetAutoFlag( rAttr.GetAutoFlag() ); + return *this; + } + + BOOL GetAutoFlag() const { return bAuto; } + void SetAutoFlag( BOOL bFlag = TRUE ) { bAuto = bFlag; } +}; + +class SwTblBoxFormula : public SfxPoolItem, public SwTableFormula +{ + SwModify* pDefinedIn; // Modify-Object, in dem die Formel steht + // kann nur TablenBoxFormat sein + +public: + SwTblBoxFormula( const String& rFormula ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFileVersion) const; + + // erfrage und setze den Modify-Pointer + inline const SwModify* GetDefinedIn() const { return pDefinedIn; } + inline void ChgDefinedIn( const SwModify* pNew ) + { pDefinedIn = (SwModify*)pNew; } + // suche den Node, in dem die Formel steht: + // BoxAttribut -> BoxStartNode + virtual const SwNode* GetNodeOfFormula() const; +}; + +class SwTblBoxValue : public SfxPoolItem +{ + double nValue; +public: + SwTblBoxValue(); + SwTblBoxValue( const double aVal ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFileVersion) const; + + inline SwTblBoxValue& operator=( const SwTblBoxValue& rCmp ) + { + nValue = rCmp.nValue; + return *this; + } + + double GetValue() const { return nValue; } + void SetValue( const double nVal ) { nValue = nVal; } +}; + + + +//*************************************************************************** + +inline const SwTblBoxNumFormat &SwAttrSet::GetTblBoxNumFmt(BOOL bInP) const + { return (const SwTblBoxNumFormat&)Get( RES_BOXATR_FORMAT,bInP); } +inline const SwTblBoxFormula &SwAttrSet::GetTblBoxFormula(BOOL bInP) const + { return (const SwTblBoxFormula&)Get( RES_BOXATR_FORMULA,bInP); } +inline const SwTblBoxValue &SwAttrSet::GetTblBoxValue(BOOL bInP) const + { return (const SwTblBoxValue&)Get( RES_BOXATR_VALUE, bInP); } + +//*************************************************************************** + +inline const SwTblBoxNumFormat &SwFmt::GetTblBoxNumFmt(BOOL bInP) const + { return aSet.GetTblBoxNumFmt(bInP); } +inline const SwTblBoxFormula &SwFmt::GetTblBoxFormula(BOOL bInP) const + { return aSet.GetTblBoxFormula(bInP); } +inline const SwTblBoxValue &SwFmt::GetTblBoxValue(BOOL bInP) const + { return aSet.GetTblBoxValue(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/cellfml.hxx b/inc/bf_sw/cellfml.hxx new file mode 100644 index 000000000..3aaa37f56 --- /dev/null +++ b/inc/bf_sw/cellfml.hxx @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _CELLFML_HXX +#define _CELLFML_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_tools/string.hxx> +namespace binfilter { + +class SwTable; +class SwNode; +class SwTableSortBoxes; +class SwSelBoxes; +class SwCalc; +class SwTableBox; +class SwTableFmlUpdate; + +class SwTblCalcPara +{ + const SwTableBox* pLastTblBox; + USHORT nStackCnt, nMaxSize; + +public: + SwTableSortBoxes *pBoxStk; // Stack fuers erkennen von Rekursionen ! + SwCalc& rCalc; // akt. Calculator + const SwTable* pTbl; // akt. Tabelle + + SwTblCalcPara( SwCalc& rCalculator, const SwTable& rTable ); + ~SwTblCalcPara(); + + BOOL IsStackOverFlow() const { return nMaxSize == nStackCnt; } + BOOL IncStackCnt() { return nMaxSize == ++nStackCnt; } + void DecStackCnt() { if( nStackCnt ) --nStackCnt; } + void SetLastTblBox( const SwTableBox* pBox ) { pLastTblBox = pBox; } +}; + + + +class SwTableFormula +{ +typedef void (SwTableFormula:: *FnScanFormel)( const SwTable&, String&, + String&, String*, void* ) const; + + void BoxNmsToPtr( const SwTable&, String&, String&, String* = 0, + void* pPara = 0 ) const; + void PtrToBoxNms( const SwTable&, String&, String&, String* = 0, + void* pPara = 0 ) const; + void _MakeFormel( const SwTable&, String&, String&, String* = 0, + void* pPara = 0 ) const; + void _SplitMergeBoxNm( const SwTable&, String&, String&, String* = 0, + void* = 0 ) const{DBG_BF_ASSERT(0, "STRIP");} + + void GetBoxes( const SwTableBox& rStt, const SwTableBox& rEnd, + SwSelBoxes& rBoxes ) const; + String ScanString( FnScanFormel fnFormel, const SwTable& rTbl, + void* = 0 ) const; + + +protected: + enum NameType { EXTRNL_NAME, INTRNL_NAME, REL_NAME }; + + String sFormel; // akt. Formel + NameType eNmType; // akt. Darstellungs Art + BOOL bValidValue; // TRUE: Formel neu berechnen + + // suche den Node, in dem die Formel steht: + // TextFeld -> TextNode, + // BoxAttribut -> BoxStartNode + // !!! MUSS VON JEDER ABLEITUNG UEBERLADEN WERDEN !!! + virtual const SwNode* GetNodeOfFormula() const = 0; + + SwTableFormula( const String& rFormel ); + + ~SwTableFormula() {} + + String MakeFormel( SwTblCalcPara& rCalcPara ) const + { + return ScanString( &SwTableFormula::_MakeFormel, + *rCalcPara.pTbl, &rCalcPara ); + } + +public: + + SwTableFormula( const SwTableFormula& rCpy ) { *this = rCpy; } + SwTableFormula& operator=( const SwTableFormula& rCpy ) + { + sFormel = rCpy.sFormel; + eNmType = rCpy.eNmType; + bValidValue = rCpy.bValidValue; + return *this; + } + + // erzeuge aus der internen (fuer CORE) die externe (fuer UI) Formel + void PtrToBoxNm( const SwTable* pTbl ); + // erzeuge aus der externen (fuer UI) die interne (fuer CORE) Formel + void BoxNmToPtr( const SwTable* pTbl ); + + // ist gerade eine intern Darstellung aktiv + BOOL IsIntrnlName() const { return eNmType == INTRNL_NAME; } + // erfrage die akt. Darstellung der Formel + NameType GetNameType() const { return eNmType; } + + // erfrage/setze das Flag, ob der akt. Wert gueltig ist + BOOL IsValid() const { return bValidValue; } + inline void ChgValid( BOOL bNew ) { bValidValue = bNew; } + + const String& GetFormula() const { return sFormel; } + void SetFormula( const String& rNew ) + { + sFormel = rNew; + bValidValue = FALSE; + eNmType = EXTRNL_NAME; + } + + // sind alle Boxen gueltig, auf die sich die Formel bezieht? +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/charatr.hxx b/inc/bf_sw/charatr.hxx new file mode 100644 index 000000000..5aac215bc --- /dev/null +++ b/inc/bf_sw/charatr.hxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CHARATR_HXX +#define _CHARATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> +namespace binfilter { + + +/****************************************************************************** + * Implementierung der Charakter-Attribut Methoden vom SwAttrSet + * AMA 12.10.94: Umstellung auf SvxItems. + ******************************************************************************/ + +inline const SvxPostureItem &SwAttrSet::GetPosture(BOOL bInP) const + { return (const SvxPostureItem&)Get( RES_CHRATR_POSTURE,bInP); } +inline const SvxPostureItem &SwAttrSet::GetCJKPosture(BOOL bInP) const + { return (const SvxPostureItem&)Get( RES_CHRATR_CJK_POSTURE,bInP); } +inline const SvxPostureItem &SwAttrSet::GetCTLPosture(BOOL bInP) const + { return (const SvxPostureItem&)Get( RES_CHRATR_CTL_POSTURE,bInP); } +inline const SvxWeightItem &SwAttrSet::GetWeight(BOOL bInP) const + { return (const SvxWeightItem&)Get( RES_CHRATR_WEIGHT,bInP); } +inline const SvxWeightItem &SwAttrSet::GetCJKWeight(BOOL bInP) const + { return (const SvxWeightItem&)Get( RES_CHRATR_CJK_WEIGHT,bInP); } +inline const SvxWeightItem &SwAttrSet::GetCTLWeight(BOOL bInP) const + { return (const SvxWeightItem&)Get( RES_CHRATR_CTL_WEIGHT,bInP); } +inline const SvxShadowedItem &SwAttrSet::GetShadowed(BOOL bInP) const + { return (const SvxShadowedItem&)Get( RES_CHRATR_SHADOWED,bInP); } +inline const SvxAutoKernItem &SwAttrSet::GetAutoKern(BOOL bInP) const + { return (const SvxAutoKernItem&)Get( RES_CHRATR_AUTOKERN,bInP); } +inline const SvxWordLineModeItem &SwAttrSet::GetWordLineMode(BOOL bInP) const + { return (const SvxWordLineModeItem&)Get( RES_CHRATR_WORDLINEMODE,bInP); } +inline const SvxContourItem &SwAttrSet::GetContour(BOOL bInP) const + { return (const SvxContourItem&)Get( RES_CHRATR_CONTOUR,bInP); } +inline const SvxKerningItem &SwAttrSet::GetKerning(BOOL bInP) const + { return (const SvxKerningItem&)Get( RES_CHRATR_KERNING,bInP); } +inline const SvxUnderlineItem &SwAttrSet::GetUnderline(BOOL bInP) const + { return (const SvxUnderlineItem&)Get( RES_CHRATR_UNDERLINE,bInP); } +inline const SvxCrossedOutItem &SwAttrSet::GetCrossedOut(BOOL bInP) const + { return (const SvxCrossedOutItem&)Get( RES_CHRATR_CROSSEDOUT,bInP); } +inline const SvxFontHeightItem &SwAttrSet::GetSize(BOOL bInP) const + { return (const SvxFontHeightItem&)Get( RES_CHRATR_FONTSIZE,bInP); } +inline const SvxFontHeightItem &SwAttrSet::GetCJKSize(BOOL bInP) const + { return (const SvxFontHeightItem&)Get( RES_CHRATR_CJK_FONTSIZE,bInP); } +inline const SvxFontHeightItem &SwAttrSet::GetCTLSize(BOOL bInP) const + { return (const SvxFontHeightItem&)Get( RES_CHRATR_CTL_FONTSIZE,bInP); } +inline const SvxPropSizeItem &SwAttrSet::GetPropSize(BOOL bInP) const + { return (const SvxPropSizeItem&)Get( RES_CHRATR_PROPORTIONALFONTSIZE,bInP); } +inline const SvxFontItem &SwAttrSet::GetFont(BOOL bInP) const + { return (const SvxFontItem&)Get( RES_CHRATR_FONT,bInP); } +inline const SvxFontItem &SwAttrSet::GetCJKFont(BOOL bInP) const + { return (const SvxFontItem&)Get( RES_CHRATR_CJK_FONT,bInP); } +inline const SvxFontItem &SwAttrSet::GetCTLFont(BOOL bInP) const + { return (const SvxFontItem&)Get( RES_CHRATR_CTL_FONT,bInP); } +inline const SvxColorItem &SwAttrSet::GetColor(BOOL bInP) const + { return (const SvxColorItem&)Get( RES_CHRATR_COLOR,bInP); } +inline const SvxCharSetColorItem &SwAttrSet::GetCharSetColor(BOOL bInP) const + { return (const SvxCharSetColorItem&)Get( RES_CHRATR_CHARSETCOLOR,bInP); } +inline const SvxLanguageItem &SwAttrSet::GetLanguage(BOOL bInP) const + { return (const SvxLanguageItem&)Get( RES_CHRATR_LANGUAGE,bInP); } +inline const SvxLanguageItem &SwAttrSet::GetCJKLanguage(BOOL bInP) const + { return (const SvxLanguageItem&)Get( RES_CHRATR_CJK_LANGUAGE,bInP); } +inline const SvxLanguageItem &SwAttrSet::GetCTLLanguage(BOOL bInP) const + { return (const SvxLanguageItem&)Get( RES_CHRATR_CTL_LANGUAGE,bInP); } +inline const SvxEscapementItem &SwAttrSet::GetEscapement(BOOL bInP) const + { return (const SvxEscapementItem&)Get( RES_CHRATR_ESCAPEMENT,bInP); } +inline const SvxCaseMapItem &SwAttrSet::GetCaseMap(BOOL bInP) const + { return (const SvxCaseMapItem&)Get( RES_CHRATR_CASEMAP,bInP); } +inline const SvxNoHyphenItem &SwAttrSet::GetNoHyphenHere(BOOL bInP) const + { return (const SvxNoHyphenItem&)Get( RES_CHRATR_NOHYPHEN,bInP); } +inline const SvxBlinkItem &SwAttrSet::GetBlink(BOOL bInP) const + { return (const SvxBlinkItem&)Get( RES_CHRATR_BLINK,bInP); } +inline const SvxBrushItem &SwAttrSet::GetChrBackground( BOOL bInP ) const + { return (const SvxBrushItem&)Get( RES_CHRATR_BACKGROUND, bInP ); } +inline const SvxEmphasisMarkItem &SwAttrSet::GetEmphasisMark( BOOL bInP ) const + { return (const SvxEmphasisMarkItem&)Get( RES_CHRATR_EMPHASIS_MARK, bInP ); } +inline const SvxTwoLinesItem &SwAttrSet::Get2Lines( BOOL bInP ) const + { return (const SvxTwoLinesItem&)Get( RES_CHRATR_TWO_LINES, bInP ); } +inline const SvxCharScaleWidthItem &SwAttrSet::GetCharScaleW( BOOL bInP ) const + { return (const SvxCharScaleWidthItem&)Get( RES_CHRATR_SCALEW, bInP ); } +inline const SvxCharRotateItem &SwAttrSet::GetCharRotate( BOOL bInP ) const + { return (const SvxCharRotateItem&)Get( RES_CHRATR_ROTATE, bInP ); } +inline const SvxCharReliefItem &SwAttrSet::GetCharRelief( BOOL bInP ) const + { return (const SvxCharReliefItem&)Get( RES_CHRATR_RELIEF, bInP ); } + +/****************************************************************************** + * Implementierung der Charakter-Attribut Methoden vom SwFmt + * AMA: 12.10.94: Umstellung auf SvxItems. + ******************************************************************************/ + +inline const SvxPostureItem &SwFmt::GetPosture(BOOL bInP) const + { return aSet.GetPosture(bInP); } +inline const SvxWeightItem &SwFmt::GetWeight(BOOL bInP) const + { return aSet.GetWeight(bInP); } +inline const SvxShadowedItem &SwFmt::GetShadowed(BOOL bInP) const + { return aSet.GetShadowed(bInP); } +inline const SvxAutoKernItem &SwFmt::GetAutoKern(BOOL bInP) const + { return aSet.GetAutoKern(bInP); } +inline const SvxWordLineModeItem &SwFmt::GetWordLineMode(BOOL bInP) const + { return aSet.GetWordLineMode(bInP); } +inline const SvxContourItem &SwFmt::GetContour(BOOL bInP) const + { return aSet.GetContour(bInP); } +inline const SvxKerningItem &SwFmt::GetKerning(BOOL bInP) const + { return aSet.GetKerning(bInP); } +inline const SvxUnderlineItem &SwFmt::GetUnderline(BOOL bInP) const + { return aSet.GetUnderline(bInP); } +inline const SvxCrossedOutItem &SwFmt::GetCrossedOut(BOOL bInP) const + { return aSet.GetCrossedOut(bInP); } +inline const SvxFontHeightItem &SwFmt::GetSize(BOOL bInP) const + { return aSet.GetSize(bInP); } +inline const SvxPropSizeItem &SwFmt::GetPropSize(BOOL bInP) const + { return aSet.GetPropSize(bInP); } +inline const SvxFontItem &SwFmt::GetFont(BOOL bInP) const + { return aSet.GetFont(bInP); } +inline const SvxFontItem &SwFmt::GetCJKFont(BOOL bInP) const + { return aSet.GetCJKFont(bInP); } +inline const SvxFontItem &SwFmt::GetCTLFont(BOOL bInP) const + { return aSet.GetCTLFont(bInP); } +inline const SvxColorItem &SwFmt::GetColor(BOOL bInP) const + { return aSet.GetColor(bInP); } +inline const SvxCharSetColorItem &SwFmt::GetCharSetColor(BOOL bInP) const + { return aSet.GetCharSetColor(bInP); } +inline const SvxLanguageItem &SwFmt::GetLanguage(BOOL bInP) const + { return aSet.GetLanguage(bInP); } +inline const SvxEscapementItem &SwFmt::GetEscapement(BOOL bInP) const + { return aSet.GetEscapement(bInP); } +inline const SvxCaseMapItem &SwFmt::GetCaseMap(BOOL bInP) const + { return aSet.GetCaseMap(bInP); } +inline const SvxNoHyphenItem &SwFmt::GetNoHyphenHere(BOOL bInP) const + { return aSet.GetNoHyphenHere(bInP); } +inline const SvxBlinkItem &SwFmt::GetBlink(BOOL bInP) const + { return aSet.GetBlink(bInP); } +inline const SvxBrushItem &SwFmt::GetChrBackground(BOOL bInP) const + { return aSet.GetChrBackground(bInP); } +inline const SvxEmphasisMarkItem &SwFmt::GetEmphasisMark( BOOL bInP ) const + { return aSet.GetEmphasisMark(bInP); } +inline const SvxTwoLinesItem &SwFmt::Get2Lines( BOOL bInP ) const + { return aSet.Get2Lines(bInP); } +inline const SvxCharScaleWidthItem &SwFmt::GetCharScaleW( BOOL bInP ) const + { return aSet.GetCharScaleW(bInP); } +inline const SvxCharRotateItem &SwFmt::GetCharRotate( BOOL bInP ) const + { return aSet.GetCharRotate(bInP); } +inline const SvxCharReliefItem &SwFmt::GetCharRelief( BOOL bInP ) const + { return aSet.GetCharRelief(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/charfmt.hxx b/inc/bf_sw/charfmt.hxx new file mode 100644 index 000000000..165d26a40 --- /dev/null +++ b/inc/bf_sw/charfmt.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CHARFMT_HXX +#define _CHARFMT_HXX + +#include <format.hxx> +namespace binfilter { + +class SwCharFmt : public SwFmt +{ + friend class SwDoc; + friend class SwTxtFmtColl; + + SwCharFmt( SwAttrPool& rPool, const sal_Char* pFmtName, + SwCharFmt *pDerivedFrom ) + : SwFmt( rPool, pFmtName, aCharFmtSetRange, pDerivedFrom, RES_CHRFMT ) + {} + SwCharFmt( SwAttrPool& rPool, const String &rFmtName, + SwCharFmt *pDerivedFrom ) + : SwFmt( rPool, rFmtName, aCharFmtSetRange, pDerivedFrom, RES_CHRFMT ) + {} + + +public: +}; + +} //namespace binfilter +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/chcmprse.hxx b/inc/bf_sw/chcmprse.hxx new file mode 100644 index 000000000..1224d8cfd --- /dev/null +++ b/inc/bf_sw/chcmprse.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _CHCMPRSE_HXX +#define _CHCMPRSE_HXX +namespace binfilter { + +enum SwCharCompressType{ CHARCOMPRESS_NONE, + CHARCOMPRESS_PUNCTUATION, + CHARCOMPRESS_PUNCTUATION_KANA }; + + +} //namespace binfilter +#endif + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/checkit.hxx b/inc/bf_sw/checkit.hxx new file mode 100644 index 000000000..2be491f19 --- /dev/null +++ b/inc/bf_sw/checkit.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _CHECKIT_HXX +#define _CHECKIT_HXX + +#include <com/sun/star/uno/Reference.h> + +#include <com/sun/star/i18n/XInputSequenceChecker.hpp> +namespace binfilter { + +/************************************************************************* + * Input strings with length > MAX_SEQUENCE_CHECK_LEN are not checked. + *************************************************************************/ + +#define MAX_SEQUENCE_CHECK_LEN 5 + +/************************************************************************* + * class SwCheckIt + * + * Wrapper for the XInputSequenceChecker + *************************************************************************/ + +class SwCheckIt +{ +public: + ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XInputSequenceChecker > xCheck; + + SwCheckIt(); +}; + +extern SwCheckIt* pCheckIt; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/chpfld.hxx b/inc/bf_sw/chpfld.hxx new file mode 100644 index 000000000..cd0f63fd8 --- /dev/null +++ b/inc/bf_sw/chpfld.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CHPFLD_HXX +#define _CHPFLD_HXX + +#include <bf_svtools/bf_solar.h> + + +class SwFrm; +class SwTxtNode; + +#include <unoobj.hxx> +namespace binfilter { + +enum SwChapterFormat +{ + CF_BEGIN, + CF_NUMBER = CF_BEGIN, // nur die Kapitelnummer + CF_TITLE, // nur die "Ueberschrift" + CF_NUM_TITLE, // Kapitelnummer und "Ueberschrift" + CF_NUMBER_NOPREPST, // nur die Kapitelnummer ohne Post/Prefix + CF_NUM_NOPREPST_TITLE, // Kapitelnummer ohne Post/Prefix und "Ueberschrift" + CF_END +}; + +/*-------------------------------------------------------------------- + Beschreibung: Kapitel + --------------------------------------------------------------------*/ + +class SwChapterFieldType : public SwFieldType +{ +public: + SwChapterFieldType(); + + virtual SwFieldType* Copy() const; + +}; + + + +/*-------------------------------------------------------------------- + Beschreibung: Kapitelnummer + --------------------------------------------------------------------*/ +class SwChapterField : public SwField +{ + friend class SwChapterFieldType; + BYTE nLevel; + String sTitle, sNumber, sPre, sPost; +public: + SwChapterField(SwChapterFieldType*, sal_uInt32 nFmt = 0); + + void ChangeExpansion( const SwFrm*, const SwTxtNode*, BOOL bSrchNum = FALSE); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline BYTE GetLevel() const; + inline void SetLevel(BYTE); + + inline const String& GetNumber() const; + inline const String& GetTitle() const; + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline BYTE SwChapterField::GetLevel() const { return nLevel; } +inline void SwChapterField::SetLevel(BYTE nLev) { nLevel = nLev; } +inline const String& SwChapterField::GetNumber() const { return sNumber; } +inline const String& SwChapterField::GetTitle() const { return sTitle; } + +} //namespace binfilter +#endif // _CHPFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/cmdid.h b/inc/bf_sw/cmdid.h new file mode 100644 index 000000000..13700e2b0 --- /dev/null +++ b/inc/bf_sw/cmdid.h @@ -0,0 +1,1218 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +/****************************************************************************** +Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr + erlaubt, da es von swicli.c included wird! +******************************************************************************/ + +#ifndef _SFX_HRC +#include <bf_sfx2/sfx.hrc> +#endif + +#include <unomid.h> +/* Flags die mittels des Disable-Features in den Slot-Definitionen ausgenutzt + * werden */ +#define SW_DISABLE_ON_PROTECTED_CURSOR 0x00000001 +#define SW_DISABLE_ON_MAILBOX_EDITOR 0x00000002 + + +#define FN_FILE SID_SW_START +#define FN_EDIT (SID_SW_START + 100) +#define FN_VIEW (SID_SW_START + 200) +#define FN_INSERT (SID_SW_START + 300) +#define FN_FORMAT (SID_SW_START + 400) +#define FN_EXTRA (SID_SW_START + 600) +#define FN_WINDOW (SID_SW_START + 700) +#define FN_HELP (SID_SW_START + 800) +#define FN_SELECTION (SID_SW_START + 900) +#define FN_QUERY (SID_SW_START + 1000) +#define FN_ENVELP (SID_SW_START + 1050) +#define FN_PARAM (SID_SW_START + 1100) +#define FN_STAT (SID_SW_START + 1180) +#define FN_PRNOPT (SID_SW_START + 1200) +#define FN_PGPREVIEW (SID_SW_START + 1250) +#define FN_FRAME (SID_SW_START + 1300) +#define FN_INSERT2 (SID_SW_START + 1400) +#define FN_FORMAT2 (SID_SW_START + 1600) +#define FN_EDIT2 (SID_SW_START + 1800) +#define FN_QUERY2 (SID_SW_START + 2000) +#define FN_EXTRA2 (SID_SW_START + 2200) +#define FN_PARAM2 (SID_SW_START + 2400) + + /* More accurately, this range should be from FN_EXTRA2 to FN_PARAM2-1, but + * FN_NUMBER_NEWSTART comes from FN_FORMAT2, and FN_PARAM_LINK_DISPLAY_NAME + * comes from FN_PARAM2 so we need to include FORMAT2, + * EDIT2 and QUERY2 and PARAM2 in the range...hopefully this will be fixed + * soon */ + +#define FN_UNO_RANGE_BEGIN FN_FORMAT2 +#define FN_UNO_RANGE_END (FN_PARAM2 + 199) + + +#define HELP_OFFSET 1100 +#define CMD_STR_OFFSET 2200 +#define CMD_STR_OFFSET_MULTILANG 3300 +#define CMDID_END 5500 + +/*-------------------------------------------------------------------- + Bereich: Datei + --------------------------------------------------------------------*/ +#define FN_CLOSE_FILE (FN_FILE + 1 ) /* Schliessen */ +#define FN_LAUNCH_REGISTRY (FN_FILE + 2 ) /* Ablage */ + + +#define FN_NEW_GLOBAL_DOC (FN_FILE + 4 ) /* Globaldokument erzeugen */ +#define FN_NEW_FILE (FN_FILE + 5 ) /* Neu */ +#define FN_NEW_FILE_DLG (FN_FILE + 6 ) /* Neu Dialog */ +#define FN_OPEN_FILE (FN_FILE + 7 ) /* Oeffnen */ +#define FN_EDIT_FILE (FN_FILE + 8 ) /* Oeffnen oder ToTop */ + +#define FN_INETFILE (FN_FILE + 9 ) /* Internet File-Dialog */ + +#define FN_PRINT_FILE (FN_FILE + 10) /* Drucken */ +#define FN_PRINT_FILE_OPTIONS (FN_FILE + 11) /* Drucken Optionen */ +#define FN_SAVE_FILE_AS (FN_FILE + 12) /* Speichern unter */ +#define FN_SAVE_FILE (FN_FILE + 13) /* Speichern */ +#define FN_SETUP_PRINTER (FN_FILE + 14) /* Druckereinstellung */ +#define FN_SETUP_PRINTER_DLG (FN_FILE + 15) /* Druckereinstellung */ +#define FN_SHOW_PREVIEW (FN_FILE + 16) /* Druckbild */ +#define FN_EXIT (FN_FILE + 17) /* Writer beenden */ +#define FN_PRINT_CFG_DLG (FN_FILE + 18) /* Optionen Drucken */ + + + +#define FN_SAVE_ALL (FN_FILE + 23) /* Alle Files speichern */ +#define FN_NEW_FILE_DEFAULT (FN_FILE + 24) /* Neue Datei mit Standardvorlage */ +#define FN_PRINT_FILE_DEFAULT (FN_FILE + 25) /* Drucken mit Defaults */ +#define FN_LAUNCH_EQ_EDITOR (FN_FILE + 26) /* Formel Editor */ +#define FN_CHANGE_PRINTER (FN_FILE + 27) /* Drucker einstellen */ +#define FN_FAX_END (FN_FILE + 29) /* Faxen fertig, Id fuer PostMessage */ + +#define FN_SELECT_DATABASE (FN_FILE + 30) /* Selektion Datenbank */ +#define FN_DOC_INFO_DLG (FN_FILE + 31) /* Dokumentinfo */ +#define FN_DOC_MGR_DLG (FN_FILE + 32) /* Dokument-Manager */ + +#define FN_GET_DOCSTAT (FN_FILE + 33) /* Dokumentstatistik einzeln auslesen */ + + +#define FN_SAVE_SELECTION (FN_FILE + 35) /* Selektion speichern */ + +#define FN_OUTLINE_TO_IMPRESS (FN_FILE + 36) /* Outline zu StarImpress senden */ +#define FN_OUTLINE_TO_CLIPBOARD (FN_FILE + 37) /* Outline in das Clipboad copieren */ + +#define FN_NEW_HTML_DOC (FN_FILE + 40 ) /* HTML-Dokument "erzeugen" */ + +#define FN_APP_START (FN_FILE + 98) /* fuer Makro bei App.Start */ +#define FN_APP_END (FN_FILE + 99) /* fuer Makro bei App.Ende */ + +/*-------------------------------------------------------------------- + Bereich: Bearbeiten + --------------------------------------------------------------------*/ +#define FN_CLEAR (FN_EDIT + 1 ) /* Loeschen */ +#define FN_COPY (FN_EDIT + 2 ) /* Kopieren */ +#define FN_CUT (FN_EDIT + 3 ) /* Ausschneiden */ +#define FN_EDIT_FIELD (FN_EDIT + 4 ) /* Textbefehl bearbeiten */ +#define FN_EDIT_FIELD_DLG (FN_EDIT + 5 ) /* Textbefehl bearbeiten */ +#define FN_EDIT_FILE_INFO (FN_EDIT + 6 ) /* Dokumentinfo */ +#define FN_EDIT_FILE_INFO_DLG (FN_EDIT + 7 ) /* Dokumentinfo Dialog */ +#define FN_EDIT_LINK (FN_EDIT + 8 ) /* Verknuepfungen */ +#define FN_EDIT_LINK_DLG (FN_EDIT + 9 ) /* Verknuepfungen */ +#define FN_GOTO (FN_EDIT + 11) /* Gehe zu */ + +#define FN_PASTE (FN_EDIT + 13) /* Einfuegen */ +#define FN_PASTESPECIAL (FN_EDIT + 14) /* Verknuepfung einfuegen */ +#define FN_PASTESPECIAL_DLG (FN_EDIT + 15) /* Verknuepfung einfuegen */ + +#define FN_NUMBER_BULLETS (FN_EDIT + 21) /* Bullets */ +#define FN_REPEAT (FN_EDIT + 22) /* Letzten Befehl wiederholen */ +#define FN_EDIT_IDX_ENTRY_DLG (FN_EDIT + 23) /* Index-Entry bearbeiten */ +#define FN_UPDATE_FIELDS (FN_EDIT + 26) /* Feldinhalte erneuern */ +#define FN_EXECUTE_MACROFIELD (FN_EDIT + 27) /* Macrofeld ausfuehren */ +#define FN_EDIT_FORMULA (FN_EDIT + 28) /* Formel in RibbonBar bearbeiten */ +#define FN_CALC_TABLE (FN_EDIT + 29) /* Tabelle durchrechnen */ + +/*-------------------------------------------------------------------- + Bereich: Bullets + --------------------------------------------------------------------*/ +#define FN_NUM_BULLET_DOWN (FN_EDIT + 30) /* Runterstufen */ +#define FN_NUM_BULLET_UP (FN_EDIT + 31) /* Raufstufen */ +#define FN_NUM_BULLET_PREV (FN_EDIT + 32) /* zum vorigen Eintrag */ +#define FN_NUM_BULLET_NEXT (FN_EDIT + 33) /* zum naechsten Eintrag */ +#define FN_NUM_BULLET_MOVEUP (FN_EDIT + 34) /* nach oben schieben */ +#define FN_NUM_BULLET_MOVEDOWN (FN_EDIT + 35) /* nach unten schieben */ +#define FN_NUM_BULLET_NONUM (FN_EDIT + 36) /* Eintrag ohne Nummer */ +#ifndef FN_NUM_BULLET_OFF //in SVX already +#define FN_NUM_BULLET_OFF (FN_EDIT + 37) /* Numerierung aus */ +#endif + + +// schon im SVX +//#define FN_NUM_BULLET_ON (FN_EDIT + 38) /* Numerierung mit Bullets an */ + +#define FN_NUM_BULLET_OUTLINE_DOWN (FN_EDIT + 39) /* Runterstufen mit Unterpunkten */ +#define FN_NUM_BULLET_OUTLINE_UP (FN_EDIT + 40) /* Raufstufen mit Unterpunkten */ +#define FN_NUM_BULLET_OUTLINE_MOVEUP (FN_EDIT + 41) /* nach oben schieben mit Unterpunkten */ +#define FN_NUM_BULLET_OUTLINE_MOVEDOWN (FN_EDIT + 42) /* nach unten schieben mit Unterpunkten */ +#define FN_UPDATE_INPUTFIELDS (FN_EDIT + 43) /* Eingabefelder updaten */ +// schon im SVX +//#define FN_NUM_NUMBERING_ON (FN_EDIT + 44) /* Numerierung an */ + +#define FN_NUM_OR_NONUM (FN_EDIT + 46) /* Nummer ein-/aus */ + +#define FN_GOTO_NEXT_INPUTFLD (FN_EDIT + 47) /* zum naechsten EingabeFeld */ +#define FN_GOTO_PREV_INPUTFLD (FN_EDIT + 48) /* zum vorherigen EingabeFeld */ + +#define FN_REPEAT_SEARCH (FN_EDIT + 50) /* Suche wiederholen */ +#define FN_REPEAT_REPLACE (FN_EDIT + 51) /* Ersetzen wiederholen */ +#define FN_UPDATE_GRAFIC (FN_EDIT + 53) /* Grafik aendern */ +#define FN_SETTAB_ATCURPOS (FN_EDIT + 54) /* Tab an der aktuellen Pos setzen */ +#define FN_SET_LR_IND_ATCURPOS (FN_EDIT + 55) /* EZE und LR setzen */ +#define FN_FRMCNT_TO_BODY (FN_EDIT + 56) /* Rahmeninhalt zu Text */ +#define FN_UPDATE_TOXBASE (FN_EDIT + 57) /* Naechstes Verzeichnis erneuern */ + +#define FN_REPAGINATE (FN_EDIT + 61) /* Neuformatierung erzwingen */ +#define FN_EDIT_FOOTNOTE (FN_EDIT + 62) /* Fussnote bearbeiten */ + +#define FN_EDIT_REGION (FN_EDIT + 65) /* Bereiche bearbeiten */ +#define FN_GOTO_REFERENCE (FN_EDIT + 66) /* Von der Refmark zur Referenz */ + +// schon im Svx definiert +#define FN_NEXT_BOOKMARK (FN_EDIT + 68) /* */ +#define FN_PREV_BOOKMARK (FN_EDIT + 69) /* */ + +/*Navigator ToolBoxen*/ +#define FN_SELECT_BOOKMARK (FN_EDIT + 70) /**/ +#define FN_ITEM_DOWN (FN_EDIT + 71) /**/ +#define FN_ITEM_LEFT (FN_EDIT + 72) /**/ +#define FN_ITEM_RIGHT (FN_EDIT + 73) /**/ +#define FN_ITEM_UP (FN_EDIT + 74) /**/ +#define FN_DOWN (FN_EDIT + 75) /**/ + +#define FN_SELECT_FOOTER (FN_EDIT + 77) /**/ +#define FN_SELECT_FRAME (FN_EDIT + 78) /**/ +#define FN_SELECT_HEADER (FN_EDIT + 79) /**/ +#define FN_PAGENUMBER (FN_EDIT + 80) /**/ +#define FN_SELECT_AUTO_BOOKMARK (FN_EDIT + 81) /**/ +#define FN_SELECT_FOOTNOTE (FN_EDIT + 82) /**/ +#define FN_SELECT_SET_AUTO_BOOKMARK (FN_EDIT + 83) /**/ +#define FN_SELECT_TABLE (FN_EDIT + 84) /**/ +#define FN_SELECT_INDEX (FN_EDIT + 85) /**/ +#define FN_UP (FN_EDIT + 86) /**/ + + +//#define FN_DELETE_REGION (FN_EDIT + 89) /* Bereiche loeschen */ + + +#define FN_SELECT_PARA (FN_EDIT + 97) /* Absatz selektieren */ + +#define FN_SELECT_CONTENT (FN_EDIT + 99) /* Navigator - Inhaltstyp */ + + + + +#define FN_REDLINE_PROTECT (FN_EDIT2 + 23) /* Redlining password */ +#define FN_UPDATE_ALL_LINKS (FN_EDIT2 + 24) /* alle Links updaten */ + +#define FN_REDLINE_ON (FN_EDIT2 + 25) /* Redlining anschalten */ +#define FN_REDLINE_SHOW (FN_EDIT2 + 26) /* Redlining anzeigen */ +#define FN_REDLINE_COMMENT (FN_EDIT2 + 27) /* Redlining kommentieren */ + +#define FN_UPDATE_ALL (FN_EDIT2 + 28) /* FN_UPDATE_ALL_LINKS, + FN_UPDATE_FIELDS, + FN_UPDATE_TOX, + CalcLayout */ + +#define FN_REDLINE_ACCEPT (FN_EDIT2 + 29) /* Redlining annehmen/ablehnen */ +#define FN_ATTR_COLUMNS (FN_EDIT2 + 31) /* SlotId fuer SwFmtCol */ +#define FN_EDIT_CURRENT_TOX (FN_EDIT2 + 32) /* edit current index */ +#define FN_EDIT_AUTH_ENTRY_DLG (FN_EDIT2 + 33) /* edit authorities entry*/ +#define FN_UPDATE_CHARTS (FN_EDIT2 + 34) /* update all charts */ + +#define FN_EDIT_HYPERLINK (FN_EDIT2 + 35) /* edit hyperlink */ + +/*-------------------------------------------------------------------- + Bereich: Bearbeiten + --------------------------------------------------------------------*/ + +#define FN_REFRESH_VIEW (FN_VIEW + 1) /* Refresh/Redraw */ +#define FN_SHOW_OUTLINE_VIEW (FN_VIEW + 2) /* Gliederungsansicht */ + +#define FN_DRAW_WRAP_DLG (FN_VIEW + 3) /* Draw Umlauf-Dlg */ + +#define FN_RULER (FN_VIEW + 11) /* Horizontales Lineal */ + +#define FN_VIEW_GRAPHIC (FN_VIEW + 13) /* Grafiken anzeigen */ +#define FN_VIEW_BOUNDS (FN_VIEW + 14) /* Begrenzungen */ +#define FN_VIEW_FIELDS (FN_VIEW + 15) /* Textbefehle */ +#define FN_VLINEAL (FN_VIEW + 16) /* Vertikales Lineal */ +#define FN_VSCROLLBAR (FN_VIEW + 17) /* Vertikaler Scrollbar */ +#define FN_HSCROLLBAR (FN_VIEW + 18) /* Horizontaler Scrollbar */ +#define FN_TOOLBOX_TOGGLE (FN_VIEW + 19) /* Toolboxinhalte umschalten */ +#define FN_VIEWOPTIONS_ON (FN_VIEW + 20) /* Gruppe Viewoptions an */ +#define FN_VIEWOPTIONS_OFF (FN_VIEW + 21) /* Gruppe Viewoptions aus */ +#define FN_CONTROLS_ON (FN_VIEW + 22) /* Gruppe Bedienelemte an */ +#define FN_CONTROLS_OFF (FN_VIEW + 23) /* Gruppe Bedienelemte aus */ + +#define FN_VIEW_META_CHARS (FN_VIEW + 24) /* Sonderzeichen anzeigen */ +#define FN_VIEW_MARKS (FN_VIEW + 25) /* Markierungen anzeigen */ +#define FN_VIEW_FIELDNAME (FN_VIEW + 26) /* Feldname anzeigen */ +#define FN_VIEW_TABLEGRID (FN_VIEW + 27) /* Tabellenbegrenzungen anzeigen */ + +#define FN_SET_PAGE (FN_VIEW + 29) /* Seitenvorlage am Absatz setzen */ + +#define FN_TOOLBOX_SWITCH (FN_VIEW + 30) /* Auf Textshell umschalten */ + + +//noch mehr Navigator +#define FN_CONTENT_LB (FN_VIEW + 32) /**/ +#define FN_SHOW_CONTENT_BOX (FN_VIEW + 33) /**/ +#define FN_SHOW_ROOT (FN_VIEW + 34) /**/ +#define FN_DROP_REGION (FN_VIEW + 35) /**/ +#define FN_OUTLINE_LEVEL (FN_VIEW + 36) /**/ + +#define FN_PRINT_LAYOUT (FN_VIEW + 37) /* invertierter BrowseMode */ + +#define FN_DROP_REGION_LINK (FN_VIEW + 38) /**/ +#define FN_DROP_REGION_COPY (FN_VIEW + 39) /**/ + +#define FN_SCROLL_NAVIGATION (FN_VIEW + 40) /* Navigationscontroller am Scrollbar*/ +#define FN_SCROLL_NEXT_PREV (FN_VIEW + 41) /* arbeitet den MoveType ab */ + +#define FN_VIEW_HIDDEN_PARA (FN_VIEW + 42) /* Versteckte Absaetze */ +#define FN_VIEW_SMOOTH_SCROLL (FN_VIEW + 43) + +#define FN_GLOBAL_SWITCH (FN_VIEW + 44) /* umschalten zw. Global und Inhalt*/ +#define FN_GLOBAL_EDIT (FN_VIEW + 45) /* bearbeiten */ +#define FN_GLOBAL_UPDATE (FN_VIEW + 46) /* aktualisieren */ +#define FN_GLOBAL_OPEN (FN_VIEW + 47) /* oeffnen */ +#define FN_GLOBAL_SAVE_CONTENT (FN_VIEW + 48) /* Inhalt der Verknuepfung mitspeichern */ +#define FN_CREATE_NAVIGATION (FN_VIEW + 49) /* Navigations-Controller erzeugen */ +#define FN_PREVIEW_PRINT_OPTIONS (FN_VIEW + 50) /* Optionsdialog Preview drucken */ +#define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* der Tabellencontroller fuer den Zoom */ + +#define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Zahlenerkennung in Tabellen */ +#define FN_HSCROLL_METRIC (FN_VIEW + 53) /* Metric horizontal scrollbar */ +#define FN_VSCROLL_METRIC (FN_VIEW + 54) /* Metric vertical scrollbar */ + +/*-------------------------------------------------------------------- + Bereich: Einfuegen + --------------------------------------------------------------------*/ +// schon im Svx definiert +#define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Sprungmarke einfuegen */ + +// schon im SVX unter der gleichen Id +//#define FN_INSERT_BREAK (FN_INSERT + 3 ) /* Umbruch */ + +#define FN_INSERT_BREAK_DLG (FN_INSERT + 4 ) /* Umbruch */ +#define FN_INSERT_COLUMN_BREAK (FN_INSERT + 5 ) /* Spaltenumbruch */ +#define FN_INSERT_DATE_TIME (FN_INSERT + 6 ) /* Datum/Uhrzeit */ +#define FN_INSERT_FIELD (FN_INSERT + 8 ) /* Textbefehl */ +#define FN_CHANGE_DBFIELD (FN_INSERT + 9 ) /* Datenbankfeld aendern */ + +#define FN_INSERT_CAPTION (FN_INSERT + 10) /* Beschriftung */ +#define FN_INSERT_DBFIELD (FN_INSERT + 11) /* Insert database field - for recording */ +#define FN_INSERT_FOOTNOTE_DLG (FN_INSERT + 12) /* Dialog Fussnote */ + +#define FN_INSERT_REF_FIELD (FN_INSERT + 13) /* Refernzfeld einfuegen */ + +#define FN_INSERT_HYPERLINK (FN_INSERT + 14) /* Zeichendialog/HyperlinkPage*/ + +#define FN_INSERT_INDEX (FN_INSERT + 16) /* Stichworteintrag */ +#define FN_INSERT_INDEX_DLG (FN_INSERT + 17) /* Stichworteintrag */ +#define FN_INSERT_LINEBREAK (FN_INSERT + 18) /* Zeilenumbruch */ +#define FN_INSERT_FIELD_DATA_ONLY (FN_INSERT + 19) /* field dialog for mail merge*/ +#define FN_INSERT_OBJECT (FN_INSERT + 21) /* Object */ +#define FN_INSERT_OBJECT_DLG (FN_INSERT + 22) /* Object */ +#define FN_INSERT_PAGEBREAK (FN_INSERT + 23) /* Seitenumbruch */ +#define FN_INSERT_PAGENO (FN_INSERT + 24) /* Seitennummer */ +#define FN_INSERT_PARAGRAPH (FN_INSERT + 25) /* Absatz */ +#define FN_INSERT_RECORD (FN_INSERT + 26) /* Datensatz einfuegen */ +#define FN_MERGE_RECORD (FN_INSERT + 27) /* Datensatz mischen */ +#define FN_INSERT_SYMBOL (FN_INSERT + 28) /* Sonderzeichen */ +#define FN_POSTIT (FN_INSERT + 29) /* PostIt einfuegen/bearbeiten */ +#define FN_INSERT_TABLE (FN_INSERT + 30) /* Tabelle */ +#define FN_INSERT_STRING (FN_INSERT+31) +#define FN_INSERT_COLS (FN_INSERT + 32) /* Spalten einfuegen */ +#define FN_INSERT_FRAME_INTERACT (FN_INSERT + 33) /* Rahmen einfuegen aktiv */ +#define FN_INSERT_FRAME (FN_INSERT + 34) /* Rahmen einfuegen */ + +#define FN_INSERT_IDX_ENTRY_DLG (FN_INSERT + 35) /* Verzeichniseintrag einfuegen */ +#define FN_INSERT_FRAME_INTERACT_NOCOL (FN_INSERT + 36) /*insert interactive non column frame*/ + +#define FN_INSERT_SOFT_HYPHEN (FN_INSERT + 43) /* weicher Trenner */ +#define FN_INSERT_HARD_SPACE (FN_INSERT + 44) /* hartes Space */ + + +#define FN_TOOL_GROUP (FN_INSERT + 47) /* Objekte gruppieren */ +#define FN_TOOL_UNGROUP (FN_INSERT + 48) /* Gruppierng aufheben */ + +#define FN_TOOL_ANKER (FN_INSERT + 49) /* Draw-Objekt umankern */ +#define FN_TOOL_ANKER_PAGE (FN_INSERT + 50) /* Draw-Objekt an Seite verankern */ +#define FN_TOOL_ANKER_PARAGRAPH (FN_INSERT + 51) /* Draw-Objekt am Absatz verankern */ +#define FN_TOOL_HIERARCHIE (FN_INSERT + 52) /* Hierarchie aendern */ + +#define FN_QRY_MERGE (FN_INSERT + 64) /* Datensatz einfuegen (Serienbrief) */ +#define FN_QRY_OPEN_TABLE (FN_INSERT + 65) /* Datenbank oeffnen (Basic) */ +#define FN_TOOL_ANKER_FRAME (FN_INSERT + 66) /* Draw-Objekt am Rahmen verankern */ + +#define FN_INSERT_SMA (FN_INSERT + 69) /* Einfuegen StarMath */ + +#define FN_QRY_GET_COLUMN_NAME (FN_INSERT + 70) /* Anzahl der Spalten (Basic) */ +#define FN_QRY_GET_COLUMN_TYPE (FN_INSERT + 71) /* Type des Datenbankfeldes ermitteln (Basic) */ +#define FN_QRY_GET_COLUMN_TEXT (FN_INSERT + 72) /* Inhalt des aktuellen Datensatzes (Basic) */ +#define FN_QRY_DEL_DEFINED_DB (FN_INSERT + 75) /* Datenbankdefinition loeschen (Basic) */ + +#define FN_DRAWTEXT_ATTR_DLG (FN_INSERT + 76) /* DrawText positionieren */ + +#define FN_QRY_APPEND_RECORD (FN_INSERT + 77) /* Neuen Datensatz anhaengen */ +#define FN_QRY_UPDATE_RECORD (FN_INSERT + 78) /* Datensatzspalte aendern */ +#define FN_QRY_DELETE_RECORD (FN_INSERT + 79) /* Datensatz loeschen */ +#define FN_QRY_GET_PHYS_RECORD_ID (FN_INSERT + 80) /* Physikalische (absolute) Datensatznummer erfragen (Basic) */ + +#define FN_TOOL_ANKER_CHAR (FN_INSERT + 84) /* DrawObject zeichengebunden */ +#define FN_INSERT_HARDHYPHEN (FN_INSERT + 85) /* Bindestrich ohne Umbruch*/ + +#define FN_QRY_INSERT (FN_INSERT + 86) /* Datensatz-Selektion in Text einfuegen */ +#define FN_QRY_MERGE_FIELD (FN_INSERT + 87) /* Datensatz-Selektion in Felder einfuegen */ +#define FN_QRY_INSERT_FIELD (FN_INSERT + 88) /* Datenbankfeld einfuegen */ + +#define FN_INSERT_CTRL (FN_INSERT + 89) /* Werkzeugleistencontroller Einfuegen*/ +#define FN_INSERT_OBJ_CTRL (FN_INSERT + 90) /* Werkzeugleistencontroller Einfuegen/Objekt*/ +#define FN_INSERT_FIELD_CTRL (FN_INSERT + 91) /* Werkzeugleistencontroller Einfuegen/Feldbefehle*/ + +#define FN_INSERT_FLD_DATE (FN_INSERT + 92) +#define FN_INSERT_FLD_TIME (FN_INSERT + 93) +#define FN_INSERT_FLD_PGNUMBER (FN_INSERT + 94) +#define FN_INSERT_FLD_PGCOUNT (FN_INSERT + 95) +#define FN_INSERT_FLD_TOPIC (FN_INSERT + 96) +#define FN_INSERT_FLD_TITLE (FN_INSERT + 97) +#define FN_INSERT_FLD_AUTHOR (FN_INSERT + 98) +#define FN_INSERT_FOOTNOTE (FN_INSERT + 99) + +/*-------------------------------------------------------------------- + Bereich: Einfuegen (2.Teil) + --------------------------------------------------------------------*/ + +#define FN_QRY_GET_ALL_DBNAME (FN_INSERT2 + 1) /* Alle konfigurierten Datenabanknamen ermitteln */ +#define FN_QRY_GET_DBNAME_COUNT (FN_INSERT2 + 2) /* Anzahl aller konfigurierten Datenabanknamen */ +#define FN_QRY_GET_TABLE_NAME (FN_INSERT2 + 3) /* Tabellenname einer Datenbank ermitteln */ +#define FN_QRY_GET_TABLE_COUNT (FN_INSERT2 + 4) /* Anzahl aller Tabellen einer Datenbank ermitteln */ + +#define FN_INSERT_HEADER (FN_INSERT2 + 5) /* Kopfzeile im Html-mode ein/ausschalten */ +#define FN_INSERT_FOOTER (FN_INSERT2 + 6) /* Fuázeile im Html-mode ein/ausschalten */ +#define FN_SBA_BRW_UPDATE (FN_INSERT2 + 7) /* Datensaetze in Felder einfuegen */ +#define FN_SBA_BRW_INSERT (FN_INSERT2 + 8) /* Datensaetze in Text einfuegen */ +#define FN_SBA_BRW_MERGE (FN_INSERT2 + 9) /* Serienbriefdruck */ +#define FN_JAVAEDIT (FN_INSERT2 + 10) /* Scriptfeld bearbeiten */ +#define FN_INSERT_HRULER (FN_INSERT2 + 11) /* horiz. Grafiklinie einfuegen */ +#define FN_TOOL_ANKER_AT_CHAR (FN_INSERT2 + 12) /* Object zeichengebunden */ + +#define FN_INSERT_PAGEHEADER (FN_INSERT2 + 13) /* Standard Kopfzeile einfuegen */ +#define FN_INSERT_PAGEFOOTER (FN_INSERT2 + 14) /* Standard Fusszeile einfuegen */ + +#define FN_INSERT_ENDNOTE (FN_INSERT2 + 18) /* Endnote einfuegen*/ +#define FN_INSERT_REGION (FN_INSERT2 + 19) /* Insert section */ + +#define FN_INSERT_MULTI_TOX (FN_INSERT2 + 20) /* insert any TOX */ +#define FN_INSERT_AUTH_ENTRY_DLG (FN_INSERT2 + 21) /* insert entry for table of authorities*/ + +/*-------------------------------------------------------------------- + Bereich: Format + --------------------------------------------------------------------*/ + +#define FN_AUTOFORMAT_APPLY (FN_FORMAT + 1 ) /* Autoformat-Optionen anwenden */ +#define FN_AUTOFORMAT_AUTO (FN_FORMAT + 2 ) /* Autoformat waehrend der Eingabe */ +#define FN_GROW_FONT_SIZE (FN_FORMAT + 3 ) /* Groesse */ +#define FN_SHRINK_FONT_SIZE (FN_FORMAT + 4 ) /* Groesse */ +#define FN_UNDERLINE_DOUBLE (FN_FORMAT + 5 ) /* Doppelt unterstreichen */ +#define FN_AUTOFORMAT_REDLINE_APPLY (FN_FORMAT + 6 ) /* Autoformat mit Redlining anwenden */ +#define FN_SET_SUPER_SCRIPT (FN_FORMAT + 11) /* Hochstellung */ +#define FN_SET_SUB_SCRIPT (FN_FORMAT + 12) /* Tiefstellung */ + +#define FN_SET_CASEMAP (FN_FORMAT + 14) /* CaseMap */ +#define FN_SET_LANGUAGE (FN_FORMAT + 15) /* Sprache */ +#define FN_SET_KERNING (FN_FORMAT + 16) /* Kerning */ + +#define FN_INDENT_TO_TABSTOP (FN_FORMAT + 17) /* Einrueckung auf die naechste Tabpostion */ +//schon in svxids.hrc +//#define FN_SET_JUSTIFY_PARA (FN_FORMAT + 21) /* Ausrichtung Absatz */ +#define FN_FLIP_HORZ_GRAFIC (FN_FORMAT + 25) /* Spiegeln horizontal */ +#define FN_FLIP_VERT_GRAFIC (FN_FORMAT + 26) /* Spiegeln vertikal */ +#define FN_SET_LINE_SPACE (FN_FORMAT + 27) /* Zeilenabstand parametrisiert */ +#define FN_SET_ADJUST (FN_FORMAT + 28) /* Ausrichtung parametrisiert */ +#define FN_SET_LRMARGIN (FN_FORMAT + 29) /* linker/rechter Rand */ +#define FN_SET_ULMARGIN (FN_FORMAT + 30) /* oberer/unterer Rand */ +#define FN_UNINDENT_TO_TABSTOP (FN_FORMAT + 31) /* Einrueckung auf die vorgige Tabpostion */ + +#define FN_SET_HYPHEN_ZONE (FN_FORMAT + 32) /* Silbentrennung */ +#define FN_SET_KEEP_TOGETHER (FN_FORMAT + 34) /* nicht trennen */ +#define FN_SET_KEEP_WITH_NEXT (FN_FORMAT + 35) /* mit folgendem zus. */ +#define FN_SET_WIDOW (FN_FORMAT + 36) /* Widows */ +#define FN_SET_ORPHAN (FN_FORMAT + 37) /* Orphans */ + + +#define FN_REGISTER_COLLECTION (FN_FORMAT + 43) /* Referenzvorlage an der Seite */ +#define FN_REGISTER_MODE (FN_FORMAT + 44) /* Registermodus an/aus */ +#define FN_NUM_FORMAT_TABLE_DLG (FN_FORMAT + 45) /* Zahlenformat in Tabelle */ +#define FN_FORMAT_BORDER_DLG (FN_FORMAT + 48) /* Umrandung */ +#define FN_FORMAT_PAGE_COLUMN_DLG (FN_FORMAT + 49) /* Spalten pro Seite */ +#define FN_FORMAT_BACKGROUND_DLG (FN_FORMAT + 50) /* Hintergrund */ +#define FN_FORMAT_PAGE (FN_FORMAT + 51) /* Seite */ +#define FN_FORMAT_PAGE_DLG (FN_FORMAT + 52) /* Seite */ +#define FN_FORMAT_COLUMN (FN_FORMAT + 53) /* Spalten */ +#define FN_FORMAT_DROPCAPS (FN_FORMAT + 54) /* Initialien */ +#define FN_FORMAT_FRAME (FN_FORMAT + 55) /* Rahmen */ +#define FN_FORMAT_FRAME_DLG (FN_FORMAT + 56) /* Rahmen */ +#define FN_FORMAT_GRAFIC (FN_FORMAT + 57) /* Grafik */ +#define FN_FORMAT_GRAFIC_DLG (FN_FORMAT + 58) /* Grafik */ +#define FN_FORMAT_TABLE (FN_FORMAT + 59) /* Tabelle */ +#define FN_FORMAT_TABLE_DLG (FN_FORMAT + 60) /* Tabelle */ +#define FN_FORMAT_OLE_DLG (FN_FORMAT + 61) /* OLE bearbeiten */ + +#define FN_NEW_STYLE_BY_EXAMPLE (FN_FORMAT + 62) /* Vorlage erzeugen by Example */ +#define FN_UPDATE_STYLE_BY_EXAMPLE (FN_FORMAT + 63) /* Vorlage aktualisieren */ +#define FN_STYLE_SHEET_FRAME_DLG (FN_FORMAT + 64) /* Rahmenvorlage */ +#define FN_STYLE_SHEET_DOC_DLG (FN_FORMAT + 65) /* Dokumentvorlage */ +#define FN_STYLE_SHEET_GRAFIK_DLG (FN_FORMAT + 66) /* Dokumentvorlage */ +#define FN_FORMAT_FOOTNOTE (FN_FORMAT + 67) /* Fussnoten */ +#define FN_FORMAT_FOOTNOTE_DLG (FN_FORMAT + 68) /* Fussnoten-Dialog */ + +// schon im Svx definiert +//#define FN_FORMAT_RESET (FN_FORMAT + 69) /* Format zuruecksetzen */ + +#define FN_FRAME_TO_TOP (FN_FORMAT + 70) /* Rahmen nach oben */ +#define FN_FRAME_TO_BOTTOM (FN_FORMAT + 71) /* Rahmen nach unten */ + +#define FN_FRAME_NOWRAP (FN_FORMAT + 72) /* Rahmen kein Umlauf */ +#define FN_FRAME_WRAP (FN_FORMAT + 73) /* Rahmen Umlauf */ +#define FN_FRAME_WRAPTHRU (FN_FORMAT + 74) /* Rahmen Durchlauf */ + +#define FN_FRAME_ALIGN_HORZ_LEFT (FN_FORMAT + 75) /* Rahmen horz. links */ +#define FN_FRAME_ALIGN_HORZ_RIGHT (FN_FORMAT + 76) /* Rahmen horz. rechts */ +#define FN_FRAME_ALIGN_HORZ_CENTER (FN_FORMAT + 77) /* Rahmen horz. zentriert */ +#define FN_FRAME_ALIGN_VERT_TOP (FN_FORMAT + 78) /* Rahmen vert. oben */ +#define FN_FRAME_ALIGN_VERT_BOTTOM (FN_FORMAT + 79) /* Rahmen vert. unten */ +#define FN_FRAME_ALIGN_VERT_CENTER (FN_FORMAT + 80) /* Rahmen vert. zentriert */ + +#define FN_SET_FRM_POSITION (FN_FORMAT + 82)/* Rahmenposition -- " -- */ +#define FN_SET_FRM_OPTIONS (FN_FORMAT + 86)/* Rahmenoptionen -- " -- */ + +#define FN_SET_PAGE_STYLE (FN_FORMAT + 93) /* Anwenden Seitenv. */ + + +#define FN_TABLE_REP (FN_FORMAT + 99) /* TableRepresentation */ +#define FN_CONVERT_TEXT_TABLE (FN_FORMAT + 100) /* Konvertierung Text <-> Tabelle */ +#define FN_TABLE_INSERT_ROW (FN_FORMAT + 101) /* Tabelle: Zeile einfuegen */ +#define FN_TABLE_INSERT_COL (FN_FORMAT + 102) /* Tabelle: Spalte einfuegen */ +#define FN_TABLE_DELETE_ROW (FN_FORMAT + 103) /* Tabelle: Zeile loeschen */ +#define FN_TABLE_DELETE_COL (FN_FORMAT + 104) /* Tabelle: Spalte loeschen */ +#define FN_TABLE_SPLIT_CELLS (FN_FORMAT + 105) /* Tabelle: Zellen teilen */ +#define FN_TABLE_MERGE_CELLS (FN_FORMAT + 106) /* Tabelle: Zellen verbinden */ +#define FN_TABLE_SET_ROW_HEIGHT (FN_FORMAT + 107) /* Tabelle: Zeilenhoehe setzen */ +#define FN_TABLE_SET_COL_WIDTH (FN_FORMAT + 108) /* Tabelle: Spaltenbreite setzen */ +#define FN_TABLE_SET_ULSPACE (FN_FORMAT + 109) /* Tabelle: oberen / unteren Abstand einstellen */ +#define FN_OPTIMIZE_TABLE (FN_FORMAT + 110) /* ToolBoxItem fuer Optimierung in Tabellen */ +#define FN_TABLE_SET_SHADOW (FN_FORMAT + 111) /* Tabelle: Schatten einstellen */ +#define FN_TABLE_GOTO_CELL (FN_FORMAT + 112) /* Tabelle: Zelle anspringen */ +#define FN_TABLE_SELECT_ROW (FN_FORMAT + 113) /* Tabelle: Zeile selektieren */ +#define FN_TABLE_SELECT_COL (FN_FORMAT + 114) /* Tabelle: Spalte selektieren */ +#define FN_TABLE_SELECT_ALL (FN_FORMAT + 115) /* Tabelle: Tabelle selektieren */ +#define FN_TABLE_SET_READ_ONLY (FN_FORMAT + 116) /* Tabelle: Tabelle schuetzen */ +#define FN_TABLE_SET_READ_ONLY_CELLS (FN_FORMAT + 117) /* Tabelle: Tabellezellen schuetzen */ +#define FN_TABLE_UNSET_READ_ONLY_CELLS (FN_FORMAT + 119) /* Tabelle: Tabellezellen schuetzen aufheben */ +#define FN_TABLE_HEADLINE_REPEAT (FN_FORMAT + 120) /* used in SwXTextTable*/ +#define FN_TABLE_ADJUST_CELLS (FN_FORMAT + 121) /* Tabelle: Zellen anpassen */ + +#define FN_FRAME_UP (FN_FORMAT + 122) /* Rahmen um eine Ebene nach oben */ +#define FN_FRAME_DOWN (FN_FORMAT + 123) /* Rahmen um eine Ebene nach unten */ + +#define FN_TABLE_INSERT_CHART (FN_FORMAT + 124) + +#define FN_SET_FRM_LRSPACE (FN_FORMAT + 125) /* Rahmen Seitenabstand */ +#define FN_SET_FRM_ULSPACE (FN_FORMAT + 126) /* Rahmen Kopf-/Fussabstand */ +#define FN_TABLE_SET_LRSPACE (FN_FORMAT + 127) /* Tabelle: linker / rechter Abstand einstellen */ +#define FN_TABLE_OPTIMAL_HEIGHT (FN_FORMAT + 128) /* Zellenhoehe optimal*/ + +/*-------------------------------------------------------------------- + Bereich: Seitenvorlage + --------------------------------------------------------------------*/ + +#define FN_NEW_PAGE_STYLE (FN_FORMAT + 129) /* Anlegen Seitenvorlage */ +#define FN_PAGE_STYLE_SET_LR_MARGIN (FN_FORMAT + 130) /* linker / rechter Rand */ +#define FN_PAGE_STYLE_SET_UL_MARGIN (FN_FORMAT + 131) /* oberer / unterer Rand */ +#define FN_PAGE_STYLE_SET_PAGE (FN_FORMAT + 134) /* linke, rechte... */ +#define FN_PAGE_STYLE_SET_PAPER_SIZE (FN_FORMAT + 135) /* Papiergroesse */ +#define FN_PAGE_STYLE_SET_PAPER_BIN (FN_FORMAT + 136) /* Druckerschacht */ +#define FN_PAGE_STYLE_SET_NUMBER_FORMAT (FN_FORMAT + 137) /* Numerierungsart */ +#define FN_PAGE_STYLE_SET_COLS (FN_FORMAT + 138) /* Spaltenanzahl */ + + +/* OS: Diese Ids werden nur noch fuer die Hilfe benoetigt und sind fuer den + Dialog durch die Ids ohne _DLG ersetzt*/ +#define FN_TABLE_INSERT_COL_DLG (FN_FORMAT + 142) /* Tabelle: Dlg. Spalte einfuegen */ +#define FN_TABLE_INSERT_ROW_DLG (FN_FORMAT + 143) /* Tabelle: Dlg. Zeile einfuegen */ + +#define FN_GOTO_NEXT_CELL (FN_FORMAT + 145) /* Table: go to next cell */ +#define FN_GOTO_PREV_CELL (FN_FORMAT + 146) /* Table: go to previous cell */ + + +//hier geht's weiter ! +/*-------------------------------------------------------------------- + Bereich: Ribbon + --------------------------------------------------------------------*/ + +#define FN_SET_BACKGROUND_COLOR (FN_FORMAT + 150) /* Hintergrundfarbe */ + +#define FN_SET_BORDER_POS (FN_FORMAT + 152) /* Position Umrandung */ +#define FN_SET_BORDER_LINES (FN_FORMAT + 153) /* Linienart Umrandung */ +#define FN_SET_BORDER_COLOR (FN_FORMAT + 154) /* Farbe Umrandung */ + +#define FN_FORMULA_CALC (FN_FORMAT + 156) /* Formelauswahl */ +#define FN_FORMULA_CANCEL (FN_FORMAT + 157) /* Formel nicht uebernehmen */ +#define FN_FORMULA_APPLY (FN_FORMAT + 158) /* Formel uebernehmen */ + +#define FN_TABLE_UNSET_READ_ONLY (FN_FORMAT + 159) /* Zellenschutz fuer Tab. aufheben */ + +#define FN_FORMULA_POSITION (FN_FORMAT + 160) /* Positionsanzeige */ +#define FN_FORMULA_EDIT (FN_FORMAT + 161) /* Editfeld */ + + +#define FN_FRAME_WRAP_IDEAL (FN_FORMAT + 163) /* Rahmen Idealer Umlauf */ +#define FN_FRAME_WRAPTHRU_TRANSP (FN_FORMAT + 164) /* Rahmen Transparenter Durchlauf */ + +#define FN_FRAME_ALIGN_VERT_ROW_TOP (FN_FORMAT + 165) /* Rahmen vert. Zeile oben */ +#define FN_FRAME_ALIGN_VERT_ROW_BOTTOM (FN_FORMAT + 166) /* Rahmen vert. Zeile unten */ +#define FN_FRAME_ALIGN_VERT_ROW_CENTER (FN_FORMAT + 167) /* Rahmen vert. Zeile zentriert */ + +#define FN_FRAME_ALIGN_VERT_CHAR_TOP (FN_FORMAT + 168) /* Rahmen vert. Zeichen oben */ +#define FN_FRAME_ALIGN_VERT_CHAR_BOTTOM (FN_FORMAT + 169) /* Rahmen vert. Zeichen unten */ +#define FN_FRAME_ALIGN_VERT_CHAR_CENTER (FN_FORMAT + 170) /* Rahmen vert. Zeichen zentriert */ + +#define FN_TABLE_SET_DEF_BORDER (FN_FORMAT + 171) /* vordefinierte Umrandungen setzen */ + +#define FN_FRAME_WRAP_LEFT (FN_FORMAT + 172) /* Rahmen Umlauf links */ +#define FN_FRAME_WRAP_RIGHT (FN_FORMAT + 173) /* Rahmen Umlauf links */ + +#define FN_TABLE_SET_ROW_AUTOHEIGHT (FN_FORMAT + 174) /* Tabelle: Minimale automatische Zeilenhoehe setzen */ + + +#define FN_WRAP_ANCHOR_ONLY (FN_FORMAT + 181) /* Umlauf nur fuer ersten Absatz */ + +#define FN_TABLE_BALANCE_CELLS (FN_FORMAT + 182) /* Spalten gleichmaessig verteilen */ +#define FN_TABLE_BALANCE_ROWS (FN_FORMAT + 183) /* Zeilen gleichmaessig verteilen */ + +#define FN_FRAME_WRAP_CONTOUR (FN_FORMAT + 184) /* Rahmen Kunturumlauf */ + +#define FN_TABLE_VERT_NONE (FN_FORMAT + 185) /* vertikale Ausrichtung in Tabellenzellen */ +#define FN_TABLE_VERT_CENTER (FN_FORMAT + 186) /* -"- */ +#define FN_TABLE_VERT_BOTTOM (FN_FORMAT + 187) /* -"- */ +#define FN_TABLE_SET_VERT_ALIGN (FN_FORMAT + 188) /* -"- */ +#define FN_TABLE_MODE_FIX (FN_FORMAT + 189) /* Tabellenmodus */ +#define FN_TABLE_MODE_FIX_PROP (FN_FORMAT + 190) /* -"- */ +#define FN_TABLE_MODE_VARIABLE (FN_FORMAT + 191) /* -"- */ + +#define FN_TABLE_AUTOSUM (FN_FORMAT + 195) /* Autosumme*/ +#define FN_SET_CONTROL_HANDLER (FN_FORMAT + 199) /* Macro setzen */ + +#define FN_IS_IMAGE (FN_FORMAT2 + 6) /* Numerierung : mit Grafik?*/ + +#define FN_GOTO_NEXT_REGION (FN_FORMAT2 + 9) /* Naechsten Bereich anspringen */ +#define FN_GOTO_PREV_REGION (FN_FORMAT2 + 10) /* Vorherigen " */ + +#define FN_GET_SBXCONTROL (FN_FORMAT2 + 11) /* SbxObject rausreichen */ +#define FN_ABSTRACT_NEWDOC (FN_FORMAT2 + 12) /* Abstract in neuem Doc */ +#define FN_ABSTRACT_STARIMPRESS (FN_FORMAT2 + 13) /* Abstract an StarImpress */ +#define FN_NAME_GROUP (FN_FORMAT2 + 14) /* Rename group shapes */ + +#define FN_NUMBER_FORMAT (FN_FORMAT2 + 120) /* Boxen/NumberFormatter eistellen */ +#define FN_NUMBER_STANDARD (FN_FORMAT2 + 121) +#define FN_NUMBER_TWODEC (FN_FORMAT2 + 123) +#define FN_NUMBER_SCIENTIFIC (FN_FORMAT2 + 124) +#define FN_NUMBER_DATE (FN_FORMAT2 + 125) +#define FN_NUMBER_TIME (FN_FORMAT2 + 126) +#define FN_NUMBER_CURRENCY (FN_FORMAT2 + 127) +#define FN_NUMBER_PERCENT (FN_FORMAT2 + 128) + + + +#define FN_FRAME_CHAIN (FN_FORMAT2 + 136) +#define FN_FRAME_UNCHAIN (FN_FORMAT2 + 137) + +#define FN_NUMBER_NEWSTART (FN_FORMAT2 + 138) +#define FN_NUMBER_NEWSTART_AT (FN_FORMAT2 + 139) + +#define FN_FRAME_MIRROR_ON_EVEN_PAGES (FN_FORMAT2 + 140) +#define FN_GRAPHIC_MIRROR_ON_EVEN_PAGES (FN_FORMAT2 + 141) + +#define FN_TABLE_SPLIT_TABLE (FN_FORMAT2 + 142) +#define FN_SYNC_LABELS (FN_FORMAT2 + 143) + +#define FN_FORMAT_LINENUMBER (FN_FORMAT2 + 144) + +#define FN_TABLE_RELATIVE_WIDTH (FN_FORMAT2 + 147) /* Tabelle: relative Breite - UNO */ +#define FN_TABLE_WIDTH (FN_FORMAT2 + 148) /* Tabelle: Breite - UNO */ +#define FN_TABLE_IS_RELATIVE_WIDTH (FN_FORMAT2 + 149) /* Tabelle: ist Breite relativ?- UNO */ + +#define FN_INC_INDENT_OFFSET (FN_FORMAT2 + 150) +#define FN_DEC_INDENT_OFFSET (FN_FORMAT2 + 151) + +#define FN_TABLE_MERGE_TABLE (FN_FORMAT2 + 152) + +/*-------------------------------------------------------------------- + Bereich: Extras + --------------------------------------------------------------------*/ + +#define FN_LINE_NUMBERING_DLG (FN_EXTRA + 2 ) /* Zeilennumerierung */ +#define FN_THESAURUS_DLG (FN_EXTRA + 3 ) /* Thesaurus */ +#define FN_HYPHENATE_OPT_DLG (FN_EXTRA + 5 ) /* Silbentrennung */ +#define FN_ADD_UNKNOWN (FN_EXTRA + 6 ) /* Woerter lernen */ +#define FN_DICTIONARY_DLG (FN_EXTRA + 8 ) /* Woerterbuecher */ +#define FN_NUMBERING (FN_EXTRA + 9 ) /* Nummerierung/Bullets */ +#define FN_NUMBERING_DLG (FN_EXTRA + 10) /* Nummerierung/Bullets */ +#define FN_NUMBERING_OUTLINE (FN_EXTRA + 11) /* Gliederungsnumerierung */ +#define FN_NUMBERING_OUTLINE_DLG (FN_EXTRA + 12) /* Gliederungsnumerierung */ +#define FN_SORTING_DLG (FN_EXTRA + 14) /* Sortieren */ +#define FN_CALCULATE (FN_EXTRA + 15) /* Berechnen */ +#define FN_GENERATE_TOC_DLG (FN_EXTRA + 16) /* Inhaltsverzeichnis */ +#define FN_GENERATE_INDEX_DLG (FN_EXTRA + 17) /* Stichwortverzeichnis */ +#define FN_GENERATE_DIR_DLG (FN_EXTRA + 18) /* Verzeichnis */ +#define FN_GLOSSARY_DLG (FN_EXTRA + 20) /* Textbausteine */ +#define FN_MACRO_CHOOSER (FN_EXTRA + 21) /* Makro aufnehmen */ +#define FN_SPELLING_DLG (FN_EXTRA + 22) /* Rechtschreibung */ + +#define FN_PLAY_MACRO (FN_EXTRA + 23) /* Makro abspielen */ +#define FN_LAUNCH_BASIC (FN_EXTRA + 25) /* Makro abspielen */ +#define FN_EXPAND_GLOSSARY (FN_EXTRA + 28) /* Textbausteine expandieren */ +#define FN_CONFIG_TOOLBOX (FN_EXTRA + 29) /* Konfiguration Toolbox */ +#define FN_CONFIG_MENU (FN_EXTRA + 30) /* Konfiguration Menu */ +#define FN_CONFIG_KEY (FN_EXTRA + 31) /* Konfiguration Tastatur */ +#define FN_CHANGE_PAGENUM (FN_EXTRA + 34) /* Seitennummer aendern */ + +#define FN_MACRO_POPUP (FN_EXTRA + 37) /* Alle Macrofunktionen */ +#define FN_BULLET (FN_EXTRA + 38) /* Bullet-Liste */ + + +// Bereich: Gloassaries + +// schon im Svx definiert + +//#define FN_GET_GLOSSARY_GROUP_COUNT (FN_EXTRA + 42) /* Anzahl der Bausteingruppen */ + +#define FN_AUTO_CORRECT (FN_EXTRA + 49 ) /* Autocorrect aus Basic */ + + +#define FN_UPDATE_TOX (FN_EXTRA + 53) /* alle Verzeichnisse aktualisieren */ +#define FN_UPDATE_CUR_TOX (FN_EXTRA + 54) /* aktuelles Verzeichnisse aktualisieren */ +#define FN_REMOVE_CUR_TOX (FN_EXTRA + 55) /* remove the current TOX*/ + +#define FN_NAVIGATION_PI_GOTO_PAGE (FN_EXTRA + 59 ) /* Seitenanwahl aus Navi-PI */ + + +#define FN_LETTER_WIZZARD (FN_EXTRA + 60 ) +#define FN_FAX_WIZZARD (FN_EXTRA + 61 ) +#define FN_MEMO_WIZZARD (FN_EXTRA + 62 ) +#define FN_AGENDA_WIZZARD (FN_EXTRA + 63 ) + +#define FN_SET_BASIC_METRIC (FN_EXTRA + 80) /* Defaultmetrik Basic setzen */ + +#define FN_RESERVED_9 (FN_EXTRA + 86) /* Platzhalter */ +#define FN_RESERVED_8 (FN_EXTRA + 87) /* Platzhalter */ +#define FN_RESERVED_7 (FN_EXTRA + 88) /* Platzhalter */ +#define FN_RESERVED_6 (FN_EXTRA + 89) /* Platzhalter */ +#define FN_RESERVED_5 (FN_EXTRA + 90) /* Platzhalter */ +#define FN_RESERVED_4 (FN_EXTRA + 91) /* Platzhalter */ +#define FN_RESERVED_3 (FN_EXTRA + 92) /* Platzhalter */ +#define FN_RESERVED_2 (FN_EXTRA + 93) /* Platzhalter */ +#define FN_RESERVED_1 (FN_EXTRA + 94) /* Platzhalter */ + +#define FN_COLLECTION_GROUP_CNT (FN_EXTRA + 96) +#define FN_COLLECTION_GROUP_IDX (FN_EXTRA + 97) +#define FN_COLL_TYPE (FN_EXTRA + 98) /* Typ fuer GlobalDoc-Collection*/ +#define FN_COLL_ADD (FN_EXTRA + 99) + +#define FN_COLL_TITLE (FN_EXTRA2 + 1) /* Bereichsname oder Index-Title */ +#define FN_SHADOWCURSOR (FN_EXTRA2 + 4) /* Shadow Cursor ein/ausschalten */ + + +#define FN_VIEW_IN_FRAME (FN_EXTRA2 + 8) /* die View befindet sich in einem FrameDoc*/ + +#define FN_UNO_PARA_STYLE (FN_EXTRA2 + 9) // jetzt kommen diverse UNO-Ids fuer die +#define FN_UNO_PAGE_STYLE (FN_EXTRA2 + 10) // PropertyMap + +#define FN_UNO_FRAME_STYLE_NAME (FN_EXTRA2 + 12) +#define FN_UNO_NUM_START_VALUE (FN_EXTRA2 + 13) +#define FN_UNO_NUM_LEVEL (FN_EXTRA2 + 14) +#define FN_UNO_NUM_RULES (FN_EXTRA2 + 15) +#define FN_UNO_DOCUMENT_INDEX_MARK (FN_EXTRA2 + 16) +#define FN_UNO_DOCUMENT_INDEX (FN_EXTRA2 + 17) +#define FN_UNO_TEXT_FIELD (FN_EXTRA2 + 18) +#define FN_UNO_TEXT_TABLE (FN_EXTRA2 + 19) +#define FN_UNO_CELL (FN_EXTRA2 + 20) +#define FN_UNO_TEXT_FRAME (FN_EXTRA2 + 21) +#define FN_UNO_REFERENCE_MARK (FN_EXTRA2 + 22) +#define FN_UNO_TEXT_SECTION (FN_EXTRA2 + 23) +#define FN_UNO_FOOTNOTE (FN_EXTRA2 + 24) +#define FN_UNO_ENDNOTE (FN_EXTRA2 + 25) +#define FN_UNO_RANGE_COL_LABEL (FN_EXTRA2 + 26) +#define FN_UNO_RANGE_ROW_LABEL (FN_EXTRA2 + 27) +#define FN_UNO_TABLE_COLUMS (FN_EXTRA2 + 28) +#define FN_UNO_TABLE_BORDER (FN_EXTRA2 + 29) +#define FN_UNO_TABLE_COLUMN_SEPARATORS (FN_EXTRA2 + 30) +#define FN_UNO_TABLE_COLUMN_RELATIVE_SUM (FN_EXTRA2 + 31) +#define FN_UNO_TABLE_CELL_BACKGROUND (FN_EXTRA2 + 32) +#define FN_UNO_ROW_HEIGHT (FN_EXTRA2 + 33) +#define FN_UNO_ROW_AUTO_HEIGHT (FN_EXTRA2 + 34) +#define FN_UNO_HEADER (FN_EXTRA2 + 35) +#define FN_UNO_HEADER_LEFT (FN_EXTRA2 + 36) +#define FN_UNO_HEADER_RIGHT (FN_EXTRA2 + 37) +#define FN_UNO_FOOTER (FN_EXTRA2 + 38) +#define FN_UNO_FOOTER_LEFT (FN_EXTRA2 + 39) +#define FN_UNO_FOOTER_RIGHT (FN_EXTRA2 + 40) +#define FN_UNO_HEADER_BACKGROUND (FN_EXTRA2 + 41) +#define FN_UNO_HEADER_BOX (FN_EXTRA2 + 42) +#define FN_UNO_HEADER_LR_SPACE (FN_EXTRA2 + 43) +#define FN_UNO_HEADER_SHADOW (FN_EXTRA2 + 44) +#define FN_UNO_FOOTER_BACKGROUND (FN_EXTRA2 + 45) +#define FN_UNO_FOOTER_BOX (FN_EXTRA2 + 46) +#define FN_UNO_FOOTER_LR_SPACE (FN_EXTRA2 + 47) +#define FN_UNO_FOOTER_SHADOW (FN_EXTRA2 + 48) +#define FN_UNO_HEADER_BODY_DISTANCE (FN_EXTRA2 + 49) +#define FN_UNO_HEADER_IS_DYNAMIC_DISTANCE (FN_EXTRA2 + 50) +#define FN_UNO_FOOTER_BODY_DISTANCE (FN_EXTRA2 + 51) +#define FN_UNO_FOOTER_IS_DYNAMIC_DISTANCE (FN_EXTRA2 + 52) +#define FN_UNO_HEADER_SHARE_CONTENT (FN_EXTRA2 + 53) +#define FN_UNO_FOOTER_SHARE_CONTENT (FN_EXTRA2 + 54) +#define FN_UNO_HEADER_HEIGHT (FN_EXTRA2 + 55) +#define FN_UNO_FOOTER_HEIGHT (FN_EXTRA2 + 56) +#define FN_UNO_HEADER_ON (FN_EXTRA2 + 57) +#define FN_UNO_FOOTER_ON (FN_EXTRA2 + 58) +#define FN_UNO_FOLLOW_STYLE (FN_EXTRA2 + 59) + +#define FN_API_CALL (FN_EXTRA2 + 60) + +#define FN_UNO_IS_PHYSICAL (FN_EXTRA2 + 61) +#define FN_UNO_IS_AUTO_UPDATE (FN_EXTRA2 + 62) +#define FN_UNO_DISPLAY_NAME (FN_EXTRA2 + 63) + +#define FN_UNO_WRAP (FN_EXTRA2 + 64) +#define FN_UNO_ANCHOR_TYPES (FN_EXTRA2 + 65) +#define FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL (FN_EXTRA2 + 66) +#define FN_UNO_PARA_CONDITIONAL_STYLE_NAME (FN_EXTRA2 + 67) + +#define FN_UNO_CATEGORY (FN_EXTRA2 + 68) +#define FN_UNO_IS_NUMBER (FN_EXTRA2 + 69) +#define FN_UNO_TEXT_WRAP (FN_EXTRA2 + 70) +#define FN_UNO_ANCHOR_TYPE (FN_EXTRA2 + 71) +#define FN_SKIP_HIDDEN_TEXT (FN_EXTRA2 + 72) +#define FN_SKIP_PROTECTED_TEXT (FN_EXTRA2 + 73) +#define FN_UNO_Z_ORDER (FN_EXTRA2 + 74) +#define FN_UNO_REDLINE_NODE_START (FN_EXTRA2 + 75) +#define FN_UNO_REDLINE_NODE_END (FN_EXTRA2 + 76) +#define FN_UNO_TEXT_PORTION_TYPE (FN_EXTRA2 + 77) +#define FN_UNO_CONTROL_CHARACTER (FN_EXTRA2 + 78) +#define FN_UNO_BOOKMARK (FN_EXTRA2 + 79) +#define FN_UNO_IS_COLLAPSED (FN_EXTRA2 + 80) +#define FN_UNO_IS_START (FN_EXTRA2 + 81) +#define FN_UNO_IS_AUTOMATIC_CONTOUR (FN_EXTRA2 + 82) +#define FN_UNO_IS_PIXEL_CONTOUR (FN_EXTRA2 + 83) +#define FN_UNO_ALTERNATIVE_TEXT (FN_EXTRA2 + 84) +#define FN_UNO_ACTUAL_SIZE (FN_EXTRA2 + 85) +#define FN_UNO_GRAPHIC_U_R_L (FN_EXTRA2 + 86) +#define FN_UNO_GRAPHIC_FILTER (FN_EXTRA2 + 87) +#define FN_UNO_CELL_NAME (FN_EXTRA2 + 88) +#define FN_INSERT_GLOSSARY (FN_EXTRA2 + 89) +#define FN_NEW_GLOSSARY (FN_EXTRA2 + 90) +#define FN_SET_ACT_GLOSSARY (FN_EXTRA2 + 91) + +#define FN_UNO_HEADER_EAT_SPACING (FN_EXTRA2 + 92) +#define FN_UNO_FOOTER_EAT_SPACING (FN_EXTRA2 + 93) +#define FN_UNO_CHARFMT_SEQUENCE (FN_EXTRA2 + 94) +#define FN_UNO_CLSID (FN_EXTRA2 + 95) +#define FN_UNO_MODEL (FN_EXTRA2 + 96) +#define FN_UNO_COMPONENT (FN_EXTRA2 + 97) +/*-------------------------------------------------------------------- + Bereich: Hilfe + --------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------- + Bereich: Traveling & Selektion + --------------------------------------------------------------------*/ + +#define FN_CHAR_LEFT (FN_SELECTION + 1 ) /* */ +#define FN_CHAR_RIGHT (FN_SELECTION + 2 ) /* */ +#define FN_LINE_UP (FN_SELECTION + 3 ) /* */ +#define FN_LINE_DOWN (FN_SELECTION + 4 ) /* */ +#define FN_START_OF_LINE (FN_SELECTION + 5 ) /* StartOfLine */ +#define FN_END_OF_LINE (FN_SELECTION + 6 ) /* EndOfLine */ +#define FN_START_OF_DOCUMENT (FN_SELECTION + 7 ) /* StartOfDocument */ +//schon in svxids.hrc +//#define FN_END_OF_DOCUMENT (FN_SELECTION + 8 ) /* EndOfDocument */ +#define FN_START_OF_NEXT_PAGE (FN_SELECTION + 9 ) /* StartOfNextPage ??? */ +#define FN_END_OF_NEXT_PAGE (FN_SELECTION + 10) /* ??? */ +#define FN_START_OF_PREV_PAGE (FN_SELECTION + 11) /* StartOfPrevPage ??? */ +#define FN_END_OF_PREV_PAGE (FN_SELECTION + 12) /* ??? */ +#define FN_START_OF_PAGE (FN_SELECTION + 13) /* StartOfPage */ +#define FN_END_OF_PAGE (FN_SELECTION + 14) /* EndOfPage */ +#define FN_START_OF_WINDOW (FN_SELECTION + 15) /* StartOfWindow */ +#define FN_END_OF_WINDOW (FN_SELECTION + 16) /* EndOfWindow */ +#define FN_START_OF_COLUMN (FN_SELECTION + 17) /* StartOfColumn */ +#define FN_END_OF_COLUMN (FN_SELECTION + 18) /* EndOfColumn */ +#define FN_START_OF_PARA (FN_SELECTION + 19) /* StartOfPara */ +#define FN_END_OF_PARA (FN_SELECTION + 20) /* EndOfPara */ +#define FN_NEXT_WORD (FN_SELECTION + 21) /* NextWord */ +#define FN_PREV_WORD (FN_SELECTION + 22) /* PrevWord */ +#define FN_NEXT_SENT (FN_SELECTION + 23) /* NextSentence */ +#define FN_PREV_SENT (FN_SELECTION + 24) /* PrevSentence */ +#define FN_DELETE (FN_SELECTION + 25) /* Delete */ +#define FN_BACKSPACE (FN_SELECTION + 26) /* Backspace */ +#define FN_DELETE_SENT (FN_SELECTION + 27) /* DeleteToEndOfSentence */ +#define FN_DELETE_BACK_SENT (FN_SELECTION + 28) /* DeleteToStartOfSentence */ +#define FN_DELETE_WORD (FN_SELECTION + 29) /* DeleteToEndOfWord */ +#define FN_DELETE_BACK_WORD (FN_SELECTION + 30) /* DeleteToStartOfWord */ +#define FN_DELETE_LINE (FN_SELECTION + 31) /* DeleteToEndOfLine */ +#define FN_DELETE_BACK_LINE (FN_SELECTION + 32) /* DeleteToStartOfLine */ +#define FN_DELETE_PARA (FN_SELECTION + 33) /* DeleteToEndOfPara */ +#define FN_DELETE_BACK_PARA (FN_SELECTION + 34) /* DeleteToStartOfPara */ +#define FN_DELETE_WHOLE_LINE (FN_SELECTION + 35) /* DeleteLine ??? */ +#define FN_SET_INS_MODE (FN_SELECTION + 36) /* Einfuegemodus / Overwrite */ +#define FN_PAGEUP (FN_SELECTION + 37) /* PageUpWithCursor */ +#define FN_PAGEDOWN (FN_SELECTION + 38) /* PageDownWithCursor */ +#define FN_SET_ADD_MODE (FN_SELECTION + 39) /* Selektionsmodus */ +#define FN_SET_EXT_MODE (FN_SELECTION + 40) /* Selektionsmodus */ +#define FN_ESCAPE (FN_SELECTION + 41) /* Normal */ +#define FN_SHIFT_BACKSPACE (FN_SELECTION + 42) /* wie Backspace */ +#define FN_SELECT_WORD (FN_SELECTION + 43) /* Wort selektieren */ + +#define FN_GOTO_NEXT_OBJ (FN_SELECTION + 44) /* N„chstes Objekt anspringen */ +#define FN_GOTO_PREV_OBJ (FN_SELECTION + 45) /* Vorhergehendes Objekt anspringen */ + +#define FN_START_TABLE (FN_SELECTION + 47) /* an den Anfang der Tabelle */ +#define FN_END_TABLE (FN_SELECTION + 48) /* an das Ende der Tabelle */ +#define FN_NEXT_TABLE (FN_SELECTION + 49) /* zur vorhergehenden Tabelle */ +#define FN_PREV_TABLE (FN_SELECTION + 50) /* zur naechsten Tabelle */ + +#define FN_START_OF_NEXT_COLUMN (FN_SELECTION + 51) /* zum Anfang der naechsten Spalte */ +#define FN_END_OF_NEXT_COLUMN (FN_SELECTION + 52) /* zum Ende der naechsten Spalte */ +#define FN_START_OF_PREV_COLUMN (FN_SELECTION + 53) /* zum Anfang der vorhergehenden Spalte */ +#define FN_END_OF_PREV_COLUMN (FN_SELECTION + 54) /* zum Ende der vorhergehenden Spalte */ + +#define FN_FOOTNOTE_TO_ANCHOR (FN_SELECTION + 55) /* aus der Fussnote zum Anchor */ +#define FN_NEXT_FOOTNOTE (FN_SELECTION + 56) /* zur naechsten Fussnote */ +#define FN_PREV_FOOTNOTE (FN_SELECTION + 57) /* zur vorhergehenden Fussnote */ + +#define FN_CNTNT_TO_NEXT_FRAME (FN_SELECTION + 58) /* aus dem Inhalt zum naechsten Rahmen */ +#define FN_FRAME_TO_ANCHOR (FN_SELECTION + 59) /* vom Rahmen zum Anker */ + +#define FN_TO_HEADER (FN_SELECTION + 60) /* Toggle zwischen Content und Kopfzeile */ +#define FN_TO_FOOTER (FN_SELECTION + 61) /* Toggle zwischen Content und Fusszeile */ + +#define FN_IDX_MARK_TO_IDX (FN_SELECTION + 62) /* von der Verzeichnismarkierung zum Verzeichnis */ + +#define FN_TO_FOOTNOTE_AREA (FN_SELECTION + 63) /* jump into the appropriate footnote area */ + + + + +#define FN_PREV_PARA (FN_SELECTION + 74) +#define FN_NEXT_PARA (FN_SELECTION + 75) + +#define FN_GOTO_NEXT_MARK (FN_SELECTION + 76) /* N„chsten Platzhalter anspringen */ +#define FN_GOTO_PREV_MARK (FN_SELECTION + 77) /* Vorhergehenden Platzhalter anspringen */ + +// schon im SVX unter der gleichen Id +//#define FN_START_DOC_DIRECT (FN_SELECTION + 78) /* Direkt zum Dokanfang springen */ +//#define FN_END_DOC_DIRECT (FN_SELECTION + 79) /* Direkt zum Dokanfang springen */ + +#define FN_NEXT_TOXMARK (FN_SELECTION + 83) /* zur naechsten Verz. Markierung */ +#define FN_PREV_TOXMARK (FN_SELECTION + 84) /* zur vorherigen Verz. Markierung */ +#define FN_NEXT_TBLFML (FN_SELECTION + 85) /* zur naechsten Tabellenformel */ +#define FN_PREV_TBLFML (FN_SELECTION + 86) /* zur vorherigen Tabellenformel */ +#define FN_NEXT_TBLFML_ERR (FN_SELECTION + 87) /* zur naechsten fehl. Tabellenformel */ +#define FN_PREV_TBLFML_ERR (FN_SELECTION + 88) /* zur vorherigen fehl. Tabellenformel */ + +#define FN_READONLY_SELECTION_MODE (FN_SELECTION + 89) /* switches text selection mode in readonly documents*/ +/*-------------------------------------------------------------------- + QUERY-Block + --------------------------------------------------------------------*/ + + + +#define FN_IS_MODIFIED (FN_QUERY +16) /* Dokument geaendert? */ +#define FN_RESET_MODIFIED (FN_QUERY +17) /* Geaendert-Flag zuruecksetzen */ + +#define FN_GET_DOC_INFO (FN_QUERY +22) /* Wert Dokumentinfo erfragen */ +#define FN_GET_ERRNO (FN_QUERY +26) /* Error-Nummer abfragen */ +#define FN_GET_DOCMAN_PATH (FN_QUERY +27) /* Pfad zu einer Gruppe im Docmgr erfragen */ + +#define FN_TXTATR_INET (FN_QUERY +29) /* INet-Attribut */ +#define FN_EXECUTE_DRAG (FN_QUERY +30) /* D&D starten */ + +#define FN_GET_PRINT_AREA (FN_QUERY +32) /* Attribut fuer druckbaren Seitenbereich besorgen */ + + + +// #define FN_IS_START_OF_PAGE (FN_QUERY +40) /**/ +// #define FN_IS_END_OF_PAGE (FN_QUERY +41) /**/ + +#define FN_GET_PARAGRAPH (FN_QUERY +48) /* Paragraph-Object von der Textshell + an die View weiterreichen*/ +// hier ist Schluss!!! + +#define FN_DB_FORM_LETTER (FN_QUERY2 + 0) /* form letter */ +#define FN_DB_INSERT_CONTENT (FN_QUERY2 + 1) /* merge data into fields*/ +#define FN_DB_INSERT_COLUMNS (FN_QUERY2 + 2) /* insert data into text/table/as fields*/ +#define FN_DB_CONNECTION_ANY (FN_QUERY2 + 3) +#define FN_DB_COLUMN_ANY (FN_QUERY2 + 4) +#define FN_DB_DATA_SOURCE_ANY (FN_QUERY2 + 5) +#define FN_DB_DATA_COMMAND_ANY (FN_QUERY2 + 6) +#define FN_DB_DATA_COMMAND_TYPE_ANY (FN_QUERY2 + 7) +#define FN_DB_DATA_COLUMN_NAME_ANY (FN_QUERY2 + 8) +#define FN_DB_DATA_SELECTION_ANY (FN_QUERY2 + 9) +#define FN_DB_DATA_CURSOR_ANY (FN_QUERY2 + 10) + +/*-------------------------------------------------------------------- + Bereich: Envelope + --------------------------------------------------------------------*/ + +#define FN_ENVELOP (FN_ENVELP ) +#define FN_LABEL (FN_ENVELP + 1) +#define FN_BUSINESS_CARD (FN_ENVELP + 2) + +/*-------------------------------------------------------------------- + Bereich: Parameter + --------------------------------------------------------------------*/ + +#define FN_PARAM_TABLE_COLS (FN_PARAM) +#define FN_PARAM_TABLE_ROWS (FN_PARAM+1) +#define FN_PARAM_MOVE_COUNT (FN_PARAM+2) +#define FN_PARAM_MOVE_SELECTION (FN_PARAM+3) + +#define FN_PARAM_SEARCH_WORDONLY (FN_PARAM+5) +#define FN_PARAM_SEARCH_EXACT (FN_PARAM+6) +#define FN_PARAM_SEARCH_REGEXP (FN_PARAM+7) +#define FN_PARAM_SEARCH_BACKWARDS (FN_PARAM+8) +#define FN_PARAM_SEARCH_FINDALL (FN_PARAM+9) +#define FN_PARAM_SEARCH_SELECTION (FN_PARAM+10) +#define FN_PARAM_SEARCH_TEXT (FN_PARAM+11) +#define FN_PARAM_SEARCH_TEXTREPLACE (FN_PARAM+12) + +#define FN_PARAM_PARADLGLIMITS (FN_PARAM+15) +#define FN_PARAM_FRMMODE (FN_PARAM+16) + +#define FN_PARAM_ADDPRINTER (FN_PARAM+18) +#define FN_PARAM_GRID (FN_PARAM+19) +#define FN_PARAM_DOCDISP (FN_PARAM+20) +#define FN_PARAM_ELEM (FN_PARAM+21) +#define FN_PARAM_SWTEST (FN_PARAM+22) + +#define FN_PARAM_FTN_INFO (FN_PARAM+23) + +#define FN_PARAM_REGION_NAME (FN_PARAM+24) +#define FN_PARAM_REGION_CONDITION (FN_PARAM+25) +#define FN_PARAM_REGION_HIDDEN (FN_PARAM+26) +#define FN_PARAM_REGION_PROTECT (FN_PARAM+27) + +#define FN_PARAM_INSERT_AFTER (FN_PARAM+29) +#define FN_PARAM_FILTER (FN_PARAM+30) +#define FN_PARAM_INDEX_NAME (FN_PARAM+31) +#define FN_PARAM_INDEX_OPTIONS (FN_PARAM+32) +#define FN_PARAM_INDEX_FORMAT (FN_PARAM+33) +#define FN_PARAM_INDEX_LEVEL (FN_PARAM+34) +#define FN_PARAM_INDEX_TEMPLATE (FN_PARAM+35) +#define FN_PARAM_INDEX_ALTSTR (FN_PARAM+36) +#define FN_PARAM_INDEX_PRIMKEY (FN_PARAM+37) +#define FN_PARAM_INDEX_SECKEY (FN_PARAM+38) +#define FN_PARAM_WIDTH (FN_PARAM+39) +#define FN_PARAM_LOCATION (FN_PARAM+40) +#define FN_PARAM_DIR (FN_PARAM+41) +#define FN_PARAM_COUNT (FN_PARAM+42) +#define FN_PARAM_COLOR (FN_PARAM+43) + +#define FN_PARAM_TABLE_NAME (FN_PARAM+44) +#define FN_PARAM_TABLE_WIDTH (FN_PARAM+45) +#define FN_PARAM_TABLE_ULSPACE (FN_PARAM+46) +#define FN_PARAM_TABLE_LRSPACE (FN_PARAM+47) +#define FN_PARAM_TABLE_SHADOW (FN_PARAM+48) +#define FN_PARAM_TABLE_ALIGN (FN_PARAM+49) +#define FN_PARAM_TABLE_HEADLINE (FN_PARAM+50) +#define FN_PARAM_TABLE_SPACE (FN_PARAM+51) +#define FN_PARAM_TABLE_COLUMNS (FN_PARAM+52) + +#define FN_PARAM_GRF_CONNECT (FN_PARAM+53) +#define FN_PARAM_FIELD_TYPE (FN_PARAM+54) +//already defined in svxids.hrc: #define FN_PARAM_FIELD_CONTENT (FN_PARAM+55) +#define FN_PARAM_FIELD_SUBTYPE (FN_PARAM+56) +#define FN_PARAM_FIELD_FORMAT (FN_PARAM+57) + + +#define FN_PARAM_EVENT (FN_PARAM+68) +#define FN_PARAM_URL (FN_PARAM+69) +#define FN_PARAM_GRF_REALSIZE (FN_PARAM+70) +#define FN_PARAM_GRF_DIALOG (FN_PARAM+71) +#define FN_PARAM_GRF_CLIENTMAP (FN_PARAM+74) /* ClientMap */ +#define FN_PARAM_GRF_SERVERMAP (FN_PARAM+75) /* ServerMap */ +#define FN_PARAM_GRF_TARGETFRAME (FN_PARAM+76) /* TargetFrame */ +#define FN_INET_FIELD_MACRO (FN_PARAM+77) /* Id fuer URL-Feld-Macros*/ + +#define FN_PARAM_PRINTER (FN_PARAM+78) /* Drucker* */ +#define FN_PARAM_STDFONTS (FN_PARAM+79) /* ConfigItem Standardfonts */ + +#define FN_PARAM_WRTSHELL (FN_PARAM2) /* SwWrtShell */ + +#define FN_COND_COLL (FN_PARAM2+1) /* Item fuer bed. Vorlagen */ +#define FN_PARAM_SELECTION (FN_PARAM2+2) /* selektiertes Wort fuer Format/Zeichen/Hyperlink */ + +#define FN_PARAM_ACT_NUMBER (FN_PARAM2+3) /* PointerItem die aktuelle NumRule */ +#define FN_PARAM_CHILD_LEVELS (FN_PARAM2+4) /* Werden Child-Levels benutzt ?*/ + +#define FN_PARAM_NUM_PRESET (FN_PARAM2+5) /* vorgewaehlte Numerierung*/ + +#define FN_PARAM_HEIGHT (FN_PARAM2+6) /* Param fuer Hoehe */ +#define FN_PARAM_DIST (FN_PARAM2+7) /* und Breite, wg. metrischer Umwandlung */ + +#define FN_PARAM_SHADOWCURSOR (FN_PARAM2+8) /* Fuer ShadowCursor Optionen */ + +#define FN_PARAM_ACT_NUMLEVEL (FN_PARAM2+9) /* BYTE-Item mit aktuellen NumLevel */ + +#define FN_PARAM_9 (FN_PARAM2+10) +#define FN_PARAM_10 (FN_PARAM2+11) + +#define FN_TEXT_RANGE (FN_PARAM2+12) /* TextRange Property*/ + +#define FN_PARAM_CRSR_IN_PROTECTED (FN_PARAM2+13) /* Cursor in geschuetzten Bereichen*/ +#define FN_PARAM_TOX_TYPE (FN_PARAM2+14) /* TOX type in tox dialog*/ +#define FN_PARAM_LINK_DISPLAY_NAME (FN_PARAM2+15) /* LinkDisplayName property*/ +#define FN_PARAM_NUM_LEVEL (FN_PARAM2+16) /* rtf filter*/ +#define FN_PARAM_COUNTOUR_PP (FN_PARAM2+17) /* contour PolyPolygon*/ + +#define FN_ANCHOR_POSITION (FN_PARAM2+18) /* AnchorPosition property */ +#define FN_DROP_TEXT (FN_PARAM2+18) /* text set in drop caps tab page - for recording */ +#define FN_DROP_CHAR_STYLE_NAME (FN_PARAM2+19) /* character style of drop caps - for recording */ +#define FN_PARAM_CHAIN_PREVIOUS (FN_PARAM2+20) /* Name of frame to be added as chain successor */ +#define FN_PARAM_CHAIN_NEXT (FN_PARAM2+21) /* Name of frame to be added as chain predecessor */ +/*-------------------------------------------------------------------- + Bereich: Druckoptionen + --------------------------------------------------------------------*/ + +#define FN_PRNOPT_GRAPHIC (FN_PRNOPT + 1) +#define FN_PRNOPT_TABLE (FN_PRNOPT + 2) +#define FN_PRNOPT_LEFT_PAGE (FN_PRNOPT + 3) +#define FN_PRNOPT_RIGHT_PAGE (FN_PRNOPT + 4) +#define FN_PRNOPT_REVERSE (FN_PRNOPT + 5) +#define FN_PRNOPT_PAPER_FROM_SETUP (FN_PRNOPT + 6) +#define FN_PRNOPT_POSTITS (FN_PRNOPT + 8) + +#define FN_PRNOPT_BEGIN FN_PRNOPT_GRAPHIC +#define FN_PRNOPT_END FN_PRNOPT_POSTITS + +/*-------------------------------------------------------------------- + Beschreibung: Status : nicht mehr als 19! + --------------------------------------------------------------------*/ + +#define FN_STAT_PAGE (FN_STAT + 1) +#define FN_STAT_TEMPLATE (FN_STAT + 2) +#define FN_STAT_ZOOM (FN_STAT + 3) +#define FN_STAT_INSOVER (FN_STAT + 4) +#define FN_STAT_SELMODE (FN_STAT + 5) +#define FN_STAT_HYPERLINKS (FN_STAT + 6) /* Hyperlinks ausfuehren */ +#define FN_STAT_CONTEXT (FN_STAT + 7) +#define FN_STAT_BOOKMARK (FN_STAT + 8) /* Fuer Popup Bookmarks*/ + +/*-------------------------------------------------------------------- + Bereich: Seitenvorschau + --------------------------------------------------------------------*/ + +#define FN_SHOW_TWO_PAGES (FN_PGPREVIEW + 1) +//already in svx/svxids.hrc +#ifndef FN_SHOW_MULTIPLE_PAGES +#define FN_SHOW_MULTIPLE_PAGES (FN_PGPREVIEW + 2) +#endif +#define FN_PRINT_PAGEPREVIEW (FN_PGPREVIEW + 3) +#define FN_CLOSE_PAGEPREVIEW (FN_PGPREVIEW + 4) + +/*-------------------------------------------------------------------- + Bereich: Rahmenattribute + --------------------------------------------------------------------*/ + +#define FN_OPAQUE (FN_FRAME + 1) +#define FN_SET_PROTECT (FN_FRAME + 2) +#define FN_SURROUND (FN_FRAME + 3) +#define FN_VERT_ORIENT (FN_FRAME + 4) +#define FN_HORI_ORIENT (FN_FRAME + 5) +#define FN_SET_FRM_NAME (FN_FRAME + 6) +#define FN_KEEP_ASPECT_RATIO (FN_FRAME + 7) +#define FN_GRF_KEEP_ZOOM (FN_FRAME + 8) + +#define FN_IID_COL1 (FN_FRAME + 13) +#define FN_IID_COL2 (FN_FRAME + 14) +#define FN_IID_COL3 (FN_FRAME + 15) +#define FN_IID_COLLEFT (FN_FRAME + 16) +#define FN_IID_COLRIGHT (FN_FRAME + 17) + +#define FN_SET_FRM_ALT_NAME (FN_FRAME + 18) + + +//Member-Ids fuer Fill/SetVariable an Items +#define MID_STYLE 0xe0 +#define MID_PWIDTH 0xe1 +#define MID_ADJUST 0xe2 +#define MID_TDIST 0xe3 +#define MID_BDIST 0xe4 +#define MID_LINES 0xe5 +#define MID_CHARS 0xe6 +#define MID_DIST 0xe7 + +#define MID_1 0xe8 +#define MID_2 0xe9 +#define MID_3 0xea +#define MID_4 0xeb +#define MID_5 0xec +#define MID_6 0xed +#define MID_7 0xee +#define MID_8 0xef +#define MID_9 0xf0 +#define MID_A 0xf1 +#define MID_B 0xf2 +#define MID_C 0xf3 +#define MID_D 0xf4 +#define MID_E 0xf5 +#define MID_F 0xf6 +#define MID_10 0xf7 +#define MID_11 0xf8 +#define MID_12 0xf9 +#define MID_13 0xfa + +#ifndef SID_SW_DOCMAN_PATH +#define SID_SW_DOCMAN_PATH (SID_OFASLOTS_START + 6) +#endif + +// defines fuer Event-Zuweisung per Macro +#define MAC_EVENT_MOUSEOVER 0x01 // +#define MAC_EVENT_MOUSECLICK 0x02 // Hyperlink ausloesen +#define MAC_EVENT_MOUSEOUT 0x03 // +#define MAC_EVENT_OBJECT_SELECT 0x04 // Obj. selektieren +#define MAC_EVENT_KEYINPUT_ALPHA 0x05 // +#define MAC_EVENT_KEYINPUT_NOALPHA 0x06 // +#define MAC_EVENT_FRM_RESIZE 0x07 // +#define MAC_EVENT_FRM_MOVE 0x08 // +#define MAC_EVENT_IMAGE_LOAD 0x09 // +#define MAC_EVENT_IMAGE_ABORT 0x0a // +#define MAC_EVENT_IMAGE_ERROR 0x0b // + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/comcore.hrc b/inc/bf_sw/comcore.hrc new file mode 100644 index 000000000..9154ad481 --- /dev/null +++ b/inc/bf_sw/comcore.hrc @@ -0,0 +1,63 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _COMCORE_HRC +#define _COMCORE_HRC + +#include "rcid.hrc" + +// --------------- +// die Strings +// --------------- + +#define STR_TABLE_DEFNAME (RC_COMCORE_BEGIN + 2) +#define STR_GRAPHIC_DEFNAME (RC_COMCORE_BEGIN + 3) +#define STR_OBJECT_DEFNAME (RC_COMCORE_BEGIN + 4) +#define STR_FRAME_DEFNAME (RC_COMCORE_BEGIN + 5) +#define STR_REGION_DEFNAME (RC_COMCORE_BEGIN + 6) +#define RID_GRAPHIC_REPLACEBMP (RC_COMCORE_BEGIN + 8) +#define RID_GRAPHIC_ERRORBMP (RC_COMCORE_BEGIN + 9) +#define STR_NUMRULE_DEFNAME (RC_COMCORE_BEGIN + 10) +#define MSG_DISABLE_READLINE_QUESTION (RC_COMCORE_BEGIN + 18) + +// defines fuer die Autoformat Redline Kommentare +#define STR_AUTOFMTREDL_DEL_EMPTY_PARA 0 +#define STR_AUTOFMTREDL_USE_REPLACE 1 +#define STR_AUTOFMTREDL_CPTL_STT_WORD 2 +#define STR_AUTOFMTREDL_CPTL_STT_SENT 3 +#define STR_AUTOFMTREDL_TYPO 4 +#define STR_AUTOFMTREDL_USER_STYLE 5 +#define STR_AUTOFMTREDL_BULLET 6 +#define STR_AUTOFMTREDL_UNDER 7 +#define STR_AUTOFMTREDL_BOLD 8 +#define STR_AUTOFMTREDL_FRACTION 9 +#define STR_AUTOFMTREDL_DETECT_URL 10 +#define STR_AUTOFMTREDL_DASH 11 +#define STR_AUTOFMTREDL_ORDINAL 12 +#define STR_AUTOFMTREDL_RIGHT_MARGIN 13 +#define STR_AUTOFMTREDL_SET_TMPL_TEXT 14 +#define STR_AUTOFMTREDL_SET_TMPL_INDENT 15 +#define STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT 16 +#define STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT 17 +#define STR_AUTOFMTREDL_SET_TMPL_HEADLINE 18 +#define STR_AUTOFMTREDL_SET_NUMBULET 19 +#define STR_AUTOFMTREDL_DEL_MORELINES 20 +// !!!!!!!!!!!!!!!!!!!!!!!!!! das Ende immer richtig setzen !!!!!!!!!!!! +#define STR_AUTOFMTREDL_END 21 + + +#endif diff --git a/inc/bf_sw/crsrsh.hxx b/inc/bf_sw/crsrsh.hxx new file mode 100644 index 000000000..dd26f4530 --- /dev/null +++ b/inc/bf_sw/crsrsh.hxx @@ -0,0 +1,328 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CRSRSH_HXX +#define _CRSRSH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/link.hxx> +#include <bf_tools/string.hxx> + +#include <viewsh.hxx> // fuer ViewShell +#include <cshtyp.hxx> // fuer die CursorShell Typen +#include <crstate.hxx> // fuer die CursorMove-Staties +#include <tblsel.hxx> //SwTblSearchType + +namespace com { namespace sun { namespace star { namespace util { + struct SearchOptions; +} } } } +class KeyCode; +class Region; +namespace binfilter { +class SfxItemSet; +class SfxPoolItem; + +// einige Forward Deklarationen + + +class SpellCheck; +class SwBookmark; +class SwCntntFrm; +class SwCrsrShell; +class SwCursor; +class SwField; +class SwFieldType; +class SwFmt; +class SwFmtFld; +class SwIndex; +class SwNodeIndex; +class SwNode; +class SwNodes; +class SwPaM; +class SwSelBoxes; +class SwShellCrsr; +class SwShellTableCrsr; +class SwTableNode; +class SwTxtFmtColl; +class SwVisCrsr; +class SwTxtINetFmt; +class SwFmtINetFmt; +class SwTxtAttr; +class SwTableBox; +class SwCellFrms; +class SwTOXMark; +class SwRedline; +struct SwPosition; + + + +// enum und struktur, um ueber die Doc-Position Informationen zu erfragen + +struct SwContentAtPos +{ + enum IsAttrAtPos + { + SW_NOTHING = 0x0000, + SW_FIELD = 0x0001, + SW_CLICKFIELD = 0x0002, + SW_FTN = 0x0004, + SW_INETATTR = 0x0008, + SW_TABLEBOXFML = 0x0010, + SW_REDLINE = 0x0020, + SW_OUTLINE = 0x0040, + SW_TOXMARK = 0x0080, + SW_REFMARK = 0x0100 +#ifdef DBG_UTIL + ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen + ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen +#endif + } eCntntAtPos; + + union { + const SwField* pFld; + const SfxPoolItem* pAttr; + const SwRedline* pRedl; + } aFnd; + + String sStr; + const SwTxtAttr* pFndTxtAttr; + + SwContentAtPos( int eGetAtPos = 0xffff ) + : eCntntAtPos( (IsAttrAtPos)eGetAtPos ) + { + aFnd.pFld = 0; + pFndTxtAttr = 0; + } + + // befindet sich der Node in einem geschuetzten Bereich? +}; + + +// defines fuers GetCharCount +#define GETCHARCOUNT_NONE 0 +#define GETCHARCOUNT_PARA 1 +#define GETCHARCOUNT_SECTION 2 + + +// ReturnWerte von SetCrsr (werden verodert) +const int CRSR_NOERROR = 0x00, + CRSR_POSOLD = 0x01, // Cursor bleibt an alter Doc-Position + CRSR_POSCHG = 0x02; // Position vom Layout veraendert + + + + +// die Cursor - Shell +class SwCrsrShell : public ViewShell, public SwModify +{ + friend class SwCallLink; + friend class SwVisCrsr; + friend class SwSelPaintRects; + friend class SwChgLinkFlag; + + friend BOOL GetAutoSumSel( const SwCrsrShell&, SwCellFrms& ); + +public: // public, damit defaultet werden kann !! + + /* ein enum fuer den Aufruf von UpdateCrsr */ + enum CrsrFlag { + UPDOWN = (1 << 0), // Up/Down auf Spalte halten + SCROLLWIN = (1 << 1), // Window Scrollen + CHKRANGE = (1 << 2), // ueberpruefen von ueberlappenden PaM's + NOCALRECT = (1 << 3), // CharRect nicht neu berechnen + READONLY = (1 << 4) // Sichtbar machen trotz Readonly + }; + +private: + + SwRect aCharRect; // Char-SRectangle auf dem der Cursor steht + Point aCrsrHeight; // Hohe&Offset von sichtbaren Cursor + Point aOldRBPos; // Right/Bottom von letzter VisArea + // (wird im Invalidate vom Cursor benutzt) + + + // um event. Macro was anhaengt auszufuehren. + Link aFlyMacroLnk; // Link will be called, if the Crsr is set + // into a fly. A macro can be then becalled + Link aChgLnk; // link will be called by every attribut/ + // format changes at cursor position. + Link aGrfArrivedLnk; // Link calls to UI if a grafik is arrived + + + SwShellCrsr* pCurCrsr; // der aktuelle Cursor + SwShellCrsr* pCrsrStk; // Stack fuer den Cursor + SwVisCrsr *pVisCrsr; // der Sichtbare-Cursor + + SwShellTableCrsr* pTblCrsr; // Tabellen-Crsr; nur in Tabellen, wenn + // die Selection ueber 2 Spalten liegt + + SwNodeIndex* pBoxIdx; // fuers erkennen der veraenderten + SwTableBox* pBoxPtr; // Tabellen-Zelle + + long nUpDownX; // versuche den Cursor bei Up/Down immer in + // der gleichen Spalte zu bewegen + long nLeftFrmPos; + ULONG nAktNode; // save CursorPos at Start-Action + xub_StrLen nAktCntnt; + USHORT nAktNdTyp; + bool bAktSelection; + + USHORT nCrsrMove; + USHORT nBasicActionCnt; // Actions, die vom Basic geklammert wurden + CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst + + BOOL bHasFocus : 1; // Shell ist in einem Window "aktiv" + BOOL bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar + BOOL bChgCallFlag : 1; // Attributaenderung innerhalb von + // Start- und EndAction + BOOL bVisPortChgd : 1; // befindet sich im VisPortChg-Aufruf + // (wird im Invalidate vom Cursor benutzt) + + BOOL bCallChgLnk : 1; // Flag fuer abgeleitete Klassen: + // TRUE -> ChgLnk callen + // Zugriff nur ueber SwChgLinkFlag + BOOL bAllProtect : 1; // Flag fuer Bereiche + // TRUE -> alles geschuetzt / versteckt + BOOL bInCMvVisportChgd : 1; // Flag fuer CrsrMoves + // TRUE -> die Sicht wurde verschoben + BOOL bGCAttr : 1; // TRUE -> es existieren nichtaufgespannte Attr. + BOOL bIgnoreReadonly : 1; // TRUE -> Beim naechsten EndAction trotz + // Readonly den Crsr sichtbar machen. + BOOL bSelTblCells : 1; // TRUE -> Zellen uebers InputWin selektieren + BOOL bAutoUpdateCells : 1; // TRUE -> Zellen werden autoformatiert + BOOL bBasicHideCrsr : 1; // TRUE -> HideCrsr vom Basic + BOOL bSetCrsrInReadOnly : 1;// TRUE -> Cursor darf in ReadOnly-Bereiche + BOOL bOverwriteCrsr : 1; // TRUE -> show Overwrite Crsr + // OD 11.02.2003 #100556# - flag to allow/avoid execution of marcos (default: true) + bool mbMacroExecAllowed : 1; + + typedef bool (SwCursor:: *FNCrsr)(); + +protected: + /* + * Compare-Methode for the StackCursor and the current Cursor. + * The Methods return -1, 0, 1 for lower, equal, greater. The enum + * CrsrCompareType says which position is compared. + */ + enum CrsrCompareType { + StackPtStackMk, + StackPtCurrPt, + StackPtCurrMk, + StackMkCurrPt, + StackMkCurrMk, + CurrPtCurrMk + }; + + USHORT IncBasicAction() { return ++nBasicActionCnt; } + USHORT DecBasicAction() { return --nBasicActionCnt; } + + // Setzt alle PaMs in OldNode auf NewPos + Offset + // Setzt alle PaMs im Bereich von [StartNode, EndNode] nach NewPos + +public: + TYPEINFO(); + SwCrsrShell( SwDoc& rDoc, Window *pWin ); + virtual ~SwCrsrShell(); + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + // loesche den aktuellen Cursor und der folgende wird zum Aktuellen + // TableCursor in normale Cursor verwandeln, Tablemode aufheben + + SwPaM* GetCrsr( bool bMakeTblCrsr = TRUE ) const; + // nur den akt. Cursor returnen + SwShellCrsr* _GetCrsr() { return pCurCrsr; } + const SwShellCrsr* _GetCrsr() const { return pCurCrsr; } + + USHORT GetBasicActionCnt() const { return nBasicActionCnt; } + + // Basiscursortravelling + long GetUpDownX() const { return nUpDownX; } + + /** + Ensure point and mark of the current PaM are in a specific order. + + @param bPointFirst TRUE: If the point is behind the mark then + swap the PaM. FALSE: If the mark is behind the point then swap + the PaM. + */ + void NormalizePam(BOOL bPointFirst = TRUE); + + // Methoden zum Anzeigen bzw. Verstecken der selektierten Bereiche mit + // dem sichtbaren Cursor + + bool IsOverwriteCrsr() const { return bOverwriteCrsr; } + void SetOverwriteCrsr( bool bFlag ) { bOverwriteCrsr = bFlag; } + + // darf der Cursor in ReadOnlyBereiche? + bool IsReadOnlyAvailable() const { return bSetCrsrInReadOnly; } + + // Methoden fuer aFlyMacroLnk + void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; } + const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } + + //ChgLink callen, innerhalb einer Action wird der Ruf verzoegert. + void CallChgLnk(); + + /* + * liefert das SRectangle, auf dem der Cursor steht. + */ + const SwRect &GetCharRect() const { return aCharRect; } + + // ist der Crsr in einer Tabelle und ist die Selection ueber + // zwei Spalten + bool IsTableMode() const { return 0 != pTblCrsr; } + + // erfrage die selektierte "Region" aller Cursor (fuer D&D auf Mac) + Region GetCrsrRegion() const; + + // steht der Curor auf einem "Symbol"-Zeichen + + BOOL BasicActionPend() const { return nBasicActionCnt != nStartAction; } + + // Attribut selelktieren + + bool CheckTblBoxCntnt( const SwPosition* pPos = 0 ); + void ClearTblBoxCntnt(); + + // wird gerufen, wenn eine Tabellenselektion im UpdateCrsr erzeugt wird, + // ohne das die UI davon etaws weiss + + void SetSelTblCells( BOOL bFlag ) { bSelTblCells = bFlag; } + BOOL IsSelTblCells() const { return bSelTblCells; } + + BOOL IsAutoUpdateCells() const { return bAutoUpdateCells; } + void SetAutoUpdateCells( BOOL bFlag ) { bAutoUpdateCells = bFlag; } +}; + + +class SwChgLinkFlag +{ + BOOL bOldFlag; + SwCrsrShell& rCrsrShell; + long nLeftFrmPos; +public: + SwChgLinkFlag( SwCrsrShell& rShell ); + ~SwChgLinkFlag(); +}; + +} //namespace binfilter +#endif // _CRSRSH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/crsskip.hxx b/inc/bf_sw/crsskip.hxx new file mode 100644 index 000000000..0a195d70a --- /dev/null +++ b/inc/bf_sw/crsskip.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _CRSSKIP_HXX +#define _CRSSKIP_HXX + +#include <bf_svtools/bf_solar.h> +namespace binfilter { + + +// define for cursor travelling normally in western text cells and chars do +// the same, but in complex text cell skip over legatures and char skip +// into it. +// These defines exist only to cut off the dependicies to I18N project. +const USHORT CRSR_SKIP_CHARS = 0; +const USHORT CRSR_SKIP_CELLS = 1; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/crstate.hxx b/inc/bf_sw/crstate.hxx new file mode 100644 index 000000000..f0081a868 --- /dev/null +++ b/inc/bf_sw/crstate.hxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CRSTATE_HXX +#define _CRSTATE_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <swtypes.hxx> +#include <swrect.hxx> +namespace binfilter { + +enum SwFillMode +{ + FILL_TAB, // default, Auffuellen mit Tabulatoren + FILL_SPACE, // ... mit Tabulatoren und Spaces + FILL_MARGIN, // nur links, zentriert, rechts Ausrichten + FILL_INDENT // durch linken Absatzeinzug +}; + +struct SwFillCrsrPos +{ + SwRect aCrsr; // Position und Groesse des Shadowcursors + USHORT nParaCnt; // Anzahl der einzufuegenden Absaetze + USHORT nTabCnt; // Anzahl der Tabs bzw. Groesse des Einzugs + USHORT nSpaceCnt; // Anzahl der einzufuegenden Leerzeichen + USHORT nColumnCnt; // Anzahl der notwendigen Spaltenumbrueche + SwHoriOrient eOrient; // Absatzausrichtung + SwFillMode eMode; // Gewuenschte Auffuellregel + SwFillCrsrPos( SwFillMode eMd = FILL_TAB ) : + nParaCnt( 0 ), nTabCnt( 0 ), nSpaceCnt( 0 ), nColumnCnt( 0 ), + eOrient( HORI_NONE ), eMode( eMd ) + {} +}; + +// Multiportion types: two lines, bidirectional, 270 degrees rotation, +// ruby portion and 90 degrees rotation +#define MT_TWOLINE 0 +#define MT_BIDI 1 +#define MT_ROT_270 3 +#define MT_RUBY 4 +#define MT_ROT_90 7 + +struct Sw2LinesPos +{ + SwRect aLine; // Position and size of the line + SwRect aPortion; // Position and size of the multi portion + SwRect aPortion2; // needed for nested multi portions + BYTE nMultiType; // Multiportion type +}; + +/** + * SwSpecialPos. This structure is used to pass some additional information + * during the call of SwTxtFrm::GetCharRect(). An SwSpecialPos defines a position + * inside a portion which does not have a representation in the core string or + * which is only represented by one position, e.g., field portions, + * number portions, ergo sum and quo vadis portions. + * + * nCharOfst - The offset inside the special portion. Fields and its + * follow fields are treated as one long special portion. + * nLineOfst - The number of lines between the beginning of the special + * portion and nCharOfst. A line offset required to be + * nCharOfst relative to the beginning of the line. + * nExtendRange - Setting this identifies portions which are in front or + * behind the core string (number portion, quo vadis) + * + * Examples 1) + * + * Get the position of the second character inside a number portion: + * nCharOfst = 2; nLineOfst = 0; nExtendRange = SP_EXTEND_RANGE_BEFORE; + * Call SwTxtFrm:::GetCharRect with core string position 0. + * + * Example 2) + * + * Field A - Length = 5 + * Follow field B - Length = 9 + * Get the position of the third character in follow field B, core position + * of field A is 33. + * nCharOfst = 7; nLineOfst = 0; nExtendRange = SP_EXTEND_RANGE_NONE; + * Call SwTxtFrm:::GetCharRect with core string position 33. + */ + +#define SP_EXTEND_RANGE_NONE 0 +#define SP_EXTEND_RANGE_BEFORE 1 +#define SP_EXTEND_RANGE_BEHIND 2 + +struct SwSpecialPos +{ + xub_StrLen nCharOfst; + USHORT nLineOfst; + BYTE nExtendRange; +}; + +// CrsrTravelling-Staties (fuer GetCrsrOfst) +enum CrsrMoveState +{ + MV_NONE, // default + MV_UPDOWN, // Crsr Up/Down + MV_RIGHTMARGIN, // an rechten Rand + MV_LEFTMARGIN, // an linken Rand + MV_SETONLYTEXT, // mit dem Cursr nur im Text bleiben + MV_TBLSEL // nicht in wiederholte Headlines +}; + +// struct fuer spaetere Erweiterungen +struct SwCrsrMoveState +{ + SwFillCrsrPos *pFill; // fuer das automatische Auffuellen mit Tabs etc. + Sw2LinesPos *p2Lines; // for selections inside/around 2line portions + SwSpecialPos* pSpecialPos; // for positions inside fields + Point aRealHeight; // enthaelt dann die Position/Hoehe des Cursors + CrsrMoveState eState; + BYTE nCursorBidiLevel; + BOOL bStop :1; + BOOL bRealHeight :1; // Soll die reale Hoehe berechnet werden? + BOOL bFieldInfo :1; // Sollen Felder erkannt werden? + BOOL bPosCorr :1; // Point musste korrigiert werden + BOOL bFtnNoInfo :1; // Fussnotennumerierung erkannt + BOOL bExactOnly :1; // GetCrsrOfst nur nach Exakten Treffern + // suchen lassen, sprich niemals in das + // GetCntntPos laufen. + BOOL bFillRet :1; // wird nur im FillModus temp. genutzt + BOOL bSetInReadOnly :1; // ReadOnlyBereiche duerfen betreten werden + BOOL bRealWidth :1; // Calculation of the width required + BOOL b2Lines :1; // Check 2line portions and fill p2Lines + BOOL bNoScroll :1; // No scrolling of undersized textframes + BOOL bPosMatchesBounds :1; // GetCrsrOfst should not return the next + // position if screen position is inside second + // have of bound rect + + SwCrsrMoveState( CrsrMoveState eSt = MV_NONE ) : + pFill( NULL ), + p2Lines( NULL ), + pSpecialPos( NULL ), + eState( eSt ), + nCursorBidiLevel( 0 ), + bStop( FALSE ), + bRealHeight( FALSE ), + bFieldInfo( FALSE ), + bPosCorr( FALSE ), + bFtnNoInfo( FALSE ), + bExactOnly( FALSE ), + bSetInReadOnly( FALSE ), + bRealWidth( FALSE ), + b2Lines( FALSE ), + bNoScroll( FALSE ), + bPosMatchesBounds( FALSE ) + {} + SwCrsrMoveState( SwFillCrsrPos *pInitFill ) : + pFill( pInitFill ), + pSpecialPos( NULL ), + eState( MV_SETONLYTEXT ), + nCursorBidiLevel( 0 ), + bStop( FALSE ), + bRealHeight( FALSE ), + bFieldInfo( FALSE ), + bPosCorr( FALSE ), + bFtnNoInfo( FALSE ), + bExactOnly( FALSE ), + bSetInReadOnly( FALSE ), + bRealWidth( FALSE ), + b2Lines( FALSE ), + bNoScroll( FALSE ), + bPosMatchesBounds( FALSE ) + {} +}; + + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/cshtyp.hxx b/inc/bf_sw/cshtyp.hxx new file mode 100644 index 000000000..d1559a92e --- /dev/null +++ b/inc/bf_sw/cshtyp.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _CSHTYP_HXX +#define _CSHTYP_HXX + +#include <bf_svtools/bf_solar.h> + +class UniString; +namespace binfilter { + + +class SwPaM; +class SwCntntFrm; +class SwLayoutFrm; + +// eine Struktur fuer den SwPaM. In dieser stehen die Methoden-Pointer +// fuer das richtungsabhaengige Bewegen des Cursors. +struct SwMoveFnCollection; +typedef SwMoveFnCollection* SwMoveFn; + + +// Type-Definition fuer die CrsrShell +// Richtungsparameter fuer MovePage ( wird in SwCntntFrm initialisiert ) +typedef SwLayoutFrm * (*SwWhichPage)( const SwLayoutFrm * ); +typedef SwCntntFrm * (*SwPosPage)( const SwLayoutFrm * ); +extern SwWhichPage fnPagePrev, fnPageCurr, fnPageNext; +extern SwPosPage fnPageStart, fnPageEnd; + +// Richtungsparameter fuer MovePara ( wird in SwPaM initialisiert ) +typedef SwMoveFnCollection* SwPosPara; +typedef bool (*SwWhichPara)( SwPaM&, SwPosPara ); +extern SwWhichPara fnParaPrev, fnParaCurr, fnParaNext; +extern SwPosPara fnParaStart, fnParaEnd; + +// Richtungsparameter fuer MoveSection +typedef SwMoveFnCollection* SwPosSection; +typedef bool (*SwWhichSection)( SwPaM&, SwPosSection ); +extern SwWhichSection fnSectionCurr; +extern SwPosSection fnSectionStart, fnSectionEnd; + +// Richtungsparameter fuer MoveTable +typedef SwMoveFnCollection* SwPosTable; +typedef bool (*SwWhichTable)( SwPaM&, SwPosTable, bool bInReadOnly ); +extern SwWhichTable fnTableCurr; +extern SwPosTable fnTableStart, fnTableEnd; + +// Richtungsparameter fuer MoveColumn +typedef SwLayoutFrm * (*SwWhichColumn)( const SwLayoutFrm * ); +typedef SwCntntFrm * (*SwPosColumn)( const SwLayoutFrm * ); +extern SwWhichColumn fnColumnPrev, fnColumnCurr, fnColumnNext; +extern SwPosColumn fnColumnStart, fnColumnEnd; + + +/* + * folgende Kombinationen sind erlaubt: + * - suche einen im Body: -> FND_IN_BODY + * - suche alle im Body: -> FND_IN_BODYONLY | FND_IN_SELALL + * - suche in Selectionen: einen / alle -> FND_IN_SEL [ | FND_IN_SELALL ] + * - suche im nicht Body: einen / alle -> FND_IN_OTHER [ | FND_IN_SELALL ] + * - suche ueberall alle: -> FND_IN_SELALL + */ +enum FindRanges +{ + FND_IN_BODY = 0x00, // suche "eins" mur im Body-Text + FND_IN_OTHER = 0x02, // suche "alles" in Footer/Header/Fly... + FND_IN_SEL = 0x04, // suche in Selectionen + FND_IN_BODYONLY = 0x08, // suche nur im Body - nur in Verbindung mit + // FND_IN_SELALL !!! + FND_IN_SELALL = 0x01 // - alle ( nur im nicht Body und Selectionen) +}; + + +enum SwDocPositions +{ + DOCPOS_START, + DOCPOS_CURR, + DOCPOS_END, + DOCPOS_OTHERSTART, + DOCPOS_OTHEREND +}; + +} //namespace binfilter +#endif // _CSHTYP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dbfld.hxx b/inc/bf_sw/dbfld.hxx new file mode 100644 index 000000000..e678fa605 --- /dev/null +++ b/inc/bf_sw/dbfld.hxx @@ -0,0 +1,330 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DBFLD_HXX +#define _DBFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include "fldbas.hxx" +#include <swdbdata.hxx> +namespace binfilter { + +class SwDoc; +class SwTxtFld; +class SwFrm; + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankfeld + --------------------------------------------------------------------*/ + +class SwDBFieldType : public SwValueFieldType +{ + SwDBData aDBData; // + String sName; // only used in ::GetName() ! + String sColumn; + long nRefCnt; + +public: + + SwDBFieldType(SwDoc* pDocPtr, const String& rColumnName, const SwDBData& rDBData); + + virtual const String& GetName() const; + virtual SwFieldType* Copy() const; + + inline void AddRef() { nRefCnt++; } + void ReleaseRef(); + inline long GetRefCount() { return nRefCnt; } + + const String& GetColumnName() const {return sColumn;} + const SwDBData& GetDBData() const {return aDBData;} + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: + von SwFields abgeleitete Klassen. Sie ueberlagern die Expand-Funktion. + Der Inhalt wird entsprechend dem Format, soweit vorhanden, formatiert. + --------------------------------------------------------------------*/ + +class SwDBField : public SwValueField +{ + String aContent; + USHORT nSubType; + BOOL bIsInBodyTxt : 1; + BOOL bValidValue : 1; + BOOL bInitialized : 1; + +public: + SwDBField(SwDBFieldType*, ULONG nFmt = 0); + virtual ~SwDBField(); + + virtual SwFieldType* ChgTyp( SwFieldType* ); + + // Der aktuelle Text + inline void SetExpansion(const String& rStr); + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nType); + + // Name oder Inhalt + + // fuer Berechnungen in Ausdruecken + void ChgValue( double d, BOOL bVal ); + + // Evaluierung fuer Kopf und Fusszeilen + void ChangeExpansion( const SwFrm*, const SwTxtFld* ); + void InitContent(); + void InitContent(const String& rExpansion); + + inline void ChgBodyTxtFlag( BOOL bIsInBody ); + inline BOOL IsInBodyTxt() const; + + inline BOOL IsValidValue() const { return bValidValue; } + + inline BOOL IsInitialized() const { return bInitialized; } + inline void ClearInitialized() { bInitialized = FALSE; } + inline void SetInitialized() { bInitialized = TRUE; } + + // Name erfragen + virtual const String& GetPar1() const; + + // DBName + inline const SwDBData& GetDBData() const { return ((SwDBFieldType*)GetTyp())->GetDBData(); } + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline void SwDBField::SetExpansion(const String& rStr) + { aContent = rStr; } + +// wird von der Formatierung abgefragt +inline BOOL SwDBField::IsInBodyTxt() const + { return bIsInBodyTxt; } + +// wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt) +inline void SwDBField::ChgBodyTxtFlag( BOOL bIsInBody ) + { bIsInBodyTxt = bIsInBody; } + +/*-------------------------------------------------------------------- + Beschreibung: Basisklasse fuer alle weiteren Datenbankfelder + --------------------------------------------------------------------*/ + +class SwDBNameInfField : public SwField +{ + SwDBData aDBData; + USHORT nSubType; + +protected: + const SwDBData& GetDBData() const {return aDBData;} + SwDBData& GetDBData() {return aDBData;} + + SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, ULONG nFmt = 0); + +public: + // DBName + inline const SwDBData& GetRealDBData() { return aDBData; } + + SwDBData GetDBData(SwDoc* pDoc); + inline void SetDBData(const SwDBData& rDBData) { aDBData = rDBData; } + + // Name oder Inhalt + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nType); +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankfeld Naechster Satz + --------------------------------------------------------------------*/ + +class SwDBNextSetFieldType : public SwFieldType +{ +public: + SwDBNextSetFieldType(); + + virtual SwFieldType* Copy() const; +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Naechsten Datensatz mit Bedingung + --------------------------------------------------------------------*/ + +class SwDBNextSetField : public SwDBNameInfField +{ + String aCond; + BOOL bCondValid; + +public: + SwDBNextSetField( SwDBNextSetFieldType*, + const String& rCond, const String& rDummy, const SwDBData& rDBData); + + virtual String Expand() const; + virtual SwField* Copy() const; + + void Evaluate(SwDoc*); + inline void SetCondValid(BOOL bCond); + inline BOOL IsCondValid() const; + + // Condition + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline BOOL SwDBNextSetField::IsCondValid() const + { return bCondValid; } + +inline void SwDBNextSetField::SetCondValid(BOOL bCond) + { bCondValid = bCond; } + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankfeld Naechster Satz + --------------------------------------------------------------------*/ + +class SwDBNumSetFieldType : public SwFieldType +{ +public: + SwDBNumSetFieldType(); + + virtual SwFieldType* Copy() const; +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Datensatz mit Nummer xxx + Die Nummer steht in nFormat + ! kleiner Missbrauch + --------------------------------------------------------------------*/ + +class SwDBNumSetField : public SwDBNameInfField +{ + String aCond; + String aPar2; + BOOL bCondValid; + +public: + SwDBNumSetField(SwDBNumSetFieldType*, const String& rCond, const String& rDBNum, const SwDBData& rDBData); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline BOOL IsCondValid() const; + inline void SetCondValid(BOOL bCond); + void Evaluate(SwDoc*); + + // Condition + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // Datensatznummer + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + // Die Datensatznummer steht in nFormat !! + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline BOOL SwDBNumSetField::IsCondValid() const + { return bCondValid; } + +inline void SwDBNumSetField::SetCondValid(BOOL bCond) + { bCondValid = bCond; } + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankname + --------------------------------------------------------------------*/ + +class SwDBNameFieldType : public SwFieldType +{ + SwDoc *pDoc; +public: + SwDBNameFieldType(SwDoc*); + + String Expand(ULONG) const; + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankfeld + --------------------------------------------------------------------*/ + +class SwDBNameField : public SwDBNameInfField +{ +public: + SwDBNameField(SwDBNameFieldType*, const SwDBData& rDBData, ULONG nFmt = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Datensatznummer + --------------------------------------------------------------------*/ + +class SwDBSetNumberFieldType : public SwFieldType +{ +public: + SwDBSetNumberFieldType(); + + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Datenbankfeld + --------------------------------------------------------------------*/ + +class SwDBSetNumberField : public SwDBNameInfField +{ + long nNumber; + +public: + SwDBSetNumberField(SwDBSetNumberFieldType*, const SwDBData& rDBData, ULONG nFmt = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + void Evaluate(SwDoc*); + + inline long GetSetNumber() const; + inline void SetSetNumber(long nNum); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline long SwDBSetNumberField::GetSetNumber() const + { return nNumber; } + +inline void SwDBSetNumberField::SetSetNumber(long nNum) + { nNumber = nNum; } + + +} //namespace binfilter +#endif // _DBFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dbmgr.hxx b/inc/bf_sw/dbmgr.hxx new file mode 100644 index 000000000..9ed54df37 --- /dev/null +++ b/inc/bf_sw/dbmgr.hxx @@ -0,0 +1,258 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWDBMGR_HXX +#define _SWDBMGR_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_tools/string.hxx> + +#include <bf_svtools/svarray.hxx> +#include <com/sun/star/util/Date.hpp> + +#include <swdbdata.hxx> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/lang/Locale.hpp> + +namespace com{namespace sun{namespace star{ + namespace sdbc{ + class XConnection; + class XStatement; + class XDataSource; + class XResultSet; + } + namespace beans{ + + class XPropertySet; + struct PropertyValue; + } + namespace sdbcx{ + class XColumnsSupplier; + } + namespace util{ + class XNumberFormatter; + } +}}} +class ListBox; +class Button; +namespace binfilter { +class SvNumberFormatter; +namespace svx { + class ODataAccessDescriptor; +} + +struct SwDBFormatData +{ + ::com::sun::star::util::Date aNullDate; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> xFormatter; + ::com::sun::star::lang::Locale aLocale; +}; + +class SwView; +class SwWrtShell; +class SwPrtOptions; +class SfxProgress; + +class SwMailMergeDlg; +class SwXMailMerge; + +// ----------------------------------------------------------------------- + +enum DBMgrOptions +{ + DBMGR_MERGE, // Datensaetze in Felder + DBMGR_INSERT, // Datensaetze in Text + DBMGR_MERGE_MAILMERGE, // Serienbriefe drucken + DBMGR_MERGE_MAILING, // Serienbriefe als email versenden + DBMGR_MERGE_MAILFILES // Serienbriefe als Datei(en) speichern +}; + +// ----------------------------------------------------------------------- + +/*-------------------------------------------------------------------- + Beschreibung: (neue) Logische Datenbanken verwalten + --------------------------------------------------------------------*/ +#define SW_DB_SELECT_UNKNOWN 0 +#define SW_DB_SELECT_TABLE 1 +#define SW_DB_SELECT_QUERY 2 + +struct SwDSParam : public SwDBData +{ + ::com::sun::star::util::Date aNullDate; + + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> xFormatter; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> xConnection; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement> xStatement; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> xResultSet; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSelection; + BOOL bScrollable; + BOOL bEndOfDB; + BOOL bAfterSelection; + long nSelectionIndex; + + SwDSParam(const SwDBData& rData) : + SwDBData(rData), + bScrollable(FALSE), + bEndOfDB(FALSE), + bAfterSelection(FALSE), + nSelectionIndex(0) + {} + + SwDSParam(const SwDBData& rData, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& xResSet, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rSelection) : + SwDBData(rData), + xResultSet(xResSet), + aSelection(rSelection), + bScrollable(TRUE), + bEndOfDB(FALSE), + bAfterSelection(FALSE), + nSelectionIndex(0) + {} + + void CheckEndOfDB() + { + if(bEndOfDB) + bAfterSelection = TRUE; + } +}; +typedef SwDSParam* SwDSParamPtr; +SV_DECL_PTRARR_DEL(SwDSParamArr, SwDSParamPtr, 0, 5) + +struct SwNewDBMgr_Impl; +class SwConnectionDisposedListener_Impl; +class SwNewDBMgr +{ +friend class SwConnectionDisposedListener_Impl; + + String sEMailAddrFld; // Mailing: Spaltenname der E-Mail Adresse + String sSubject; // Mailing: Subject + String sAttached; // Mailing: Attachte Files + USHORT nMergeType; + BOOL bInitDBFields : 1; // TRUE: Datenbank an Feldern beim Mergen + BOOL bSingleJobs : 1; // Einzelne Druckjobs bei Aufruf aus Basic + BOOL bCancel : 1; // Serienbrief-Save abgebrochen + + BOOL bInMerge : 1; //merge process active + BOOL bMergeSilent : 1; // suppress display of dialogs/boxes (used when called over API) + BOOL bMergeLock : 1; // prevent update of database fields while document is + // actually printed at the ViewShell + SwDSParamArr aDataSourceParams; + SwNewDBMgr_Impl* pImpl; + const SwXMailMerge* pMergeEvtSrc; // != 0 if mail merge events are to be send + + SwDSParam* pMergeData; + SwMailMergeDlg* pMergeDialog; + + SwDSParam* FindDSData(const SwDBData& rData, BOOL bCreate); + SwDSParam* FindDSConnection(const ::rtl::OUString& rSource, BOOL bCreate); + + + + // Datensaetze als Text ins Dokument einfuegen + + // Einzelnen Datensatz als Text ins Dokument einfuegen + + // Mischen von Datensaetzen in Felder, dann per email versenden + // Mischen von Datensaetzen in Felder, dann als Datei abspeichern + BOOL ToNextRecord(SwDSParam* pParam); + +public: + SwNewDBMgr(); + ~SwNewDBMgr(); + + // Art des aktellen Mergens. Siehe DBMgrOptions-enum + inline USHORT GetMergeType() const { return nMergeType; } + inline void SetMergeType( USHORT nTyp ) { nMergeType = nTyp; } + + // MailMergeEvent source + const SwXMailMerge * GetMailMergeEvtSrc() const { return pMergeEvtSrc; } + void SetMailMergeEvtSrc( const SwXMailMerge *pSrc ) { pMergeEvtSrc = pSrc; } + + inline BOOL IsMergeSilent() const { return bMergeSilent != 0; } + inline void SetMergeSilent( BOOL bVal ) { bMergeSilent = bVal; } + + // Mischen von Datensaetzen in Felder, dann drucken + // Datenbankfelder mit fehlendem Datenbankname initialisieren + inline BOOL IsInitDBFields() const { return bInitDBFields; } + inline void SetInitDBFields(BOOL b) { bInitDBFields = b; } + + // Serienbriefe einzelnd oder alle zusammen drucken/speichern + inline BOOL IsSingleJobs() const { return bSingleJobs; } + inline void SetSingleJobs(BOOL b) { bSingleJobs = b; } + + // Mailing + // email-Daten setzen + inline void SetEMailColumn(const String& sColName) { sEMailAddrFld = sColName; } + inline void SetSubject(const String& sSbj) { sSubject = sSbj; } + inline void SetAttachment(const String& sAtt) { sAttached = sAtt; } + + + // Listbox mit allen Tabellennamen einer Datenbank fuellen + + // Listbox mit allen Spaltennamen einer Datenbanktabelle fuellen + + + + inline BOOL IsInMerge() const { return bInMerge; } + + // check if a data source is open + BOOL IsDataSourceOpen(const String& rDataSource, + const String& rTableOrQuery, sal_Bool bMergeOnly); + + // add data source information to the data source array - was PreInitDBData + void AddDSData(const SwDBData& rData, long nSelStart, long nSelEnd); + + // open the source while fields are updated - for the calculator only! + BOOL OpenDataSource(const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType = -1); + sal_uInt32 GetSelectedRecordId(const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType = -1); + BOOL GetColumnCnt(const String& rSourceName, const String& rTableName, + const String& rColumnName, sal_uInt32 nAbsRecordId, long nLanguage, + String& rResult, double* pNumber); + //create and store or find an already stored connection to a data source for use + //in SwFldMgr and SwDBTreeList + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> + RegisterConnection(::rtl::OUString& rSource); + + const SwDSParam* CreateDSData(const SwDBData& rData) + {return FindDSData(rData, TRUE);} + const SwDSParamArr& GetDSParamArray() const {return aDataSourceParams;} + + + //close all data sources - after fields were updated + void CloseAll(BOOL bIncludingMerge = TRUE); + + BOOL ToNextRecord(const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType = -1); + + sal_uInt32 GetSelectedRecordId(); + + const SwDBData& GetAddressDBName(); + + + static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> + GetConnection(const String& rDataSource, + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>& rxSource); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dcontact.hxx b/inc/bf_sw/dcontact.hxx new file mode 100644 index 000000000..9637dac43 --- /dev/null +++ b/inc/bf_sw/dcontact.hxx @@ -0,0 +1,341 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DCONTACT_HXX +#define _DCONTACT_HXX + +#include <bf_svx/svdobj.hxx> +// OD 14.05.2003 #108784# +#include <bf_svx/svdovirt.hxx> + +// OD 17.06.2003 #108784# +#include <list> + +#include "calbck.hxx" +namespace binfilter { + +class SfxPoolItem; + +class SwFrmFmt; +class SwFlyFrmFmt; +class SwDrawFrmFmt; +class SwFlyFrm; +class SwFrm; +class SwPageFrm; +class SwVirtFlyDrawObj; +class SwFmtAnchor; +class SwFlyDrawObj; +class SwRect; +// OD 17.06.2003 #108784# - forward declaration for class <SwDrawVirtObj> +class SwDrawContact; + +//Der Umgekehrte Weg: Sucht das Format zum angegebenen Objekt. +//Wenn das Object ein SwVirtFlyDrawObj ist so wird das Format von +//selbigem besorgt. +//Anderfalls ist es eben ein einfaches Zeichenobjekt. Diese hat einen +//UserCall und der ist Client vom gesuchten Format. +//Implementierung in dcontact.cxx +SwFrmFmt *FindFrmFmt( SdrObject *pObj ); +inline const SwFrmFmt *FindFrmFmt( const SdrObject *pObj ) +{ return ::binfilter::FindFrmFmt( (SdrObject*)pObj ); } +sal_Bool HasWrap( const SdrObject* pObj ); + +//Bei Aenderungen das Objekt aus dem ContourCache entfernen. +//Implementierung in TxtFly.Cxx +void ClrContourCache( const SdrObject *pObj ); + +// liefert BoundRect inklusive Abstand +SwRect GetBoundRect( const SdrObject* pObj ); + +// Moves a SdrObj so that it fits to a given frame +void CaptureDrawObj( SdrObject& rObj, const SwRect& rFrm ); + +//Liefert den UserCall ggf. vom Gruppenobjekt +SdrObjUserCall* GetUserCall( const SdrObject* ); + +// liefert TRUE falls das SrdObject ein Marquee-Object (Lauftext) ist +bool IsMarqueeTextObj( const SdrObject& rObj ); + +//Basisklasse fuer die folgenden KontaktObjekte (Rahmen+Zeichenobjekte) +class SwContact : public SdrObjUserCall, public SwClient +{ + SdrObject *pMasterObj; +public: + TYPEINFO(); + + //Fuer den Reader, es wir nur die Verbindung hergestellt. + SwContact( SwFrmFmt *pToRegisterIn, SdrObject *pObj ); + SwContact( SwModify *pToRegisterIn ) : SwClient( pToRegisterIn ){} + + // OD 13.05.2003 #108784# - made methods virtual and not inline + virtual const SdrObject *GetMaster() const; + virtual SdrObject *GetMaster(); + virtual void SetMaster( SdrObject* pNew ); + + virtual ~SwContact(); + + SwFrmFmt *GetFmt(){ return (SwFrmFmt*)GetRegisteredIn(); } + const SwFrmFmt *GetFmt() const + { return (const SwFrmFmt*)GetRegisteredIn(); } + +}; + +//KontactObjekt fuer die Verbindung zwischen Rahmen bzw. deren Formaten +//im StarWriter (SwClient) und den Zeichenobjekten des Drawing (SdrObjUserCall) + +class SwFlyDrawContact : public SwContact +{ +public: + TYPEINFO(); + + //Legt das DrawObjekt an und meldet es beim Model an. + SwFlyDrawContact( SwFlyFrmFmt *pToRegisterIn, SdrModel *pMod ); + SwFlyDrawContact( SwFrmFmt *pToRegisterIn, SdrObject *pObj ): + SwContact( pToRegisterIn, pObj ){} + + SwVirtFlyDrawObj *CreateNewRef( SwFlyFrm *pFly ); + + // virtuelle Methoden von SwClient + virtual void Modify( SfxPoolItem *, SfxPoolItem * ) {} //DBG_BF_ASSERT + +}; + +// OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual' +// drawing object to its referenced object. +class SwDrawVirtObj : public SdrVirtObj +{ + private: + // data for connection to writer layout + SwFrm* mpAnchorFrm; + SwPageFrm* mpPageFrm; + + // #108784# + // implement a real offset for this object since the anchor pos will be + // needed, too. + Point maOffset; + + // writer-drawing contact object the 'virtual' drawing object is controlled by. + // This object is also the <UserCall> of the drawing object, if it's + // inserted into the drawing layer. + SwDrawContact& mrDrawContact; + + public: + TYPEINFO(); + + SwDrawVirtObj( SdrObject& _rNewObj, + SwDrawContact& _rDrawContact ); + virtual ~SwDrawVirtObj(); + + // access to offset + void SetOffset( const Point& rNewOffset ); + // OD 30.06.2003 #108784# - virtual!!! + virtual const Point GetOffset() const; + + using SdrObject::Clone; + virtual SdrObject* Clone() const; + virtual void operator=( const SdrObject& ) {} //DBG_BF_ASSERT + + // connection to writer layout + void SetAnchorFrm( SwFrm* _pNewAnchorFrm ); + SwFrm* GetAnchorFrm() const; + void SetPageFrm( SwPageFrm* _pNewPageFrm ); + SwPageFrm* GetPageFrm() const; + void RemoveFromWriterLayout(); + + // connection to drawing layer + void AddToDrawingPage(); + void RemoveFromDrawingPage(); + + // is 'virtual' drawing object connected to writer layout and + // to drawing layer. + bool IsConnected() const; + + // OD 19.06.2003 #108784# - adjust the relative postion of the 'virtual' + // drawing object to the reference object + void AdjustRelativePosToReference(); + + // #108784# + // All overloaded methods which need to use the offset to move + // the object position virtually. + virtual void NbcSetRelativePos(const Point& rPnt); + virtual void NbcSetAnchorPos(const Point& rPnt); + + // #108784# + // All overloaded methods which need to use the offset + virtual const Rectangle& GetBoundRect() const; + virtual void RecalcBoundRect(); + virtual bool Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec) const; + virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const; + virtual void TakeXorPoly(XPolyPolygon& rPoly, bool bDetail) const; + virtual void TakeContour(XPolyPolygon& rPoly) const; + using SdrObject::TakeContour; + virtual SdrHdl* GetHdl(USHORT) const { return NULL; } //DBG_BF_ASSERT + virtual SdrHdl* GetPlusHdl(const SdrHdl&, USHORT) const { return NULL; } //DBG_BF_ASSERT + virtual void NbcMove(const Size& rSiz); + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); + virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs); + virtual void NbcMirror(const Point& rRef1, const Point& rRef2); + virtual void NbcShear(const Point& rRef, double tn, bool bVShear); + virtual void Move(const Size& rSiz); + virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); + virtual void Rotate(const Point& rRef, long nWink, double sn, double cs); + virtual void Mirror(const Point&, const Point&) {} //DBG_BF_ASSERT + virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear); + virtual void RecalcSnapRect(); + virtual const Rectangle& GetSnapRect() const; + virtual void SetSnapRect(const Rectangle& rRect); + virtual void NbcSetSnapRect(const Rectangle& rRect); + virtual const Rectangle& GetLogicRect() const; + virtual void SetLogicRect(const Rectangle& rRect); + virtual void NbcSetLogicRect(const Rectangle& rRect); + virtual Point GetSnapPoint(USHORT) const { Point ap; return ap; } //DBG_BF_ASSERT + virtual const Point& GetPoint(USHORT i) const; + virtual void NbcSetPoint(const Point& rPnt, USHORT i); + + // #108784# + virtual bool HasTextEdit() const; + + // OD 17.06.2003 #108784# - overload 'layer' methods + virtual SdrLayerID GetLayer() const; + using SdrObject::GetLayer; + virtual void NbcSetLayer(SdrLayerID nLayer); + virtual void SetLayer(SdrLayerID nLayer); +}; + +// OD 26.06.2003 #108784# +bool CheckControlLayer( const SdrObject *pObj ); + +//KontactObjekt fuer die Verbindung von Formaten als Repraesentanten der +//Zeichenobjekte im StarWriter (SwClient) und den Objekten selbst im Drawing +//(SdrObjUserCall). + +class SwDrawContact : public SwContact +{ + private: + SwFrm *pAnchor; + SwPageFrm *pPage; + + // OD 16.05.2003 #108784# - data structure for collecting 'virtual' + // drawing object supporting drawing objects in headers/footers. + std::list<SwDrawVirtObj*> maDrawVirtObjs; + + // unary function used by <list> iterator to find a disconnected 'virtual' + // drawing object + struct UsedOrUnusedVirtObjPred + { + bool mbUsedPred; + UsedOrUnusedVirtObjPred( bool _bUsed ) : mbUsedPred( _bUsed ) {}; + bool operator() ( const SwDrawVirtObj* _pDrawVirtObj ) + { + if ( mbUsedPred ) + { + return _pDrawVirtObj->IsConnected(); + } + else + { + return !_pDrawVirtObj->IsConnected(); + } + } + }; + + // unary function used by <list> iterator to find a 'virtual' drawing + // object anchored at a given frame + struct VirtObjAnchoredAtFrmPred + { + const SwFrm& mrAnchorFrm; + VirtObjAnchoredAtFrmPred( const SwFrm& _rAnchorFrm ) : mrAnchorFrm( _rAnchorFrm ) {}; + bool operator() ( const SwDrawVirtObj* _pDrawVirtObj ) + { + return ( _pDrawVirtObj->GetAnchorFrm() == &mrAnchorFrm ); + } + }; + + // OD 16.05.2003 #108784# - method for adding/removing 'virtual' drawing object. + SwDrawVirtObj* CreateVirtObj(); + void DestroyVirtObj( SwDrawVirtObj* pVirtObj ); + void RemoveAllVirtObjs(); + + public: + TYPEINFO(); + + SwDrawContact( SwFrmFmt *pToRegisterIn, SdrObject *pObj ); + virtual ~SwDrawContact(); + + const SwPageFrm *GetPage() const { return pPage; } + SwPageFrm *GetPage() { return pPage; } + const SwFrm *GetAnchor() const { return pAnchor; } + SwFrm *GetAnchor() { return pAnchor; } + void ChgAnchor( SwFrm *pNew ) { pAnchor = pNew; } + void ChgPage ( SwPageFrm *pNew){ pPage = pNew; } + + void ChkPage(); //Muss immer nach SetAnchorPos() gerufen + //werden. Das Objekt haengt sich dann an + //die richtige Seite. + SwPageFrm* FindPage( const SwRect &rRect ); + + //Fuegt das SdrObject in die Arrays (SwPageFrm und SwFrm) des Layouts ein. + //Der Anker wird Anhand des Attributes SwFmtAnchor bestimmt. + //Das Objekt wird ggf. beim alten Anker abgemeldet. + void ConnectToLayout( const SwFmtAnchor *pAnch = 0 ); + + void DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer = true ); + // OD 19.06.2003 #108784# - disconnect for a dedicated drawing object - + // could be 'master' or 'virtual'. + void DisconnectObjFromLayout( SdrObject* _pDrawObj ); + // OD 26.06.2003 #108784# - method to remove 'master' drawing object + // from drawing page. + // To be used by the undo for delete of object. Call it after method + // <DisconnectFromLayout( bool = true )> is already performed. + // Note: <DisconnectFromLayout( bool )> no longer removes the 'master' + // drawing object from drawing page. + void RemoveMasterFromDrawPage(); + + // OD 16.05.2003 #108784# - overload in order to perform work for 'virtual' + // drawing object + virtual void SetMaster( SdrObject* pNew ); + // OD 19.06.2003 #108784# - get drawing object ('master' or 'virtual') + // by frame. + SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm ); + + // virtuelle Methoden von SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + // virtuelle Methoden von SdrObjUserCall + virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect); + + // wird von Changed() und auch vom UndoDraw benutzt, uebernimmt + // das Notifien von Absaetzen, die ausweichen muessen + void _Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle* pOldBoundRect); + + //Moved alle SW-Verbindungen zu dem neuen Master. + + // OD 19.06.2003 #108784# + SwDrawVirtObj* AddVirtObj(); + + // OD 20.06.2003 #108784# + void CorrectRelativePosOfVirtObjs(); + void MoveOffsetOfVirtObjs( const Size& _rMoveSize ); + void InvalidateAnchorOfVirtObjs(); + void NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect ); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ddefld.hxx b/inc/bf_sw/ddefld.hxx new file mode 100644 index 000000000..4281265ba --- /dev/null +++ b/inc/bf_sw/ddefld.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DDEFLD_HXX +#define _DDEFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_so3/lnkbase.hxx> +#include "fldbas.hxx" +namespace binfilter { + +class SwDoc; + +/*-------------------------------------------------------------------- + Beschreibung: FieldType fuer DDE + --------------------------------------------------------------------*/ + +class SwDDEFieldType : public SwFieldType +{ + String aName; + String aExpansion; + + ::binfilter::SvBaseLinkRef refLink; + SwDoc* pDoc; + + USHORT nRefCnt; + BOOL bCRLFFlag : 1; + BOOL bDeleted : 1; + + void _RefCntChgd(); +public: + SwDDEFieldType( const String& rName, const String& rCmd, + USHORT = ::binfilter::LINKUPDATE_ONCALL ); + ~SwDDEFieldType(); + + const String& GetExpansion() const { return aExpansion; } + void SetExpansion( const String& rStr ) { aExpansion = rStr, + bCRLFFlag = FALSE; } + + virtual SwFieldType* Copy() const; + virtual const String& GetName() const; + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + String GetCmd() const; + void SetCmd( const String& rStr ); + + USHORT GetType() const { return refLink->GetUpdateMode(); } + void SetType( USHORT nType ) { refLink->SetUpdateMode( nType ); } + + BOOL IsDeleted() const { return bDeleted; } + void SetDeleted( BOOL b ) { bDeleted = b; } + + BOOL IsConnected() const { return 0 != refLink->GetObj(); } + void UpdateNow() { refLink->Update(); } + void Disconnect() { refLink->Disconnect(); } + + const ::binfilter::SvBaseLink& GetBaseLink() const { return *refLink; } + ::binfilter::SvBaseLink& GetBaseLink() { return *refLink; } + + const SwDoc* GetDoc() const { return pDoc; } + SwDoc* GetDoc() { return pDoc; } + void SetDoc( SwDoc* pDoc ); + + void IncRefCnt() { if( !nRefCnt++ && pDoc ) _RefCntChgd(); } + void DecRefCnt() { if( !--nRefCnt && pDoc ) _RefCntChgd(); } + + void SetCRLFDelFlag( BOOL bFlag = TRUE ) { bCRLFFlag = bFlag; } + BOOL IsCRLFDelFlag() const { return bCRLFFlag; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: DDE-Feld + --------------------------------------------------------------------*/ + +class SwDDEField : public SwField +{ +public: + SwDDEField(SwDDEFieldType*); + ~SwDDEField(); + + virtual String Expand() const; + virtual SwField* Copy() const; + + // ueber Typen Parameter ermitteln + // Name kann nicht geaendert werden + virtual const String& GetPar1() const; + + // Commando + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); +}; + + +} //namespace binfilter +#endif // _DDEFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dlelstnr.hxx b/inc/bf_sw/dlelstnr.hxx new file mode 100644 index 000000000..2fb96b0b9 --- /dev/null +++ b/inc/bf_sw/dlelstnr.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _DLELSTNR_HXX_ +#define _DLELSTNR_HXX_ + + +#include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp> +#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp> +#include <com/sun/star/frame/XDesktop.hpp> + +#include <cppuhelper/implbase2.hxx> // helper for implementations + + +namespace com { namespace sun { namespace star { + namespace linguistic2 { + class XDictionaryList; + class XLinguServiceManager; + } + namespace frame { + class XTerminateListener; + } +} } } +namespace binfilter { + +/////////////////////////////////////////////////////////////////////////// +// SwLinguServiceEventListener +// is a EventListener that triggers spellchecking +// and hyphenation when relevant changes (to the +// dictionaries of the dictionary list, or properties) were made. +// + +class SwLinguServiceEventListener : + public cppu::WeakImplHelper2 + < + ::com::sun::star::linguistic2::XLinguServiceEventListener, + ::com::sun::star::frame::XTerminateListener + > +{ + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XDesktop > xDesktop; + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceManager > xLngSvcMgr; + + // disallow use of copy-constructor and assignment operator + SwLinguServiceEventListener(const SwLinguServiceEventListener &); + SwLinguServiceEventListener & operator = (const SwLinguServiceEventListener &); + +public: + SwLinguServiceEventListener(); + virtual ~SwLinguServiceEventListener(); + + // XEventListener + virtual void SAL_CALL disposing( + const ::com::sun::star::lang::EventObject& rEventObj ) + throw(::com::sun::star::uno::RuntimeException); + + // XDictionaryListEventListener + virtual void SAL_CALL processDictionaryListEvent( + const ::com::sun::star::linguistic2::DictionaryListEvent& rDicListEvent) + throw( ::com::sun::star::uno::RuntimeException ); + + // XLinguServiceEventListener + virtual void SAL_CALL processLinguServiceEvent( + const ::com::sun::star::linguistic2::LinguServiceEvent& rLngSvcEvent ) + throw(::com::sun::star::uno::RuntimeException); + + // XTerminateListener + virtual void SAL_CALL queryTermination( + const ::com::sun::star::lang::EventObject& rEventObj ) + throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL notifyTermination( + const ::com::sun::star::lang::EventObject& rEventObj ) + throw(::com::sun::star::uno::RuntimeException); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dobjfac.hxx b/inc/bf_sw/dobjfac.hxx new file mode 100644 index 000000000..12e11d1fd --- /dev/null +++ b/inc/bf_sw/dobjfac.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOBJFAC_HXX +#define _DOBJFAC_HXX + +#include <tools/link.hxx> +namespace binfilter { + +//----------------------- +// class SwObjectFactory +//----------------------- +class SdrObjFactory; + +class SwObjectFactory +{ +public: + DECL_LINK( MakeObject, SdrObjFactory * ); +}; + +extern SwObjectFactory aSwObjectFactory; + + +} //namespace binfilter +#endif // _DOBJFAC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/doc.hxx b/inc/bf_sw/doc.hxx new file mode 100644 index 000000000..3e1a1d392 --- /dev/null +++ b/inc/bf_sw/doc.hxx @@ -0,0 +1,1466 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOC_HXX +#define _DOC_HXX + +#include <bf_svtools/bf_solar.h> + +#define _SVSTDARR_STRINGSDTOR +#include <bf_svtools/svstdarr.hxx> + +#include <vcl/timer.hxx> +#include <swtypes.hxx> +#include <ndarr.hxx> +#include <swatrset.hxx> +#include <toxe.hxx> // enums +#include <redlenum.hxx> // enums +#include <bkmrke.hxx> +#include <flyenum.hxx> +#include <itabenum.hxx> +#include <swdbdata.hxx> +#include <chcmprse.hxx> +#include <horiornt.hxx> +#include <com/sun/star/linguistic2/XSpellChecker1.hpp> +#include <com/sun/star/linguistic2/XHyphenatedWord.hpp> +#include <rtl/ref.hxx> + +// OD 25.06.2003 #108784# +#include <bf_svx/svdtypes.hxx> +namespace com { namespace sun { namespace star { +namespace i18n { + struct ForbiddenCharacters; // comes from the I18N UNO interface +} +namespace uno { + template < class > class Sequence; +} +}}} + +namespace utl { + class TransliterationWrapper; +} +namespace binfilter { + class SvLinkSource; +} +class DateTime; +class JobSetup; +class Color; +class KeyCode; +class OutputDevice; +class Point; +class SbxArray; +class VirtualDevice; + +namespace binfilter { +class SvEmbeddedObjectRef; +class SvStrings; +class SvxMacro; +class SvxMacroTableDtor; +class SvPersist; +class SvStorage; +class SvUShorts; +class SvUShortsSort; +class SvNumberFormatter; +class BfGraphicObject; + +class SvxForbiddenCharactersTable; +class SwExtTextInput; + +class EditFieldInfo; +class Outliner; +class SdrModel; +class SdrObject; +class SfxDocumentInfo; + +class SfxPrinter; +class SvData; +class SvStringsSort; +class SvxAutoCorrDoc; +class SvxLinkManager; +class SvxBorderLine; +class SwAutoCorrExceptWord; +class SwBookmark; +class SwBookmarks; +class SwCalc; +class SwCellFrm; +class SwCharFmt; +class SwCharFmts; +class SwClient; +class SwConditionTxtFmtColl; +class SwCrsrShell; +class SwCursor; +class SwDBNameInfField; +class SwDocShell; +class SwDocUpdtFld; +class SwDrawFrmFmt; +class SwDrawView; +class SwEditShell; +class SwFieldType; +class SwFldTypes; +class SwFlyFrm; +class SwFlyFrmFmt; +class SwFmt; +class SwFmtCol; +class SwFmtINetFmt; +class SwFmtRefMark; +class SwFrmFmt; +class SwFrmFmts; +class SwFtnIdxs; +class SwFtnInfo; +class SwEndNoteInfo; + +class SwGrfFmtColl; +class SwGrfFmtColls; +class SwLineNumberInfo; +class SwNewDBMgr; +class SwNoTxtNode; +class SwNodeIndex; +class SwNodeRange; +class SwNumRule; +class SwNumRuleTbl; +class SwPageDesc; +class SwPagePreViewPrtData; +class SwRedline; +class SwRedlineTbl; +class SwRootFrm; +class SwRubyList; +class SwRubyListEntry; +class SwSectionFmt; +class SwSectionFmts; +class SwSelBoxes; +class SwSpzFrmFmts; +class SwTOXBase; +class SwTOXBaseSection; +class SwTOXMark; +class SwTOXMarks; +class SwTOXType; +class SwTOXTypes; +class SwTabCols; +class SwTable; +class SwTableAutoFmt; +class SwTableBox; +class SwTableBoxFmt; +class SwTableFmt; +class SwTableLineFmt; +class SwTableNode; +class SwTxtFld; +class SwTxtFmtColl; +class SwTxtFmtColls; +class SwURLStateChanged; +class SwUnoCrsr; +class SwUnoCrsrTbl; +class ViewShell; +class _SetGetExpFld; +class SwDrawContact; +class SdrView; +class SdrMarkList; +class SwAuthEntry; +class SwUnoCallBack; +class SwLayoutCache; +struct SwCallMouseEvent; +struct SwDocStat; +struct SwHash; +struct SwSortOptions; +struct SwDefTOXBase_Impl; +struct SwPrintData; +struct SwTableEntry; +// OD 26.06.2003 #108784# +class SdrPageView; + + +//PageDescriptor-Schnittstelle, Array hier wegen inlines. +typedef SwPageDesc* SwPageDescPtr; +SV_DECL_PTRARR_DEL( SwPageDescs, SwPageDescPtr, 4, 4 ) + +enum SwMoveFlags +{ + DOC_MOVEDEFAULT = 0x00, + DOC_MOVEALLFLYS = 0x01, + DOC_CREATEUNDOOBJ = 0x02, + DOC_MOVEREDLINES = 0x04 +}; + +#define DUMMY_PARASPACEMAX 0x04 +#define DUMMY_PARASPACEMAX_AT_PAGES 0x20 +#define DUMMY_TAB_COMPAT 0x40 +#define DUMMY_USE_VIRTUAL_DEVICE 0x80 +#define DUMMY_ADD_FLY_OFFSETS 0x01 + + +#define SW_HYPH_ERROR 0 +#define SW_HYPH_OK 1 +#define SW_HYPH_ABORTED 2 +#define SW_HYPH_CONTINUE 3 + +// forward declartion +void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem ); + + +class SwDoc +{ + friend class SwReader; // fuers Undo von Insert(SwDoc) + friend class SwSwgReader; // Zugriff auf bDtor-Flag (wg. Loeschen v.Frames) + friend class Sw3IoImp; // Zugriff u.a. auf den Drawing Layer + + friend void _InitCore(); + friend void _FinitCore(); + + //Fuer das Loeschen der Header-/Footer-Formate + //Implementierung und Benutzung in frmatr.cxx + friend void DelHFFormat( SwClient *, SwFrmFmt * ); + + //---------------- private Member -------------------------------- + + // ------------------------------------------------------------------- + // die Objecte + SwNodes aNodes; // Inhalt des Dokumentes + SwAttrPool aAttrPool; // der Attribut Pool + SwPageDescs aPageDescs; // PageDescriptoren + Link aOle2Link; // OLE 2.0-Benachrichtigung + AutoTimer aIdleTimer; // der eigene IdleTimer + Timer aChartTimer; // der Timer fuers Update aller Charts + Timer aOLEModifiedTimer; // Timer for update modified OLE-Objecs + SwDBData aDBData; // database descriptor + ::com::sun::star::uno::Sequence <sal_Int8 > aRedlinePasswd; + String sTOIAutoMarkURL; // ::com::sun::star::util::URL of table of index AutoMark file + SvStringsDtor aPatternNms; // Array fuer die Namen der Dokument-Vorlagen + + + // ------------------------------------------------------------------- + // die Pointer + //Defaultformate + SwFrmFmt *pDfltFrmFmt; + SwFrmFmt *pEmptyPageFmt; // Format fuer die Default-Leerseite. + SwFrmFmt *pColumnContFmt; // Format fuer Spaltencontainer + SwCharFmt *pDfltCharFmt; + SwTxtFmtColl *pDfltTxtFmtColl; // Defaultformatcollections + SwGrfFmtColl *pDfltGrfFmtColl; + + SwFrmFmts *pFrmFmtTbl; // Formattabellen + SwCharFmts *pCharFmtTbl; + SwSpzFrmFmts *pSpzFrmFmtTbl; + SwSectionFmts *pSectionFmtTbl; + SwFrmFmts *pTblFrmFmtTbl; // spz. fuer Tabellen + SwTxtFmtColls *pTxtFmtCollTbl; // FormatCollections + SwGrfFmtColls *pGrfFmtCollTbl; + + SwBookmarks *pBookmarkTbl; //Bookmarks + + SwTOXTypes *pTOXTypes; // Verzeichnisse + SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's + + SdrModel *pDrawModel; // StarView Drawing + + SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update + SwFldTypes *pFldTypes; // Feldtypen + SwNewDBMgr *pNewDBMgr; // Pointer auf den neuen DBMgr fuer + // Evaluierung der DB-Fields + + VirtualDevice *pVirDev; // can be used for formatting + SfxPrinter *pPrt; // can be used for formatting + SwPrintData *pPrtData; // Print configuration + + SwDoc *pGlossaryDoc; // Pointer auf das Glossary-Dokument. Dieses + + SwNumRule *pOutlineRule; + SwFtnInfo *pFtnInfo; + SwEndNoteInfo *pEndNoteInfo; + SwLineNumberInfo *pLineNumberInfo; + SwFtnIdxs *pFtnIdxs; + SwDocStat *pDocStat; // Statistic Informationen + SfxDocumentInfo *pSwgInfo; // Dokumentinformationen + SvxMacroTableDtor *pMacroTable; // Tabelle der dokumentglobalen Macros + + SwDocShell *pDocShell; // Ptr auf die SfxDocShell vom Doc + SvEmbeddedObjectRef* pDocShRef; // fuers Kopieren von OLE-Nodes (wenn keine + // DocShell gesetzt ist, muss dieser + // Ref-Pointer gesetzt sein!!!!) + SvxLinkManager *pLinkMgr; // Liste von Verknuepften (Grafiken/DDE/OLE) + + SwAutoCorrExceptWord *pACEWord; // fuer die automatische Uebernahme von + // autokorrigierten Woertern, die "zurueck" + // verbessert werden + SwURLStateChanged *pURLStateChgd; // SfxClient fuer Aenderungen in der + // INetHistory + SvNumberFormatter *pNumberFormatter; // NumFormatter fuer die Tabellen/Felder + SwNumRuleTbl *pNumRuleTbl; // Liste aller benannten NumRules + SwRedlineTbl *pRedlineTbl; // Liste aller Redlines + String *pAutoFmtRedlnComment; // Kommentar fuer Redlines, die + // uebers Autoformat eingefuegt werden + SwUnoCrsrTbl *pUnoCrsrTbl; + + SwPagePreViewPrtData *pPgPViewPrtData; // Einzuege/Abstaende fuers + // Drucken der Seitenansicht + SwPaM *pExtInputRing; + + SwLayoutCache *pLayoutCache; // Layout cache to read and save with the + // document for a faster formatting + + SwUnoCallBack *pUnoCallBack; + + // table of forbidden characters of this document + ::rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; + + // ------------------------------------------------------------------- + // sonstige + sal_uInt16 nAutoFmtRedlnCommentNo; // SeqNo fuers UI-seitige zusammenfassen + // von AutoFmt-Redlines. Wird vom SwAutoFmt + // verwaltet! + sal_uInt16 nLinkUpdMode; // UpdateMode fuer Links + sal_uInt16 nFldUpdMode; // Mode fuer Felder/Charts automatisch aktualisieren + + SwRedlineMode eRedlineMode; // aktueller Redline Modus + SwCharCompressType eChrCmprType; // for ASIAN: compress punctuation/kana + + sal_Int8 nLinkCt; // wieviele kennen das Dokument + sal_Int8 nLockExpFld; // Wenn != 0 hat UpdateExpFlds() keine Wirkung + + SdrLayerID nHeaven; // LayerIds, Heaven == ueber dem Dokument + SdrLayerID nHell; // Hell == unter dem Dokument + SdrLayerID nControls; // Controls == ganz oben + // OD 25.06.2003 #108784# - Layer IDs for invisible 'heaven', 'hell' and 'controls'. + // The corresponding layers will be permanently invisible and are corresponding + // to the visible ones. + // Needed for support of drawing objects in hidden header/footer and drawing + // objects in other hidden area, e.g. hidden section. + SdrLayerID nInvisibleHeaven; + SdrLayerID nInvisibleHell; + SdrLayerID nInvisibleControls; + + sal_Bool bGlossDoc : 1; //TRUE: ist ein Textbaustein Dokument + sal_Bool bModified : 1; //TRUE: Dokument ist veraendert + sal_Bool bDtor : 1; //TRUE: ist im SwDoc DTOR + // leider auch temporaer von + // SwSwgReader::InLayout(), wenn fehlerhafte + //Frames geloescht werden muessen + sal_Bool bPageNums : 1; // TRUE: es gibt virtuelle Seitennummern + sal_Bool bLoaded : 1; // TRUE: ein geladenes Doc + sal_Bool bUpdateExpFld : 1; // TRUE: Expression-Felder updaten + sal_Bool bNewDoc : 1; // TRUE: neues Doc + sal_Bool bNewFldLst : 1; // TRUE: Felder-Liste neu aufbauen + sal_Bool bCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move + sal_Bool bVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt + sal_Bool bBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen + sal_Bool bInReading : 1; // TRUE: Dokument wird gerade gelesen + sal_Bool bUpdateTOX : 1; // TRUE: nach Dokument laden die TOX Updaten + sal_Bool bInLoadAsynchron: 1; // TRUE: Dokument wird gerade asynchron geladen + sal_Bool bHTMLMode : 1; // TRUE: Dokument ist im HTMLMode + sal_Bool bHeadInBrowse : 1; // TRUE: Header sind im BrowseMode aktiviert + sal_Bool bFootInBrowse : 1; // TRUE: Footer sind im BrowseMode aktiviert + sal_Bool bFrmBeepEnabled : 1; // TRUE: Frames beepen wenn der Inhalt zu gross wird + sal_Bool bInCallModified : 1; // TRUE: im Set/Reset-Modified Link + sal_Bool bIsGlobalDoc : 1; // TRUE: es ist ein GlobalDokument + sal_Bool bGlblDocSaveLinks : 1; // TRUE: im GlobalDoc. gelinkte Sect. mit speichern + sal_Bool bIsLabelDoc : 1; // TRUE: es ist ein Etiketten-Dokument + sal_Bool bIsAutoFmtRedline : 1; // TRUE: die Redlines werden vom Autoformat aufgezeichnet + sal_Bool bOLEPrtNotifyPending:1; // TRUE: Printer ist geaendert und beim + // Erzeugen der ::com::sun::star::sdbcx::View ist eine Benachrichtigung + // der OLE-Objekte PrtOLENotify() notwendig. + sal_Bool bAllOLENotify :1; // True: Benachrichtigung aller Objekte ist notwendig + sal_Bool bIsRedlineMove : 1; // True: die Redlines werden in/aus der Section verschoben + sal_Bool bInsOnlyTxtGlssry : 1; // True: insert 'only text' glossary into doc + sal_Bool bContains_MSVBasic : 1; // True: MS-VBasic exist is in our storage + sal_Bool bPurgeOLE : 1; // TRUE: Purge OLE-Objects + sal_Bool bKernAsianPunctuation : 1; // TRUE: kerning also for ASIAN punctuation + sal_Bool bReadlineChecked : 1; // TRUE: if the query was already shown +#ifdef DBG_UTIL + sal_Bool bXMLExport : 1; // TRUE: during XML export +#endif + + // ------------------------------------------------------------------- + + // ------------------------------------------------------------------- + // Dummies Members fuers FileFormat + String sDummy1; // Dummy-Member. + String sDummy2; + sal_uInt32 n32Dummy1; + sal_uInt32 n32Dummy2; + sal_Int8 n8Dummy1; + sal_Int8 n8Dummy2; + + + //---------------- private Methoden ------------------------------ + void checkRedlining(SwRedlineMode& _rReadlineMode); + + // nur fuer den internen Gebrauch deshalb privat. + // Kopieren eines Bereiches im oder in ein anderes Dokument ! + // Die Position darf nicht im Bereich liegen !! + + SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos, + const SwCntntNode& rNode, RndStdIds eRequestId, + const SfxItemSet* pFlyAttrSet, + SwFrmFmt* = 0 ); + + SwFlyFrmFmt* _InsNoTxtNode( const SwPosition&rPos, SwNoTxtNode*, + const SfxItemSet* pFlyAttrSet, + const SfxItemSet* pGrfAttrSet, + SwFrmFmt* = 0 ); + + void _CopyFlyInFly( const SwNodeRange& rRg, const SwNodeIndex& rSttIdx, + sal_Bool bCopyFlyAtFly = sal_False ) const; // steht im ndcopy.cxx + sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms ); + + typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt* ); + SwFmt* CopyFmt( const SwFmt& rFmt, const SvPtrarr& rFmtArr, + FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt ); + SwFmt* FindFmtByName( const SvPtrarr& rFmtArr, + const String& rName ) const; + + VirtualDevice& _GetVirDev() const; + SfxPrinter& _GetPrt() const; + void PrtDataChanged(); //Printer oder JobSetup geandert, es muss + //fuer entsprechende Invalidierungen und + //Benachrichtigungen gesorgt werden. + + // gcc: aFtnInfo::CopyCtor ist private, also muessen wir uns auch schuetzen + SwDoc( const SwDoc &); + + //wird nur von SwSwgReader::InlayoutFrames() verwendet! + inline void SetInDtor( sal_Bool b ) { bDtor = b; } + + // fuer Felder: + void _InitFieldTypes(); // wird vom CTOR gerufen!! + void _MakeFldList( int eMode ); + // Datenbankfelder: + void UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ); + + void InitDrawModel(); + void ReleaseDrawModel(); + + void _CreateNumberFormatter(); + + + // unser eigener 'IdlTimer' ruft folgende Methode + DECL_LINK( DoIdleJobs, Timer * ); + // der CharTimer ruft diese Methode + DECL_LINK( DoUpdateAllCharts, Timer * ); + DECL_LINK( DoUpdateModifiedOLE, Timer * ); + +public: + SwDoc(); + ~SwDoc(); + + SwNodes& GetNodes() { return aNodes; } + const SwNodes& GetNodes() const { return aNodes; } + + DECL_LINK(CalcFieldValueHdl, EditFieldInfo*); + + // Links un-/sichtbar in LinkManager einfuegen (gelinkte Bereiche) + sal_Bool IsVisibleLinks() const { return bVisibleLinks; } + void SetVisibleLinks( sal_Bool bFlag ) { bVisibleLinks = bFlag; } + + SvxLinkManager& GetLinkManager() { return *pLinkMgr; } + const SvxLinkManager& GetLinkManager() const { return *pLinkMgr; } + + // erfrage das spezifische Layout + const SwRootFrm* GetRootFrm() const { return NULL; } + + void StartIdleTimer() { aIdleTimer.Start(); } + void StopIdleTimer() { aIdleTimer.Stop(); } + sal_Bool IsIdleTimerActive() const { return aIdleTimer.IsActive(); } + + sal_Bool IsOLEPrtNotifyPending() const { return bOLEPrtNotifyPending; } + inline void SetOLEPrtNotifyPending( sal_Bool bSet=sal_True ); + void PrtOLENotify( sal_Bool bAll ); //Alle oder nur Markierte + + sal_Bool IsPurgeOLE() const { return bPurgeOLE; } + void SetPurgeOLE( sal_Bool bFlag ) { bPurgeOLE = bFlag; } + + sal_Bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; } + void SetKernAsianPunctuation( sal_Bool bFlag ) { bKernAsianPunctuation = bFlag; } + +#ifdef DBG_UTIL + sal_Bool InXMLExport() const { return bXMLExport; } + void SetXMLExport( sal_Bool bFlag ) { bXMLExport = bFlag; } +#endif + + // das Dokument im Browse-Modus anzeigen + void SetBrowseMode( sal_Bool bFlag = sal_True ) { bBrowseMode = bFlag; } + sal_Bool IsBrowseMode() const { return bBrowseMode; } + void SetHTMLMode( sal_Bool bFlag = sal_True ) { bHTMLMode = bFlag; } + sal_Bool IsHTMLMode() const { return bHTMLMode; } + void SetHeadInBrowse( sal_Bool bFlag = sal_True ) { bHeadInBrowse = bFlag; } + sal_Bool IsHeadInBrowse() const { return bHeadInBrowse; } + void SetFootInBrowse( sal_Bool bFlag = sal_True ) { bFootInBrowse = bFlag; } + sal_Bool IsFootInBrowse() const { return bFootInBrowse; } + void SetFrmBeepEnabled( sal_Bool bFlag = sal_True ) { bFrmBeepEnabled = bFlag; } + sal_Bool IsFrmBeepEnabled() const { return bFrmBeepEnabled; } + + void SetGlobalDoc( sal_Bool bFlag = sal_True ) { bIsGlobalDoc = bFlag; } + sal_Bool IsGlobalDoc() const { return bIsGlobalDoc; } + void SetGlblDocSaveLinks( sal_Bool bFlag=sal_True ) { bGlblDocSaveLinks = bFlag; } + sal_Bool IsGlblDocSaveLinks() const { return bGlblDocSaveLinks; } + + void SetLabelDoc( sal_Bool bFlag = sal_True ) { bIsLabelDoc = bFlag; } + sal_Bool IsLabelDoc() const { return bIsLabelDoc; } + + sal_uInt16 GetLinkUpdMode() const; + void SetLinkUpdMode( sal_uInt16 nMode ) { nLinkUpdMode = nMode; } + // nur fuer den Writer, weil dieser das richtige Enum schreiben muss! + sal_uInt16 _GetLinkUpdMode() const { return nLinkUpdMode; } + + SwCharCompressType GetCharCompressType() const { return eChrCmprType; } + void SetCharCompressType( SwCharCompressType n ); + + inline sal_Bool IsInDtor() const { return bDtor; } + + // SS fuer das Drawing, Model und LayerId's + const SdrModel* GetDrawModel() const { return pDrawModel; } + SdrModel* GetDrawModel() { return pDrawModel; } + SdrLayerID GetHeavenId() const { return nHeaven; } + SdrLayerID GetHellId() const { return nHell; } + SdrLayerID GetControlsId() const { return nControls; } + // OD 25.06.2003 #108784# - accessor for layer IDs of invisible layers. + inline SdrLayerID GetInvisibleHeavenId() const { return nInvisibleHeaven; } + inline SdrLayerID GetInvisibleHellId() const { return nInvisibleHell; } + inline SdrLayerID GetInvisibleControlsId() const { return nInvisibleControls; } + + /** method to determine, if a layer ID belongs to the visible ones. + + OD 25.06.2003 #108784# + Note: If given layer ID is unknown, method asserts and returns <false>. + + @author OD + + @param _nLayerId + input parameter - layer ID, which has to be checked, if it belongs to + the visible ones. + + @return bool, indicating, if given layer ID belongs to the visible ones. + */ + bool IsVisibleLayerId( const SdrLayerID& _nLayerId ); + + /** method to determine, if the corresponding visible layer ID for a invisible one. + + OD 25.06.2003 #108784# + Note: If given layer ID is a visible one, method returns given layer ID. + Note: If given layer ID is unknown, method returns given layer ID. + + @author OD + + @param _nInvisibleLayerId + input parameter - invisible layer ID for which the corresponding + visible one has to be returned. + + @return sal_Int8, visible layer ID corresponding to given layer ID + */ + SdrLayerID GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId ); + + /** method to determine, if the corresponding invisible layer ID for a visible one. + + OD 25.06.2003 #108784# + Note: If given layer ID is a invisible one, method returns given layer ID. + Note: If given layer ID is unknown, method returns given layer ID. + + @author OD + + @param _nVisibleLayerId + input parameter - visible layer ID for which the corresponding + invisible one has to be returned. + + @return sal_Int8, invisible layer ID corresponding to given layer ID + */ + SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId ); + + // dokumentglobale Macros + void SetGlobalMacro(sal_uInt16 nEvent, const SvxMacro&); + const SvxMacroTableDtor& GetMacroTable() const { return *pMacroTable; } + + // Fussnoten Informationen + const SwFtnInfo& GetFtnInfo() const { return *pFtnInfo; } + void SetFtnInfo(const SwFtnInfo& rInfo); + const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; } + void SetEndNoteInfo(const SwEndNoteInfo& rInfo); + + // Zeilennummerierung + const SwLineNumberInfo& GetLineNumberInfo() const { return *pLineNumberInfo; } + void SetLineNumberInfo(const SwLineNumberInfo& rInfo); + + SwFtnIdxs& GetFtnIdxs() { return *pFtnIdxs; } + const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; } + // Fussnoten im Bereich aendern + sal_Bool SetCurFtn( const SwPaM& rPam, const String& rNumStr, + sal_uInt16 nNumber, sal_Bool bIsEndNote ); + + // wegen swrtf.cxx und define private public, jetzt hier + SwFlyFrmFmt *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom); + SwDrawFrmFmt *MakeDrawFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom); + + const SwBookmarks& GetBookmarks() const { return *pBookmarkTbl; } + SwBookmark* MakeBookmark( const SwPaM& rPaM, const KeyCode&, + const String& rName, const String& rShortName, BOOKMARK_TYPE eMark = BOOKMARK); + void DelBookmark( sal_uInt16 nPos ); + void DelBookmark( const String& rName ); + sal_uInt16 FindBookmark( const String& rName ); + + // Anzahl der ::com::sun::star::text::Bookmarks, gfs. nur "echte" + sal_uInt16 GetBookmarkCnt(sal_Bool bBkmrk = sal_False) const; + SwBookmark& GetBookmark( sal_uInt16, sal_Bool bBkmrk = sal_False); + + // Textbaustein Dokument? + void SetGlossDoc( sal_Bool bGlssDc = sal_True ) { bGlossDoc = bGlssDc; } + sal_Bool IsGlossDoc() const { return bGlossDoc; } + sal_Bool IsInsOnlyTextGlossary() const { return bInsOnlyTxtGlssry; } + + //Bei Formataenderungen muss das zu Fuss gerufen werden! + void SetModified(); + void ResetModified(); + sal_Bool IsModified() const { return bModified; } //Dokumentaenderungen? + + sal_Bool IsInCallModified() const { return bInCallModified; } + + //Die neuen (hoffentlich bestaendigen) Schnittstellen fuer alles, + //was mit dem Layout zu tun hat. + SwFrmFmt *MakeLayoutFmt( RndStdIds eRequest, + SwFrmFmt* = 0, + const SfxItemSet* pSet = 0 ); + // JP 08.05.98: fuer Flys muss jetzt diese Schnittstelle benutzt + // werden. pAnchorPos muss gesetzt sein, wenn keine + // Seitenbindung vorliegt UND der ::com::sun::star::chaos::Anchor nicht schon + // im FlySet/FrmFmt mit gueltiger CntntPos gesetzt ist + /* #109161# new parameter bCalledFromShell + + TRUE: An existing adjust item at pAnchorPos is propagated to + the content node of the new fly section. That propagation only + takes place if there is no adjust item in the paragraph style + for the new fly section. + + FALSE: no propagation + */ + SwFlyFrmFmt* MakeFlySection( RndStdIds eAnchorType, + const SwPosition* pAnchorPos, + const SfxItemSet* pSet = 0, + SwFrmFmt *pParent = 0, + BOOL bCalledFromShell = FALSE ); + + void DelLayoutFmt( SwFrmFmt *pFmt ); + SwFrmFmt *CopyLayoutFmt( const SwFrmFmt& rSrc, + const SwFmtAnchor& rNewAnchor, + sal_Bool bSetTxtFlyAtt = sal_True, sal_Bool bMakeFrms = sal_True ); + void CopyWithFlyInFly( const SwNodeRange& rRg, + const SwNodeIndex& rInsPos, + sal_Bool bMakeNewFrms, + sal_Bool bCopyFlyAtFly ) const; + sal_Bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const; + + sal_Bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ); + sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt, + SfxItemSet* pSet = 0, sal_Bool bKeepOrient = sal_False ); + + // Abstakt fuellen + + /* Verwaltet SwDoc::nLinkCt, sollte (paarig!) von allen benutzt werden, + * die einen Pointer auf dieses Dokument halten, denn wenn Remove() 0 + * liefert, wird das Dokument zerstoert! Oder anders: Jeder bei dem + * Remove() 0 liefert, muss das Dokument zerstoeren. + */ + sal_Int8 AddLink() { return nLinkCt++; } + sal_Int8 RemoveLink() { return nLinkCt ? --nLinkCt : nLinkCt; } + sal_Int8 GetLinkCnt() const { return nLinkCt; } + + /* Felder */ + const SwFldTypes *GetFldTypes() const { return pFldTypes; } + SwFieldType *InsertFldType(const SwFieldType &); + SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const; + SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName) const; + void RemoveFldType(sal_uInt16 nFld); + + // rufe das Update der Expression Felder auf; alle Ausdruecke werden + // neu berechnet. + void UpdateRefFlds( SfxPoolItem* pHt = 0); + void UpdateTblFlds( SfxPoolItem* pHt = 0); + void UpdateExpFlds( SwTxtFld* pFld = 0, sal_Bool bUpdateRefFlds = sal_True ); + void UpdatePageFlds( SfxPoolItem* ); + void LockExpFlds() { ++nLockExpFld; } + void UnlockExpFlds() { if( nLockExpFld ) --nLockExpFld; } + sal_Bool IsExpFldsLocked() const { return 0 != nLockExpFld; } + SwDocUpdtFld& GetUpdtFlds() const { return *pUpdtFlds; } + sal_Bool SetFieldsDirty( sal_Bool b, const SwNode* pChk = 0, ULONG nLen = 0 ); + + sal_uInt16 GetFldUpdateFlags() const; + void SetFldUpdateFlags( sal_uInt16 eMode ) { nFldUpdMode = eMode; } + // nur fuer den Writer, weil dieser das richtige Enum schreiben muss! + sal_uInt16 _GetFldUpdateFlags() const { return nFldUpdMode; } + + + // Zustaende ueber Ladezustand + // frueher DocInfo + // + sal_Bool IsPageNums() const { return bPageNums; } + sal_Bool IsLoaded() const { return bLoaded; } + sal_Bool IsUpdateExpFld() const { return bUpdateExpFld; } + sal_Bool IsNewDoc() const { return bNewDoc; } + + void SetPageNums(sal_Bool b = sal_True) { bPageNums = b; } + void SetNewDoc(sal_Bool b = sal_True) { bNewDoc = b; } + void SetUpdateExpFldStat(sal_Bool b = sal_True) { bUpdateExpFld = b; } + void SetLoaded(sal_Bool b = sal_True) { bLoaded = b; } + + // Setze im Calculator alle SetExpresion Felder, die bis zur + // angegebenen Position (Node [ + ::com::sun::star::ucb::Content]) gueltig sind. Es kann + // eine erzeugte Liste aller Felder mit uebergegeben werden. + // (ist die Adresse != 0, und der Pointer == 0 wird eine neue + // Liste returnt.) + void FldsToCalc( const _SetGetExpFld& rToThisFld ); + sal_Bool IsNewFldLst() const { return bNewFldLst; } + void SetNewFldLst( sal_Bool bFlag = sal_True ) { bNewFldLst = bFlag; } + void InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ); + + /* Datenbank && DB-Manager */ + void SetNewDBMgr( SwNewDBMgr* pNewMgr ) { pNewDBMgr = pNewMgr; } + SwNewDBMgr* GetNewDBMgr() const { return pNewDBMgr; } + void SetInitDBFields(sal_Bool b); + + void ChgDBData( const SwDBData& rNewData ); + SwDBData GetDBData(); + const SwDBData& GetDBDesc(); + const SwDBData& _GetDBDesc() const { return aDBData; } + + // Loesche die Section, in der der Node steht. + void DeleteSection( SwNode *pNode ); + + sal_Bool Delete( SwPaM& ); //loeschen eines Bereiches + sal_Bool DelFullPara( SwPaM& ); //loeschen gesamter Absaetze + sal_Bool DeleteAndJoin( SwPaM& ); //komplett loeschen eines Bereiches + + //Ueberschreiben eines einzelnen Zeichens. rRg.Start() bezeichnet + //den Node und die Position in dem Node, an der eingefuegt wird, + //Ueberschreiben eines Strings in einem bestehenden Textnode. + //Einfuegen eines einzelnen Zeichens. rRg.Start() bezeichnet + //den Node und die Position in dem Node, an der eingefuegt wird. + sal_Bool Insert(const SwPaM &rRg, sal_Unicode c ); + //Einfuegen eines Strings in einen bestehenden + //Textnode. Der Text wird kopiert. + sal_Bool Insert( const SwPaM &rRg, const String &, + sal_Bool bHintExpand = sal_True ); + + // change text to Upper/Lower/Hiragana/Katagana/... + + //Einfuegen einer Grafik, Formel. Die XXXX werden kopiert. + SwFlyFrmFmt* Insert(const SwPaM &rRg, + const String& rGrfName, + const String& rFltName, + const Graphic* pGraphic = 0, + const SfxItemSet* pFlyAttrSet = 0, + const SfxItemSet* pGrfAttrSet = 0, + SwFrmFmt* = 0 ); + SwFlyFrmFmt* Insert(const SwPaM &rRg, + const BfGraphicObject& rGrfObj, + const SfxItemSet* pFlyAttrSet = 0, + const SfxItemSet* pGrfAttrSet = 0, + SwFrmFmt* = 0 ); + + //Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel + // angemeldet sein. + SwDrawFrmFmt* Insert( const SwPaM &rRg, + SdrObject& rDrawObj, + const SfxItemSet* pFlyAttrSet = 0, + SwFrmFmt* = 0 ); + String GetUniqueGrfName() const; + + //Einfuegen von OLE-Objecten. + SwFlyFrmFmt* Insert( const SwPaM &rRg, SvInPlaceObject *, + const SfxItemSet* pFlyAttrSet = 0, + const SfxItemSet* pGrfAttrSet = 0, + SwFrmFmt* = 0 ); + SwFlyFrmFmt* InsertOLE( const SwPaM &rRg, String& rObjName, + const SfxItemSet* pFlyAttrSet = 0, + const SfxItemSet* pGrfAttrSet = 0, + SwFrmFmt* = 0 ); + String GetUniqueOLEName() const; + + // ein bischen wa fuer die benannten FlyFrames + String GetUniqueFrameName() const; + void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName ); + const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const; + + void GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName, + String* pFltName ) const; + + // setze bei allen Flys ohne Namen einen gueltigen (Wird von den Readern + // nach dem Einlesen gerufen ) + void SetAllUniqueFlyNames(); + + //Aufspalten eines Nodes an rPos (nur fuer den TxtNode implementiert) + sal_Bool SplitNode(const SwPosition &rPos, sal_Bool bChkTableStart = sal_False ); + sal_Bool AppendTxtNode( SwPosition& rPos ); // nicht const! + + /* + * Einfuegen eines Attributs. Erstreckt sich rRg ueber + * mehrere Nodes, wird das Attribut aufgespaltet, sofern + * dieses Sinn macht. Nodes, in denen dieses Attribut keinen + * Sinn macht, werden ignoriert. In vollstaendig in der + * Selektion eingeschlossenen Nodes wird das Attribut zu + * harter Formatierung, in den anderen (Text-)Nodes wird das + * Attribut in das Attributearray eingefuegt. Bei einem + * Zeichenattribut wird ein "leerer" Hint eingefuegt, + * wenn keine Selektion + * vorliegt; andernfalls wird das Attribut als harte + * Formatierung dem durch rRg.Start() bezeichneten Node + * hinzugefuegt. Wenn das Attribut nicht eingefuegt werden + * konnte, liefert die Methode sal_False. + */ + sal_Bool Insert( const SwPaM &rRg, const SfxPoolItem&, sal_uInt16 nFlags = 0 ); + sal_Bool Insert( const SwPaM &rRg, const SfxItemSet&, sal_uInt16 nFlags = 0 ); + + //Zuruecksetzen der Attribute; es werden alle TxtHints und bei + //vollstaendiger Selektion harte Formatierung (AUTO-Formate) entfernt + void ResetAttr(const SwPaM &rRg, sal_Bool bTxtAttr = sal_True, + const SvUShortsSort* = 0 ); + + // Setze das Attribut im angegebenen Format. Ist Undo aktiv, wird + // das alte in die Undo-History aufgenommen + void SetAttr( const SfxPoolItem&, SwFmt& ); + void SetAttr( const SfxItemSet&, SwFmt& ); + + // Setze das Attribut als neues default Attribut in diesem Dokument. + // Ist Undo aktiv, wird das alte in die Undo-History aufgenommen + void SetDefault( const SfxPoolItem& ); + void SetDefault( const SfxItemSet& ); + + // Erfrage das Default Attribut in diesem Dokument. + const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const; + // TextAttribute nicht mehr aufspannen lassen + + /* Formate */ + const SwFrmFmts* GetFrmFmts() const { return pFrmFmtTbl; } + SwFrmFmts* GetFrmFmts() { return pFrmFmtTbl; } + const SwCharFmts* GetCharFmts() const { return pCharFmtTbl;} + + /* LayoutFormate (Rahmen, DrawObjecte), mal const mal nicht */ + const SwSpzFrmFmts* GetSpzFrmFmts() const { return pSpzFrmFmtTbl; } + SwSpzFrmFmts* GetSpzFrmFmts() { return pSpzFrmFmtTbl; } + + const SwFrmFmt *GetDfltFrmFmt() const { return pDfltFrmFmt; } + SwFrmFmt *GetDfltFrmFmt() { return pDfltFrmFmt; } + const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; } + SwFrmFmt *GetEmptyPageFmt() { return pEmptyPageFmt; } + const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; } + SwFrmFmt *GetColumnContFmt() { return pColumnContFmt; } + const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;} + SwCharFmt *GetDfltCharFmt() { return pDfltCharFmt;} + + // Remove all language dependencies from all existing formats + void RemoveAllFmtLanguageDependencies(); + + SwFrmFmt *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom); + void DelFrmFmt( SwFrmFmt *pFmt ); + SwFrmFmt* FindFrmFmtByName( const String& rName ) const + { return (SwFrmFmt*)FindFmtByName( (SvPtrarr&)*pFrmFmtTbl, rName ); } + SwFrmFmt* FindSpzFrmFmtByName( const String& rName ) const + { return (SwFrmFmt*)FindFmtByName( (SvPtrarr&)*pSpzFrmFmtTbl, rName ); } + + SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom); + void DelCharFmt(sal_uInt16 nFmt); + void DelCharFmt(SwCharFmt* pFmt); + SwCharFmt* FindCharFmtByName( const String& rName ) const + { return (SwCharFmt*)FindFmtByName( (SvPtrarr&)*pCharFmtTbl, rName ); } + + /* Formatcollections (Vorlagen) */ + // TXT + const SwTxtFmtColl* GetDfltTxtFmtColl() const { return pDfltTxtFmtColl; } + const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; } + SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName, + SwTxtFmtColl *pDerivedFrom ); +/*NBFF*/ SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName, +/*NBFF*/ SwTxtFmtColl *pDerivedFrom ); + sal_Bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt, + sal_Bool bReset = sal_True); + SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const + { return (SwTxtFmtColl*)FindFmtByName( (SvPtrarr&)*pTxtFmtCollTbl, rName ); } + + // GRF + const SwGrfFmtColl* GetDfltGrfFmtColl() const { return pDfltGrfFmtColl; } + const SwGrfFmtColls *GetGrfFmtColls() const { return pGrfFmtCollTbl; } + SwGrfFmtColl* FindGrfFmtCollByName( const String& rName ) const + { return (SwGrfFmtColl*)FindFmtByName( (SvPtrarr&)*pGrfFmtCollTbl, rName ); } + + // Tabellen-Formate + const SwFrmFmts* GetTblFrmFmts() const { return pTblFrmFmtTbl; } + SwFrmFmts* GetTblFrmFmts() { return pTblFrmFmtTbl; } + + SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom); + void DelTblFrmFmt( SwTableFmt* pFmt ); + SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const; + + //Rahmenzugriff + //iterieren ueber Flys - fuer Basic-Collections + sal_uInt16 GetFlyCount(FlyCntType eType = FLYCNTTYPE_ALL) const; + SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL); + + + // kopiere die Formate in die eigenen Arrays und returne diese + SwFrmFmt *CopyFrmFmt ( const SwFrmFmt& ); + SwCharFmt *CopyCharFmt( const SwCharFmt& ); + SwTxtFmtColl* CopyTxtColl( const SwTxtFmtColl& rColl ); + SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl ); + + // ersetze alle Formate mit denen aus rSource + + // Gebe die "Auto-Collection" mit der Id zurueck. Existiert + // sie noch nicht, dann erzuege sie + // Ist der String-Pointer definiert, dann erfrage nur die + // Beschreibung der Attribute, !! es legt keine Vorlage an !! + // ...Simple to prevent ambiguity with GetPageDescFromPool + SwTxtFmtColl* GetTxtCollFromPoolSimple(sal_uInt16 nId, + BOOL bRegardLanguage) + { + return GetTxtCollFromPool + ( nId, 0, SFX_ITEM_PRESENTATION_COMPLETE, SFX_MAPUNIT_TWIP, + SFX_MAPUNIT_TWIP, bRegardLanguage); + } + SwTxtFmtColl* GetTxtCollFromPool( sal_uInt16 nId, String* pDescription = 0, + SfxItemPresentation ePres = SFX_ITEM_PRESENTATION_COMPLETE, + SfxMapUnit eCoreMetric = SFX_MAPUNIT_TWIP, + SfxMapUnit ePresMetric = SFX_MAPUNIT_TWIP, + BOOL bRegardLanguage = TRUE ); + // return das geforderte automatische Format - Basis-Klasse ! + SwFmt* GetFmtFromPool( sal_uInt16 nId, String* pDescription = 0 ); + // returne das geforderte automatische Format + SwFrmFmt* GetFrmFmtFromPool( sal_uInt16 nId, String* pDescription = 0 ) + { return (SwFrmFmt*)GetFmtFromPool( nId, pDescription ); } + SwCharFmt* GetCharFmtFromPool( sal_uInt16 nId, String* pDescription = 0 ) + { return (SwCharFmt*)GetFmtFromPool( nId, pDescription ); } + // returne die geforderte automatische Seiten-Vorlage + SwPageDesc* GetPageDescFromPool( sal_uInt16 nId, String* pDescription = 0, + SfxItemPresentation ePres = SFX_ITEM_PRESENTATION_COMPLETE, + SfxMapUnit eCoreMetric = SFX_MAPUNIT_TWIP, + SfxMapUnit ePresMetric = SFX_MAPUNIT_TWIP, + BOOL bRegardLanguage = TRUE ); + // ...Simple to prevent ambiguity with GetPageDescFromPool + SwPageDesc* GetPageDescFromPoolSimple( sal_uInt16 nId, + BOOL bRegardLanguage) + { + return GetPageDescFromPool + ( nId, 0, SFX_ITEM_PRESENTATION_COMPLETE, SFX_MAPUNIT_TWIP, + SFX_MAPUNIT_TWIP, bRegardLanguage); + } + SwNumRule* GetNumRuleFromPool( sal_uInt16 nId, String* pDescription = 0, + SfxItemPresentation ePres = SFX_ITEM_PRESENTATION_COMPLETE, + SfxMapUnit eCoreMetric = SFX_MAPUNIT_TWIP, + SfxMapUnit ePresMetric = SFX_MAPUNIT_TWIP ); + + // pruefe, ob diese "Auto-Collection" in Dokument schon/noch + // benutzt wird + + // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird + sal_Bool IsUsed( const SwModify& ) const; + sal_Bool IsUsed( const SwNumRule& ) const; + + // setze den Namen der neu geladenen Dokument-Vorlage + sal_uInt16 SetDocPattern( const String& rPatternName ); + // gebe die Anzahl von geladenen Dok-VorlagenNamen zurueck. + // !! Die nicht mehr benutzten sind 0-Pointer !! + sal_uInt16 GetDocPatternCnt() const { return aPatternNms.Count(); } + // gebe den Dok-VorlagenNamen zurueck. !!! Kann auch 0 sein !!! + String* GetDocPattern( sal_uInt16 nPos ) const { return aPatternNms[nPos]; } + // loeche die nicht mehr benutzten Pattern-Namen aus dem Array. + + // alle nicht mehr referenzierten Namen werden durch 0-Pointer + // ersetzt. Diese Positionen koennen wieder vergeben werden. + + + // Loesche alle nicht referenzierten FeldTypen + + // akt. Dokument mit Textbausteindokument verbinden/erfragen + void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; } + SwDoc* GetGlossaryDoc() const { return pGlossaryDoc; } + // jetzt mit einem verkappten Reader/Writer/Dokument + + // JobSetup und Freunde + + OutputDevice& GetRefDev() const; + OutputDevice* _GetRefDev() const; + + VirtualDevice* GetVirDev( sal_Bool bCreate ) const + { if ( !bCreate || pVirDev ) return pVirDev; else return &_GetVirDev(); } + VirtualDevice* GetVirDev() const { return pVirDev; } + + void SetVirDev( VirtualDevice* pVd, sal_Bool bCallVirDevDataChanged ); + + SfxPrinter* GetPrt( sal_Bool bCreate ) const + { if( !bCreate || pPrt ) return pPrt; else return &_GetPrt(); } + SfxPrinter* GetPrt() const { return pPrt; } + + inline void _SetPrt( SfxPrinter *pP ) { pPrt = pP; } + void SetPrt( SfxPrinter *pP, sal_Bool bCallPrtDataChanged = sal_True ); + + // sets the flag at the document and invalidates the layout if flag has changed + void SetUseVirtualDevice( sal_Bool bFlag ); + + void SetJobsetup( const JobSetup& rJobSetup ); + + SwPrintData* GetPrintData() const; + void SetPrintData(SwPrintData& rPrtData); + + // Dokument - Info + // legt sie auf jedenfall an! + const SfxDocumentInfo* GetInfo(); + // kann auch 0 sein !!! + const SfxDocumentInfo* GetpInfo() const { return pSwgInfo; } + + // die DocInfo hat siche geaendert (Notify ueber die DocShell) + // stosse die entsp. Felder zum Updaten an. + void DocInfoChgd( const SfxDocumentInfo& rInfo ); + + // Dokument - Statistics + inline const SwDocStat &GetDocStat() const { return *pDocStat; } + void SetDocStat( const SwDocStat& rStat ); + void UpdateDocStat( SwDocStat& rStat ); + + sal_uInt16 GetPageCount() const; + + //PageDescriptor-Schnittstelle + sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); } + const SwPageDesc& GetPageDesc( sal_uInt16 i ) const { return *aPageDescs[i]; } + SwPageDesc* FindPageDescByName( const String& rName, + sal_uInt16* pPos = 0 ) const; + + //fuer Reader + SwPageDesc& _GetPageDesc( sal_uInt16 i ) const { return *aPageDescs[i]; } + void ChgPageDesc( sal_uInt16 i, const SwPageDesc& ); + sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0, + BOOL bRegardLanguage = TRUE); + + // - Verzeichnis einfuegen, und bei Bedarf erneuern + const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos, + const SwTOXBase& rTOX, + const SfxItemSet* pSet = 0, + sal_Bool bExpand = sal_False ); + const SwTOXBaseSection* InsertTableOf( ULONG nSttNd, ULONG nEndNd, + const SwTOXBase& rTOX, + const SfxItemSet* pSet = 0 ); + const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const; + const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const; + + String GetUniqueTOXBaseName( const SwTOXType& rType, + const String* pChkStr = 0 ) const; + + sal_Bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName); + + // nach einlesen einer Datei alle Verzeichnisse updaten + void SetUpdateTOX( sal_Bool bFlag = sal_True ) { bUpdateTOX = bFlag; } + sal_Bool IsUpdateTOX() const { return bUpdateTOX; } + + const String& GetTOIAutoMarkURL() const {return sTOIAutoMarkURL;} + void SetTOIAutoMarkURL(const String& rSet) {sTOIAutoMarkURL = rSet;} + void ApplyAutoMark(); + + sal_Bool IsInReading() const { return bInReading; } + + // - Verzeichnis-Typen verwalten + sal_uInt16 GetTOXTypeCount( TOXTypes eTyp ) const; + const SwTOXType* GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const; + const SwTOXType* InsertTOXType( const SwTOXType& rTyp ); + const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; } + + + // - Schluessel fuer die Indexverwaltung + + // korrigiere die im Dokument angemeldeten SwPosition-Objecte, + // wie z.B. die ::com::sun::star::text::Bookmarks oder die Verzeichnisse. + // JP 22.06.95: ist bMoveCrsr gesetzt, verschiebe auch die Crsr + + // Setzt alles in rOldNode auf rNewPos + Offset + void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos, + const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False ); + // Setzt alles im Bereich von [rStartNode, rEndNode] nach rNewPos + void CorrAbs( const SwNodeIndex& rStartNode, const SwNodeIndex& rEndNode, + const SwPosition& rNewPos, sal_Bool bMoveCrsr = sal_False ); + // Setzt alles im Bereich von rRange nach rNewPos + // Setzt alles in rOldNode auf relative Pos + void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos, + const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False ); + + // GliederungsRegeln erfragen / setzen + const SwNumRule* GetOutlineNumRule() const { return pOutlineRule; } + void SetOutlineNumRule( const SwNumRule& rRule ); + // Gliederung - hoch-/runterstufen + // Gliederung - hoch-/runtermoven + // zu diesem Gliederungspunkt + // die Aenderungen an den Gliederungsvorlagen in die OutlineRule uebernehmen + void SetOutlineLSpace( sal_uInt8 nLevel, short nFirstLnOfst, sal_uInt16 nLSpace ); + + // setzt, wenn noch keine Numerierung, sonst wird geaendert + // arbeitet mit alten und neuen Regeln, nur Differenzen aktualisieren + /** #109308# new parameter + @param bCalledFromShell + - sal_True called from shel + - sal_False else + */ + void SetNumRule( const SwPaM&, const SwNumRule&, + sal_Bool bSetAbsLSpace = sal_True, + sal_Bool bCalledFromShell = sal_False ); + // ab hier neu starten lassen oder den Start wieder aufheben + void SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt = USHRT_MAX ); + + SwNumRule* GetCurrNumRule( const SwPosition& rPos ) const; + SwNumRuleTbl& GetNumRuleTbl() { return *pNumRuleTbl; } + const SwNumRuleTbl& GetNumRuleTbl() const { return *pNumRuleTbl; } + sal_uInt16 MakeNumRule( const String &rName, const SwNumRule* pCpy = 0 ); + sal_uInt16 FindNumRule( const String& rName ) const; + SwNumRule* FindNumRulePtr( const String& rName ) const; + // loeschen geht nur, wenn die ::com::sun::star::chaos::Rule niemand benutzt! + sal_Bool DelNumRule( const String& rName ); + String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const; + void UpdateNumRule( const String& rName, ULONG nUpdPos ); + void UpdateNumRule(); // alle invaliden Updaten + void ChgNumRuleFmts( const SwNumRule& rRule ); + + + // Hoch-/Runterstufen + sal_Bool NumUpDown( const SwPaM&, sal_Bool bDown = sal_True ); + // Bewegt selektierte Absaetze (nicht nur Numerierungen) + // entsprechend des Offsets. (negativ: zum Doc-Anf.) + // No-/Numerierung ueber Delete/Backspace ein/abschalten + // Animation der Grafiken stoppen + void StopNumRuleAnimations( OutputDevice* ); + + // fuege eine neue Tabelle auf der Position rPos ein. (es + // wird vor dem Node eingefuegt !!) + //JP 28.10.96: + // fuer AutoFormat bei der Eingabe: dann muessen die Spalten + // auf die vordefinierten Breite gesetzt werden. Im Array stehen die + // Positionen der Spalten!! (nicht deren Breite!) + /* #109161# new parameter bCalledFromShell: + + TRUE: called from shell -> propagate existing adjust item at + rPos to every new cell. A existing adjust item in the table + heading or table contents paragraph style prevent that + propagation. + + FALSE: do not propagate + */ + const SwTable* InsertTable( const SwPosition& rPos, sal_uInt16 nRows, + sal_uInt16 nCols, SwHoriOrient eAdjust, + sal_uInt16 nInsert = HEADLINE_NO_BORDER, + const SwTableAutoFmt* pTAFmt = 0, + const SvUShorts* pColArr = 0, + BOOL bCalledFromShell = FALSE ); + + // steht der Index in einer Tabelle, dann returne den TableNode sonst 0 + SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ); + inline const SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ) const; + + // teilen / zusammenfassen von Boxen in der Tabelle + String GetUniqueTblName() const; + + // Erfrage wie attributiert ist + // setze das TabelleAttribut Undo auf: + // setze das InsertDB als Tabelle Undo auf: + // setze die Spalten/Zeilen/ZTellen Breite/Hoehe + SwTableBoxFmt* MakeTableBoxFmt(); + SwTableLineFmt* MakeTableLineFmt(); + void ClearBoxNumAttrs( const SwNodeIndex& rNode ); + + + + // Tabelle an der Position in der GrundLine aufsplitten, sprich eine + // neue Tabelle erzeugen. + // und die Umkehrung davon. rPos muss in der Tabelle stehen, die bestehen + // bleibt. Das Flag besagt ob die aktuelle mit der davor oder dahinter + // stehenden vereint wird. + + // Raeume die Umrandung innerhalb der Tabelle ein wenig auf (doppelte + // an einer Kante erkennen und beseitigen) + // Charts der angegebenen Tabelle zum Update bewegen + // update all charts, for that exists any table + void UpdateAllCharts() { DoUpdateAllCharts( 0 ); } + + // returne zum Namen die im Doc gesetzte Referenz + const SwFmtRefMark* GetRefMark( const String& rName ) const; + + //Einfuegen einer Beschriftung - falls ein FlyFormat erzeugt wird, so + // returne dieses. + + // erfrage den Attribut Pool + const SwAttrPool& GetAttrPool() const { return aAttrPool; } + SwAttrPool& GetAttrPool() { return aAttrPool; } + + // OLE 2.0-Benachrichtung + inline void SetOle2Link(const Link& rLink) {aOle2Link = rLink;} + inline const Link& GetOle2Link() const {return aOle2Link;} + + // SS fuer Bereiche + SwSection* Insert( const SwPaM& rRange, const SwSection& rNew, + const SfxItemSet* pAttr = 0, sal_Bool bUpdate = sal_True ); + sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange, + const SwNode** ppSttNd = 0 ) const; + SwSection* GetCurrSection( const SwPosition& rPos ) const; + SwSectionFmts& GetSections() { return *pSectionFmtTbl; } + const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; } + SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom ); + void DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes = sal_False ); + void ChgSection( sal_uInt16 nSect, const SwSection&, const SfxItemSet* = 0, sal_Bool bPreventLinkUpdate = FALSE); + String GetUniqueSectionName( const String* pChkStr = 0 ) const; + + + // Pointer auf die SfxDocShell vom Doc, kann 0 sein !!! + SwDocShell* GetDocShell() { return pDocShell; } + const SwDocShell* GetDocShell() const { return pDocShell; } + void SetDocShell( SwDocShell* pDSh ); + + // falls beim Kopieren von OLE-Nodes eine DocShell angelegt werden muss, + // dann MUSS der Ref-Pointer besetzt sein!!!! + SvEmbeddedObjectRef* GetRefForDocShell() { return pDocShRef; } + void SetRefForDocShell( SvEmbeddedObjectRef* p ) { pDocShRef = p; } + + // fuer die TextBausteine - diese habe nur ein SvPersist zur + // Verfuegung + SvPersist* GetPersist() const; + + // Pointer auf den Storage des SfxDocShells, kann 0 sein !!! + SvStorage* GetDocStorage(); + + // abfrage/setze Flag, ob das Dokument im asynchronen Laden ist + sal_Bool IsInLoadAsynchron() const { return bInLoadAsynchron; } + void SetInLoadAsynchron( sal_Bool bFlag ) { bInLoadAsynchron = bFlag; } + + // SS fuers Linken von Dokumentteilen + ::binfilter::SvLinkSource* CreateLinkSource( const String& rItem ); + // erzeuge um das zu Servende Object eine Selektion + sal_Bool SelectServerObj( const String& rStr, SwPaM*& rpPam, + SwNodeRange*& rpRange ) const; + // erfage alle zu servendenen Objecte + + // fuer Drag&Move: ( z.B. RefMarks "verschieben" erlauben ) + sal_Bool IsCopyIsMove() const { return bCopyIsMove; } + void SetCopyIsMove( sal_Bool bFlag ) { bCopyIsMove = bFlag; } + + SdrModel* _MakeDrawModel(); + inline SdrModel* MakeDrawModel() + { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); } + void SetCalcFieldValueHdl(Outliner* pOutliner); + + // erfrage ob die ::com::sun::star::util::URL besucht war. Uebers Doc, falls nur ein ::com::sun::star::text::Bookmark + // angegeben ist. Dann muss der Doc. Name davor gesetzt werden! + sal_Bool IsVisitedURL( const String& rURL ) const; + + // speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen + // in die Autokorrektur + SwAutoCorrExceptWord* GetAutoCorrExceptWord() { return pACEWord; } + + + // rufe ins dunkle Basic, mit evt. Return String + // rufe ins dunkle Basic/JavaScript + + // linken Rand ueber Objectleiste einstellen (aenhlich dem Stufen von + // Numerierungen), optional kann man "um" den Offset stufen oder "auf" + // die Position gestuft werden (bModulus = sal_True) + + // Numberformatter erfragen + inline SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ); + inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const; + + // loesche den nicht sichtbaren ::com::sun::star::ucb::Content aus dem Document, wie z.B.: + // versteckte Bereiche, versteckte Absaetze + // embedded alle lokalen Links (Bereiche/Grafiken) + // erzeuge Anhand der vorgebenen Collection Teildokumente + // falls keine angegeben ist, nehme die Kapitelvorlage der 1. Ebene + + + // alles fuers Redlining + SwRedlineMode GetRedlineMode() const { return eRedlineMode; } + sal_Bool IsRedlineOn() const { return ::binfilter::IsRedlineOn( eRedlineMode ); } + sal_Bool IsIgnoreRedline() const { return REDLINE_IGNORE & eRedlineMode; } + void SetRedlineMode_intern( sal_uInt16 eMode ) { eRedlineMode = (SwRedlineMode)eMode; } + void SetRedlineMode( sal_uInt16 eMode ); + + const SwRedlineTbl& GetRedlineTbl() const { return *pRedlineTbl; } + sal_Bool DeleteRedline( const SwPaM& rPam, sal_Bool bSaveInUndo = sal_True, + sal_uInt16 nDelType = USHRT_MAX ); + sal_Bool DeleteRedline( const SwStartNode& rSection, sal_Bool bSaveInUndo = sal_True, + sal_uInt16 nDelType = USHRT_MAX ); + const SwRedline* GetRedline( const SwPosition& rPos, + sal_uInt16* pFndPos = 0 ) const; + + sal_Bool IsRedlineMove() const { return bIsRedlineMove; } + void SetRedlineMove( sal_Bool bFlag ) { bIsRedlineMove = bFlag; } + + + // fuer die Reader usw. - neuen Author in die Tabelle eintragen + sal_uInt16 InsertRedlineAuthor( const String& ); + // Kommentar am Redline an der Position setzen + + // Passwords for Redline ask/set + const ::com::sun::star::uno::Sequence <sal_Int8>& + GetRedlinePasswd() const { return aRedlinePasswd; } + void SetRedlinePasswd( + const ::com::sun::star::uno::Sequence <sal_Int8>& rNew ); + + // vergleiche zwei Dokument miteinander + // merge zweier Dokumente + // setze Kommentar-Text fuers Redline, das dann per AppendRedline + // hereinkommt. Wird vom Autoformat benutzt. 0-Pointer setzt den Modus + // wieder zurueck. Die SequenceNummer ist fuers UI-seitige zusammen- + // fassen von Redlines. + + sal_Bool IsAutoFmtRedline() const { return bIsAutoFmtRedline; } + void SetAutoFmtRedline( sal_Bool bFlag ) { bIsAutoFmtRedline = bFlag; } + + // fuer AutoFormat: mit Undo/Redlining - Behandlung + + // !!!NUR fuer die SW-Textblocks!! beachtet kein LAYOUT!!! + + // erfrage / setze die Daten fuer die PagePreView + const SwPagePreViewPrtData* GetPreViewPrtData() const { return pPgPViewPrtData; } + // wenn der Pointer == 0 ist, dann wird im Doc der Pointer zerstoert, + // ansonsten wird das Object kopiert. + // Der Pointer geht NICHT in den Besitz des Doc's!! + void SetPreViewPrtData( const SwPagePreViewPrtData* pData ); + + // -------------------- Uno - Schnittstellen --------------------------- + const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; } + SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, sal_Bool bTblCrsr = sal_False ); + // -------------------- Uno - Schnittstellen --------------------------- + + // -------------------- FeShell - Schnittstellen ----------------------- + // !!!!! diese gehen immer davon aus, das ein Layout existiert !!!! + sal_Bool ChgAnchor( const SdrMarkList &rMrkList, int eAnchorId, + sal_Bool bSameOnly, sal_Bool bPosCorr ); + + void GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const; + + // fuers Copy/Move aus der FrmShell + SdrObject* CloneSdrObj( const SdrObject&, sal_Bool bMoveWithinDoc = sal_False, + sal_Bool bInsInPage = sal_True ); + + // + // -------------------- FeShell - Schnittstellen Ende ------------------ + + sal_Bool ContainsMSVBasic() const { return bContains_MSVBasic; } + void SetContainsMSVBasic( sal_Bool bFlag ) { bContains_MSVBasic = bFlag; } + + // Interface for the forbidden characters of any asian/.. languages + const ::com::sun::star::i18n:: + ForbiddenCharacters* GetForbiddenCharacters( USHORT nLang, + BOOL bLocaleData ) const; + const rtl::Reference<SvxForbiddenCharactersTable>& GetForbiddenCharacterTbl() const + { return xForbiddenCharsTable; } + rtl::Reference<SvxForbiddenCharactersTable>& GetForbiddenCharacterTbl(); + + // ------------------- Zugriff auf Dummy-Member -------------------- + + sal_Bool IsParaSpaceMax() const { return n8Dummy1 & DUMMY_PARASPACEMAX; } + sal_Bool IsParaSpaceMaxAtPages() const { return n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES; } + void SetParaSpaceMax( sal_Bool bNew, sal_Bool bAtPages ) + { + if( bNew ) n8Dummy1 |= DUMMY_PARASPACEMAX; else n8Dummy1 &= ~DUMMY_PARASPACEMAX; + if( bAtPages ) n8Dummy1 |= DUMMY_PARASPACEMAX_AT_PAGES; else n8Dummy1 &= ~DUMMY_PARASPACEMAX_AT_PAGES; + } + + sal_Bool IsTabCompat() const { return n8Dummy1 & DUMMY_TAB_COMPAT; } + void SetTabCompat( sal_Bool bNew ) + { + if( bNew ) n8Dummy1 |= DUMMY_TAB_COMPAT; else n8Dummy1 &= ~DUMMY_TAB_COMPAT; + } + + sal_Bool IsUseVirtualDevice() const { return n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE; } + void _SetUseVirtualDevice( sal_Bool bNew ) + { + if( bNew ) n8Dummy1 |= DUMMY_USE_VIRTUAL_DEVICE; + else n8Dummy1 &= ~DUMMY_USE_VIRTUAL_DEVICE; + } + + sal_Bool IsAddFlyOffsets() const { return n8Dummy2 & DUMMY_ADD_FLY_OFFSETS; } + void SetAddFlyOffsets( sal_Bool bNew ) + { + if( bNew ) n8Dummy2 |= DUMMY_ADD_FLY_OFFSETS; + else n8Dummy2 &= ~DUMMY_ADD_FLY_OFFSETS; + } + + SwLayoutCache* GetLayoutCache() const { return pLayoutCache; } + + void SetULongDummy1( sal_uInt32 n ) { n32Dummy1 = n; } + void SetULongDummy2( sal_uInt32 n ) { n32Dummy2 = n; } + void SetByteDummy1( sal_Int8 n ) { n8Dummy1 = n; } + void SetByteDummy2( sal_Int8 n ) { n8Dummy2 = n; } + void SetStringDummy1( const String& r ) { sDummy1 = r; } + void SetStringDummy2( const String& r ) { sDummy2 = r; } + sal_uInt32 GetULongDummy1() const { return n32Dummy1; } + sal_uInt32 GetULongDummy2() const { return n32Dummy2; } + sal_Int8 GetByteDummy1() const { return n8Dummy1; } + sal_Int8 GetByteDummy2() const { return n8Dummy2; } + const String& GetStringDummy1() const { return sDummy1; } + const String& GetStringDummy2() const { return sDummy2; } + + // #102505# -> + /** + Append a new temporary auto correction. + + @param aWrong the wrong word + @param aCorrect the correct word + */ + void AppendTmpCorr(const String & aWrong, const String & aCorrect); + + /** Remove a temporary auto correction. + + @param aWrong the wrong word whose correction shall be removed + */ + void RemoveTmpCorr(const String & aWrong); + // <- #102505# + + // call back for API wrapper + SwModify* GetUnoCallBack() const; +}; + + +// Diese Methode wird im Dtor vom SwDoc gerufen und loescht den Cache +// der Konturobjekte +void ClrContourCache(); + + +//------------------ inline impl. --------------------------------- + +inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const +{ + return ((SwDoc*)this)->IsIdxInTbl( rIdx ); +} + +inline SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) +{ + if( bCreate && !pNumberFormatter ) + _CreateNumberFormatter(); + return pNumberFormatter; +} + +inline const SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) const +{ + return ((SwDoc*)this)->GetNumberFormatter( bCreate ); +} + + +// ist das NodesArray das normale vom Doc? (nicht das UndoNds, .. ) +// Implementierung steht hier, weil man dazu Doc kennen muss! +inline sal_Bool SwNodes::IsDocNodes() const +{ + return this == &pMyDoc->GetNodes(); +} + +inline void SwDoc::SetOLEPrtNotifyPending( sal_Bool bSet ) +{ + bOLEPrtNotifyPending = bSet; + if( !bSet ) + bAllOLENotify = sal_False; +} + + +} //namespace binfilter +#endif //_DOC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docary.hxx b/inc/bf_sw/docary.hxx new file mode 100644 index 000000000..7e2f44f86 --- /dev/null +++ b/inc/bf_sw/docary.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOCARY_HXX +#define _DOCARY_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { +class SwFieldType; +class SwFrmFmt; +class SwCharFmt; +class SwBookmark; +class SwTOXType; +class SwSectionFmt; +class SwNumRule; +class SwRedline; +class SwUnoCrsr; +class SwOLENode; +} //namespace binfilter + +#ifdef sun +#undef sun +#endif + +namespace com { namespace sun { namespace star { namespace i18n { + struct ForbiddenCharacters; // comes from the I18N UNO interface +}}}} + + +#include <swtypes.hxx> + +#include <bf_svtools/svarray.hxx> +namespace binfilter { + +typedef SwFieldType* SwFldTypePtr; +#define GROW_FLDTYPES 16 + +//PageDescriptor-Schnittstelle +//typedef SwPageDesc * SwPageDescPtr; +//SV_DECL_PTRARR_DEL(SwPageDescs, SwPageDescPtr,1,1) + +typedef SwFrmFmt* SwFrmFmtPtr; +SV_DECL_PTRARR_DEL(SwFrmFmts,SwFrmFmtPtr,4,4) + +//Spezifische Frameformate (Rahmen, DrawObjecte) +SV_DECL_PTRARR_DEL(SwSpzFrmFmts,SwFrmFmtPtr,0,4) + +typedef SwCharFmt* SwCharFmtPtr; +SV_DECL_PTRARR_DEL(SwCharFmts,SwCharFmtPtr,4,4) + +SV_DECL_PTRARR_DEL( SwFldTypes, SwFldTypePtr, INIT_FLDTYPES, GROW_FLDTYPES ) + +//Bookmarks (nach Dokumentpositionen sortiertes Array) +typedef SwBookmark* SwBookmarkPtr; +SV_DECL_PTRARR_SORT(SwBookmarks, SwBookmarkPtr,0,1) + +typedef SwTOXType* SwTOXTypePtr; +SV_DECL_PTRARR_DEL( SwTOXTypes, SwTOXTypePtr, 0, 1 ) + +typedef SwSectionFmt* SwSectionFmtPtr; +SV_DECL_PTRARR_DEL(SwSectionFmts,SwSectionFmtPtr,0,4) + + +typedef SwNumRule* SwNumRulePtr; +SV_DECL_PTRARR_DEL( SwNumRuleTbl, SwNumRulePtr, 0, 5 ) + +typedef SwRedline* SwRedlinePtr; +SV_DECL_PTRARR_SORT_DEL( _SwRedlineTbl, SwRedlinePtr, 0, 16 ) + +class SwRedlineTbl : private _SwRedlineTbl +{ +public: + SwRedlineTbl( BYTE nSize = 0, BYTE nG = 16 ) + : _SwRedlineTbl( nSize, nG ) {} + ~SwRedlineTbl() {} + + BOOL SavePtrInArr( SwRedlinePtr p ) { return _SwRedlineTbl::Insert( p ); } + +/*N*/ BOOL Insert( SwRedlinePtr& p, BOOL bIns = TRUE ); //SW50.SDW +/*N*/ BOOL InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos = 0 ); //SW50.SDW + +/*N*/ void Remove( USHORT nP, USHORT nL = 1 ); //SW50.SDW + + // suche den naechsten oder vorherigen Redline mit dergleichen Seq.No + // Mit dem Lookahead kann die Suche eingeschraenkt werden. 0 oder + // USHRT_MAX suchen im gesamten Array. + + using _SwRedlineTbl::Count; + using _SwRedlineTbl::operator[]; + using _SwRedlineTbl::GetObject; + using _SwRedlineTbl::Seek_Entry; + using _SwRedlineTbl::GetPos; +}; + +typedef SwUnoCrsr* SwUnoCrsrPtr; +SV_DECL_PTRARR_DEL( SwUnoCrsrTbl, SwUnoCrsrPtr, 0, 4 ) + +typedef SwOLENode* SwOLENodePtr; +SV_DECL_PTRARR(SwOLENodes,SwOLENodePtr,16,16) + + +} //namespace binfilter +#endif //_DOCARY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docfac.hxx b/inc/bf_sw/docfac.hxx new file mode 100644 index 000000000..70d0cd6f4 --- /dev/null +++ b/inc/bf_sw/docfac.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOCFAC_HXX +#define _DOCFAC_HXX + +#include <bf_svtools/bf_solar.h> +namespace binfilter { + +class SwDoc; + +class SwDocFac +{ +protected: + SwDoc* pDoc; + +public: + SwDocFac( SwDoc *pDoc = 0 ); + ~SwDocFac(); + + // Das Dokument ist nach dem Aufruf von Read(..) angelegt + SwDoc* GetDoc(); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docsh.hxx b/inc/bf_sw/docsh.hxx new file mode 100644 index 000000000..0bb62ac4b --- /dev/null +++ b/inc/bf_sw/docsh.hxx @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWDOCSH_HXX +#define _SWDOCSH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <vcl/timer.hxx> +#include <bf_sfx2/docfac.hxx> +#include <bf_sfx2/interno.hxx> +#include <bf_sfx2/objsh.hxx> +#include <swdll.hxx> +#include <shellid.hxx> + +#include <bf_svtools/lstner.hxx> + +class SfxStyleSheetBasePool; +class FontList; +class PushButton; +class FixedText; + +namespace binfilter { + +class SwDoc; +class Sw3Io; +class SfxDocumentInfoDialog; +class SwView; +class SwFEShell; +class Reader; +class SwReader; +class SwCrsrShell; +class SwSrcView; +class SwPaM; +class SwgReaderOption; + +class SwDocShell: public SfxObjectShell, public SfxInPlaceObject, + public SfxListener +{ + SwDoc* pDoc; // Document + Sw3Io* pIo; // Reader / Writer + SfxStyleSheetBasePool* pBasePool; // Durchreiche fuer Formate + FontList* pFontList; // aktuelle FontListe + + // Nix geht ohne die WrtShell (historische Gruende) + // RuekwaertsPointer auf die View (historische Gruende) + // Dieser gilt solange bis im Activate ein neuer gesetzt wird + // oder dieser im Dtor der View geloescht wird + // + SwView* pView; + + Timer aFinishedTimer; // Timer fuers ueberpriefen der + // Grafik-Links. Sind alle da, + // dann ist Doc voll. geladen + + SvPersistRef xOLEChildList; // fuers RemoveOLEObjects + sal_Int16 nUpdateDocMode; // contains the ::com::sun::star::document::UpdateDocMode + + // Methoden fuer den Zugriff aufs Doc + void AddLink(); + void RemoveLink(); + + // Hint abfangen fuer DocInfo + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // FileIO + virtual BOOL InitNew(SvStorage* pNewStor); + virtual BOOL Load(SvStorage* pStor); + virtual BOOL LoadFrom(SvStorage* pStor); + virtual BOOL ConvertFrom( SfxMedium &rMedium ); + virtual void HandsOff(); + + // DocInfo dem Doc melden + // + // OLE-Geraffel + + // Methoden fuer StyleSheets + + void InitDraw(); + void SubInitNew(); // fuer InitNew und HtmlSourceModus + + void Init_Impl(); + DECL_STATIC_LINK( SwDocShell, IsLoadFinished, void* ); + +public: + + // aber selbst implementieren + SFX_DECL_OBJECTFACTORY_DLL(SwDocShell, SW_DLL()); + TYPEINFO(); + + //Das Doc wird fuer SO-Datenaustausch benoetigt! + SwDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED); + SwDocShell( SwDoc *pDoc, SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD ); + ~SwDocShell(); + + // OLE 2.0-Benachrichtigung + DECL_LINK( Ole2ModifiedHdl, void * ); + + // OLE-Geraffel + virtual void SetVisArea( const Rectangle &rRect ); + virtual Rectangle GetVisArea( USHORT nAspect ) const; + virtual Printer *GetDocumentPrinter(); + virtual OutputDevice* GetDocumentRefDev(); + virtual void OnDocumentPrinterChanged( Printer * pNewPrinter ); + virtual ULONG GetMiscStatus() const; + + virtual void SetModified( BOOL = TRUE ); + + // Doc rausreichen aber VORSICHT + inline SwDoc* GetDoc() { return pDoc; } + void UpdateFontList(); + void UpdateChildWindows(); + + // DocumentInfo neu setzen + + // globaler IO + virtual BOOL Save() {return false;} + + // fuer VorlagenPI + virtual SfxStyleSheetBasePool* GetStyleSheetPool(); + + // Fuer Organizer + + + + const SwView *GetView() const { return pView; } + SwView *GetView() { return pView; } + + // fuer die Core - die kennt die DocShell aber keine WrtShell! + const SwFEShell *GetFEShell() const + { return ((SwDocShell*)this)->GetFEShell(); } + + + // Fuer Einfuegen Dokument + Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, + SwCrsrShell* pCrsrSh = 0, SwPaM* pPaM = 0); + + // Anforderung der pIo-Struktur fuer den Zugriff auf Substorages + // und Streams + Sw3Io* GetIoSystem() { return pIo; } + + virtual void FillClass( SvGlobalName * pClassName, + ULONG * pClipFormat, + String * pAppName, + String * pLongUserName, + String * pUserName, + long nVersion = SOFFICE_FILEFORMAT_CURRENT ) const; + + + // Seitenvorlagedialog anzeigen, ggf. auf Spaltenpage + + // Timer starten fuers ueberpruefen der Grafik-Links. Sind alle + // vollstaendig geladen, dann ist das Doc fertig + void StartLoadFinishedTimer(); + + // eine Uebertragung wird abgebrochen (wird aus dem SFX gerufen) + virtual void CancelTransfers(); + + // Doc aus Html-Source neu laden + + // embedded alle lokalen Links (Bereiche/Grafiken) + sal_Int16 GetUpdateDocMode() const {return nUpdateDocMode;} + + //Activate wait cursor for all windows of this document + //Optionally all dispatcher could be Locked + //Usually locking should be done using the class: SwWaitObject! + void EnterWait( BOOL bLockDispatcher ); + void LeaveWait( BOOL bLockDispatcher ); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > GetEventNames(); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docstat.hxx b/inc/bf_sw/docstat.hxx new file mode 100644 index 000000000..a9d9d3217 --- /dev/null +++ b/inc/bf_sw/docstat.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOCSTAT_HXX +#define _DOCSTAT_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { + +/////////////////////////////////////////////////////////////////////////// +// PRODUCT: struct SwInternStat ist nur fuer CORE Interne Statistics und +// hat nichts in einer ProductVersion zu suchen. +/////////////////////////////////////////////////////////////////////////// + +struct SwInternStat; + +struct SwDocStat +{ + USHORT nTbl; + USHORT nGrf; + USHORT nOLE; + ULONG nPage; + ULONG nPara; + ULONG nWord; + ULONG nChar; + BOOL bModified; + SwInternStat* pInternStat; + SwDocStat(); + void Reset(); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docstyle.hxx b/inc/bf_sw/docstyle.hxx new file mode 100644 index 000000000..15a29e7d0 --- /dev/null +++ b/inc/bf_sw/docstyle.hxx @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOCSTYLE_HXX +#define _DOCSTYLE_HXX + +#include <bf_svtools/bf_solar.h> + +#ifndef _SVSTDARR_HXX +#define _SVSTDARR_STRINGSDTOR +#include <bf_svtools/svstdarr.hxx> +#endif + +#include <bf_svtools/style.hxx> + +#include <bf_svtools/itemset.hxx> +namespace binfilter { + +class SwDoc; +class SwDocStyleSheetPool; +class SwPageDesc; +class SwCharFmt; +class SwTxtFmtColl; +class SwFrmFmt; +class SwNumRule; + +/*-------------------------------------------------------------------- + Beschreibung: Lokale Hilfsklasse + --------------------------------------------------------------------*/ +class SwPoolFmtList : public SvStringsDtor +{ +public: + SwPoolFmtList() {} + void Append( char cChar, const String& rStr ); + void Erase(); +}; + + +/*-------------------------------------------------------------------- + Beschreibung: temp. StyleSheet + --------------------------------------------------------------------*/ +class SwDocStyleSheet : public SfxStyleSheetBase +{ + friend class SwDocStyleSheetPool; + friend class SwStyleSheetIterator; + + SwCharFmt* pCharFmt; + SwTxtFmtColl* pColl; + SwFrmFmt* pFrmFmt; + const SwPageDesc* pDesc; + const SwNumRule* pNumRule; + + SwDoc& rDoc; + SfxItemSet aCoreSet; + + BOOL bPhysical; + + + // leere Huelse zum richtigen StyleSheet (Core) machen + void Create(); + + // den StyleSheet mit Daten fuellen + enum FillStyleType { + FillOnlyName, + FillAllInfo, + FillPhysical + }; + BOOL FillStyleSheet( FillStyleType eFType ); + + +public: + SwDocStyleSheet( SwDoc& rDoc, + const String& rName, + SwDocStyleSheetPool& rPool, + SfxStyleFamily eFam, + USHORT nMask); + + SwDocStyleSheet( const SwDocStyleSheet& ); + virtual ~SwDocStyleSheet(); + + void Reset(); + + void SetMask(USHORT nMsk) { nMask = nMsk; } + void SetFamily(SfxStyleFamily eFam) { nFamily = eFam; } + + BOOL IsPhysical() const { return bPhysical; } + void SetPhysical(BOOL bPhys); + + void SetItemSet(const SfxItemSet& rSet); + + virtual SfxItemSet& GetItemSet(); + virtual const String& GetParent() const; + virtual const String& GetFollow() const; + + + // Vorbelegen der member ohne physikalischen Zugriff + // wird vom StyleSheetPool benutzt + // + void PresetName(const String& rName) { aName = rName; } + void PresetNameAndFamily(const String& rName); + void PresetParent(const String& rName){ aParent = rName; } + void PresetFollow(const String& rName){ aFollow = rName; } + + virtual BOOL SetParent( const String& rStr); + virtual BOOL SetFollow( const String& rStr); + + + SwCharFmt* GetCharFmt(); + SwTxtFmtColl* GetCollection(); + SwFrmFmt* GetFrmFmt(); + const SwPageDesc* GetPageDesc(); + const SwNumRule* GetNumRule(); + void SetNumRule(const SwNumRule& rRule); + +}; + +/*-------------------------------------------------------------------- + Beschreibung: Iterator fuer den Pool + --------------------------------------------------------------------*/ + +class SwStyleSheetIterator : public SfxStyleSheetIterator, public SfxListener +{ + SwDocStyleSheet aIterSheet; + SwDocStyleSheet aStyleSheet; + SwPoolFmtList aLst; + USHORT nLastPos; + BOOL bFirstCalled; + + void AppendStyleList(const SvStringsDtor& rLst, + BOOL bUsed, + USHORT nSection, + char cType); + +public: + SwStyleSheetIterator( SwDocStyleSheetPool* pBase, + SfxStyleFamily eFam, USHORT n=0xFFFF ); + virtual ~SwStyleSheetIterator(); + + virtual SfxStyleSheetBase* First(); + virtual SfxStyleSheetBase* Next(); + + virtual void Notify( SfxBroadcaster&, const SfxHint& ) { DBG_BF_ASSERT(0, "STRIP"); } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Pool fuer + --------------------------------------------------------------------*/ + +class SwDocStyleSheetPool : public SfxStyleSheetBasePool +{ + SwDocStyleSheet aStyleSheet; + SwDoc& rDoc; + BOOL bOrganizer : 1; // TRUE: fuer den Organizer + + +public: + SwDocStyleSheetPool( SwDoc&, BOOL bOrganizer = FALSE ); + virtual ~SwDocStyleSheetPool() {} + + virtual SfxStyleSheetBase& Make(const String&, SfxStyleFamily, USHORT nMask, USHORT nPos = 0xffff); + virtual SfxStyleSheetBase* Find( const String&, SfxStyleFamily eFam, + USHORT n=0xFFFF ); + virtual BOOL SetParent( SfxStyleFamily, const String&, const String& ) { DBG_BF_ASSERT(0, "STRIP"); return FALSE; } + + void SetItemSet(const SfxItemSet& rSet) { aStyleSheet.SetItemSet(rSet); } + + void SetOrganizerMode( BOOL bMode ) { bOrganizer = bMode; } + BOOL IsOrganizerMode() const { return bOrganizer; } + + virtual SfxStyleSheetIterator* CreateIterator( SfxStyleFamily, + USHORT nMask ); + + SwDoc& GetDoc() const { return rDoc; } + + //Fuer die daemlicheren Compiler +private: + SwDocStyleSheetPool( const SwDocStyleSheetPool& ); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/docufld.hxx b/inc/bf_sw/docufld.hxx new file mode 100644 index 000000000..376902e28 --- /dev/null +++ b/inc/bf_sw/docufld.hxx @@ -0,0 +1,807 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DOCUFLD_HXX +#define _DOCUFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/date.hxx> + +#include "fldbas.hxx" +#include "numrule.hxx" +namespace binfilter { + +class _SetGetExpFlds; +class SwTxtFld; +class SwFrm; + +enum SwAuthorFormat +{ + AF_BEGIN, + AF_NAME = AF_BEGIN, + AF_SHORTCUT, + AF_END, + AF_FIXED = 0x8000 +}; + +/*-------------------------------------------------------------------- + Beschreibung: Untertyp der Dokumentstatistik + --------------------------------------------------------------------*/ + +enum SwDocStatSubType +{ + DS_BEGIN, + DS_PAGE = DS_BEGIN, + DS_PARA, + DS_WORD, + DS_CHAR, + DS_TBL, + DS_GRF, + DS_OLE, + DS_END +}; + +enum SwDocInfoSubType +{ + DI_SUBTYPE_BEGIN, + DI_TITEL = DI_SUBTYPE_BEGIN, + DI_THEMA, + DI_KEYS, + DI_COMMENT, + DI_INFO1, + DI_INFO2, + DI_INFO3, + DI_INFO4, + DI_CREATE, + DI_CHANGE, + DI_PRINT, + DI_DOCNO, + DI_EDIT, + DI_SUBTYPE_END +}; + +enum SwDocInfoExtSubType +{ + DI_SUB_AUTHOR = 0x0100, + DI_SUB_TIME = 0x0200, + DI_SUB_DATE = 0x0300, + DI_SUB_FIXED = 0x1000 +}; + +enum RegInfoFormat // Nur noch zum laden alter Dokumente!!! +{ + RF_AUTHOR, + RF_TIME, + RF_DATE, + RF_ALL +}; + +enum SwPageNumSubType +{ + PG_RANDOM, + PG_NEXT, + PG_PREV +}; + +enum SwExtUserSubType +{ + EU_COMPANY /*EU_FIRMA*/, + EU_FIRSTNAME /*EU_VORNAME*/, + EU_NAME /*EU_NAME*/, + EU_SHORTCUT /*EU_ABK*/, + EU_STREET /*EU_STRASSE*/, + EU_COUNTRY /*EU_LAND*/, + EU_ZIP /*EU_PLZ*/, + EU_CITY /*EU_ORT*/, + EU_TITLE /*EU_TITEL*/, + EU_POSITION /*EU_POS*/, + EU_PHONE_PRIVATE /*EU_TELPRIV*/, + EU_PHONE_COMPANY /*EU_TELFIRMA*/, + EU_FAX, + EU_EMAIL, + EU_STATE, + EU_FATHERSNAME, + EU_APARTMENT +}; + +enum SwJumpEditFormat +{ + JE_FMT_TEXT, + JE_FMT_TABLE, + JE_FMT_FRAME, + JE_FMT_GRAPHIC, + JE_FMT_OLE +}; + +/*-------------------------------------------------------------------- + Beschreibung: Seitennummer + --------------------------------------------------------------------*/ + +class SwPageNumberFieldType : public SwFieldType +{ + sal_Int16 nNumberingType; + USHORT nNum, nMax; + BOOL bVirtuell; + +public: + SwPageNumberFieldType(); + + String& Expand( sal_uInt32 nFmt, short nOff, const String&, String& rRet ) const; + void ChangeExpansion( SwDoc* pDoc, USHORT nNum, USHORT nMax, + BOOL bVirtPageNum, const sal_Int16* pNumFmt = 0 ); + inline sal_Int16 GetNumFormat() const { return nNumberingType; } + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Seitennummerierung + --------------------------------------------------------------------*/ + +class SwPageNumberField : public SwField +{ + String sUserStr; + short nOffset; + USHORT nSubType; + +public: + SwPageNumberField(SwPageNumberFieldType*, USHORT nSub = PG_RANDOM, + sal_uInt32 nFmt = 0, short nOff = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + virtual USHORT GetSubType() const; + // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + const String& GetUserString() const { return sUserStr; } + void SetUserString( const String& rS ) { sUserStr = rS; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Autoren + --------------------------------------------------------------------*/ + +class SwAuthorFieldType : public SwFieldType +{ +public: + SwAuthorFieldType(); + + String Expand(ULONG) const; + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: AutorenFeld + --------------------------------------------------------------------*/ + +class SwAuthorField : public SwField +{ + String aContent; + +public: + SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFmt = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline void SetExpansion(const String& rStr) { aContent = rStr; } + inline const String& GetContent() const { return aContent; } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Filename + --------------------------------------------------------------------*/ + +class SwFileNameFieldType : public SwFieldType +{ + SwDoc *pDoc; +public: + SwFileNameFieldType(SwDoc*); + + String Expand(ULONG) const; + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: FileName + --------------------------------------------------------------------*/ + +class SwFileNameField : public SwField +{ + String aContent; + +public: + SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFmt = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline void SetExpansion(const String& rStr) { aContent = rStr; } + inline const String& GetContent() const { return aContent; } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: TemplName + --------------------------------------------------------------------*/ + +class SwTemplNameFieldType : public SwFieldType +{ + SwDoc *pDoc; +public: + SwTemplNameFieldType(SwDoc*); + + String Expand(ULONG) const; + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: TemplName + --------------------------------------------------------------------*/ + +class SwTemplNameField : public SwField +{ +public: + SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFmt = 0); + + virtual String Expand() const; + virtual SwField* Copy() const; + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Docstatistik + --------------------------------------------------------------------*/ + +class SwDocStatFieldType : public SwFieldType +{ + SwDoc* pDoc; + sal_Int16 nNumberingType;//com::sun::star::style::NumberingType + +public: + SwDocStatFieldType(SwDoc*); + String Expand(USHORT nSubType, sal_uInt32 nFmt) const; + virtual SwFieldType* Copy() const; + + inline sal_Int16 GetNumFormat() const { return nNumberingType; } + inline void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Dokumentstatistik + --------------------------------------------------------------------*/ + +class SwDocStatField : public SwField +{ + USHORT nSubType; + +public: + SwDocStatField( SwDocStatFieldType*, + USHORT nSubType = 0, sal_uInt32 nFmt = 0); + + void ChangeExpansion( const SwFrm* pFrm ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nSub); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: versteckter Text + --------------------------------------------------------------------*/ + +class SwHiddenTxtFieldType : public SwFieldType +{ + BOOL bHidden; +public: + SwHiddenTxtFieldType(BOOL bSetHidden = TRUE); + + virtual SwFieldType* Copy() const; + + inline BOOL GetHiddenFlag() const { return bHidden; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Versteckter Text + --------------------------------------------------------------------*/ + +class SwHiddenTxtField : public SwField +{ + String aTRUETxt; // Text wenn Bedingung TRUE + String aFALSETxt; // Wenn Bedingung falsch + String aContent; // Ausgewerteter DB-Text + + String aCond; // Bedingung + USHORT nSubType; + + BOOL bCanToggle : 1; // kann das Feld einzeln getoggelt werden? + BOOL bIsHidden : 1; // ist es nicht sichtbar? + BOOL bValid : 1; // DB-Feld evaluiert? + +public: + SwHiddenTxtField( SwHiddenTxtFieldType*, + BOOL bConditional, + const String& rCond, + const String& rTxt, + BOOL bHidden = FALSE, + USHORT nSubType = TYP_HIDDENTXTFLD); + + SwHiddenTxtField( SwHiddenTxtFieldType*, + const String& rCond, + const String& rTrue, + const String& rFalse, + USHORT nSubType = TYP_HIDDENTXTFLD); + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual String Expand() const; + virtual SwField* Copy() const; + + void Evaluate(SwDoc*); + + inline void SetValue(BOOL bHidden) { bIsHidden = bHidden; } + inline BOOL GetValue() const { return bIsHidden; } + inline BOOL IsConditional() const { return bCanToggle; } + inline BOOL IsValid() const { return bValid; } + + // Condition + virtual void SetPar1(const String& rStr); + virtual const String& GetPar1() const; + + // True/False - String + virtual void SetPar2(const String& rStr); + virtual String GetPar2() const; + + + virtual USHORT GetSubType() const; + // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Feld das zu einer Leerzeile (ohne Hoehe) expandiert + --------------------------------------------------------------------*/ + +class SwHiddenParaFieldType : public SwFieldType +{ +public: + SwHiddenParaFieldType(); + + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Versteckter Absatz + --------------------------------------------------------------------*/ + +class SwHiddenParaField : public SwField +{ + String aCond; + BOOL bIsHidden:1; +public: + // Direkte Eingabe alten Wert loeschen + SwHiddenParaField(SwHiddenParaFieldType*, const String& rCond); + + virtual String Expand() const; + virtual SwField* Copy() const; + + void SetHidden(BOOL bHidden) { bIsHidden = bHidden; } + BOOL IsHidden() const { return bIsHidden; } + + // Bedingung erfragen/setzen + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Macro ausfuehren + --------------------------------------------------------------------*/ + +class SwMacroFieldType : public SwFieldType +{ + SwDoc* pDoc; + +public: + SwMacroFieldType(SwDoc*); + + virtual SwFieldType* Copy() const { DBG_BF_ASSERT(0, "STRIP"); return NULL; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Macrofeld + --------------------------------------------------------------------*/ + +class SwMacroField : public SwField +{ + String aMacro; + String aText; + +public: + // Direkte Eingabe alten Wert loeschen + SwMacroField( SwMacroFieldType*, const String& rLibAndName, + const String& rTxt); + + inline const String& GetMacro() const { return aMacro; } + String GetLibName() const; + String GetMacroName() const; + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual String Expand() const; + virtual SwField* Copy() const; + + // Library und FileName + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // Macrotext + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + static void CreateMacroString( String& rMacro, + const String& rMacroName, + const String& rLibraryName ); +}; + + +/*-------------------------------------------------------------------- + Beschreibung: PostIts + --------------------------------------------------------------------*/ + +class SwPostItFieldType : public SwFieldType +{ +public: + SwPostItFieldType(); + + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: PostIt + --------------------------------------------------------------------*/ + +class SwPostItField : public SwField +{ + String sTxt; // die Anmerkung + String sAuthor; // der Author + Date aDate; // Datum ??/Zeit?? der Anmerkung + +public: + SwPostItField( SwPostItFieldType*, + const String& rAuthor, const String& rTxt, const Date& rDate); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline const Date& GetDate() const { return aDate; } + // Author + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // Text + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: DokumentInfo + --------------------------------------------------------------------*/ + +class SwDocInfoFieldType : public SwValueFieldType +{ +public: + SwDocInfoFieldType(SwDoc* pDc); + + String Expand(USHORT nSubType, sal_uInt32 nFormat, USHORT nLang) const; + virtual SwFieldType* Copy() const; +}; + +class SwDocInfoField : public SwValueField +{ + USHORT nSubType; + String aContent; + +public: + SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, sal_uInt32 nFmt=0); + + virtual void SetSubType(USHORT); + virtual USHORT GetSubType() const; + virtual void SetLanguage(USHORT nLng); + virtual String Expand() const; + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual SwField* Copy() const; + + inline void SetExpansion(const String& rStr) { aContent = rStr; } + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: erweiterte Benutzereinstellung + --------------------------------------------------------------------*/ + + +class SwExtUserFieldType : public SwFieldType +{ + String aData; +public: + SwExtUserFieldType(); + + inline const String& GetData() const { return aData; } + inline void SetData(const String& rStr) { aData = rStr; } + + String Expand(USHORT nSubType, sal_uInt32 nFormat) const; + virtual SwFieldType* Copy() const; +}; + +class SwExtUserField : public SwField +{ + String aContent; + USHORT nType; + +public: + SwExtUserField(SwExtUserFieldType*, USHORT nSub, sal_uInt32 nFmt=0); + + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nSub); + + inline void SetExpansion(const String& rStr) { aContent = rStr; } + inline const String& GetContent() const { return aContent; } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Relatives Seitennummern - Feld + --------------------------------------------------------------------*/ + +class SwRefPageSetFieldType : public SwFieldType +{ +public: + SwRefPageSetFieldType(); + + virtual SwFieldType* Copy() const; + // ueberlagert, weil es nichts zum Updaten gibt! +}; + +/*-------------------------------------------------------------------- + Beschreibung: Relative Seitennummerierung + --------------------------------------------------------------------*/ + +class SwRefPageSetField : public SwField +{ + short nOffset; + BOOL bOn; + +public: + SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0, + BOOL bOn = TRUE ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + BOOL IsOn() const { return bOn; } + short GetOffset() const { return nOffset; } + void SetOffset( short nOff ) { nOffset = nOff; } + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: relatives Seitennummern - Abfrage Feld + --------------------------------------------------------------------*/ + +class SwRefPageGetFieldType : public SwFieldType +{ + SwDoc* pDoc; + sal_Int16 nNumberingType; + + +public: + SwRefPageGetFieldType( SwDoc* pDoc ); + virtual SwFieldType* Copy() const; + + // ueberlagert, um alle RefPageGet-Felder zu updaten + virtual void Modify( SfxPoolItem *, SfxPoolItem * ); + + sal_Int16 GetNumFormat() const { return nNumberingType; } + void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; } + SwDoc* GetDoc() const { return pDoc; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Relative Seitennummerierung Abfragen + --------------------------------------------------------------------*/ + +class SwRefPageGetField : public SwField +{ + String sTxt; +public: + SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + void SetText( const String& rTxt ) { sTxt = rTxt; } + const String& GetText() const { return sTxt; } + + void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld ); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Feld zum Anspringen und Editieren + --------------------------------------------------------------------*/ + +class SwJumpEditFieldType : public SwFieldType +{ + SwDoc* pDoc; + SwDepend aDep; + +public: + SwJumpEditFieldType( SwDoc* pDoc ); + virtual SwFieldType* Copy() const; + + SwDoc* GetDoc() { return pDoc; } + const SwDoc* GetDoc() const { return pDoc; } + + SwCharFmt* GetCharFmt(); +}; + +class SwJumpEditField : public SwField +{ + String sTxt, sHelp; +public: + SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat, + const String& sText, const String& sHelp ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + // Platzhalter-Text + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // HinweisText + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + SwCharFmt* GetCharFmt() const + { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); } + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Script Fieldtype + --------------------------------------------------------------------*/ + +class SwScriptFieldType : public SwFieldType +{ + SwDoc* pDoc; +public: + SwScriptFieldType( SwDoc* pDoc ); + + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Script Field + --------------------------------------------------------------------*/ + +class SwScriptField : public SwField +{ + String sType; // Type von Code (Java/VBScript/...) + String sCode; // der Code als Text + // der Code als JavaCode ? + + BOOL bCodeURL; // Code enthaelt URL eines Scripts + +public: + SwScriptField( SwScriptFieldType*, const String& rType, + const String& rCode, BOOL bURL=FALSE ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + // Type + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + // Text + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + const String& GetCode() const { return sCode; } + + BOOL IsCodeURL() const { return bCodeURL; } + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Combined Character Fieldtype + --------------------------------------------------------------------*/ + +class SwCombinedCharFieldType : public SwFieldType +{ +public: + SwCombinedCharFieldType(); + + virtual SwFieldType* Copy() const; +}; + +/*-------------------------------------------------------------------- + Beschreibung: Script Field + --------------------------------------------------------------------*/ + +#define MAX_COMBINED_CHARACTERS 6 + +class SwCombinedCharField : public SwField +{ + String sCharacters; // combine these characters + +public: + SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + // Characters + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + + +} //namespace binfilter +#endif // _DOCUFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/dpage.hxx b/inc/bf_sw/dpage.hxx new file mode 100644 index 000000000..d7581d1c8 --- /dev/null +++ b/inc/bf_sw/dpage.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DPAGE_HXX +#define _DPAGE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svx/fmpage.hxx> + +#include <bf_svx/svdobj.hxx> +namespace binfilter { + +class SdrPageGridFrameList; +class SwDrawDocument; +class SwDoc; + +class SwDPage : public FmFormPage, public SdrObjUserCall +{ + SdrPageGridFrameList* pGridLst; + SwDoc& rDoc; + +public: + SwDPage(SwDrawDocument& rNewModel, BOOL bMasterPage=FALSE); + ~SwDPage(); + + // #i3694# + // This GetOffset() method is not needed anymore, it even leads to errors. + // virtual Point GetOffset() const; + virtual SdrObject* ReplaceObject( SdrObject* pNewObj, ULONG nObjNum ); + + + + + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage(); +}; + +} //namespace binfilter +#endif // _DPAGE_HXX + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/drawdoc.hxx b/inc/bf_sw/drawdoc.hxx new file mode 100644 index 000000000..efa62b05d --- /dev/null +++ b/inc/bf_sw/drawdoc.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _DRAWDOC_HXX +#define _DRAWDOC_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svx/fmmodel.hxx> +class Window; +class SbxValue; +class SbxObject; +namespace binfilter { + +class SwDoc; +class SwDocShell; +class SjJSbxObject; + + +//================================================================== + +class SwDrawDocument : public FmFormModel +{ + SwDoc* pDoc; +public: + SwDrawDocument( SwDoc* pDoc ); + SwDrawDocument( SfxItemPool *pPool, SwDocShell *pDocSh ); + ~SwDrawDocument(); + + const SwDoc& GetDoc() const { return *pDoc; } + SwDoc& GetDoc() { return *pDoc; } + + virtual SdrPage* AllocPage(bool bMasterPage); + + // fuers "load on demand" von Grafiken im DrawingLayer + virtual SvStream* GetDocumentStream( SdrDocumentStreamInfo& rInfo ) const; + + // fuers Speicher von Rechtecken als Control-Ersatz fuker Versionen < 5.0 +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/editsh.hxx b/inc/bf_sw/editsh.hxx new file mode 100644 index 000000000..9ff21ced2 --- /dev/null +++ b/inc/bf_sw/editsh.hxx @@ -0,0 +1,239 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _EDITSH_HXX +#define _EDITSH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_tools/string.hxx> +#include <bf_svtools/svarray.hxx> +#include <vcl/font.hxx> +#include <bf_svx/swafopt.hxx> +#include <crsrsh.hxx> // fuer Basisklasse +#include <itabenum.hxx> +#include <swdbdata.hxx> +#include <com/sun/star/linguistic2/XSpellAlternatives.hpp> + +namespace com { namespace sun { namespace star { namespace uno { + template < class > class Sequence; +}}}} +class PolyPolygon; +class DateTime; +class CommandExtTextInputData; + +class Graphic; // fuer GetGraphic +class Font; +namespace binfilter { +class SvStringsDtor; +class SvInPlaceObjectRef; +class SvInPlaceObject; +class SvNumberFormatter; +class SfxPoolItem; +class SfxItemSet; +class BfGraphicObject; // fuer GetGraphicObj + + +class SwDoc; +class SvxLinkManager; +class SvxAutoCorrect; + +class SwField; // fuer Felder +class SwFieldType; +class SwDDEFieldType; +class SwNewDBMgr; + +struct SwDocStat; +class SfxDocumentInfo; + +class SvStringsSort; + +class SwFmtRefMark; +class SwFmtCol; +class SwNumRule; // Numerierung +class SwNodeNum; // Numerierung +class SwTxtFmtColl; +#ifdef USED +class SwGrfFmt; +class SwGrfFmtColl; +#endif +class SwGrfNode; +class SwFlyFrmFmt; + +class SwFrmFmt; // fuer GetTxtNodeFmts() +class SwCharFmt; +class SwExtTextInput; +class SwTxtNode; // fuer IsNotMakeTxtNode +class SwFmtINetFmt; // InsertURL + +class SwTable; +class SwBlockExceptList; +class SwFmtFtn; +class SpellCheck; +class SwSection; +class SwSectionFmt; +class SwTOXMarks; +class SwTOXBase; +class SwTOXType; +class SwTableAutoFmt; +class SwPageDesc; +class SchMemChart; + +class SwTxtINetFmt; +class SwSeqFldList; +class SwGlblDocContent; +class SwGlblDocContents; +class SwRedline; +class SwRedlineData; +class SwFtnInfo; +class SwEndNoteInfo; +class SwLineNumberInfo; +class SwAttrSet; +class SwAuthEntry; + + + +// Flags for GetScriptType - to define how handle weak - scripts (b.e. +// symbol characters): +// GETSCRIPT_WEAKTOAPPLANGSCRIPT: +// app language define the script type if only weak characters +// are selected and before the weak script no weak script if found +// (mostly the default for Get any attributes, etc) +// GETSCRIPT_WEAKTOAPPLANGSCRIPT: +// app language defines the script type if only weak characters +// are selected and before the weak script no weak script is found +// (mostly the default for Get any attributes, etc) +// GETSCRIPT_WEAKTOALL: +// all script flags are set. +// are selected and before the weak script no weak script if found +// (mostly the default for Get any attributes, etc) +#define GETSCRIPT_WEAKTOAPPLANGSCRIPT 0 +#define GETSCRIPT_WEAKTOALL 1 + + +#define GETSELTXT_PARABRK_TO_BLANK 0 +#define GETSELTXT_PARABRK_KEEP 1 +#define GETSELTXT_PARABRK_TO_ONLYCR 2 + +/**************************************************************** + * zum Abfragen der INet-Attribute fuer den Navigator + ****************************************************************/ +struct SwGetINetAttr +{ + String sText; + const SwTxtINetFmt& rINetAttr; + + SwGetINetAttr( const String& rTxt, const SwTxtINetFmt& rAttr ) + : sText( rTxt ), rINetAttr( rAttr ) + {} +}; +SV_DECL_PTRARR_DEL( SwGetINetAttrs, SwGetINetAttr*, 0, 5 ) + +/**************************************************************** + * Typen der Inhaltsformen + ****************************************************************/ +#define CNT_TXT 0x0001 +#define CNT_GRF 0x0002 +#define CNT_OLE 0x0010 +/* Teste einen USHORT auf eine bestimmte Inhaltsform */ +#define CNT_HasTxt(USH) ((USH)&CNT_TXT) +#define CNT_HasGrf(USH) ((USH)&CNT_GRF) +#define CNT_HasOLE(USH) ((USH)&CNT_OLE) + +class SwEditShell: public SwCrsrShell +{ + // fuer die privaten Methoden DelRange und die vom AutoCorrect + friend void _InitCore(); + friend void _FinitCore(); + // fuer die PamCorrAbs/-Rel Methoden + + SfxPoolItem& _GetChrFmt( SfxPoolItem& ) const; + + /* + * liefert einen Pointer auf einen SwGrfNode; dieser wird von + * GetGraphic() und GetGraphicSize() verwendet. + */ + + + +public: + +#ifdef USED + // GRF + USHORT GetGrfFmtCollCount() const; + SwGrfFmtColl& GetGrfFmtColl( USHORT nGrfFmtColl) const; + void DelGrfFmtColl(USHORT nFmt); + SwGrfFmtColl* GetCurGrfFmtColl() const; + void SetGrfFmtColl(SwGrfFmtColl*); + SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtCollName, + SwGrfFmtColl *pDerivedFrom = 0); +#endif + + // Gebe die "Auto-Collection" mit der Id zurueck. Existiert + // sie noch nicht, dann erzuege sie + // return das geforderte automatische Format - Basis-Klasse ! + // returne die geforderte automatische Seiten-Vorlage + // returne die geforderte automatische NumRule + + // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird + + // returne das geforderte automatische Format + + // Felder + void Insert(SwField&); + + + //check whether DB fields point to an available data source and returns it + BOOL IsFieldDataSourceAvailable(String& rUsedDataSource) const; + + // Is spelling active somewhere else? + // Is text conversion active somewhere else? + BOOL HasConvIter() const; + + // special insert: Insert a new text node just before or after a section or + // table, if the cursor is positioned at the start/end of said + // section/table. The purpose of the method is to allow users to inert text + // at certain 'impossible' position, e.g. before a table at the document + // start or between to sections. + bool DoSpecialInsert(); + bool CanSpecialInsert() const; + + // Optimierung UI + + inline const SvxLinkManager& GetLinkManager() const; + + // Numberformatter vom Doc erfragen + const SvNumberFormatter* GetNumberFormatter() const + { return ((SwEditShell*)this)->GetNumberFormatter(); } + + virtual ~SwEditShell() {} + +private: + // fuer METWARE: + // es wird nicht kopiert und nicht zugewiesen + SwEditShell(const SwEditShell &); + const SwEditShell &operator=(const SwEditShell &); +}; + +inline const SvxLinkManager& SwEditShell::GetLinkManager() const +{ return ((SwEditShell*)this)->GetLinkManager(); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/expfld.hxx b/inc/bf_sw/expfld.hxx new file mode 100644 index 000000000..f9f18c899 --- /dev/null +++ b/inc/bf_sw/expfld.hxx @@ -0,0 +1,408 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _EXPFLD_HXX +#define _EXPFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/svarray.hxx> + +#include <fldbas.hxx> +#include <cellfml.hxx> +namespace binfilter { + +class SfxPoolItem; +class SwTxtNode; +class SwCalc; +class SwFrm; +struct SwPosition; +class SwTxtFld; +class SwTableSortBoxes; +class SwDoc; +class SwTable; +class SwFmtFld; + +// Vorwaertsdeklaration: besorge den "Body-TextNode", fuer Exp.Fld in Fly's +// Header/Footers/Footnodes +const SwTxtNode* GetBodyTxtNode( const SwDoc& pDoc, SwPosition& rPos, + const SwFrm& rFrm ); +// Wandlung Address -> Adressen +void ReplacePoint(String& sTmpName, BOOL bWithCommandType = FALSE); + +struct _SeqFldLstElem +{ + String sDlgEntry; + USHORT nSeqNo; + + _SeqFldLstElem( const String& rStr, USHORT nNo ) + : sDlgEntry( rStr ), nSeqNo( nNo ) + {} +}; +SV_DECL_PTRARR_DEL( _SwSeqFldList, _SeqFldLstElem*, 10, 10 ) + +class SwSeqFldList : public _SwSeqFldList +{ +public: + SwSeqFldList() : _SwSeqFldList( 10, 10 ) {} + + BOOL InsertSort( _SeqFldLstElem* ); + BOOL SeekEntry( const _SeqFldLstElem& , USHORT* pPos = 0 ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Ausdruck + --------------------------------------------------------------------*/ + +class SwGetExpFieldType : public SwValueFieldType +{ +public: + SwGetExpFieldType(SwDoc* pDoc); + virtual SwFieldType* Copy() const; + + // ueberlagert, weil das Get-Field nicht veraendert werden kann + // und dann auch nicht aktualisiert werden muss. Aktualisierung + // erfolgt beim Aendern von Set-Werten ! + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: GetExperession + --------------------------------------------------------------------*/ + +class SwGetExpField : public SwFormulaField +{ + String sExpand; + BOOL bIsInBodyTxt; + USHORT nSubType; + +public: + SwGetExpField( SwGetExpFieldType*, const String& rFormel, + USHORT nSubType = GSE_EXPR, ULONG nFmt = 0); + + virtual void SetValue( const double& rVal ); + virtual void SetLanguage(USHORT nLng); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline const String& GetExpStr() const; + inline void ChgExpStr(const String& rExpand); + + // wird von der Formatierung abgefragt + inline BOOL IsInBodyTxt() const; + // wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt) + inline void ChgBodyTxtFlag( BOOL bIsInBody ); + // fuer Felder in Header/Footer/Footnotes/Flys: + // (wird nur von der Formatierung aufgerufen!!) + + virtual String GetCntnt(BOOL bName = FALSE) const; + + // Die Formel aendern + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nType); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + + static USHORT GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc); +}; + +inline void SwGetExpField::ChgExpStr(const String& rExpand) + { sExpand = rExpand;} + +inline const String& SwGetExpField::GetExpStr() const + { return sExpand; } + +// wird von der Formatierung abgefragt +inline BOOL SwGetExpField::IsInBodyTxt() const + { return bIsInBodyTxt; } + +// wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt) +inline void SwGetExpField::ChgBodyTxtFlag( BOOL bIsInBody ) + { bIsInBodyTxt = bIsInBody; } + + +/*-------------------------------------------------------------------- + Beschreibung: Ausdruck setzen + --------------------------------------------------------------------*/ + +class SwSetExpField; + +class SwSetExpFieldType : public SwValueFieldType +{ + String sName; + const SwNode* pOutlChgNd; + sal_Unicode cDelim; + USHORT nType; + BYTE nLevel; + BOOL bDeleted; + +public: + SwSetExpFieldType( SwDoc* pDoc, const String& rName, + USHORT nType = GSE_EXPR ); + virtual SwFieldType* Copy() const; + virtual const String& GetName() const; + + inline void SetType(USHORT nTyp); + inline USHORT GetType() const; + + void SetSeqFormat(ULONG nFormat); + ULONG GetSeqFormat(); + + BOOL IsDeleted() const { return bDeleted; } + void SetDeleted( BOOL b ) { bDeleted = b; } + + // ueberlagert, weil das Set-Field selbst dafuer sorgt, das + // es aktualisiert wird. + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + inline const String& GetSetRefName() const; + + USHORT SetSeqRefNo( SwSetExpField& rFld ); + + USHORT GetSeqFldList( SwSeqFldList& rList ); + String MakeSeqName( USHORT nSeqNo ); + + // Seqencefelder ggfs. Kapitelweise numerieren + sal_Unicode GetDelimiter() const { return cDelim; } + void SetDelimiter( sal_Unicode c ) { cDelim = c; } + BYTE GetOutlineLvl() const { return nLevel; } + void SetOutlineLvl( BYTE n ) { nLevel = n; } + // Member nur fuers SwDoc::UpdateExpFld - wird nur waehrend der Laufzeit + // von SequencefeldTypen benoetigt!!! + const SwNode* GetOutlineChgNd() const { return pOutlChgNd; } + void SetOutlineChgNd( const SwNode* p ) { pOutlChgNd = p; } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline void SwSetExpFieldType::SetType( USHORT nTyp ) +{ + nType = nTyp; + EnableFormat( !(nType & (GSE_SEQ|GSE_STRING))); +} + +inline USHORT SwSetExpFieldType::GetType() const + { return nType; } + +inline const String& SwSetExpFieldType::GetSetRefName() const + { return sName; } + + +/*-------------------------------------------------------------------- + Beschreibung: Ausdruck + --------------------------------------------------------------------*/ + +class SwSetExpField : public SwFormulaField +{ + String sExpand; + String aPText; + String aSeqText; + BOOL bInput; + USHORT nSeqNo; + USHORT nSubType; + +public: + SwSetExpField(SwSetExpFieldType*, const String& rFormel, ULONG nFmt = 0); + + virtual void SetValue( const double& rVal ); + + virtual String Expand() const; + virtual SwField* Copy() const; + + inline const String& GetExpStr() const; + + inline void ChgExpStr( const String& rExpand ); + + inline void SetPromptText(const String& rStr); + inline const String& GetPromptText() const; + + inline void SetInputFlag(BOOL bInp); + inline BOOL GetInputFlag() const; + + inline void SetSeqText(const String& rStr); + inline const String& GetSeqText() const; + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nType); + + inline BOOL IsSequenceFld() const; + + // fuer SequenceFelder - logische Nummer + inline void SetSeqNumber( USHORT n ) { nSeqNo = n; } + inline USHORT GetSeqNumber() const { return nSeqNo; } + + // Der Name nur erfragen + virtual const String& GetPar1() const; + + // Die Formel + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline const String& SwSetExpField::GetExpStr() const + { return sExpand; } + +inline void SwSetExpField::ChgExpStr( const String& rExpand ) + { sExpand = rExpand; } + +inline void SwSetExpField::SetPromptText(const String& rStr) + { aPText = rStr; } + +inline const String& SwSetExpField::GetPromptText() const + { return aPText; } + +inline void SwSetExpField::SetSeqText(const String& rStr) + { aSeqText = rStr; } + +inline const String& SwSetExpField::GetSeqText() const + { return aSeqText; } + +inline void SwSetExpField::SetInputFlag(BOOL bInp) + { bInput = bInp; } + +inline BOOL SwSetExpField::GetInputFlag() const + { return bInput; } + +inline BOOL SwSetExpField::IsSequenceFld() const + { return 0 != (GSE_SEQ & ((SwSetExpFieldType*)GetTyp())->GetType()); } + +/*-------------------------------------------------------------------- + Beschreibung: Eingabe im Text/Variable setzen + --------------------------------------------------------------------*/ + +class SwInputFieldType : public SwFieldType +{ + SwDoc* pDoc; +public: + SwInputFieldType( SwDoc* pDoc ); + + virtual SwFieldType* Copy() const; + + SwDoc* GetDoc() const { return pDoc; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Eingabefeld + --------------------------------------------------------------------*/ + +class SwInputField : public SwField +{ + String aContent; + String aPText; + USHORT nSubType; +public: + // Direkte Eingabe ueber Dialog alten Wert loeschen + SwInputField(SwInputFieldType*, const String& rContent , + const String& rPrompt, USHORT nSubType = 0, + ULONG nFmt = 0); + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual String Expand() const; + virtual SwField* Copy() const; + + // Content + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // aPromptText + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nSub); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +/*-------------------------------------------------------------------- + Description: Sorted list of input fields and DropDown fields + --------------------------------------------------------------------*/ + + + + + // vergleiche TmpLst mit akt Feldern. Alle neue kommen in die SortLst + // damit sie geupdatet werden koennen. Returnt die Anzahl. + // (Fuer Textbausteine: nur seine Input-Felder aktualisieren) + + // Alle unselektierten Felder aus Liste entfernen + + +/*-------------------------------------------------------------------- + Beschreibung: Tabellen-Formelfeld + (Implementierung steht in tblcalc.cxx) + --------------------------------------------------------------------*/ + +class SwTblFieldType : public SwValueFieldType +{ +public: + SwTblFieldType(SwDoc* pDocPtr); + virtual SwFieldType* Copy() const; +}; + + +// MSC will den hier nicht +//typedef void (SwField:: *FnScanFormel)( const SwTable&, String&, +// String&, String* = 0, void* = 0 ); + + +class SwTblField : public SwValueField, public SwTableFormula +{ + String sExpand; + USHORT nSubType; + + // suche den TextNode, in dem das Feld steht + virtual const SwNode* GetNodeOfFormula() const; + +public: + SwTblField( SwTblFieldType*, const String& rFormel, + USHORT nSubType = 0, ULONG nFmt = 0); + + virtual void SetValue( const double& rVal ); + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nType); + virtual String Expand() const; + virtual SwField* Copy() const; + + const String& GetExpStr() const { return sExpand; } + void ChgExpStr(const String& rStr) { sExpand = rStr; } + + // berechne sich selbst + void CalcField( SwTblCalcPara& rCalcPara ); + + virtual String GetCntnt(BOOL bName = FALSE) const; + // Die Formel + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + + +} //namespace binfilter +#endif // _EXPFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/extinput.hxx b/inc/bf_sw/extinput.hxx new file mode 100644 index 000000000..443d73388 --- /dev/null +++ b/inc/bf_sw/extinput.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _EXTINPUT_HXX +#define _EXTINPUT_HXX + +#include <bf_svtools/bf_solar.h> + +#ifndef _SVSTDARR_HXX +#define _SVSTDARR_USHORTS +#include <bf_svtools/svstdarr.hxx> +#endif +#include <pam.hxx> +class CommandExtTextInputData; +class Font; + +namespace binfilter { + + +class SwExtTextInput : public SwPaM +{ + SvUShorts aAttrs; + String sOverwriteText; + BOOL bInsText : 1; + BOOL bIsOverwriteCursor : 1; +public: + SwExtTextInput(){}; + + const SvUShorts& GetAttrs() const { return aAttrs; } + BOOL IsInsText() const { return bInsText; } + void SetInsText( BOOL bFlag ) { bInsText = bFlag; } + BOOL IsOverwriteCursor() const { return bIsOverwriteCursor; } +}; + +} //namespace binfilter +#endif //_EXTINPUT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fchrfmt.hxx b/inc/bf_sw/fchrfmt.hxx new file mode 100644 index 000000000..20723d7fd --- /dev/null +++ b/inc/bf_sw/fchrfmt.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FCHRFMT_HXX +#define _FCHRFMT_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + +class SwCharFmt; +class SwTxtCharFmt; + + +// ATT_CHARFMT ********************************************* + + +class SwFmtCharFmt: public SfxPoolItem, public SwClient +{ + friend class SwTxtCharFmt; + SwTxtCharFmt* pTxtAttr; // mein TextAttribut +public: + SwFmtCharFmt( SwCharFmt *pFmt ); + SwFmtCharFmt( const SwFmtCharFmt& rAttr ); + ~SwFmtCharFmt(); // fuer SEXPORT + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + virtual SfxItemPresentation GetPresentation( + SfxItemPresentation /* ePres */, + SfxMapUnit /* eCoreMetric */, + SfxMapUnit /* ePresMetric */, + String& /* rText */, + const ::IntlWrapper* /* pIntl */ = NULL + ) const + { return SFX_ITEM_PRESENTATION_NONE; } + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + + // an das SwTxtCharFmt weiterleiten (vom SwClient) + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); } + SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fesh.hxx b/inc/bf_sw/fesh.hxx new file mode 100644 index 000000000..dae1a2821 --- /dev/null +++ b/inc/bf_sw/fesh.hxx @@ -0,0 +1,194 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FESH_HXX +#define _FESH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <editsh.hxx> +#include <orntenum.hxx> +#include <flyenum.hxx> + +// OD 25.06.2003 #108784# +#include <bf_svx/svdtypes.hxx> + +#include <vector> +class Color; +namespace binfilter { + +class SvEmbeddedObject; +class SvEmbeddedObjectRef; +class SvInPlaceObject; +class SwFlyFrm; + +class SwTabCols; +class SvxBrushItem; +class SwTableAutoFmt; +class SwFrm; +class SwTabFrm; +class SwFmtFrmSize; +class SvxBorderLine; +class SvStorageStream; +class SdrObject; + +class Outliner; +class SotDataObject; +class SwFrmFmt; +struct SwSortOptions; +class SdrMarkList; + +enum FrmType +{ + //Veroderung. + FRMTYPE_NONE = 0, + FRMTYPE_PAGE = 1, + FRMTYPE_HEADER = 2, + FRMTYPE_FOOTER = 4, + FRMTYPE_BODY = 8, + FRMTYPE_COLUMN = 16, + FRMTYPE_TABLE = 32, + FRMTYPE_FLY_FREE = 64, + FRMTYPE_FLY_ATCNT = 128, + FRMTYPE_FLY_INCNT = 256, + FRMTYPE_FOOTNOTE = 512, + FRMTYPE_FTNPAGE = 1024, + FRMTYPE_FLY_ANY = 2048, + FRMTYPE_DRAWOBJ = 4096, + FRMTYPE_COLSECT = 8192, + FRMTYPE_COLSECTOUTTAB = 16384 +}; + +#define FRMTYPE_ANYCOLSECT ( FRMTYPE_COLSECT | FRMTYPE_COLSECTOUTTAB ) + +enum GotoObjType +{ + DRAW_CONTROL = 1, + DRAW_SIMPLE = 2, + DRAW_ANY = 3, + FLY_FRM = 4, + FLY_GRF = 8, + FLY_OLE = 16, + FLY_ANY = 28, + GOTO_ANY = 31 +}; + +enum FlyProtectType +{ + FLYPROTECT_CONTENT = 1, // kann verodert werden! + FLYPROTECT_SIZE = 2, + FLYPROTECT_POS = 4, + FLYPROTECT_PARENT = 8, // nur Parents untersuchen + FLYPROTECT_FIXED = 16 // nur nicht aufhebbarer Schutz + // z.B. durch OLE-Server, gilt auch + // fuer Dialog +}; + +enum ObjCntType //Fuer das Ermitteln des Cntnts per Positon (D&D) +{ + OBJCNT_NONE, + OBJCNT_FLY, + OBJCNT_GRF, + OBJCNT_OLE, + OBJCNT_SIMPLE, + OBJCNT_CONTROL, + OBJCNT_URLBUTTON, + + OBJCNT_GROUPOBJ, + OBJCNT_DONTCARE // nicht bestimmbar - unterschiedliche Objecte selektiert +}; + +enum CurRectType +{ + RECT_PAGE, //Rect der aktuellen Seite. + RECT_PAGE_CALC, //... Seite wird ggf. Formatiert + RECT_PAGE_PRT, //Rect der aktuellen PrtArea der Seite + RECT_FRM, //Rect des aktuellen Rahmen + RECT_FLY_EMBEDDED, //Rect des aktuellen FlyFrm + RECT_FLY_PRT_EMBEDDED, //Rect der PrtArea des FlyFrm + RECT_SECTION, //Rect des aktuellen Bereichs + RECT_OUTTABSECTION, //Rect des aktuellen Bereichs, + // aber ausserhalb der Tabelle + RECT_SECTION_PRT, //Rect der aktuellen PrtArea des Bereichs + RECT_OUTTABSECTION_PRT, //Rect der aktuellen PrtArea des Bereichs, + // aber ausserhalb der Tabelle + RECT_HEADERFOOTER, //Rect des aktuellen Headers/Footer + RECT_HEADERFOOTER_PRT //Rect der PrtArea des aktuellen Headers/Footers +}; + +struct SwGetCurColNumPara +{ + const SwFrmFmt* pFrmFmt; + const SwRect* pPrtRect, *pFrmRect; + SwGetCurColNumPara() : pFrmFmt( 0 ), pPrtRect( 0 ), pFrmRect( 0 ) {} +}; + +#define SW_PASTESDR_INSERT 1 +#define SW_PASTESDR_REPLACE 2 +#define SW_PASTESDR_SETATTR 3 + +#define SW_ADD_SELECT 1 +#define SW_ENTER_GROUP 2 +#define SW_LEAVE_FRAME 4 + +#define SW_MOVE_UP 0 +#define SW_MOVE_DOWN 1 +#define SW_MOVE_LEFT 2 +#define SW_MOVE_RIGHT 3 + +#define SW_TABCOL_NONE 0 +#define SW_TABCOL_HORI 1 +#define SW_TABCOL_VERT 2 + +class SwFEShell : public SwEditShell +{ + BOOL bCheckForOLEInCaption; + +public: + TYPEINFO(); + SwFEShell( SwDoc& rDoc, Window *pWin ); + virtual ~SwFEShell(); + + // #107513# + // Test if there is a draw object at that position and if it should be selected. + // The 'should' is aimed at Writer text fly frames which may be in front of + // the draw object. + sal_Bool ShouldObjectBeSelected(const Point& rPt); + + //Liefert neben der Grafik in rName bei gelinkten Grafiken den Namen mit + //Pfad und sonst den Grafiknamen. rbLink ist TRU bei gelinkten Grafiken. + + //Der Client fuer das OleObject muss bezueglich der Scalierung auf dem + //neuesten Stand gehalten werden. Impl in der WrtShell. + //Wird ein Pointer auf eine Size uebergeben, so ist diese die aktuelle + //Core-Groesse des Objectes. Anderfalls wird die Groesse per GetCurFlyRect() + //besorgt. + virtual void CalcAndSetScale( SvEmbeddedObjectRef xIPObj, + const SwRect *pFlyPrtRect = 0, + const SwRect *pFlyFrmRect = 0 ) = 0; + + //Objekte mit ActivateWhenVisible werden beim Paint Connected. + //gerufen von notxtfrm::Paint, impl in wrtsh + virtual void ConnectObj( SvInPlaceObjectRef xIPObj, const SwRect &rPrt, + const SwRect &rFrm ) = 0; +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fldbas.hxx b/inc/bf_sw/fldbas.hxx new file mode 100644 index 000000000..7ca77a683 --- /dev/null +++ b/inc/bf_sw/fldbas.hxx @@ -0,0 +1,471 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _FLDBAS_HXX +#define _FLDBAS_HXX + +#include <bf_svtools/bf_solar.h> + +#ifndef FIELDIDS_ONLY // SWG-Testreader!! + +#include <i18npool/lang.h> +#include <tools/debug.hxx> +#include <bf_tools/string.hxx> +#include <calbck.hxx> + +#include <com/sun/star/uno/Any.hxx> +class Date; +class Time; + +namespace binfilter { + +class SvStringsDtor; +class SvNumberFormatter; +class SwDoc; +class _SetGetExpFlds; +class SwEditShell; +} //namespace binfilter +#endif // FIELDIDS_ONLY + +/*-------------------------------------------------------------------- + Beschreibung: die ID's fuer die Feldtypen + --------------------------------------------------------------------*/ +namespace binfilter { +enum RES_FIELDS +{ +// Fuer die alten Dokumente muessen die Field-Which IDS erhalten bleiben !!!! + RES_FIELDS_BEGIN, + RES_DBFLD = RES_FIELDS_BEGIN, + RES_USERFLD, + RES_FILENAMEFLD, + RES_DBNAMEFLD, + RES_DATEFLD, + RES_TIMEFLD, + RES_PAGENUMBERFLD, + RES_AUTHORFLD, + RES_CHAPTERFLD, + RES_DOCSTATFLD, + RES_GETEXPFLD, + RES_SETEXPFLD, + RES_GETREFFLD, + RES_HIDDENTXTFLD, + RES_POSTITFLD, + RES_FIXDATEFLD, + RES_FIXTIMEFLD, + RES_REGFLD, + RES_VARREGFLD, + RES_SETREFFLD, + RES_INPUTFLD, + RES_MACROFLD, + RES_DDEFLD, + RES_TABLEFLD, + RES_HIDDENPARAFLD, + RES_DOCINFOFLD, + RES_TEMPLNAMEFLD, + RES_DBNEXTSETFLD, + RES_DBNUMSETFLD, + RES_DBSETNUMBERFLD, + RES_EXTUSERFLD, + RES_REFPAGESETFLD, + RES_REFPAGEGETFLD, + RES_INTERNETFLD, + RES_JUMPEDITFLD, + RES_SCRIPTFLD, + RES_DATETIMEFLD, + RES_AUTHORITY, //Table of authorities + RES_COMBINED_CHARS, + RES_DROPDOWN, + RES_FIELDS_END +}; + +/*-------------------------------------------------------------------- + Beschreibung: Liste der FieldTypes am UI + --------------------------------------------------------------------*/ + +enum SwFldTypesEnum +{ + TYP_BEGIN, + TYP_DATEFLD = TYP_BEGIN, // 0 + TYP_TIMEFLD, + TYP_FILENAMEFLD, + TYP_DBNAMEFLD, + TYP_CHAPTERFLD, + TYP_PAGENUMBERFLD, + TYP_DOCSTATFLD, + TYP_AUTHORFLD, + TYP_SETFLD, + TYP_GETFLD, + TYP_FORMELFLD, // 10 + TYP_HIDDENTXTFLD, + TYP_SETREFFLD, + TYP_GETREFFLD, + TYP_DDEFLD, + TYP_MACROFLD, + TYP_INPUTFLD, + TYP_HIDDENPARAFLD, + TYP_DOCINFOFLD, + TYP_DBFLD, + TYP_USERFLD, // 20 + TYP_POSTITFLD, + TYP_TEMPLNAMEFLD, + TYP_SEQFLD, + TYP_DBNEXTSETFLD, + TYP_DBNUMSETFLD, + TYP_DBSETNUMBERFLD, + TYP_CONDTXTFLD, + TYP_NEXTPAGEFLD, + TYP_PREVPAGEFLD, + TYP_EXTUSERFLD, // 30 + TYP_FIXDATEFLD, + TYP_FIXTIMEFLD, + TYP_SETINPFLD, + TYP_USRINPFLD, + TYP_SETREFPAGEFLD, + TYP_GETREFPAGEFLD, + TYP_INTERNETFLD, + TYP_JUMPEDITFLD, + TYP_SCRIPTFLD, // 40 + TYP_AUTHORITY, + TYP_COMBINED_CHARS, + TYP_DROPDOWN, + TYP_END +}; + + +enum SwFileNameFormat +{ + FF_BEGIN, + FF_NAME = FF_BEGIN, + FF_PATHNAME, + FF_PATH, + FF_NAME_NOEXT, + FF_UI_NAME, + FF_UI_RANGE, + FF_END, + FF_FIXED = 0x8000 +}; + +enum SwVarFormat +{ + VVF_CMD = 0x0010, // Kommando anzeigen + VVF_INVISIBLE = 0x0040, // unsichtbar + VVF_XXP = 0x0400, // 1234% + VVF_XX_XXP = 0x0800, // 1.234,56% + VVF_CLEAR = 0x000f, + +// ab hier neue Formate + VVF_SYS = 0x2000, //Zahlenformat aus der Systemeinstellung + VVF_X = 0x2100, // 1234 + VVF_X_X = 0x2200, // 1234,5 + VVF_X_XX = 0x2300, // 1245,56 + VVF_XX_X = 0x2400, // 1.234,5 + VVF_XX_XX = 0x2500, // 1.234,56 + VVF_XX_XXX = 0x2600, // 1.234,567 + VVF_SYS_CUR = 0x2700, // W„hrungsformat aus der Systemeinstellung + VVF_CUR_X = 0x2800, // DM 1234 + VVF_CUR_XX_XX = 0x2900, // DM 1234,56 DM 1234,00 + VVF_CUR_XX_X0 = 0x2a00, // DM 1234,56 DM 1234,-- + VVF_X_CUR = 0x2b00, // 1234 DM + VVF_XX_XX_CUR = 0x2c00, // 1234,56 DM 1234,00 DM + VVF_XX_X0_CUR = 0x2d00, // 1234,56 DM 1234,-- DM +// Kompatibilitaet: + VF_CMD = VVF_CMD, + VF_INVISIBLE = VVF_INVISIBLE, + VF_XXP = VVF_XXP, + VF_XX_XXP = VVF_XX_XXP, + VF_VISIBLE = VVF_SYS, + VF_XX = VVF_X, + VF_XX_XX = VVF_XX_XX, + VF_XX_XX_CUR = VVF_SYS_CUR, + VF_CLEAR = VVF_CLEAR + +}; + +enum SwGetSetExpType +{ + GSE_STRING = 0x0001, // String + GSE_EXPR = 0x0002, // Expression + GSE_INP = 0x0004, // InputField + GSE_SEQ = 0x0008, // Sequence + GSE_FORMULA = 0x0010 // Formel +}; + +enum SwExtendedSubType +{ + SUB_CMD = 0x0100, // Kommando anzeigen + SUB_INVISIBLE = 0x0200, // unsichtbar + SUB_OWN_FMT = 0x0400 // SwDBField: Uebernimmt Formatierung nicht + // aus Datenbank +}; + +enum SwInputFieldSubType +{ + INP_TXT = 0x01, + INP_USR = 0x02, + INP_VAR = 0x03 +}; + + +enum SwUserType +{ + UF_STRING = 0x01, + UF_EXPR = 0x02 +}; + +enum SwDateTimeSubType +{ + FIXEDFLD = 1, + DATEFLD = 2, + TIMEFLD = 4 +}; + +#ifndef FIELDIDS_ONLY // SWG-Testreader!! + + +extern USHORT aTypeTab[]; + +/*-------------------------------------------------------------------- + Beschreibung: Allgemeine Tools + --------------------------------------------------------------------*/ + +String GetResult(double nVal, sal_uInt32 nNumFmt, USHORT nLang = LANGUAGE_SYSTEM); +void SetErrorStr(const String& rStr); +//String ExpandDate(const Date& rDate, ULONG nFmt, USHORT nLang); +//String ExpandTime(const Time& rTime, ULONG nFmt, USHORT nLang); +String FormatNumber(USHORT nNum, sal_uInt32 nFormat); + +/*-------------------------------------------------------------------- + Beschreibung: Instanzen von SwFields und Abgeleiteten kommen 0-n mal vor. + Zu jeder Klasse SwFields existiert + 1 Instanz der zugehoerigen Typenklasse + Basisklasse aller Feldtypen ist SwFieldType + --------------------------------------------------------------------*/ +class SwFldNames; + +DBG_NAMEEX(SwFieldType) + +class SwFieldType : public SwModify +{ + USHORT nWhich; + + friend void _FinitUI(); // um den Pointer zu loeschen! + static SvStringsDtor* pFldNames; + + static void _GetFldName(); // legt die FldNames an, fldmgr.cxx! +protected: + SwFieldType( USHORT nWhichId ); + +public: + +#ifdef DBG_UTIL + virtual ~SwFieldType(); +#endif + static const String& GetTypeStr( USHORT nTypeId ); + + // nur in abgeleiteten Klassen + virtual const String& GetName() const; + virtual SwFieldType* Copy() const = 0; + virtual BOOL QueryValue( ::com::sun::star::uno::Any& /*rVal*/, BYTE /*nMId*/ ) const{DBG_BF_ASSERT(0, "STRIP"); return FALSE;} + virtual BOOL PutValue( const ::com::sun::star::uno::Any& /*rVal*/, BYTE /*nMId*/ ){DBG_BF_ASSERT(0, "STRIP"); return FALSE;} + + USHORT Which() const { return nWhich; } + + inline void UpdateFlds() const; + + static inline SvStringsDtor* GetFldNames(); +}; + +inline void SwFieldType::UpdateFlds() const +{ + ((SwFieldType*)this)->Modify( 0, 0 ); +} + +/*-------------------------------------------------------------------- + Beschreibung: Basisklasse aller Felder. + Ueber Which wird der Typ des Feldes abgefragt. + Ueber Expand() wird der expandierte Inhalt + des Feldes in Erfahrung gebracht. + --------------------------------------------------------------------*/ + +class SwField +{ + USHORT nLang; // Immer ueber SetLanguage aendern! + BOOL bIsAutomaticLanguage; + sal_uInt32 nFormat; + + SwFieldType* pType; +protected: + void SetFormat(sal_uInt32 nSet) {nFormat = nSet;} + + SwField(SwFieldType* pTyp, sal_uInt32 nFmt = 0, USHORT nLang = LANGUAGE_SYSTEM); +public: + virtual ~SwField(); + + // Typ feststellen + inline SwFieldType* GetTyp() const; + + // neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt) + virtual SwFieldType* ChgTyp( SwFieldType* ); + + // Expandierung fuer die Anzeige + virtual String Expand() const = 0; + + // liefert den Namen oder den Inhalt + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual SwField* Copy() const = 0; + + // ResId + USHORT Which() const +#ifndef DBG_UTIL + { return pType->Which(); } +#else + ; // in fldbas.cxx implementiert +#endif + + // TYP_ID + virtual USHORT GetSubType() const { DBG_BF_ASSERT(0, "STRIP"); return 0; } + virtual void SetSubType(USHORT) { DBG_BF_ASSERT(0, "STRIP"); } + + // Sprache an der Feldposition + inline USHORT GetLanguage() const; + virtual void SetLanguage(USHORT nLng); + + // Parameter fuer Dialog und BASIC erfragen + inline sal_uInt32 GetFormat() const; + virtual const String& GetPar1() const; + virtual String GetPar2() const; + + virtual String GetFormula() const; + + virtual void ChangeFormat(sal_uInt32 n); + virtual void SetPar1(const String&) { DBG_BF_ASSERT(0, "STRIP"); } + virtual void SetPar2(const String&) { DBG_BF_ASSERT(0, "STRIP"); } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); + // hat das Feld eine Action auf dem ClickHandler ? (z.B. INetFelder,..) + // ist es ein Fix-Feld? + bool IsFixed() const; + + BOOL IsAutomaticLanguage() const { return bIsAutomaticLanguage;} + void SetAutomaticLanguage(BOOL bSet){bIsAutomaticLanguage = bSet;} +}; + +inline SwFieldType* SwField::GetTyp() const + { return pType; } + +inline sal_uInt32 SwField::GetFormat() const + { return nFormat; } + +inline USHORT SwField::GetLanguage() const + { return nLang; } + +/*-------------------------------------------------------------------- + Beschreibung: Felder mit Values, die ueber der Numberformatter + formatiert werden muessen + --------------------------------------------------------------------*/ + +class SwValueFieldType : public SwFieldType +{ + SwDoc* pDoc; + BOOL bUseFormat; // Numberformatter verwenden + +protected: + SwValueFieldType( SwDoc* pDocPtr, USHORT nWhichId ); + +public: + inline SwDoc* GetDoc() const { return pDoc; } + inline void SetDoc(SwDoc* pNewDoc) { pDoc = pNewDoc; } + + inline BOOL UseFormat() const { return bUseFormat; } + inline void EnableFormat(BOOL bFormat = TRUE) { bUseFormat = bFormat; } + + String ExpandValue(const double& rVal, sal_uInt32 nFmt, USHORT nLng=0) const; + void DoubleToString(String &rValue, const double &rVal, LanguageType eLng) const; +}; + +class SwValueField : public SwField +{ + double fValue; +// String sExpand; + +protected: + SwValueField( SwValueFieldType* pFldType, sal_uInt32 nFmt = 0, USHORT nLang = LANGUAGE_SYSTEM, const double fVal = 0.0 ); + +public: + virtual ~SwValueField(); + + virtual SwFieldType* ChgTyp( SwFieldType* ); + virtual void SetLanguage(USHORT nLng); +// os: wozu war das denn da? +// virtual void ChangeFormat(ULONG n); + + inline SwDoc* GetDoc() const { return ((SwValueFieldType*)GetTyp())->GetDoc(); } + + virtual double GetValue() const; + virtual void SetValue( const double& rVal ); + + inline String ExpandValue(const double& rVal, sal_uInt32 nFmt, USHORT nLng=0) const + { return ((SwValueFieldType*)GetTyp())->ExpandValue(rVal, nFmt, nLng); } + +}; + +class SwFormulaField : public SwValueField +{ + String sFormula; + +protected: + SwFormulaField( SwValueFieldType* pFldType, sal_uInt32 nFmt = 0, const double fVal = 0.0 ); + +public: + virtual String GetFormula() const; + void SetFormula(const String& rStr); + + void SetExpandedFormula(const String& rStr); + String GetExpandedFormula() const; + +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Sortierung von Felder nach der Position + --------------------------------------------------------------------*/ + +inline SvStringsDtor* SwFieldType::GetFldNames() +{ + if( !SwFieldType::pFldNames ) + SwFieldType::_GetFldName(); + return SwFieldType::pFldNames; +} + +#endif // FIELDIDS_ONLY + + +} //namespace binfilter +#endif // _FLDBAS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/flddat.hxx b/inc/bf_sw/flddat.hxx new file mode 100644 index 000000000..864558898 --- /dev/null +++ b/inc/bf_sw/flddat.hxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FLDDAT_HXX +#define _FLDDAT_HXX + +#include <bf_svtools/bf_solar.h> + + +#include "fldbas.hxx" +class DateTime; +namespace binfilter { + + + +/*-------------------------------------------------------------------- + Beschreibung: Formate + --------------------------------------------------------------------*/ + +enum SwDateFormat +{ + DF_BEGIN, + //neue Formate: + DFF_SSYS = DF_BEGIN, + DFF_LSYS , + DFF_DMY , + DFF_DMYY , + DFF_DMMY , + DFF_DMMYY, + DFF_DMMMY , + DFF_DMMMYY, + DFF_DDMMY , + DFF_DDMMMY , + DFF_DDMMMYY , + DFF_DDDMMMY , + DFF_DDDMMMYY , + DFF_MY , + DFF_MD , + DFF_YMD , + DFF_YYMD , + DF_END , +// Kompatibilitaet: + DF_SSYS = DFF_SSYS, + DF_LSYS = DFF_LSYS, + DF_SHORT = DFF_DMY, + DF_SCENT = DFF_DMYY, + DF_LMON = DFF_DMMYY, + DF_LMONTH = DFF_DMMMYY, + DF_LDAYMON = DFF_DDMMMYY, + DF_LDAYMONTH= DFF_DDDMMMYY +}; + +enum SwTimeFormat +{ + TF_BEGIN, + TF_SYSTEM=TF_BEGIN, + TF_SSMM_24, + TF_SSMM_12, + TF_END +}; + +enum SwTimeSubFormat +{ + TIME_FIX, + TIME_VAR +}; + +enum SwDateSubFormat +{ + DATE_FIX, + DATE_VAR +}; + +/*-------------------------------------------------------------------- + Beschreibung: Datum/Uhrzeitfeld + --------------------------------------------------------------------*/ + +class SwDateTimeFieldType : public SwValueFieldType +{ +public: + SwDateTimeFieldType(SwDoc* pDoc); + + virtual SwFieldType* Copy() const { DBG_BF_ASSERT(0, "STRIP"); return NULL; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: Datum/Uhrzeitfeld + --------------------------------------------------------------------*/ + +class SwDateTimeField : public SwValueField +{ + USHORT nSubType; + long nOffset; // Offset in Minuten + +public: + SwDateTimeField(SwDateTimeFieldType* pType, USHORT nSubType = DATEFLD, + ULONG nFmt = 0, USHORT nLng = 0); + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nSub); //SW40.SDW + + virtual double GetValue() const; + + + inline BOOL IsDate() const + { return (nSubType & DATEFLD) != 0; } + + inline void SetOffset(long nMinutes) { nOffset = nMinutes; } + inline long GetOffset() const { return nOffset; } + + Date GetDate(BOOL bUseOffset = FALSE) const; + Time GetTime(BOOL bUseOffset = FALSE) const; + void SetDateTime(const DateTime& rDT); + static double GetDateTime(SwDoc* pDoc, const DateTime& rDT); + + virtual String Expand() const; + virtual SwField* Copy() const; + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +} //namespace binfilter +#endif // _FLDDAT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/flddropdown.hxx b/inc/bf_sw/flddropdown.hxx new file mode 100644 index 000000000..cc6b56c91 --- /dev/null +++ b/inc/bf_sw/flddropdown.hxx @@ -0,0 +1,224 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FLDDROPDOWN_HXX +#define _FLDDROPDOWN_HXX + +#include <bf_svtools/bf_solar.h> + +#include <com/sun/star/uno/Sequence.hxx> +#include <fldbas.hxx> +#include <vector> +namespace binfilter { + +using namespace ::com::sun::star::uno; +using namespace std; + +using rtl::OUString; + +/** + Field type for dropdown boxes. +*/ +class SwDropDownFieldType : public SwFieldType +{ +public: + /** + Constructor + */ + SwDropDownFieldType(); + + /** + Destructor + */ + virtual ~SwDropDownFieldType(); + + /** + Create a copy of this field type. + + @return a copy of this type + */ + virtual SwFieldType * Copy () const; +}; + +/** + Dropdown field. + + The dropdown field contains a list of strings. At most one of them + can be selected. +*/ +class SwDropDownField : public SwField +{ + /** + the possible values (aka items) of the dropdown box + */ + vector<String> aValues; + + /** + the selected item + */ + String aSelectedItem; + + /** + the name of the field + */ + String aName; + +public: + /** + Constructor + + @param pTyp field type for this field + */ + SwDropDownField(SwFieldType * pTyp); + + /** + Copy constructor + + @param rSrc dropdown field to copy + */ + SwDropDownField(const SwDropDownField & rSrc); + + /** + Destructor + */ + virtual ~SwDropDownField(); + + /** + Expands the field. + + The expanded value of the field is the value of the selected + item. If no item is selected, an empty string is returned. + + @return the expanded value of the field + */ + virtual String Expand() const; + + /** + Creates a copy of this field. + + @return the copy of this field + */ + virtual SwField * Copy() const; + + /** + Returns the selected value. + + @see Expand + + @return the selected value + */ + virtual const String & GetPar1() const; + + /** + Returns the name of the field. + + @return the name of the field + */ + virtual String GetPar2() const; + + /** + Sets the selected value. + + If rStr is an item of the field that item will be + selected. Otherwise no item will be selected, i.e. the + resulting selection will be empty. + */ + virtual void SetPar1(const String & rStr); + + /** + Sets the name of the field. + + @param rStr the new name of the field + */ + virtual void SetPar2(const String & rStr); + + /** + Sets the items of the dropdown box. + + After setting the items the selection will be empty. + + @param rItems the new items + */ + void SetItems(const Sequence<OUString> & rItems); + + /** + Returns the items of the dropdown box. + + @return the items of the dropdown box + */ + Sequence<OUString> GetItemSequence() const; + + /** + Returns the selected item. + + @return the selected item + */ + const String & GetSelectedItem() const; + + /** + Returns the name of the field. + + @return the name of the field + */ + const String & GetName() const; + + /** + Sets the selected item. + + If rItem is found in this dropdown field it is selected. If + rItem is not found the selection will be empty. + + @param rItem the item to be set + + @retval TRUE the selected item was successfully set + @retval TRUE failure (empty selection) + */ + BOOL SetSelectedItem(const String & rItem); + + /** + Sets the name of the field. + + @param rName the new name of the field + */ + void SetName(const String & rName); + + /** + API: Gets a property value from the dropdown field. + + @param rVal return value + @param nMId + - FIELD_PROP_PAR1 Get selected item (String) + - FIELD_PROP_STRINGS Get all items (Sequence) + */ + virtual BOOL QueryValue(Any &rVal, BYTE nMId) const; + + /** + API: Sets a property value on the dropdown field. + + @param rVal value to set + @param nMId + - FIELD_PROP_PAR1 Set selected item (String) + - FIELD_PROP_STRINGS Set all items (Sequence) + */ + virtual BOOL PutValue(const Any &rVal, BYTE nMId); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fldupde.hxx b/inc/bf_sw/fldupde.hxx new file mode 100644 index 000000000..a5500902b --- /dev/null +++ b/inc/bf_sw/fldupde.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FLDUPDE_HXX +#define _FLDUPDE_HXX +namespace binfilter { + +enum SwFldUpdateFlags +{ + AUTOUPD_OFF, + AUTOUPD_FIELD_ONLY, + AUTOUPD_FIELD_AND_CHARTS, + AUTOUPD_GLOBALSETTING +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/flyenum.hxx b/inc/bf_sw/flyenum.hxx new file mode 100644 index 000000000..2108de106 --- /dev/null +++ b/inc/bf_sw/flyenum.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FLYENUM_HXX +#define _FLYENUM_HXX +namespace binfilter { + +enum FlyCntType +{ + FLYCNTTYPE_ALL = 0, + FLYCNTTYPE_FRM, + FLYCNTTYPE_GRF, + FLYCNTTYPE_OLE + +}; + +//Returnwerte fuer Chainable und Chain +#define SW_CHAIN_OK 0 +#define SW_CHAIN_NOT_EMPTY 1 //Nur leere Frames duerfen connected werden +#define SW_CHAIN_IS_IN_CHAIN 2 //Destination ist bereits in einer chain +#define SW_CHAIN_WRONG_AREA 3 //Destination steht in einer nicht erlaubten + //Section (Kopf-/Fusszeile) +#define SW_CHAIN_NOT_FOUND 4 //Destination und/oder Source nicht gefunden +#define SW_CHAIN_SOURCE_CHAINED 5 //Source hat bereits einen Follow +#define SW_CHAIN_SELF 6 //Sich selbst zu verketten ist + //natuerlich nicht erleubt. + + + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtanchr.hxx b/inc/bf_sw/fmtanchr.hxx new file mode 100644 index 000000000..cb74e22fb --- /dev/null +++ b/inc/bf_sw/fmtanchr.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTANCHR_HXX +#define _FMTANCHR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <swtypes.hxx> +#include <format.hxx> + +class IntlWrapper; +namespace binfilter { + +struct SwPosition; + +#define IVER_FMTANCHOR_LONGIDX ((USHORT)1) + +//FlyAnchor, Anker des Freifliegenden Rahmen ---- + +class SwFmtAnchor: public SfxPoolItem +{ + SwPosition *pCntntAnchor; //0 Fuer Seitengebundene Rahmen. + //Index fuer Absatzgebundene Rahmen. + //Position fuer Zeichengebundene Rahmen + RndStdIds nAnchorId; + USHORT nPageNum; //Seitennummer bei Seitengeb. Rahmen. + +public: + SwFmtAnchor( RndStdIds eRnd = FLY_PAGE, USHORT nPageNum = 0 ); + SwFmtAnchor( const SwFmtAnchor &rCpy ); + ~SwFmtAnchor(); + + // Zuweisungsoperator + SwFmtAnchor &operator=( const SwFmtAnchor& ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + RndStdIds GetAnchorId() const { return nAnchorId; } + USHORT GetPageNum() const { return nPageNum; } + const SwPosition *GetCntntAnchor() const { return pCntntAnchor; } + + void SetPageNum( USHORT nNew ) { nPageNum = nNew; } + + void SetType( RndStdIds nRndId ) { nAnchorId = nRndId; } + void SetAnchor( const SwPosition *pPos ); +}; + +inline const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const + { return (const SwFmtAnchor&)Get( RES_ANCHOR,bInP); } + + inline const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const + { return aSet.GetAnchor(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtclbl.hxx b/inc/bf_sw/fmtclbl.hxx new file mode 100644 index 000000000..ebb0692f1 --- /dev/null +++ b/inc/bf_sw/fmtclbl.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTCLBL_HXX +#define _FMTCLBL_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/eitem.hxx> +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + + + +class SwFmtNoBalancedColumns : public SfxBoolItem +{ +public: + SwFmtNoBalancedColumns( BOOL bFlag = FALSE ) + : SfxBoolItem( RES_COLUMNBALANCE, bFlag ) {} + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + + +inline const SwFmtNoBalancedColumns &SwAttrSet::GetBalancedColumns(BOOL bInP) const + { return (const SwFmtNoBalancedColumns&)Get( RES_COLUMNBALANCE, bInP ); } + +inline const SwFmtNoBalancedColumns &SwFmt::GetBalancedColumns(BOOL bInP) const + { return aSet.GetBalancedColumns( bInP ); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtclds.hxx b/inc/bf_sw/fmtclds.hxx new file mode 100644 index 000000000..dbc15f42c --- /dev/null +++ b/inc/bf_sw/fmtclds.hxx @@ -0,0 +1,164 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTCLDS_HXX +#define _FMTCLDS_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/color.hxx> +#include <format.hxx> +namespace binfilter { + +//Der ColumnDescriptor -------------------------- + +class SwColumn +{ + USHORT nWish; //Wunschbreite incl. Raender. + //Verhaelt sich proportional zum Verhaeltniss: + //Wunschbreite der Umgebung / aktuelle Breite der Spalte + USHORT nUpper; //Oberer Rand + USHORT nLower; //Unterer Rand + USHORT nLeft; //Linker Rand + USHORT nRight; //Rechter Rand + +public: + SwColumn(); + + BOOL operator==( const SwColumn & ); + + + void SetWishWidth( USHORT nNew ) { nWish = nNew; } + void SetUpper( USHORT nNew ) { nUpper = nNew; } + void SetLower( USHORT nNew ) { nLower = nNew; } + void SetLeft ( USHORT nNew ) { nLeft = nNew; } + void SetRight( USHORT nNew ) { nRight = nNew; } + + USHORT GetWishWidth() const { return nWish; } + USHORT GetUpper() const { return nUpper; } + USHORT GetLower() const { return nLower; } + USHORT GetLeft () const { return nLeft; } + USHORT GetRight() const { return nRight; } +}; + +typedef SwColumn* SwColumnPtr; +SV_DECL_PTRARR_DEL( SwColumns, SwColumnPtr, 0, 2 ) + +enum SwColLineAdj +{ + COLADJ_NONE, + COLADJ_TOP, + COLADJ_CENTER, + COLADJ_BOTTOM +}; + +class SwFmtCol : public SfxPoolItem +{ + ULONG nLineWidth; //width of the separator line + Color aLineColor; //color of the separator line + + BYTE nLineHeight; //Prozentuale Hoehe der Linien + //(Relativ zu der Hoehe der Spalten incl. UL). + SwColLineAdj eAdj; //Linie wird oben, mittig oder unten ausgerichtet. + + SwColumns aColumns; //Informationen fuer die einzelnen Spalten. + USHORT nWidth; //Gesamtwunschbreite aller Spalten. + + BOOL bOrtho; //Nur wenn dieses Flag gesetzt ist wird beim setzen + //der GutterWidth eine 'optische Verteilung' + //vorgenommen. + //Es muss zurueckgesetzt werden wenn an den + //Spaltenbreiten bzw. den Raendern gedreht wird. + //Wenn es wieder gesetzt wird wird automatisch neu + //gemischt (optisch verteilt). + //Das Flag ist initial gesetzt. + + void Calc( USHORT nGutterWidth, USHORT nAct ); + +public: + SwFmtCol(); + SwFmtCol( const SwFmtCol& ); + ~SwFmtCol(); + + SwFmtCol& operator=( const SwFmtCol& ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + const SwColumns &GetColumns() const { return aColumns; } + SwColumns &GetColumns() { return aColumns; } + USHORT GetNumCols() const { return aColumns.Count(); } + ULONG GetLineWidth() const { return nLineWidth;} + const Color& GetLineColor() const { return aLineColor;} + + + SwColLineAdj GetLineAdj() const { return eAdj; } + BOOL IsOrtho() const { return bOrtho; } + USHORT GetWishWidth() const { return nWidth; } + BYTE GetLineHeight()const { return nLineHeight; } + + //Return USHRT_MAX wenn uneindeutig. + //Return die kleinste Breite wenn bMin True ist. + USHORT GetGutterWidth( BOOL bMin = FALSE ) const; + + void SetLineWidth(ULONG nWidth_) { nLineWidth = nWidth_;} + void SetLineColor(const Color& rCol ) { aLineColor = rCol;} + void SetLineHeight( BYTE nNew ) { nLineHeight = nNew; } + void SetLineAdj( SwColLineAdj eNew ){ eAdj = eNew; } + void SetWishWidth( USHORT nNew ) { nWidth = nNew; } + + //Mit dieser Funktion koennen die Spalten (immer wieder) initialisert + //werden. Das Ortho Flag wird automatisch gesetzt. + void Init( USHORT nNumCols, USHORT nGutterWidth, USHORT nAct ); + + //Stellt die Raender fuer die Spalten in aColumns ein. + //Wenn das Flag bOrtho gesetzt ist, werden die Spalten neu optisch + //verteilt. Ist das Flag nicht gesetzt werden die Spaltenbreiten nicht + //veraendert und die Raender werden einfach eingestellt. + + //Verteilt ebenfalls automatisch neu wenn das Flag gesetzt wird; + //nur dann wird auch der zweite Param. benoetigt und beachtet. + + //Fuer den Reader + void _SetOrtho( BOOL bNew ) { bOrtho = bNew; } + + //Berechnet die aktuelle Breite der Spalte nCol. + //Das Verhaeltniss von Wunschbreite der Spalte zum Returnwert ist + //proportional zum Verhaeltniss des Gesamtwunschwertes zu nAct. + USHORT CalcColWidth( USHORT nCol, USHORT nAct ) const; + + //Wie oben, aber es wir die Breite der PrtArea - also das was fuer + //den Anwender die Spalte ist - geliefert. +}; + +inline const SwFmtCol &SwAttrSet::GetCol(BOOL bInP) const + { return (const SwFmtCol&)Get( RES_COL,bInP); } + +inline const SwFmtCol &SwFmt::GetCol(BOOL bInP) const + { return aSet.GetCol(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtcnct.hxx b/inc/bf_sw/fmtcnct.hxx new file mode 100644 index 000000000..543aecb66 --- /dev/null +++ b/inc/bf_sw/fmtcnct.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTCNCT_HXX +#define _FMTCNCT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> + +class IntlWrapper; + +namespace binfilter { + +class SwFlyFrmFmt; + +//Verbindung (Textfluss) zwischen zwei FlyFrms + +class SwFmtChain: public SfxPoolItem +{ + SwClient aPrev, //Vorgaenger (SwFlyFrmFmt), wenn es diesen gibt. + aNext; //Nachfolger (SwFlyFrmFmt), wenn es diesen gibt. + +public: + SwFmtChain() : SfxPoolItem( RES_CHAIN ) {} + SwFmtChain( const SwFmtChain &rCpy ); + + inline SwFmtChain &operator=( const SwFmtChain& ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + + SwFlyFrmFmt* GetPrev() const { return (SwFlyFrmFmt*)aPrev.GetRegisteredIn(); } + SwFlyFrmFmt* GetNext() const { return (SwFlyFrmFmt*)aNext.GetRegisteredIn(); } + + void SetPrev( SwFlyFrmFmt *pFmt ); + void SetNext( SwFlyFrmFmt *pFmt ); +}; + +SwFmtChain &SwFmtChain::operator=( const SwFmtChain &rCpy ) +{ + SetPrev( rCpy.GetPrev() ); + SetNext( rCpy.GetNext() ); + return *this; +} + + +inline const SwFmtChain &SwAttrSet::GetChain(BOOL bInP) const + { return (const SwFmtChain&)Get( RES_CHAIN,bInP); } + +inline const SwFmtChain &SwFmt::GetChain(BOOL bInP) const + { return aSet.GetChain(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtcntnt.hxx b/inc/bf_sw/fmtcntnt.hxx new file mode 100644 index 000000000..3f138639e --- /dev/null +++ b/inc/bf_sw/fmtcntnt.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTCNTNT_HXX +#define _FMTCNTNT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> +namespace binfilter { + +class SwNodeIndex; +class SwStartNode; + +//Cntnt, Inhalt des Frame (Header, Footer, Fly) ---- + +class SwFmtCntnt: public SfxPoolItem +{ + SwNodeIndex *pStartNode; + + SwFmtCntnt &operator=( const SwFmtCntnt & ); //Kopieren verboten + +public: + SwFmtCntnt( const SwStartNode* pStartNode = 0 ); + SwFmtCntnt( const SwFmtCntnt &rCpy ); + ~SwFmtCntnt(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + const SwNodeIndex *GetCntntIdx() const { return pStartNode; } + void SetNewCntntIdx( const SwNodeIndex *pIdx ); +}; + +inline const SwFmtCntnt &SwAttrSet::GetCntnt(BOOL bInP) const + { return (const SwFmtCntnt&)Get( RES_CNTNT,bInP); } + +inline const SwFmtCntnt &SwFmt::GetCntnt(BOOL bInP) const + { return aSet.GetCntnt(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtcol.hxx b/inc/bf_sw/fmtcol.hxx new file mode 100644 index 000000000..b055222b3 --- /dev/null +++ b/inc/bf_sw/fmtcol.hxx @@ -0,0 +1,218 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTCOL_HXX +#define _FMTCOL_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <format.hxx> +#include <swtypes.hxx> // fuer MAXLEVEL +#include <osl/diagnose.h> +namespace binfilter { + +class SwDoc; // fuer friend + +class SwFmtColl : public SwFmt +{ +protected: + SwFmtColl( SwAttrPool& rPool, const sal_Char* pFmtName, + const USHORT* pWhichRanges, SwFmtColl* pDerFrom, + USHORT nFmtWhich ) + : SwFmt( rPool, pFmtName, pWhichRanges, pDerFrom, nFmtWhich ) + { SetAuto( FALSE ); } + + SwFmtColl( SwAttrPool& rPool, const String &rFmtName, + const USHORT* pWhichRanges, SwFmtColl* pDerFrom, + USHORT nFmtWhich ) + : SwFmt( rPool, rFmtName, pWhichRanges, pDerFrom, nFmtWhich ) + { SetAuto( FALSE ); } + + +private: + // erstmal wird nicht kopiert und nicht zugewiesen + SwFmtColl(const SwFmtColl & ); + const SwFmtColl &operator=(const SwFmtColl &); +}; + + +class SwTxtFmtColl: public SwFmtColl +{ + friend class SwDoc; +protected: + BYTE nOutlineLevel; + SwTxtFmtColl *pNextTxtFmtColl; + + SwTxtFmtColl( SwAttrPool& rPool, const sal_Char* pFmtCollName, + SwTxtFmtColl* pDerFrom = 0, + USHORT nFmtWh = RES_TXTFMTCOLL ) + : SwFmtColl( rPool, pFmtCollName, aTxtFmtCollSetRange, + pDerFrom, nFmtWh ), + nOutlineLevel( NO_NUMBERING ) + { pNextTxtFmtColl = this; } + + SwTxtFmtColl( SwAttrPool& rPool, const String &rFmtCollName, + SwTxtFmtColl* pDerFrom = 0, + USHORT nFmtWh = RES_TXTFMTCOLL ) + : SwFmtColl( rPool, rFmtCollName, aTxtFmtCollSetRange, + pDerFrom, nFmtWh ), + nOutlineLevel( NO_NUMBERING ) + { pNextTxtFmtColl = this; } + +public: + + // zum "abfischen" von UL-/LR-/FontHeight Aenderungen + virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + + TYPEINFO(); //Bereits in Basisklasse Client drin. + + inline void SetOutlineLevel( BYTE ); + inline BYTE GetOutlineLevel() const { return nOutlineLevel; } + + inline void SetNextTxtFmtColl(SwTxtFmtColl& rNext); + SwTxtFmtColl& GetNextTxtFmtColl() const { return *pNextTxtFmtColl; } + + BOOL IsAtDocNodeSet() const; +}; + +typedef SwTxtFmtColl* SwTxtFmtCollPtr; +SV_DECL_PTRARR(SwTxtFmtColls,SwTxtFmtCollPtr,2,4) + + +class SwGrfFmtColl: public SwFmtColl +{ + friend class SwDoc; +protected: + SwGrfFmtColl( SwAttrPool& rPool, const sal_Char* pFmtCollName, + SwGrfFmtColl* pDerFrom = 0 ) + : SwFmtColl( rPool, pFmtCollName, aGrfFmtCollSetRange, + pDerFrom, RES_GRFFMTCOLL ) + {} + + SwGrfFmtColl( SwAttrPool& rPool, const String &rFmtCollName, + SwGrfFmtColl* pDerFrom = 0 ) + : SwFmtColl( rPool, rFmtCollName, aGrfFmtCollSetRange, + pDerFrom, RES_GRFFMTCOLL ) + {} + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. +}; + +typedef SwGrfFmtColl* SwGrfFmtCollPtr; +SV_DECL_PTRARR(SwGrfFmtColls,SwGrfFmtCollPtr,2,4) + + + +//FEATURE::CONDCOLL +// --------- Bedingte Vorlagen ------------------------------- + +enum Master_CollConditions +{ + PARA_IN_LIST = 0x0001, + PARA_IN_OUTLINE = 0x0002, + PARA_IN_FRAME = 0x0004, + PARA_IN_TABLEHEAD = 0x0008, + PARA_IN_TABLEBODY = 0x0010, + PARA_IN_SECTION = 0x0020, + PARA_IN_FOOTENOTE = 0x0040, + PARA_IN_FOOTER = 0x0080, + PARA_IN_HEADER = 0x0100, + PARA_IN_ENDNOTE = 0x0200, + // ... + USRFLD_EXPRESSION = (int)0x8000 +}; + + +class SwCollCondition : public SwClient +{ + ULONG nCondition; + union + { + ULONG nSubCondition; + String* pFldExpression; + } aSubCondition; + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + + SwCollCondition( SwTxtFmtColl* pColl, ULONG nMasterCond, + ULONG nSubCond = 0 ); + + virtual ~SwCollCondition(); + + ULONG GetCondition() const { return nCondition; } + ULONG GetSubCondition() const { return aSubCondition.nSubCondition; } + const String* GetFldExpression() const + { return aSubCondition.pFldExpression; } + + void SetCondition( ULONG nCond, ULONG nSubCond ); + SwTxtFmtColl* GetTxtFmtColl() const { return (SwTxtFmtColl*)GetRegisteredIn(); } +}; + + +typedef SwCollCondition* SwCollConditionPtr; +SV_DECL_PTRARR_DEL( SwFmtCollConditions, SwCollConditionPtr, 0, 5 ) + +class SwConditionTxtFmtColl : public SwTxtFmtColl +{ + friend class SwDoc; +protected: + SwFmtCollConditions aCondColls; + + SwConditionTxtFmtColl( SwAttrPool& rPool, const sal_Char* pFmtCollName, + SwTxtFmtColl* pDerFrom = 0 ) + : SwTxtFmtColl( rPool, pFmtCollName, pDerFrom, RES_CONDTXTFMTCOLL ) + {} + SwConditionTxtFmtColl( SwAttrPool& rPool, const String &rFmtCollName, + SwTxtFmtColl* pDerFrom = 0 ) + : SwTxtFmtColl( rPool, rFmtCollName, pDerFrom, RES_CONDTXTFMTCOLL ) + {} + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + virtual ~SwConditionTxtFmtColl() {} + + const SwFmtCollConditions& GetCondColls() const { return aCondColls; } + +}; + +//FEATURE::CONDCOLL + +// ------------- Inline Implementierungen -------------------- + +inline void SwTxtFmtColl::SetNextTxtFmtColl( SwTxtFmtColl& rNext ) +{ + pNextTxtFmtColl = &rNext; +} + +inline void SwTxtFmtColl::SetOutlineLevel( BYTE nLevel ) +{ + OSL_ENSURE( nLevel < MAXLEVEL || nLevel == NO_NUMBERING , + "SwTxtFmtColl: Level too low" ); + nOutlineLevel = nLevel; +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmteiro.hxx b/inc/bf_sw/fmteiro.hxx new file mode 100644 index 000000000..301ab348e --- /dev/null +++ b/inc/bf_sw/fmteiro.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTEIRO_HXX +#define _FMTEIRO_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/eitem.hxx> +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + + + +class SwFmtEditInReadonly : public SfxBoolItem +{ +public: + SwFmtEditInReadonly( USHORT nId = RES_EDIT_IN_READONLY, + BOOL bPrt = FALSE ) : SfxBoolItem( nId, bPrt ) {} + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +inline const SwFmtEditInReadonly &SwAttrSet::GetEditInReadonly(BOOL bInP) const + { return (const SwFmtEditInReadonly&)Get( RES_EDIT_IN_READONLY,bInP); } + +inline const SwFmtEditInReadonly &SwFmt::GetEditInReadonly(BOOL bInP) const + { return aSet.GetEditInReadonly(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtflcnt.hxx b/inc/bf_sw/fmtflcnt.hxx new file mode 100644 index 000000000..2d4be515b --- /dev/null +++ b/inc/bf_sw/fmtflcnt.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFLCNT_HXX +#define _FMTFLCNT_HXX + + +#include <bf_svtools/poolitem.hxx> +namespace binfilter { + +class SwFrmFmt; +class SwTxtFlyCnt; +// ATT_FLYCNT ******************************************************* + +class SwFmtFlyCnt : public SfxPoolItem +{ + friend class SwTxtFlyCnt; + SwTxtFlyCnt* pTxtAttr; // mein TextAttribut + SwFrmFmt* pFmt; // mein Fly/DrawFrame-Format + // geschuetzter CopyCtor + SwFmtFlyCnt& operator=(const SwFmtFlyCnt& rFlyCnt); + +public: + SwFmtFlyCnt( SwFrmFmt *pFrmFmt ); + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const { DBG_BF_ASSERT(0, "STRIP"); return 0; } + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + inline SwFrmFmt *GetFrmFmt() const { return pFmt; } + // fuer Undo: loesche "logisch" das FlyFrmFormat, wird sich im + // Undo-Object gemerkt. + inline void SetFlyFmt( SwFrmFmt* pNew = 0 ) { pFmt = pNew; } + + const SwTxtFlyCnt *GetTxtFlyCnt() const { return pTxtAttr; } + SwTxtFlyCnt *GetTxtFlyCnt() { return pTxtAttr; } +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtfld.hxx b/inc/bf_sw/fmtfld.hxx new file mode 100644 index 000000000..b2f49e470 --- /dev/null +++ b/inc/bf_sw/fmtfld.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFLD_HXX +#define _FMTFLD_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/poolitem.hxx> +#include <calbck.hxx> +namespace binfilter { + +class SwField; +class SwTxtFld; +// ATT_FLD *********************************** + +class SwFmtFld : public SfxPoolItem, public SwClient +{ + friend class SwTxtFld; + friend void _InitCore(); + + SwField *pField; + SwTxtFld* pTxtAttr; // mein TextAttribut + SwFmtFld(); // das default-Attibut + + // geschuetzter CopyCtor + SwFmtFld& operator=(const SwFmtFld& rFld); +public: + TYPEINFO(); + + SwFmtFld( const SwField &rFld ); + SwFmtFld( const SwFmtFld& rAttr ); + ~SwFmtFld(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const { DBG_BF_ASSERT(0, "STRIP"); return 0; } + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + const SwField *GetFld() const { return pField; } + SwField *GetFld() { return pField; } + + const SwTxtFld *GetTxtFld() const { return pTxtAttr; } + SwTxtFld *GetTxtFld() { return pTxtAttr; } + + BOOL IsFldInDoc() const; + BOOL IsProtect() const; +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtfordr.hxx b/inc/bf_sw/fmtfordr.hxx new file mode 100644 index 000000000..24b106d66 --- /dev/null +++ b/inc/bf_sw/fmtfordr.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFORDR_HXX +#define _FMTFORDR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/eitem.hxx> +#include <format.hxx> +namespace binfilter { + +//Die FillOrder --------------------------------- + +enum SwFillOrder +{ + SW_FILL_ORDER_BEGIN, + ATT_TOP_DOWN = SW_FILL_ORDER_BEGIN, + ATT_BOTTOM_UP, + ATT_LEFT_TO_RIGHT, + ATT_RIGHT_TO_LEFT, + SW_FILL_ORDER_END +}; + +class SwFmtFillOrder: public SfxEnumItem +{ +public: + SwFmtFillOrder( SwFillOrder = ATT_TOP_DOWN ); + inline SwFmtFillOrder &operator=( const SwFmtFillOrder &rCpy ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetValueCount() const{DBG_BF_ASSERT(0, "STRIP"); return 0;} + + SwFillOrder GetFillOrder() const { return SwFillOrder(GetValue()); } + void SetFillOrder( const SwFillOrder eNew ) { SetValue( USHORT(eNew) ); } +}; + +inline SwFmtFillOrder &SwFmtFillOrder::operator=( const SwFmtFillOrder &rCpy ) +{ + SetValue( rCpy.GetValue() ); + return *this; +} + +inline const SwFmtFillOrder &SwAttrSet::GetFillOrder(BOOL bInP) const + { return (const SwFmtFillOrder&)Get( RES_FILL_ORDER,bInP); } + +inline const SwFmtFillOrder &SwFmt::GetFillOrder(BOOL bInP) const + { return aSet.GetFillOrder(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtfsize.hxx b/inc/bf_sw/fmtfsize.hxx new file mode 100644 index 000000000..f1b005fe1 --- /dev/null +++ b/inc/bf_sw/fmtfsize.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFSIZE_HXX +#define _FMTFSIZE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/gen.hxx> +#include <swtypes.hxx> +#include <format.hxx> + +class IntlWrapper; + +namespace binfilter { + +//Die Framesize --------------------------------- + +enum SwFrmSize +{ + ATT_VAR_SIZE, //Frm ist in der Var-Richtung variabel + ATT_FIX_SIZE, //Frm ist in der Var-Richtung unbeweglich + ATT_MIN_SIZE //Der Wert in der Var-Richtung beschreibt eine + //Minimalgroesse, die nicht unter- wohl aber + //ueberschritten werden kann. +}; + +class SwFmtFrmSize: public SfxPoolItem +{ + Size aSize; + SwFrmSize eFrmSize; + BYTE nWidthPercent; //Fuer Tabellen kann die Breite in Prozent + BYTE nHeightPercent; //angegeben sein. + //Fuer Rahmen koennen Hoehe und/oder Breite + //in Prozent angegeben sein. Wenn nur eine + //der Angaben in Prozent angeben ist, kann + //durch den ausgezeichneten Wert 0xFF in der + //anderen Prozentangabe bestimmt werden, das + //sich diese Richtung proportional zur anderen + //verhaelt. Basis fuer die Umrechnung sind fuer + //diesen Fall die Angaben in der Size. + //Die Prozentwerte beziehen sich immer auf die + //Umgebung in der das Objekt steht (PrtArea) + //Auf die Bildschirmbreite abzueglich Raender + //in der BrowseView wenn die Umgebung die Seite + //ist. +public: + SwFmtFrmSize( SwFrmSize eSize = ATT_VAR_SIZE, + SwTwips nWidth = 0, SwTwips nHeight = 0 ); + SwFmtFrmSize& operator=( const SwFmtFrmSize& rCpy ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual USHORT GetVersion( USHORT nFFVer ) const; + + SwFrmSize GetSizeType() const { return eFrmSize; } + void SetSizeType( SwFrmSize eSize ) { eFrmSize = eSize; } + + const Size& GetSize() const { return aSize; } + void SetSize( const Size &rNew ) { aSize = rNew; } + + SwTwips GetHeight() const { return aSize.Height(); } + SwTwips GetWidth() const { return aSize.Width(); } + void SetHeight( const SwTwips nNew ) { aSize.Height() = nNew; } + void SetWidth ( const SwTwips nNew ) { aSize.Width() = nNew; } + + BYTE GetHeightPercent() const{ return nHeightPercent; } + BYTE GetWidthPercent() const { return nWidthPercent; } + void SetHeightPercent( BYTE n ) { nHeightPercent = n; } + void SetWidthPercent ( BYTE n ) { nWidthPercent = n; } + + Size GetSizeConvertedFromSw31( const SvxLRSpaceItem *pLRSpace, + const SvxULSpaceItem *pULSpace ) const; +}; + +inline const SwFmtFrmSize &SwAttrSet::GetFrmSize(BOOL bInP) const + { return (const SwFmtFrmSize&)Get( RES_FRM_SIZE,bInP); } + +inline const SwFmtFrmSize &SwFmt::GetFrmSize(BOOL bInP) const + { return aSet.GetFrmSize(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtftn.hxx b/inc/bf_sw/fmtftn.hxx new file mode 100644 index 000000000..a462fbd3d --- /dev/null +++ b/inc/bf_sw/fmtftn.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFTN_HXX +#define _FMTFTN_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/poolitem.hxx> +namespace binfilter { + +class SwDoc; +class SwTxtFtn; + +// ATT_FTN ********************************************************** + +class SwFmtFtn: public SfxPoolItem +{ + friend class SwTxtFtn; + SwTxtFtn* pTxtAttr; //mein TextAttribut + String aNumber; //Benutzerdefinierte 'Nummer' + USHORT nNumber; //Automatische Nummerierung + BOOL bEndNote; //Ist es eine Endnote? + + // geschuetzter CopyCtor + SwFmtFtn& operator=(const SwFmtFtn& rFtn); + SwFmtFtn( const SwFmtFtn& ); + +public: + SwFmtFtn( BOOL bEndNote = FALSE ); + ~SwFmtFtn() {} + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const {DBG_BF_ASSERT(0, "STRIP"); return 0; } + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + const String &GetNumStr() const { return aNumber; } + const USHORT &GetNumber() const { return nNumber; } + BOOL IsEndNote() const { return bEndNote;} + + void SetNumStr( const String& rStr ) { aNumber = rStr; } + void SetNumber( USHORT nNo ) { nNumber = nNo; } + + void SetNumber( const SwFmtFtn& rFtn ) + { nNumber = rFtn.nNumber; aNumber = rFtn.aNumber; } + + const SwTxtFtn *GetTxtFtn() const { return pTxtAttr; } + SwTxtFtn *GetTxtFtn() { return pTxtAttr; } + + + // returnt den anzuzeigenden String der Fuss-/Endnote + String GetViewNumStr( const SwDoc& rDoc, BOOL bInclStrs = FALSE ) const; +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtftntx.hxx b/inc/bf_sw/fmtftntx.hxx new file mode 100644 index 000000000..cf80a5467 --- /dev/null +++ b/inc/bf_sw/fmtftntx.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTFTNTX_HXX +#define _FMTFTNTX_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/eitem.hxx> +#include <hintids.hxx> +#include <format.hxx> +#include <numrule.hxx> +namespace binfilter { + + +enum SwFtnEndPosEnum +{ + FTNEND_ATPGORDOCEND, // at page or document end + FTNEND_ATTXTEND, // at end of the current text end + FTNEND_ATTXTEND_OWNNUMSEQ, // -""- and with own number sequence + FTNEND_ATTXTEND_OWNNUMANDFMT, // -""- and with onw numberformat + FTNEND_ATTXTEND_END +}; + + +class SwFmtFtnEndAtTxtEnd : public SfxEnumItem +{ + String sPrefix; + String sSuffix; + SvxNumberType aFmt; + USHORT nOffset; + +protected: + SwFmtFtnEndAtTxtEnd( USHORT nWhich, SwFtnEndPosEnum ePos ) + : SfxEnumItem( nWhich, ePos ), nOffset( 0 ) + {} + SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd& rAttr ) + : SfxEnumItem( rAttr ) + , sPrefix( rAttr.sPrefix ) + , sSuffix( rAttr.sSuffix ) + , aFmt( rAttr.aFmt ) + , nOffset( rAttr.nOffset ) + {} + +public: + virtual USHORT GetValueCount() const{DBG_BF_ASSERT(0, "STRIP"); return 0;} + virtual SfxPoolItem* Create(SvStream &, USHORT nVer ) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + virtual int operator==( const SfxPoolItem& ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + inline BOOL IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); } + + SwFmtFtnEndAtTxtEnd & operator=( const SwFmtFtnEndAtTxtEnd & rAttr ); + + sal_Int16 GetNumType() const { return aFmt.GetNumberingType(); } + void SetNumType( sal_Int16 eType ) { aFmt.SetNumberingType(eType); } + + const SvxNumberType& GetSwNumType() const { return aFmt; } + + USHORT GetOffset() const { return nOffset; } + void SetOffset( USHORT nOff ) { nOffset = nOff; } + + const String& GetPrefix() const { return sPrefix; } + void SetPrefix(const String& rSet) { sPrefix = rSet; } + + const String& GetSuffix() const { return sSuffix; } + void SetSuffix(const String& rSet) { sSuffix = rSet; } +}; + +class SwFmtFtnAtTxtEnd : public SwFmtFtnEndAtTxtEnd +{ +public: + SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND ) + : SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND, ePos ) + {} + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; +}; + +class SwFmtEndAtTxtEnd : public SwFmtFtnEndAtTxtEnd +{ +public: + SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND ) + : SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND, ePos ) + { + SetNumType( SVX_NUM_ROMAN_LOWER ); + } + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; +}; + +inline const SwFmtFtnAtTxtEnd &SwAttrSet::GetFtnAtTxtEnd(BOOL bInP) const + { return (const SwFmtFtnAtTxtEnd&)Get( RES_FTN_AT_TXTEND, bInP); } +inline const SwFmtEndAtTxtEnd &SwAttrSet::GetEndAtTxtEnd(BOOL bInP) const + { return (const SwFmtEndAtTxtEnd&)Get( RES_END_AT_TXTEND, bInP); } + +inline const SwFmtFtnAtTxtEnd &SwFmt::GetFtnAtTxtEnd(BOOL bInP) const + { return aSet.GetFtnAtTxtEnd(bInP); } +inline const SwFmtEndAtTxtEnd &SwFmt::GetEndAtTxtEnd(BOOL bInP) const + { return aSet.GetEndAtTxtEnd(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmthbsh.hxx b/inc/bf_sw/fmthbsh.hxx new file mode 100644 index 000000000..4f9921e32 --- /dev/null +++ b/inc/bf_sw/fmthbsh.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTHBSH_HXX +#define _FMTHBSH_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/poolitem.hxx> +namespace binfilter { + +// ATT_SOFTHYPH ****************************** +// Attribut fuer benutzerdefinierte Trennstellen. + +class SwFmtSoftHyph : public SfxPoolItem +{ +public: + SwFmtSoftHyph(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const{DBG_BF_ASSERT(0, "STRIP"); return 0;}; + virtual SfxPoolItem* Clone( SfxItemPool* /*pPool = 0*/ ) const{DBG_BF_ASSERT(0, "STRIP");return NULL; }; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + inline SwFmtSoftHyph& operator=(const SwFmtSoftHyph& /*rSH*/) { + return *this; + } +}; + +// ATT_HARDBLANK ****************************** +// Attribut fuer geschuetzte Leerzeichen. + +class SwFmtHardBlank : public SfxPoolItem +{ + sal_Unicode cChar; +public: + SwFmtHardBlank( sal_Unicode cCh, BOOL bCheck = TRUE ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const{DBG_BF_ASSERT(0, "STRIP"); return 0;}; + virtual SfxPoolItem* Clone( SfxItemPool* /*pPool = 0*/ ) const{DBG_BF_ASSERT(0, "STRIP"); return NULL;}; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + virtual USHORT GetVersion( USHORT nFFVer ) const; + + inline sal_Unicode GetChar() const { return cChar; } + inline SwFmtHardBlank& operator=(const SwFmtHardBlank& rHB) + { cChar = rHB.GetChar(); return *this; } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmthdft.hxx b/inc/bf_sw/fmthdft.hxx new file mode 100644 index 000000000..70aca017c --- /dev/null +++ b/inc/bf_sw/fmthdft.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTHDFT_HXX +#define _FMTHDFT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + +class SwFrmFmt; + + + +//Kopfzeile, fuer Seitenformate +//Client von FrmFmt das den Header beschreibt. + +class SwFmtHeader: public SfxPoolItem, public SwClient +{ + BOOL bActive; //Nur zur Steuerung (Erzeugung des Inhaltes) + +public: + SwFmtHeader( BOOL bOn = FALSE ); + SwFmtHeader( SwFrmFmt *pHeaderFmt ); + SwFmtHeader( const SwFmtHeader &rCpy ); + ~SwFmtHeader(); + SwFmtHeader& operator=( const SwFmtHeader &rCpy ); + + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)pRegisteredIn; } + + BOOL IsActive() const { return bActive; } + void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } +}; + +//Fusszeile, fuer Seitenformate +//Client von FrmFmt das den Footer beschreibt. + +class SwFmtFooter: public SfxPoolItem, public SwClient +{ + BOOL bActive; //Nur zur Steuerung (Erzeugung des Inhaltes) + +public: + SwFmtFooter( BOOL bOn = FALSE ); + SwFmtFooter( SwFrmFmt *pFooterFmt ); + SwFmtFooter( const SwFmtFooter &rCpy ); + ~SwFmtFooter(); + SwFmtFooter& operator=( const SwFmtFooter &rCpy ); + + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)pRegisteredIn; } + + BOOL IsActive() const { return bActive; } + void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } +}; + +inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const + { return (const SwFmtHeader&)Get( RES_HEADER,bInP); } +inline const SwFmtFooter &SwAttrSet::GetFooter(BOOL bInP) const + { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); } + +inline const SwFmtHeader &SwFmt::GetHeader(BOOL bInP) const + { return aSet.GetHeader(bInP); } +inline const SwFmtFooter &SwFmt::GetFooter(BOOL bInP) const + { return aSet.GetFooter(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtinfmt.hxx b/inc/bf_sw/fmtinfmt.hxx new file mode 100644 index 000000000..1a2e182d6 --- /dev/null +++ b/inc/bf_sw/fmtinfmt.hxx @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTINFMT_HXX +#define _FMTINFMT_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/poolitem.hxx> + +class IntlWrapper; + +namespace binfilter { + +class SvxMacro; +class SvxMacroTableDtor; +class SwTxtINetFmt; +// ATT_INETFMT ********************************************* + +class SwFmtINetFmt: public SfxPoolItem +{ + friend class SwTxtINetFmt; + + String aURL; // die URL + String aTargetFrame; // in diesen Frame soll die URL + String aINetFmt; + String aVisitedFmt; + String aName; // Name des Links + SvxMacroTableDtor* pMacroTbl; + SwTxtINetFmt* pTxtAttr; // mein TextAttribut + USHORT nINetId; + USHORT nVisitedId; +public: + SwFmtINetFmt( const String& rURL, const String& rTarget ); + SwFmtINetFmt( const SwFmtINetFmt& rAttr ); + SwFmtINetFmt(); // for TypeInfo + virtual ~SwFmtINetFmt(); + + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + virtual USHORT GetVersion( USHORT nFFVer ) const; + + const SwTxtINetFmt* GetTxtINetFmt() const { return pTxtAttr; } + SwTxtINetFmt* GetTxtINetFmt() { return pTxtAttr; } + + const String& GetValue() const { return aURL; } + void SetValue( const String& rS ) { aURL = rS; } + + const String& GetName() const { return aName; } + void SetName( const String& rNm ) { aName = rNm; } + + const String& GetTargetFrame() const { return aTargetFrame; } + void SetTargetFrame( const String& rNm ){ aTargetFrame = rNm; } + + const String& GetINetFmt() const { return aINetFmt; } + void SetINetFmt( const String& rNm ) { aINetFmt = rNm; } + + const String& GetVisitedFmt() const { return aVisitedFmt; } + void SetVisitedFmt( const String& rNm ) { aVisitedFmt = rNm; } + + USHORT GetINetFmtId() const { return nINetId; } + void SetINetFmtId( USHORT nNew ) { nINetId = nNew; } + + USHORT GetVisitedFmtId() const { return nVisitedId; } + void SetVisitedFmtId( USHORT nNew ) { nVisitedId = nNew; } + + // setze eine neue oder loesche die akt. MakroTabelle + const SvxMacroTableDtor* GetMacroTbl() const { return pMacroTbl; } + + // setze / erfrage ein Makro +/*N #i27164#*/ void SetMacro( USHORT nEvent, const SvxMacro& rMacro ); + const SvxMacro* GetMacro( USHORT nEvent ) const; +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtline.hxx b/inc/bf_sw/fmtline.hxx new file mode 100644 index 000000000..bf2194d47 --- /dev/null +++ b/inc/bf_sw/fmtline.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SW_FMTLINE_HXX +#define SW_FMTLINE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> + +class IntlWrapper; + +namespace binfilter { + +class SwFmtLineNumber: public SfxPoolItem +{ + ULONG nStartValue :24; //Startwert fuer den Absatz, 0 == kein Startwert + ULONG bCountLines :1; //Zeilen des Absatzes sollen mitgezaehlt werden. + +public: + SwFmtLineNumber(); + ~SwFmtLineNumber(); + + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream;} + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + ULONG GetStartValue() const { return nStartValue; } + BOOL IsCount() const { return bCountLines != 0; } + + void SetStartValue( ULONG nNew ) { nStartValue = nNew; } + void SetCountLines( BOOL b ) { bCountLines = b; } +}; + +inline const SwFmtLineNumber &SwAttrSet::GetLineNumber(BOOL bInP) const + { return (const SwFmtLineNumber&)Get( RES_LINENUMBER,bInP); } + +inline const SwFmtLineNumber &SwFmt::GetLineNumber(BOOL bInP) const + { return aSet.GetLineNumber(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtlsplt.hxx b/inc/bf_sw/fmtlsplt.hxx new file mode 100644 index 000000000..e15e6a571 --- /dev/null +++ b/inc/bf_sw/fmtlsplt.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTTSPLT_HXX +#define _FMTTSPLT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/eitem.hxx> +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + + +class SwFmtLayoutSplit : public SfxBoolItem +{ +public: + SwFmtLayoutSplit( BOOL bSplit = TRUE ) : SfxBoolItem( RES_LAYOUT_SPLIT, bSplit ) {} + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +inline const SwFmtLayoutSplit &SwAttrSet::GetLayoutSplit(BOOL bInP) const + { return (const SwFmtLayoutSplit&)Get( RES_LAYOUT_SPLIT,bInP); } + +inline const SwFmtLayoutSplit &SwFmt::GetLayoutSplit(BOOL bInP) const + { return aSet.GetLayoutSplit(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtornt.hxx b/inc/bf_sw/fmtornt.hxx new file mode 100644 index 000000000..a08ab1084 --- /dev/null +++ b/inc/bf_sw/fmtornt.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTORNT_HXX +#define _FMTORNT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <swtypes.hxx> +#include <format.hxx> +#include <horiornt.hxx> +#include <orntenum.hxx> +class IntlWrapper; +namespace binfilter { + + + +#define IVER_VERTORIENT_REL ((USHORT)0x0001) + +class SwFmtVertOrient: public SfxPoolItem +{ + SwTwips nYPos; //Enthaelt _immer_ die aktuelle RelPos. + SwVertOrient eOrient; + SwRelationOrient eRelation; +public: + TYPEINFO(); + SwFmtVertOrient( SwTwips nY = 0, SwVertOrient eVert = VERT_NONE, + SwRelationOrient eRel = PRTAREA ); + inline SwFmtVertOrient &operator=( const SwFmtVertOrient &rCpy ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + SwVertOrient GetVertOrient() const { return eOrient; } + SwRelationOrient GetRelationOrient() const { return eRelation; } + void SetVertOrient( SwVertOrient eNew ) { eOrient = eNew; } + void SetRelationOrient( SwRelationOrient eNew ) { eRelation = eNew; } + + SwTwips GetPos() const { return nYPos; } + void SetPos( SwTwips nNew ) { nYPos = nNew; } + + SwTwips GetPosConvertedFromSw31( const SvxULSpaceItem *pULSpace ) const; +}; + +//SwFmtHoriOrient, wie und woran orientiert -- +// sich der FlyFrm in der Hoizontalen ---------- + +#define IVER_HORIORIENT_TOGGLE ((USHORT)0x0001) +#define IVER_HORIORIENT_REL ((USHORT)0x0002) + +class SwFmtHoriOrient: public SfxPoolItem +{ + SwTwips nXPos; //Enthaelt _immer_ die aktuelle RelPos. + SwHoriOrient eOrient; + SwRelationOrient eRelation; + BOOL bPosToggle : 1; // auf geraden Seiten Position spiegeln +public: + TYPEINFO(); + SwFmtHoriOrient( SwTwips nX = 0, SwHoriOrient eHori = HORI_NONE, + SwRelationOrient eRel = PRTAREA, BOOL bPos = FALSE ); + inline SwFmtHoriOrient &operator=( const SwFmtHoriOrient &rCpy ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + SwHoriOrient GetHoriOrient() const { return eOrient; } + SwRelationOrient GetRelationOrient() const { return eRelation; } + void SetHoriOrient( SwHoriOrient eNew ) { eOrient = eNew; } + void SetRelationOrient( SwRelationOrient eNew ) { eRelation = eNew; } + + SwTwips GetPos() const { return nXPos; } + void SetPos( SwTwips nNew ) { nXPos = nNew; } + + SwTwips GetPosConvertedFromSw31( const SvxLRSpaceItem *pLRSpace ) const; + + BOOL IsPosToggle() const { return bPosToggle; } + void SetPosToggle( BOOL bNew ) { bPosToggle = bNew; } +}; + +inline SwFmtVertOrient &SwFmtVertOrient::operator=( const SwFmtVertOrient &rCpy ) +{ + nYPos = rCpy.GetPos(); + eOrient = rCpy.GetVertOrient(); + eRelation = rCpy.GetRelationOrient(); + return *this; +} +inline SwFmtHoriOrient &SwFmtHoriOrient::operator=( const SwFmtHoriOrient &rCpy ) +{ + nXPos = rCpy.GetPos(); + eOrient = rCpy.GetHoriOrient(); + eRelation = rCpy.GetRelationOrient(); + bPosToggle = rCpy.IsPosToggle(); + return *this; +} + +inline const SwFmtVertOrient &SwAttrSet::GetVertOrient(BOOL bInP) const + { return (const SwFmtVertOrient&)Get( RES_VERT_ORIENT,bInP); } +inline const SwFmtHoriOrient &SwAttrSet::GetHoriOrient(BOOL bInP) const + { return (const SwFmtHoriOrient&)Get( RES_HORI_ORIENT,bInP); } + +inline const SwFmtVertOrient &SwFmt::GetVertOrient(BOOL bInP) const + { return aSet.GetVertOrient(bInP); } +inline const SwFmtHoriOrient &SwFmt::GetHoriOrient(BOOL bInP) const + { return aSet.GetHoriOrient(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtpdsc.hxx b/inc/bf_sw/fmtpdsc.hxx new file mode 100644 index 000000000..7e47b2f0c --- /dev/null +++ b/inc/bf_sw/fmtpdsc.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTPDSC_HXX +#define _FMTPDSC_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + +class SwPageDesc; +class SwHistory; +class SwPaM; + + +//Pagedescriptor +//Client vom SwPageDesc der durch das Attribut "beschrieben" wird. + +#define IVER_FMTPAGEDESC_NOAUTO ((USHORT)0x0001) +#define IVER_FMTPAGEDESC_LONGPAGE ((USHORT)0x0002) + +class SwFmtPageDesc : public SfxPoolItem, public SwClient +{ + // diese "Doc"-Funktion ist friend, um nach dem kopieren das + // Auto-Flag setzen zu koennen !! + friend BOOL InsAttr( SwDoc*, const SwPaM &, const SfxItemSet&, USHORT, + SwHistory* ); + SwModify* pDefinedIn; // Verweis auf das Objekt, in dem das + // Attribut gesetzt wurde (CntntNode/Format) + USHORT nNumOffset; // Seitennummer Offset + USHORT nDescNameIdx; // SW3-Reader: Stringpool-Index des Vorlagennamens + +public: + SwFmtPageDesc( const SwPageDesc *pDesc = 0 ); + SwFmtPageDesc( const SwFmtPageDesc &rCpy ); + SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy ); + ~SwFmtPageDesc(); + + TYPEINFO(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); } + const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); } + + USHORT GetNumOffset() const { return nNumOffset; } + void SetNumOffset( USHORT nNum ) { nNumOffset = nNum; } + + // erfrage/setze, wo drin das Attribut verankert ist + inline const SwModify* GetDefinedIn() const { return pDefinedIn; } + void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; } + + // fuer den SW3-Reader: + USHORT GetDescNameIdx() const { return nDescNameIdx; } + void SetDescNameIdx( USHORT n ) { nDescNameIdx = n; } +}; + + +inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(BOOL bInP) const + { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); } + +inline const SwFmtPageDesc &SwFmt::GetPageDesc(BOOL bInP) const + { return aSet.GetPageDesc(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtrfmrk.hxx b/inc/bf_sw/fmtrfmrk.hxx new file mode 100644 index 000000000..b6b738f95 --- /dev/null +++ b/inc/bf_sw/fmtrfmrk.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTRFMRK_HXX +#define _FMTRFMRK_HXX + + +#include <bf_svtools/poolitem.hxx> +namespace binfilter { + +class SwTxtRefMark; +// ATT_REFMARK ******************************************************* + +class SwFmtRefMark : public SfxPoolItem +{ + friend class SwTxtRefMark; + SwTxtRefMark* pTxtAttr; // mein TextAttribut + + // geschuetzter CopyCtor + SwFmtRefMark& operator=(const SwFmtRefMark& rRefMark); + String aRefName; + +public: + SwFmtRefMark( const String& rTxt ); + SwFmtRefMark( const SwFmtRefMark& rRefMark ); + ~SwFmtRefMark( ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const {DBG_BF_ASSERT(0, "STRIP"); return 0; } + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + const SwTxtRefMark *GetTxtRefMark() const { return pTxtAttr; } + SwTxtRefMark *GetTxtRefMark() { return pTxtAttr; } + + inline String &GetRefName() { return aRefName; } + inline const String &GetRefName() const { return aRefName; } +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtruby.hxx b/inc/bf_sw/fmtruby.hxx new file mode 100644 index 000000000..a18bdc68f --- /dev/null +++ b/inc/bf_sw/fmtruby.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTRUBY_HXX +#define _FMTRUBY_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/poolitem.hxx> +namespace binfilter { + +class SwTxtRuby; + +class SwFmtRuby : public SfxPoolItem +{ + friend class SwTxtRuby; + + String sRubyTxt; // the ruby txt + String sCharFmtName; // name of the charformat + SwTxtRuby* pTxtAttr; // the TextAttribut + USHORT nCharFmtId; // PoolId of the charformat + USHORT nPosition; // Position of the Ruby-Character + USHORT nAdjustment; // specific adjustment of the Ruby-Ch. + +public: + SwFmtRuby( const String& rRubyTxt ); + SwFmtRuby( const SwFmtRuby& rAttr ); + virtual ~SwFmtRuby(); + + SwFmtRuby& operator=( const SwFmtRuby& rAttr ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + virtual USHORT GetVersion( USHORT nFFVer ) const; + + const SwTxtRuby* GetTxtRuby() const { return pTxtAttr; } + SwTxtRuby* GetTxtRuby() { return pTxtAttr; } + + const String& GetText() const { return sRubyTxt; } + void SetText( const String& rTxt ) { sRubyTxt = rTxt; } + + const String& GetCharFmtName() const { return sCharFmtName; } + void SetCharFmtName( const String& rNm ) { sCharFmtName = rNm; } + + USHORT GetCharFmtId() const { return nCharFmtId; } + void SetCharFmtId( USHORT nNew ) { nCharFmtId = nNew; } + + USHORT GetPosition() const { return nPosition; } + void SetPosition( USHORT nNew ) { nPosition = nNew; } + + USHORT GetAdjustment() const { return nAdjustment; } + void SetAdjustment( USHORT nNew ) { nAdjustment = nNew; } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmtsrnd.hxx b/inc/bf_sw/fmtsrnd.hxx new file mode 100644 index 000000000..1f48973f7 --- /dev/null +++ b/inc/bf_sw/fmtsrnd.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTSRND_HXX +#define _FMTSRND_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> +#include <bf_svtools/eitem.hxx> +class IntlWrapper; +namespace binfilter { + + + +//SwFmtSurround, wie soll sich der --------------- +// Dokumentinhalt unter dem Rahmen verhalten --- + +enum SwSurround { + SURROUND_BEGIN, + SURROUND_NONE = SURROUND_BEGIN, + SURROUND_THROUGHT, + SURROUND_PARALLEL, + SURROUND_IDEAL, + SURROUND_LEFT, + SURROUND_RIGHT, + SURROUND_END +}; + +class SwFmtSurround: public SfxEnumItem +{ + BOOL bAnchorOnly :1; + BOOL bContour :1; + BOOL bOutside :1; +public: + SwFmtSurround( SwSurround eNew = SURROUND_PARALLEL ); + SwFmtSurround( const SwFmtSurround & ); + inline SwFmtSurround &operator=( const SwFmtSurround &rCpy ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetValueCount() const{DBG_BF_ASSERT(0, "STRIP"); return 0;} + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + + SwSurround GetSurround()const { return SwSurround( GetValue() ); } + BOOL IsAnchorOnly() const { return bAnchorOnly; } + BOOL IsContour() const { return bContour; } + BOOL IsOutside() const { return bOutside; } + void SetSurround ( SwSurround eNew ){ SfxEnumItem::SetValue( USHORT( eNew ) ); } + void SetAnchorOnly( BOOL bNew ) { bAnchorOnly = bNew; } + void SetContour( BOOL bNew ) { bContour = bNew; } + void SetOutside( BOOL bNew ) { bOutside = bNew; } +}; + +inline SwFmtSurround &SwFmtSurround::operator=( const SwFmtSurround &rCpy ) +{ + bAnchorOnly = rCpy.IsAnchorOnly(); + bContour = rCpy.IsContour(); + bOutside = rCpy.IsOutside(); + SfxEnumItem::SetValue( rCpy.GetValue() ); + return *this; +} + +inline const SwFmtSurround &SwAttrSet::GetSurround(BOOL bInP) const + { return (const SwFmtSurround&)Get( RES_SURROUND,bInP); } + +inline const SwFmtSurround &SwFmt::GetSurround(BOOL bInP) const + { return aSet.GetSurround(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/fmturl.hxx b/inc/bf_sw/fmturl.hxx new file mode 100644 index 000000000..6d1aa655c --- /dev/null +++ b/inc/bf_sw/fmturl.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FMTURL_HXX +#define _FMTURL_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <format.hxx> +class IntlWrapper; + +namespace binfilter { +class ImageMap; + + +// URL, ServerMap und ClientMap + +class SwFmtURL: public SfxPoolItem +{ + String sTargetFrameName; // in diesen Frame soll die URL + String sURL; //Einfache URL + String sName; // Name des Anchors + ImageMap *pMap; //ClientSide Images + + BOOL bIsServerMap; //mit der URL eine ServerSideImageMap + + SwFmtURL& operator=( const SwFmtURL& ); + +public: + SwFmtURL(); + SwFmtURL( const SwFmtURL& ); + ~SwFmtURL(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + void SetTargetFrameName( const String& rStr ) { sTargetFrameName = rStr; } + void SetURL( const String &rURL, BOOL bServerMap ); + void SetMap( const ImageMap *pM ); //Pointer wird kopiert! + + const String &GetTargetFrameName()const { return sTargetFrameName; } + const String &GetURL() const { return sURL; } + BOOL IsServerMap() const { return bIsServerMap; } + const ImageMap *GetMap() const { return pMap; } + ImageMap *GetMap() { return pMap; } + + const String& GetName() const { return sName; } + void SetName( const String& rNm ) { sName = rNm; } +}; + + +inline const SwFmtURL &SwAttrSet::GetURL(BOOL bInP) const + { return (const SwFmtURL&)Get( RES_URL,bInP); } + +inline const SwFmtURL &SwFmt::GetURL(BOOL bInP) const + { return aSet.GetURL(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/format.hxx b/inc/bf_sw/format.hxx new file mode 100644 index 000000000..7592bb4c8 --- /dev/null +++ b/inc/bf_sw/format.hxx @@ -0,0 +1,302 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FORMAT_HXX +#define _FORMAT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <swatrset.hxx> // fuer SfxItemPool/-Set, Attr forward decl. +#include <calbck.hxx> // fuer SwModify +#include <hintids.hxx> +namespace binfilter { + +class SwDoc; + +class SwFmt : public SwModify +{ + friend class SwSwgReader; + friend class SwSwgWriter; + + String aFmtName; + SwAttrSet aSet; + + USHORT nWhichId; + USHORT nFmtId; // Format-ID fuer Lesen/Schreiben + USHORT nPoolFmtId; // Id-fuer "automatich" erzeugte Formate + // (ist keine harte Attributierung !!) + USHORT nPoolHelpId; // HelpId fuer diese Pool-Vorlage + BYTE nPoolHlpFileId; // FilePos ans Doc auf die Vorlagen-Hilfen + BOOL bWritten : 1; // TRUE: bereits geschrieben + BOOL bAutoFmt : 1; // FALSE: es handelt sich um eine Vorlage + // ist dflt immer auf TRUE ! + BOOL bFmtInDTOR : 1; // TRUE: das Format wird geloscht. Damit man in + // der FmtChg-Message das erkennen kann!!! + BOOL bAutoUpdateFmt : 1; // TRUE: am Format werden die Attribute + // eines kompletten Absatzes gesetzt (UI-seitig!) + BOOL bLayerFmt : 1; // nur fuer SwFrmFmt ( LAYER_IMPL ) + + +protected: + SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + const USHORT* pWhichRanges, SwFmt *pDrvdFrm, USHORT nFmtWhich ); + SwFmt( SwAttrPool& rPool, const String &rFmtNm, const USHORT* pWhichRanges, + SwFmt *pDrvdFrm, USHORT nFmtWhich ); + SwFmt( SwAttrPool& rPool, const String &rFmtNm, USHORT nWhich1, + USHORT nWhich2, SwFmt *pDrvdFrm, USHORT nFmtWhich ); + SwFmt( const SwFmt& rFmt ); + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + virtual ~SwFmt(); + SwFmt &operator=(const SwFmt&); + + // fuer die Abfrage der Writer-Funktionen + USHORT Which() const { return nWhichId; } + + virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); + // erfrage vom Format Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + + // kopiere Attribute; auch ueber Dokumentgrenzen hinweg + void CopyAttrs( const SwFmt&, BOOL bReplace=TRUE ); + + // Umhaengen des Formats (0 = Default) + BOOL SetDerivedFrom(SwFmt *pDerivedFrom = 0); + + // Ist bInParents FALSE, + // wird nur in diesem Format nach dem Attribut gesucht. + inline const SfxPoolItem& GetAttr( USHORT nWhich, + BOOL bInParents = TRUE ) const; + inline SfxItemState GetItemState( USHORT nWhich, BOOL bSrchInParent = TRUE, + const SfxPoolItem **ppItem = 0 ) const; + BOOL SetAttr( const SfxPoolItem& ); + BOOL SetAttr( const SfxItemSet& rSet ); + + // Nimmt den Hint mit nWhich aus dem Delta-Array + BOOL ResetAttr( USHORT nWhich1, USHORT nWhich2 = 0 ); + + // Nimmt alle Hints aus dem Delta-Array, + // liefert die Anzahl der geloeschten Hints + USHORT ResetAllAttr(); + + inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; } + inline BOOL IsDefault() const { return DerivedFrom() == 0; } + + inline const String& GetName() const { return aFmtName; } + void SetName( const String& rNewName, sal_Bool bBroadcast=sal_False ); + inline void SetName( const sal_Char* pNewName, + sal_Bool bBroadcast=sal_False); + + // zur Abfrage des Attribute Arrays + inline const SwAttrSet& GetAttrSet() const { return aSet; } + + // Das Doc wird jetzt am SwAttrPool gesetzt. Dadurch hat man es immer + // im Zugriff. + const SwDoc *GetDoc() const { return aSet.GetDoc(); } + SwDoc *GetDoc() { return aSet.GetDoc(); } + + // erfragen und setzen der Poolvorlagen-Id's + USHORT GetPoolFmtId() const { return nPoolFmtId; } + void SetPoolFmtId( USHORT nId ) { nPoolFmtId = nId; } + + // erfragen und setzen der Hilfe-Id's fuer die Document-Vorlagen + USHORT GetPoolHelpId() const { return nPoolHelpId; } + void SetPoolHelpId( USHORT nId ) { nPoolHelpId = nId; } + BYTE GetPoolHlpFileId() const { return nPoolHlpFileId; } + void SetPoolHlpFileId( BYTE nId ) { nPoolHlpFileId = nId; } + + // Das Format-ID fuer Lesen/Schreiben: + USHORT GetFmtId() const { return nFmtId; } + void SetWritten() { bWritten = TRUE; } + void ResetWritten() { bWritten = FALSE; } + BOOL IsWritten() const { return bWritten; } + + // Abfragen/Setzen vom AutoFmt-Flag + BOOL IsAuto() const { return bAutoFmt; } + void SetAuto( BOOL bNew = FALSE ) { bAutoFmt = bNew; } + + // Abfragen/Setzen vom bAutoUpdateFmt-Flag + BOOL IsAutoUpdateFmt() const { return bAutoUpdateFmt; } + void SetAutoUpdateFmt( BOOL bNew = TRUE ) { bAutoUpdateFmt = bNew; } + + BOOL IsFmtInDTOR() const { return bFmtInDTOR; } + + BOOL IsLayerFmt() const { return bLayerFmt; } + void SetLayerFmt( BOOL bNew ) { bLayerFmt = bNew; } + + BOOL IsFrmFmt() const { return nWhichId == RES_FLYFRMFMT || + nWhichId == RES_DRAWFRMFMT|| + nWhichId == RES_FRMFMT; } + + // GetMethoden: das Bool gibt an, ob nur im Set (FALSE) oder auch in + // den Parents gesucht werden soll. Wird nichts gefunden, + // wird das deflt. Attribut returnt. + // Charakter-Attribute - impl. steht im charatr.hxx + // AMA 12.10.94: Umstellung von SwFmt... auf Svx... + inline const SvxPostureItem &GetPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetWeight( BOOL = TRUE ) const; + inline const SvxShadowedItem &GetShadowed( BOOL = TRUE ) const; + inline const SvxAutoKernItem &GetAutoKern( BOOL = TRUE ) const; + inline const SvxWordLineModeItem &GetWordLineMode( BOOL = TRUE ) const; + inline const SvxContourItem &GetContour( BOOL = TRUE ) const; + inline const SvxKerningItem &GetKerning( BOOL = TRUE ) const; + inline const SvxUnderlineItem &GetUnderline( BOOL = TRUE ) const; + inline const SvxCrossedOutItem &GetCrossedOut( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetSize( BOOL = TRUE ) const; + inline const SvxPropSizeItem &GetPropSize( BOOL = TRUE ) const; + inline const SvxFontItem &GetFont( BOOL = TRUE ) const; + inline const SvxColorItem &GetColor( BOOL = TRUE ) const; + inline const SvxCharSetColorItem &GetCharSetColor( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetLanguage( BOOL = TRUE ) const; + inline const SvxEscapementItem &GetEscapement( BOOL = TRUE ) const; + inline const SvxCaseMapItem &GetCaseMap( BOOL = TRUE ) const; + inline const SvxNoHyphenItem &GetNoHyphenHere( BOOL = TRUE ) const; + inline const SvxBlinkItem &GetBlink( BOOL = TRUE ) const; + inline const SvxBrushItem &GetChrBackground( BOOL = TRUE ) const; + + inline const SvxFontItem &GetCJKFont( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetCJKSize( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetCJKLanguage( BOOL = TRUE ) const; + inline const SvxPostureItem &GetCJKPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetCJKWeight( BOOL = TRUE ) const; + inline const SvxFontItem &GetCTLFont( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetCTLSize( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetCTLLanguage( BOOL = TRUE ) const; + inline const SvxPostureItem &GetCTLPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetCTLWeight( BOOL = TRUE ) const; + inline const SfxBoolItem &GetWritingDirection( BOOL = TRUE ) const; + inline const SvxEmphasisMarkItem &GetEmphasisMark( BOOL = TRUE ) const; + inline const SvxTwoLinesItem &Get2Lines( BOOL = TRUE ) const; + inline const SvxCharScaleWidthItem &GetCharScaleW( BOOL = TRUE ) const; + inline const SvxCharRotateItem &GetCharRotate( BOOL = TRUE ) const; + inline const SvxCharReliefItem &GetCharRelief( BOOL = TRUE ) const; + + // Frame-Attribute - impl. steht im frmatr.hxx, + inline const SwFmtFillOrder &GetFillOrder( BOOL = TRUE ) const; + inline const SwFmtFrmSize &GetFrmSize( BOOL = TRUE ) const; + inline const SwFmtHeader &GetHeader( BOOL = TRUE ) const; + inline const SwFmtFooter &GetFooter( BOOL = TRUE ) const; + inline const SwFmtSurround &GetSurround( BOOL = TRUE ) const; + inline const SwFmtHoriOrient &GetHoriOrient( BOOL = TRUE ) const; + inline const SwFmtAnchor &GetAnchor( BOOL = TRUE ) const; + inline const SwFmtCol &GetCol( BOOL = TRUE ) const; + inline const SvxPaperBinItem &GetPaperBin( BOOL = TRUE ) const; + inline const SvxLRSpaceItem &GetLRSpace( BOOL = TRUE ) const; + inline const SvxULSpaceItem &GetULSpace( BOOL = TRUE ) const; + inline const SwFmtCntnt &GetCntnt( BOOL = TRUE ) const; + inline const SvxPrintItem &GetPrint( BOOL = TRUE ) const; + inline const SvxOpaqueItem &GetOpaque( BOOL = TRUE ) const; + inline const SvxProtectItem &GetProtect( BOOL = TRUE ) const; + inline const SwFmtVertOrient &GetVertOrient( BOOL = TRUE ) const; + inline const SvxBoxItem &GetBox( BOOL = TRUE ) const; + inline const SvxFmtKeepItem &GetKeep( BOOL = TRUE ) const; + inline const SvxBrushItem &GetBackground( BOOL = TRUE ) const; + inline const SvxShadowItem &GetShadow( BOOL = TRUE ) const; + inline const SwFmtPageDesc &GetPageDesc( BOOL = TRUE ) const; + inline const SvxFmtBreakItem &GetBreak( BOOL = TRUE ) const; + inline const SvxMacroItem &GetMacro( BOOL = TRUE ) const; + inline const SwFmtURL &GetURL( BOOL = TRUE ) const; + inline const SwFmtEditInReadonly &GetEditInReadonly( BOOL = TRUE ) const; + inline const SwFmtLayoutSplit &GetLayoutSplit( BOOL = TRUE ) const; + inline const SwFmtChain &GetChain( BOOL = TRUE ) const; + inline const SwFmtLineNumber &GetLineNumber( BOOL = TRUE ) const; + inline const SwFmtFtnAtTxtEnd &GetFtnAtTxtEnd( BOOL = TRUE ) const; + inline const SwFmtEndAtTxtEnd &GetEndAtTxtEnd( BOOL = TRUE ) const; + inline const SwFmtNoBalancedColumns &GetBalancedColumns( BOOL = TRUE ) const; + inline const SvxFrameDirectionItem &GetFrmDir( BOOL = TRUE ) const; + inline const SwTextGridItem &GetTextGrid( BOOL = TRUE ) const; + inline const SwHeaderAndFooterEatSpacingItem &GetHeaderAndFooterEatSpacing( BOOL = TRUE ) const; + + // Grafik-Attribute - impl. steht im grfatr.hxx + inline const SwMirrorGrf &GetMirrorGrf( BOOL = TRUE ) const; + inline const SwCropGrf &GetCropGrf( BOOL = TRUE ) const; + inline const SwRotationGrf &GetRotationGrf(BOOL = TRUE ) const; + inline const SwLuminanceGrf &GetLuminanceGrf(BOOL = TRUE ) const; + inline const SwContrastGrf &GetContrastGrf(BOOL = TRUE ) const; + inline const SwChannelRGrf &GetChannelRGrf(BOOL = TRUE ) const; + inline const SwChannelGGrf &GetChannelGGrf(BOOL = TRUE ) const; + inline const SwChannelBGrf &GetChannelBGrf(BOOL = TRUE ) const; + inline const SwGammaGrf &GetGammaGrf(BOOL = TRUE ) const; + inline const SwInvertGrf &GetInvertGrf(BOOL = TRUE ) const; + inline const SwTransparencyGrf &GetTransparencyGrf(BOOL = TRUE ) const; + inline const SwDrawModeGrf &GetDrawModeGrf(BOOL = TRUE ) const; + + // Paragraph-Attribute - impl. steht im paratr.hxx + inline const SvxLineSpacingItem &GetLineSpacing( BOOL = TRUE ) const; + inline const SvxAdjustItem &GetAdjust( BOOL = TRUE ) const; + inline const SvxFmtSplitItem &GetSplit( BOOL = TRUE ) const; + inline const SwRegisterItem &GetRegister( BOOL = TRUE ) const; + inline const SwNumRuleItem &GetNumRule( BOOL = TRUE ) const; + inline const SvxWidowsItem &GetWidows( BOOL = TRUE ) const; + inline const SvxOrphansItem &GetOrphans( BOOL = TRUE ) const; + inline const SvxTabStopItem &GetTabStops( BOOL = TRUE ) const; + inline const SvxHyphenZoneItem &GetHyphenZone( BOOL = TRUE ) const; + inline const SwFmtDrop &GetDrop( BOOL = TRUE ) const; + inline const SvxScriptSpaceItem &GetScriptSpace(BOOL = TRUE) const; + inline const SvxHangingPunctuationItem &GetHangingPunctuation(BOOL = TRUE) const; + inline const SvxForbiddenRuleItem &GetForbiddenRule(BOOL = TRUE) const; + inline const SvxParaVertAlignItem &GetParaVertAlign(BOOL = TRUE) const; + inline const SvxParaGridItem &GetParaGrid(BOOL = TRUE) const; + inline const SwParaConnectBorderItem &GetParaConnectBorder(BOOL = TRUE ) const; + + // TabellenBox-Attribute - impl. steht im cellatr.hxx + inline const SwTblBoxNumFormat &GetTblBoxNumFmt( BOOL = TRUE ) const; + inline const SwTblBoxFormula &GetTblBoxFormula( BOOL = TRUE ) const; + inline const SwTblBoxValue &GetTblBoxValue( BOOL = TRUE ) const; + + /** SwFmt::IsBackgroundTransparent - for feature #99657# + + OD 22.08.2002 + Virtual method to determine, if background of format is transparent. + Default implementation returns false. Thus, subclasses have to overload + method, if the specific subclass can have a transparent background. + + @author OD + + @return false, default implementation + */ + virtual sal_Bool IsBackgroundTransparent() const; +}; + +// --------------- Inline Implementierungen ------------------------ + +inline const SfxPoolItem& SwFmt::GetAttr( USHORT nWhich, + BOOL bInParents ) const +{ + return aSet.Get( nWhich, bInParents ); +} + +inline void SwFmt::SetName( const sal_Char* pNewName, + sal_Bool bBroadcast ) +{ + String aTmp( String::CreateFromAscii( pNewName ) ); + SetName( aTmp, bBroadcast ); +} + +inline SfxItemState SwFmt::GetItemState( USHORT nWhich, BOOL bSrchInParent, + const SfxPoolItem **ppItem ) const +{ + return aSet.GetItemState( nWhich, bSrchInParent, ppItem ); +} + +} //namespace binfilter +#endif // _FORMAT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/frmatr.hxx b/inc/bf_sw/frmatr.hxx new file mode 100644 index 000000000..99f3243ea --- /dev/null +++ b/inc/bf_sw/frmatr.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FRMATR_HXX +#define _FRMATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> //fuer Implementierung der inlines +namespace binfilter { + +/****************************************************************************** + * Implementierung der FrameAttribut Methoden vom SwAttrSet + ******************************************************************************/ + +inline const SvxPaperBinItem &SwAttrSet::GetPaperBin(BOOL bInP) const + { return (const SvxPaperBinItem&)Get( RES_PAPER_BIN,bInP); } +inline const SvxLRSpaceItem &SwAttrSet::GetLRSpace(BOOL bInP) const + { return (const SvxLRSpaceItem&)Get( RES_LR_SPACE,bInP); } +inline const SvxULSpaceItem &SwAttrSet::GetULSpace(BOOL bInP) const + { return (const SvxULSpaceItem&)Get( RES_UL_SPACE,bInP); } +inline const SvxPrintItem &SwAttrSet::GetPrint(BOOL bInP) const + { return (const SvxPrintItem&)Get( RES_PRINT,bInP); } +inline const SvxOpaqueItem &SwAttrSet::GetOpaque(BOOL bInP) const + { return (const SvxOpaqueItem&)Get( RES_OPAQUE,bInP); } +inline const SvxProtectItem &SwAttrSet::GetProtect(BOOL bInP) const + { return (const SvxProtectItem&)Get( RES_PROTECT,bInP); } +inline const SvxBoxItem &SwAttrSet::GetBox(BOOL bInP) const + { return (const SvxBoxItem&)Get( RES_BOX,bInP); } +inline const SvxFmtKeepItem &SwAttrSet::GetKeep(BOOL bInP) const + { return (const SvxFmtKeepItem&)Get( RES_KEEP,bInP); } +inline const SvxBrushItem &SwAttrSet::GetBackground(BOOL bInP) const + { return (const SvxBrushItem&)Get( RES_BACKGROUND,bInP); } +inline const SvxShadowItem &SwAttrSet::GetShadow(BOOL bInP) const + { return (const SvxShadowItem&)Get( RES_SHADOW,bInP); } +inline const SvxFmtBreakItem &SwAttrSet::GetBreak(BOOL bInP) const + { return (const SvxFmtBreakItem&)Get( RES_BREAK,bInP); } +inline const SvxMacroItem &SwAttrSet::GetMacro(BOOL bInP) const + { return (const SvxMacroItem&)Get( RES_FRMMACRO,bInP); } +inline const SvxFrameDirectionItem &SwAttrSet::GetFrmDir(BOOL bInP) const + { return (const SvxFrameDirectionItem&)Get( RES_FRAMEDIR,bInP); } + + +/****************************************************************************** + * Implementierung der FrameAttribut Methoden vom SwFmt + ******************************************************************************/ + +inline const SvxPaperBinItem &SwFmt::GetPaperBin(BOOL bInP) const + { return aSet.GetPaperBin(bInP); } +inline const SvxLRSpaceItem &SwFmt::GetLRSpace(BOOL bInP) const + { return aSet.GetLRSpace(bInP); } +inline const SvxULSpaceItem &SwFmt::GetULSpace(BOOL bInP) const + { return aSet.GetULSpace(bInP); } +inline const SvxPrintItem &SwFmt::GetPrint(BOOL bInP) const + { return aSet.GetPrint(bInP); } +inline const SvxOpaqueItem &SwFmt::GetOpaque(BOOL bInP) const + { return aSet.GetOpaque(bInP); } +inline const SvxProtectItem &SwFmt::GetProtect(BOOL bInP) const + { return aSet.GetProtect(bInP); } +inline const SvxBoxItem &SwFmt::GetBox(BOOL bInP) const + { return aSet.GetBox(bInP); } +inline const SvxFmtKeepItem &SwFmt::GetKeep(BOOL bInP) const + { return aSet.GetKeep(bInP); } +inline const SvxBrushItem &SwFmt::GetBackground(BOOL bInP) const + { return aSet.GetBackground(bInP); } +inline const SvxShadowItem &SwFmt::GetShadow(BOOL bInP) const + { return aSet.GetShadow(bInP); } +inline const SvxFmtBreakItem &SwFmt::GetBreak(BOOL bInP) const + { return aSet.GetBreak(bInP); } +inline const SvxMacroItem &SwFmt::GetMacro(BOOL bInP) const + { return aSet.GetMacro(bInP); } +inline const SvxFrameDirectionItem &SwFmt::GetFrmDir(BOOL bInP) const + { return aSet.GetFrmDir(bInP); } + +} //namespace binfilter +#endif //_FRMATR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/frmfmt.hxx b/inc/bf_sw/frmfmt.hxx new file mode 100644 index 000000000..fcc7e9644 --- /dev/null +++ b/inc/bf_sw/frmfmt.hxx @@ -0,0 +1,209 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FRMFMT_HXX +#define _FRMFMT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <format.hxx> +class Graphic; +class Point; + +namespace binfilter { + +class ImageMap; +class SwDrawContact; +class SwFlyFrm; +class IMapObject; +class SwRect; +class SwContact; +class SdrObject; + +class SwFrmFmt: public SwFmt +{ + friend class SwDoc; + friend class SwPageDesc; //darf den protected CTor rufen. + friend class SwSwgReader; // der SW2-Reader auch! + friend class Sw3IoImp; // der SW3-Reader auch! + +protected: + SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm, USHORT nFmtWhich = RES_FRMFMT, + const USHORT* pWhichRange = 0 ) + : SwFmt( rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), + pDrvdFrm, nFmtWhich ) + {} + + SwFrmFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm, USHORT nFmtWhich = RES_FRMFMT, + const USHORT* pWhichRange = 0 ) + : SwFmt( rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), + pDrvdFrm, nFmtWhich ) + {} + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt). + virtual void DelFrms(); + + //Erzeugt die Ansichten + virtual void MakeFrms(); + + + virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); + + // returnt das IMapObject, das an dem Format (Fly), in der ImageMap + // an der Point Position definiert ist. + // rPoint - teste auf der DocPosition + // pFly - optionaler FlyFrame, falls der schon bekannt ist. + + // Gibt die tatsaechlche Groesse des Frames zurueck bzw. ein leeres + // Rechteck, wenn kein Layout existiert. Wird pPoint angegeben, dann + // wird der am dichtesten liegende Frame gesucht. + SwRect FindLayoutRect( const BOOL bPrtArea = FALSE, + const Point* pPoint = 0, + const BOOL bCalcFrm = FALSE ) const; + + // Sucht das SdrObject. Der SdrObjUserCall ist Client vom Format. + // Der UserCall kennt sein SdrObject. + SwContact *FindContactObj(); + const SwContact *FindContactObj() const + { return ((SwFrmFmt*)this)->FindContactObj(); } + + // returns the SdrObject, that ist connected to the ContactObject. + // Only DrawFrmFmts are connected to the "real SdrObject". FlyFrmFmts + // are connected to a Master and all FlyFrms has the "real SdrObject". + // "Real SdrObject" has position and a Z-order. + SdrObject *FindSdrObject(); + const SdrObject *FindSdrObject() const + { return ((SwFrmFmt*)this)->FindSdrObject(); } + + SdrObject *FindRealSdrObject(); + const SdrObject *FindRealSdrObject() const + { return ((SwFrmFmt*)this)->FindRealSdrObject(); } + + + DECL_FIXEDMEMPOOL_NEWDEL(SwFrmFmt) +}; + +//Das FlyFrame-Format ------------------------------ + +class SwFlyFrmFmt: public SwFrmFmt +{ + friend class SwDoc; + + //Beide nicht vorhanden. + SwFlyFrmFmt( const SwFlyFrmFmt &rCpy ); + SwFlyFrmFmt &operator=( const SwFlyFrmFmt &rCpy ); + +protected: + SwFlyFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FLYFRMFMT ) + {} + SwFlyFrmFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FLYFRMFMT ) + {} + +public: + TYPEINFO(); + ~SwFlyFrmFmt(); + + //Erzeugt die Ansichten + virtual void MakeFrms(); + + SwFlyFrm* GetFrm( const Point* pDocPos = 0, + const BOOL bCalcFrm = FALSE ) const; + + + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + /** SwFlyFrmFmt::IsBackgroundTransparent - for #99657# + + OD 22.08.2002 - overloading virtual method and its default implementation, + because format of fly frame provides transparent backgrounds. + Method determines, if background of fly frame is transparent. + + @author OD + + @return true, if background color is transparent, but not "no fill" + or a existing background graphic is transparent. + */ + virtual sal_Bool IsBackgroundTransparent() const; + + /** SwFlyFrmFmt::IsBackgroundBrushInherited - for #103898# + + OD 08.10.2002 - method to determine, if the brush for drawing the + background is "inherited" from its parent/grandparent. + This is the case, if no background graphic is set and the background + color is "no fill"/"auto fill" + + @author OD + + @return true, if background brush is "inherited" from parent/grandparent + */ + sal_Bool IsBackgroundBrushInherited() const; + + DECL_FIXEDMEMPOOL_NEWDEL(SwFlyFrmFmt) +}; + +//Das DrawFrame-Format ----------------------------- + +class SwDrawFrmFmt: public SwFrmFmt +{ + friend class SwDoc; + + //Beide nicht vorhanden. + SwDrawFrmFmt( const SwDrawFrmFmt &rCpy ); + SwDrawFrmFmt &operator=( const SwDrawFrmFmt &rCpy ); + +protected: + SwDrawFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_DRAWFRMFMT ) + {} + SwDrawFrmFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_DRAWFRMFMT ) + {} + +public: + TYPEINFO(); + ~SwDrawFrmFmt(); + + //DrawObjecte werden aus den Arrays am Layout entfernt. Die DrawObjecte + //werden als geloescht gekennzeichnet. + virtual void DelFrms(); + + //Anmelden der DrawObjecte in den Arrays am Layout. Loeschkennzeichen + //werden zurueckgesetzt. + virtual void MakeFrms(); + + + + DECL_FIXEDMEMPOOL_NEWDEL(SwDrawFrmFmt); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ftnidx.hxx b/inc/bf_sw/ftnidx.hxx new file mode 100644 index 000000000..dc16c8771 --- /dev/null +++ b/inc/bf_sw/ftnidx.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FTNIDX_HXX +#define _FTNIDX_HXX + + +#define _SVSTDARR_USHORTS +#include <bf_svtools/svstdarr.hxx> +namespace binfilter { + +class SwTxtFtn; +class SwNodeIndex; +class SwSectionNode; + +// ueberall, wo der NodeIndex gebraucht wird, werden die hier fehlenden +// Headerfiles schon includes. Darum hier nur als define und nicht als +// inline Methode (spart Compile-Zeit) +#define _SwTxtFtn_GetIndex( pFIdx ) (pFIdx->GetTxtNode().GetIndex()) + + +typedef SwTxtFtn* SwTxtFtnPtr; +SV_DECL_PTRARR_SORT( _SwFtnIdxs, SwTxtFtnPtr, 0, 10 ) + +class SwFtnIdxs : public _SwFtnIdxs +{ +public: + SwFtnIdxs() {} + + void UpdateFtn( const SwNodeIndex& rStt ); // ab Pos. alle Updaten + void UpdateAllFtn(); // alle Fussnoten updaten + + SwTxtFtn* SeekEntry( const SwNodeIndex& rIdx, USHORT* pPos = 0 ) const; +}; + + +class SwUpdFtnEndNtAtEnd +{ + SvPtrarr aFtnSects, aEndSects; + SvUShorts aFtnNums, aEndNums; + +public: + SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ), + aFtnNums( 0, 4 ), aEndNums( 0, 4 ) + {} + + static const SwSectionNode* FindSectNdWithEndAttr( + const SwTxtFtn& rTxtFtn ); + + USHORT GetNumber( const SwTxtFtn& rTxtFtn, const SwSectionNode& rNd ); + USHORT ChkNumber( const SwTxtFtn& rTxtFtn ); +}; + + + +} //namespace binfilter +#endif // _FTNIDX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ftninfo.hxx b/inc/bf_sw/ftninfo.hxx new file mode 100644 index 000000000..2036a9732 --- /dev/null +++ b/inc/bf_sw/ftninfo.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FTNINFO_HXX +#define _FTNINFO_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_tools/string.hxx> + +#include "numrule.hxx" +namespace binfilter { + +class SwTxtFmtColl; +class SwPageDesc; + +class SwEndNoteInfo : public SwClient +{ + SwDepend aPageDescDep; + SwDepend aCharFmtDep, aAnchorCharFmtDep; + String sPrefix; + String sSuffix; +protected: + BOOL bEndNote; +public: + SvxNumberType aFmt; + USHORT nFtnOffset; + + void ChgPageDesc( SwPageDesc *pDesc ); + SwPageDesc *GetPageDesc( SwDoc &rDoc ) const; + SwClient *GetPageDescDep() const { return (SwClient*)&aPageDescDep; } + + SwTxtFmtColl* GetFtnTxtColl() const { return (SwTxtFmtColl*) GetRegisteredIn(); } // kann 0 sein + + SwCharFmt* GetCharFmt(SwDoc &rDoc) const; + void SetCharFmt( SwCharFmt* ); + SwClient *GetCharFmtDep() const { return (SwClient*)&aCharFmtDep; } + + SwCharFmt* GetAnchorCharFmt(SwDoc &rDoc) const; + void SetAnchorCharFmt( SwCharFmt* ); + SwClient *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; } + + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + SwEndNoteInfo & operator=(const SwEndNoteInfo&); + BOOL operator==( const SwEndNoteInfo &rInf ) const; + + SwEndNoteInfo( SwTxtFmtColl *pTxtColl = 0); + SwEndNoteInfo(const SwEndNoteInfo&); + + const String& GetPrefix() const { return sPrefix; } + const String& GetSuffix() const { return sSuffix; } + + void SetPrefix(const String& rSet) { sPrefix = rSet; } + void SetSuffix(const String& rSet) { sSuffix = rSet; } + + BOOL IsEndNoteInfo() const { return bEndNote; } +}; + +enum SwFtnPos +{ + //Derzeit nur PAGE und CHAPTER. CHAPTER == Dokumentendenoten. + FTNPOS_PAGE = 1, + FTNPOS_CHAPTER = 8 +}; + +enum SwFtnNum +{ + FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC +}; + +class SwFtnInfo: public SwEndNoteInfo +{ +public: + String aQuoVadis; + String aErgoSum; + SwFtnPos ePos; + SwFtnNum eNum; + + + SwFtnInfo& operator=(const SwFtnInfo&); + BOOL operator==( const SwFtnInfo &rInf ) const; + + SwFtnInfo(SwTxtFmtColl* pTxtColl = 0); + SwFtnInfo(const SwFtnInfo&); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/globals.hrc b/inc/bf_sw/globals.hrc new file mode 100644 index 000000000..53a18b4fd --- /dev/null +++ b/inc/bf_sw/globals.hrc @@ -0,0 +1,200 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _GLOBALS_HRC +#define _GLOBALS_HRC + + +// Versions-Definition wie in solar.h und swtypes.hxx +//#define SW_FILEFORMAT_40 3580 + +#include "rcid.hrc" + +// STRINGS ----------------------------------------------------------- + + +#define STR_SEPARATOR (RC_GLOBALS_BEGIN + 4) + + +#define STR_BASIC_IMPORT (RC_GLOBALS_BEGIN + 5) +#define STR_BASIC_BEGIN (RC_GLOBALS_BEGIN + 6) +#define STR_BASIC_END (RC_GLOBALS_BEGIN + 7) +#define STR_BASIC_REC_LIB (RC_GLOBALS_BEGIN + 8) + +#define STR_PAGE (RC_GLOBALS_BEGIN + 14) + +//EventStrings + + +// Strings fuer Rahmenausrichtungen im Popup +#define STR_TOP (RC_GLOBALS_BEGIN + 33) + + +#define STR_AUTH (RC_GLOBALS_BEGIN + 38) +#define STR_TBL (RC_GLOBALS_BEGIN + 39) +#define STR_TOO (RC_GLOBALS_BEGIN + 40) +#define STR_TOILL (RC_GLOBALS_BEGIN + 41) + +// BITMAPS ----------------------------------------------------------- + +#define RES_TABL (RC_GLOBALS_BEGIN + 1) +#define RES_TABR (RC_GLOBALS_BEGIN + 2) +#define RES_TABD (RC_GLOBALS_BEGIN + 3) +#define RES_TABC (RC_GLOBALS_BEGIN + 4) + +// DIALOGE ----------------------------------------------------------- + +#define DLG_LISTBOX (RC_GLOBALS_BEGIN + 1) + +// QUERYBOX --------------------------------------------------------- + + +// INFOBOX ------------------------------------------------------------ + + + +// ACC --------------------------------------------------------------- + +#define FN_CHAR_LEFT_SEL (RC_GLOBALS_BEGIN + 1) // +#define FN_CHAR_RIGHT_SEL (RC_GLOBALS_BEGIN + 2) // +#define FN_LINE_UP_SEL (RC_GLOBALS_BEGIN + 3) // +#define FN_LINE_DOWN_SEL (RC_GLOBALS_BEGIN + 4) // +#define FN_START_OF_LINE_SEL (RC_GLOBALS_BEGIN + 5) // StartOfLine +#define FN_END_OF_LINE_SEL (RC_GLOBALS_BEGIN + 6) // EndOfLine +#define FN_START_OF_DOCUMENT_SEL (RC_GLOBALS_BEGIN + 7) // StartOfDocument +#define FN_END_OF_DOCUMENT_SEL (RC_GLOBALS_BEGIN + 8) // EndOfDocument +#define FN_START_OF_NEXT_PAGE_SEL (RC_GLOBALS_BEGIN + 9) // StartOfNextPage ??? +#define FN_END_OF_NEXT_PAGE_SEL (RC_GLOBALS_BEGIN + 10) // ??? +#define FN_START_OF_PREV_PAGE_SEL (RC_GLOBALS_BEGIN + 11) // StartOfPrevPage ??? +#define FN_END_OF_PREV_PAGE_SEL (RC_GLOBALS_BEGIN + 12) // ??? +#define FN_START_OF_PAGE_SEL (RC_GLOBALS_BEGIN + 13) // StartOfPage +#define FN_END_OF_PAGE_SEL (RC_GLOBALS_BEGIN + 14) // EndOfPage +#define FN_START_OF_WINDOW_SEL (RC_GLOBALS_BEGIN + 15) // StartOfWindow +#define FN_END_OF_WINDOW_SEL (RC_GLOBALS_BEGIN + 16) // EndOfWindow +#define FN_START_OF_COLUMN_SEL (RC_GLOBALS_BEGIN + 17) // StartOfColumn +#define FN_END_OF_COLUMN_SEL (RC_GLOBALS_BEGIN + 18) // EndOfColumn +#define FN_START_OF_PARA_SEL (RC_GLOBALS_BEGIN + 19) // StartOfPara +#define FN_END_OF_PARA_SEL (RC_GLOBALS_BEGIN + 20) // EndOfPara +#define FN_NEXT_WORD_SEL (RC_GLOBALS_BEGIN + 21) // NextWord +#define FN_PREV_WORD_SEL (RC_GLOBALS_BEGIN + 22) // PrevWord +#define FN_NEXT_SENT_SEL (RC_GLOBALS_BEGIN + 23) // NextSentence +#define FN_PREV_SENT_SEL (RC_GLOBALS_BEGIN + 24) // PrevSentence + +#define FN_START_OF_NEXT_COLUMN_SEL (RC_GLOBALS_BEGIN + 25) +#define FN_END_OF_NEXT_COLUMN_SEL (RC_GLOBALS_BEGIN + 26) +#define FN_START_OF_PREV_COLUMN_SEL (RC_GLOBALS_BEGIN + 27) +#define FN_END_OF_PREV_COLUMN_SEL (RC_GLOBALS_BEGIN + 28) +#define FN_PAGEUP_SEL (RC_GLOBALS_BEGIN + 29) +#define FN_PAGEDOWN_SEL (RC_GLOBALS_BEGIN + 30) + +// TABPAGES ----------------------------------------------------------- + +#define TP_PAGE_STD (RC_GLOBALS_BEGIN + 1) +#define TP_PAGE_EXT (RC_GLOBALS_BEGIN + 2) + +#define TP_PARA_STD (RC_GLOBALS_BEGIN + 3) +#define TP_PARA_EXT (RC_GLOBALS_BEGIN + 4) + +#define TP_FRAME_STD (RC_GLOBALS_BEGIN + 5) +#define TP_FRAME_EXT (RC_GLOBALS_BEGIN + 6) + +#define TP_CHAR_STD (RC_GLOBALS_BEGIN + 7) +#define TP_CHAR_EXT (RC_GLOBALS_BEGIN + 8) + +#define TP_TABULATOR (RC_GLOBALS_BEGIN + 9) +#define TP_BACKGROUND (RC_GLOBALS_BEGIN + 11) +#define TP_BORDER (RC_GLOBALS_BEGIN + 12) + +#define TP_DOC_STAT (RC_GLOBALS_BEGIN + 15) + +#define TP_HEADER_PAGE (RC_GLOBALS_BEGIN + 16) +#define TP_FOOTER_PAGE (RC_GLOBALS_BEGIN + 17) + +#define TP_OPTGENERAL_PAGE (RC_GLOBALS_BEGIN + 19) //Sfx-Seiten +#define TP_OPTSAVE_PAGE (RC_GLOBALS_BEGIN + 20) +#define TP_OPTPATH_PAGE (RC_GLOBALS_BEGIN + 21) +#define TP_OPTSPELL_PAGE (RC_GLOBALS_BEGIN + 22) + //Sw-Seiten +#define SW_EDIT_OPTIONS_TDLG (RC_GLOBALS_BEGIN + 23) +#define SW_BROWSER_OPTIONS_TDLG (RC_GLOBALS_BEGIN + 24) +#define TP_OPTTEST_PAGE (RC_GLOBALS_BEGIN + 25) +#define TP_OPTCOLOR_PAGE (RC_GLOBALS_BEGIN + 27) + +#define SW_OPTIONS_TDLG (RC_GLOBALS_BEGIN + 28) +#define SW_OPTIONS_TDLG_ELEM (RC_GLOBALS_BEGIN + 29) +#define SW_OPTIONS_TDLG_PRINT (RC_GLOBALS_BEGIN + 30) + + +#define TP_OPTGRID_PAGE (RC_GLOBALS_BEGIN + 33) + + + +#define RID_INPUT_TOOLBOX (RC_GLOBALS_BEGIN + 39) + +#define TP_MACRO_ASSIGN (RC_GLOBALS_BEGIN + 40) + +#define TP_LAYOUT_OPT (RC_GLOBALS_BEGIN + 44) +#define TP_HTML_OPT (RC_GLOBALS_BEGIN + 46) + + + +#define TP_AUTOFMT_BY_INPUT (RC_GLOBALS_BEGIN + 53) +#define TP_AUTOFMT_APPLY (RC_GLOBALS_BEGIN + 54) + +#define TP_PARA_ALIGN (RC_GLOBALS_BEGIN + 55) + +#define TP_NUMBER (RC_GLOBALS_BEGIN + 57) + +#define DLG_NUM_BULLET (RC_GLOBALS_BEGIN + 58) +#define TP_PICK_SINGLE_NUM (RC_GLOBALS_BEGIN + 59) +#define TP_PICK_BULLET (RC_GLOBALS_BEGIN + 60) +#define TP_PICK_NUM (RC_GLOBALS_BEGIN + 61) +#define TP_PICK_BMP (RC_GLOBALS_BEGIN + 62) + + +#define TP_NUM_OPTIONS (RC_GLOBALS_BEGIN + 71) + + + +#define TP_OPTINSERT_PAGE (RC_GLOBALS_BEGIN + 77) +#define TP_INSERT_TOX (RC_GLOBALS_BEGIN + 81) +#define TP_TOX_FORM_ENTRY (RC_GLOBALS_BEGIN + 82) +#define TP_TOX_FORM_STYLES (RC_GLOBALS_BEGIN + 83) +#define DLG_INSERT_TOX_TABDLG (RC_GLOBALS_BEGIN + 84) + +#define TP_CHAR_POS (RC_GLOBALS_BEGIN + 98) +#define TP_CHAR_TWOLN (RC_GLOBALS_BEGIN + 99) +#define TP_PARA_ASIAN (RC_GLOBALS_BEGIN + 100) +//maximum: RC_GLOBALS_BEGIN + 119 +// Kontext-Menues (Format-Menue) -------------------------------------------- + +#define MN_OBJECTMENU_TEXT (RC_GLOBALS_BEGIN + 1) +#define MN_OBJECTMENU_LIST (RC_GLOBALS_BEGIN + 2) +#define MN_OBJECTMENU_TABLE (RC_GLOBALS_BEGIN + 3) +#define MN_OBJECTMENU_FRAME (RC_GLOBALS_BEGIN + 4) +#define MN_OBJECTMENU_GRAFIK (RC_GLOBALS_BEGIN + 5) +#define MN_OBJECTMENU_DRAW (RC_GLOBALS_BEGIN + 6) +#define MN_OBJECTMENU_DRWTXT (RC_GLOBALS_BEGIN + 7) +#define MN_OBJECTMENU_OLE (RC_GLOBALS_BEGIN + 8) +#define MN_OBJECTMENU_DRAWCONTROL (RC_GLOBALS_BEGIN + 9) +#define MN_OBJECTMENU_DRAWFORM (RC_GLOBALS_BEGIN + 10) + + + + +#endif // _GLOBALS_HRC diff --git a/inc/bf_sw/globdoc.hxx b/inc/bf_sw/globdoc.hxx new file mode 100644 index 000000000..7a159510d --- /dev/null +++ b/inc/bf_sw/globdoc.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWGLOBDOCSH_HXX +#define _SWGLOBDOCSH_HXX + +#include <swdll.hxx> +#include "docsh.hxx" +namespace binfilter { + +class SwGlobalDocShell : public SwDocShell +{ +public: + + SFX_DECL_OBJECTFACTORY_DLL(SwGlobalDocShell, SW_DLL()); + TYPEINFO(); + + SwGlobalDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED); + ~SwGlobalDocShell(); + + virtual void FillClass( SvGlobalName * pClassName, + ULONG * pClipFormat, + String * pAppName, + String * pLongUserName, + String * pUserName, + long nVersion = SOFFICE_FILEFORMAT_CURRENT ) const; +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/grfatr.hxx b/inc/bf_sw/grfatr.hxx new file mode 100644 index 000000000..607bd3665 --- /dev/null +++ b/inc/bf_sw/grfatr.hxx @@ -0,0 +1,340 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _GRFATR_HXX +#define _GRFATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <hintids.hxx> // fuer die WhichIds + +#include <tools/gen.hxx> +#include <bf_svtools/eitem.hxx> +#include <bf_svtools/intitem.hxx> +#include <bf_svx/grfcrop.hxx> + +#include <swatrset.hxx> // fuer inlines +#include <format.hxx> // fuer inlines +namespace binfilter { + +/****************************************************************************** + * class SwMirrorGrf + ******************************************************************************/ + +enum GRFMIRROR +{ +RES_GRFMIRROR_BEGIN, + RES_DONT_MIRROR_GRF = RES_GRFMIRROR_BEGIN, + RES_MIRROR_GRF_VERT, + RES_MIRROR_GRF_HOR, + RES_MIRROR_GRF_BOTH, +RES_GRFMIRROR_END +}; + +class SwMirrorGrf : public SfxEnumItem +{ + BOOL bGrfToggle; // auf geraden Seiten Grafiken spiegeln + +public: + SwMirrorGrf( USHORT nMiro = RES_DONT_MIRROR_GRF ) + : SfxEnumItem( RES_GRFATR_MIRRORGRF, nMiro ), bGrfToggle( sal_False ) + {} + SwMirrorGrf( const SwMirrorGrf &rMirrorGrf ) + : SfxEnumItem( RES_GRFATR_MIRRORGRF, rMirrorGrf.GetValue()), + bGrfToggle( rMirrorGrf.IsGrfToggle() ) + {} + + // pure virtual-Methoden von SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + // pure virtual-Methiden von SfxEnumItem + virtual USHORT GetValueCount() const; + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer ) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual int operator==( const SfxPoolItem& ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + inline SwMirrorGrf& operator=( const SwMirrorGrf& rMirrorGrf ) + { + SfxEnumItem::SetValue( rMirrorGrf.GetValue() ); + bGrfToggle = rMirrorGrf.IsGrfToggle(); + return *this; + } + + inline BOOL IsGrfToggle() const { return bGrfToggle; } + inline void SetGrfToggle( BOOL bNew ) { bGrfToggle = bNew; } +}; + + +/****************************************************************************** + * class SwAttrCropGrf + ******************************************************************************/ + +class SwCropGrf : public SvxGrfCrop +{ +public: + TYPEINFO(); + SwCropGrf(); + SwCropGrf( sal_Int32 nLeft, sal_Int32 nRight, + sal_Int32 nTop, sal_Int32 nBottom ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFileVersion ) const; +}; + +class SwRotationGrf : public SfxUInt16Item +{ + Size aUnrotatedSize; +public: + SwRotationGrf( sal_Int16 nVal = 0 ) + : SfxUInt16Item( RES_GRFATR_ROTATION, nVal ) + {} + SwRotationGrf( sal_Int16 nVal, const Size& rSz ) + : SfxUInt16Item( RES_GRFATR_ROTATION, nVal ), aUnrotatedSize( rSz ) + {} + + // pure virtual-Methiden from SfxInt16Item + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer ) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual int operator==( const SfxPoolItem& ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + void SetUnrotatedSize( const Size& rSz ) { aUnrotatedSize = rSz; } + const Size& GetUnrotatedSize() const { return aUnrotatedSize; } +}; + +class SwLuminanceGrf : public SfxInt16Item +{ +public: + SwLuminanceGrf( sal_Int16 nVal = 0 ) + : SfxInt16Item( RES_GRFATR_LUMINANCE, nVal ) + {} + + // pure virtual-Methiden from SfxInt16Item + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +class SwContrastGrf : public SfxInt16Item +{ +public: + SwContrastGrf( sal_Int16 nVal = 0 ) + : SfxInt16Item( RES_GRFATR_CONTRAST, nVal ) + {} + + // pure virtual-Methiden from SfxInt16Item + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +class SwChannelGrf : public SfxInt16Item +{ +protected: + SwChannelGrf( sal_Int16 nVal, USHORT nWhich ) + : SfxInt16Item( nWhich, nVal ) + {} + +public: + // pure virtual-Methiden from SfxInt16Item + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +class SwChannelRGrf : public SwChannelGrf +{ +public: + SwChannelRGrf( sal_Int16 nVal = 0 ) + : SwChannelGrf( nVal, RES_GRFATR_CHANNELR ) + {} + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; +}; +class SwChannelGGrf : public SwChannelGrf +{ +public: + SwChannelGGrf( sal_Int16 nVal = 0 ) + : SwChannelGrf( nVal, RES_GRFATR_CHANNELG ) + {} + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; +}; +class SwChannelBGrf : public SwChannelGrf +{ +public: + SwChannelBGrf( sal_Int16 nVal = 0 ) + : SwChannelGrf( nVal, RES_GRFATR_CHANNELB ) + {} + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; +}; + +class SwGammaGrf : public SfxPoolItem +{ + double nValue; +public: + TYPEINFO(); + SwGammaGrf() : SfxPoolItem( RES_GRFATR_GAMMA ), nValue( 1.0 ) + {} + + SwGammaGrf( const double& rVal ) + : SfxPoolItem( RES_GRFATR_GAMMA ), nValue( rVal ) + {} + + inline SwGammaGrf& operator=( const SwGammaGrf& rCopy ) + { + SetValue( rCopy.GetValue() ); + return *this; + } + + // pure virtual-Methiden von SfxEnumItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer ) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual int operator==( const SfxPoolItem& ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + + const double& GetValue() const { return nValue; } + void SetValue( const double& rVal ) { nValue = rVal; } +}; + +class SwInvertGrf: public SfxBoolItem +{ +public: + SwInvertGrf( sal_Bool bVal = sal_False ) + : SfxBoolItem( RES_GRFATR_INVERT, bVal ) + {} + + // pure virtual-Methiden from SfxInt16Item + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +class SwTransparencyGrf : public SfxByteItem +{ +public: + SwTransparencyGrf( sal_Int8 nVal = 0 ) + : SfxByteItem( RES_GRFATR_TRANSPARENCY, nVal ) + {} + + // pure virtual-Methiden from SfxInt16Item + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); +}; + +class SwDrawModeGrf : public SfxEnumItem +{ +public: + SwDrawModeGrf( USHORT nMode = 0 ) + : SfxEnumItem( RES_GRFATR_DRAWMODE, nMode ) + {} + + // pure virtual-Methoden von SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + // pure virtual-Methiden von SfxEnumItem + virtual USHORT GetValueCount() const{DBG_BF_ASSERT(0, "STRIP"); return 0;} + virtual USHORT GetVersion( USHORT nFFVer ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); +}; + + + +/****************************************************************************** + * Implementierung der GrafikAttribut Methoden vom SwAttrSet + ******************************************************************************/ + +inline const SwMirrorGrf &SwAttrSet::GetMirrorGrf(BOOL bInP) const + { return (const SwMirrorGrf&)Get( RES_GRFATR_MIRRORGRF,bInP); } +inline const SwCropGrf &SwAttrSet::GetCropGrf(BOOL bInP) const + { return (const SwCropGrf&)Get( RES_GRFATR_CROPGRF,bInP); } +inline const SwRotationGrf &SwAttrSet::GetRotationGrf(BOOL bInP) const + { return (const SwRotationGrf&)Get( RES_GRFATR_ROTATION,bInP); } +inline const SwLuminanceGrf &SwAttrSet::GetLuminanceGrf(BOOL bInP) const + { return (const SwLuminanceGrf&)Get( RES_GRFATR_LUMINANCE,bInP); } +inline const SwContrastGrf &SwAttrSet::GetContrastGrf(BOOL bInP) const + { return (const SwContrastGrf&)Get( RES_GRFATR_CONTRAST,bInP); } +inline const SwChannelRGrf &SwAttrSet::GetChannelRGrf(BOOL bInP) const + { return (const SwChannelRGrf&)Get( RES_GRFATR_CHANNELR,bInP); } +inline const SwChannelGGrf &SwAttrSet::GetChannelGGrf(BOOL bInP) const + { return (const SwChannelGGrf&)Get( RES_GRFATR_CHANNELG,bInP); } +inline const SwChannelBGrf &SwAttrSet::GetChannelBGrf(BOOL bInP) const + { return (const SwChannelBGrf&)Get( RES_GRFATR_CHANNELB,bInP); } +inline const SwGammaGrf &SwAttrSet::GetGammaGrf(BOOL bInP) const + { return (const SwGammaGrf&)Get( RES_GRFATR_GAMMA,bInP); } +inline const SwInvertGrf &SwAttrSet::GetInvertGrf(BOOL bInP) const + { return (const SwInvertGrf&)Get( RES_GRFATR_INVERT,bInP); } +inline const SwTransparencyGrf &SwAttrSet::GetTransparencyGrf(BOOL bInP) const + { return (const SwTransparencyGrf&)Get( RES_GRFATR_TRANSPARENCY,bInP); } +inline const SwDrawModeGrf &SwAttrSet::GetDrawModeGrf(BOOL bInP) const + { return (const SwDrawModeGrf&)Get( RES_GRFATR_DRAWMODE,bInP); } + +/****************************************************************************** + * Implementierung der GrafikAttribut Methoden vom SwFmt + ******************************************************************************/ + +inline const SwMirrorGrf &SwFmt::GetMirrorGrf(BOOL bInP) const + { return aSet.GetMirrorGrf(bInP); } +inline const SwCropGrf &SwFmt::GetCropGrf(BOOL bInP) const + { return aSet.GetCropGrf(bInP); } +inline const SwRotationGrf &SwFmt::GetRotationGrf(BOOL bInP) const + { return aSet.GetRotationGrf(bInP); } +inline const SwLuminanceGrf &SwFmt::GetLuminanceGrf(BOOL bInP) const + { return aSet.GetLuminanceGrf( bInP); } +inline const SwContrastGrf &SwFmt::GetContrastGrf(BOOL bInP) const + { return aSet.GetContrastGrf( bInP); } +inline const SwChannelRGrf &SwFmt::GetChannelRGrf(BOOL bInP) const + { return aSet.GetChannelRGrf( bInP); } +inline const SwChannelGGrf &SwFmt::GetChannelGGrf(BOOL bInP) const + { return aSet.GetChannelGGrf( bInP); } +inline const SwChannelBGrf &SwFmt::GetChannelBGrf(BOOL bInP) const + { return aSet.GetChannelBGrf( bInP); } +inline const SwGammaGrf &SwFmt::GetGammaGrf(BOOL bInP) const + { return aSet.GetGammaGrf( bInP); } +inline const SwInvertGrf &SwFmt::GetInvertGrf(BOOL bInP) const + { return aSet.GetInvertGrf( bInP); } +inline const SwTransparencyGrf &SwFmt::GetTransparencyGrf(BOOL bInP) const + { return aSet.GetTransparencyGrf( bInP); } +inline const SwDrawModeGrf &SwFmt::GetDrawModeGrf(BOOL bInP) const + { return aSet.GetDrawModeGrf(bInP); } + + +} //namespace binfilter +#endif // _GRFATR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/helpid.h b/inc/bf_sw/helpid.h new file mode 100644 index 000000000..45884a345 --- /dev/null +++ b/inc/bf_sw/helpid.h @@ -0,0 +1,876 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SOLAR_HRC +#include <bf_svtools/solar.hrc> +#endif + +#define HID_BASE HID_APP_START + +#define HID_BIB_BASE (HID_BASE + 1) +#define HID_DBSEL (HID_BASE + 2) +#define HID_DBEDIT (HID_BASE + 3) +#define HID_PRINT_OPTION (HID_BASE + 4) +#define HID_MERGE_PRINTMONITOR (HID_BASE + 5) +#define HID_FLD_INPUT (HID_BASE + 6) +#define HID_CONFIG_MISC (HID_BASE + 7) +#define HID_CONFIG_PATH (HID_BASE + 8) +#define HID_CONFIG_TB (HID_BASE + 9) +#define HID_PG_FOOTNOTE (HID_BASE + 10) +#define HID_FORMAT_GRAPHIC (HID_BASE + 11) +#define HID_FILTERSTATUS (HID_BASE + 12) +#define HID_DOCINFO_EDT (HID_BASE + 13) +#define HID_DBLOGON (HID_BASE + 14) +#define HID_MAC_ASSIGN (HID_BASE + 15) +#define HID_CONFIG_MN (HID_BASE + 16) +#define HID_PAPERSIZE (HID_BASE + 17) +#define HID_PASSWD (HID_BASE + 18) +#define HID_SPELLING_OPTIONS (HID_BASE + 19) +#define HID_HYPHENATE_OPTIONS (HID_BASE + 20) +#define HID_FORMAT_COLUMN (HID_BASE + 21) +#define HID_CONFIG_SAVE (HID_BASE + 22) +#define HID_NUM_NAMES (HID_BASE + 23) +#define HID_SYMBOL_SELECT (HID_BASE + 24) +#define HID_CONFIG_KY (HID_BASE + 25) +#define HID_LINKEDIT (HID_BASE + 26) +#define HID_GRAPHIC_PREVIEW (HID_BASE + 28) +#define HID_DICTIONARY (HID_BASE + 29) +#define HID_SET_STYLE (HID_BASE + 30) +#define HID_RIBBONBAR (HID_BASE + 31) +#define HID_STATUSLINE (HID_BASE + 32) +#define HID_DOCBAR (HID_BASE + 33) +#define HID_VRULER (HID_BASE + 34) +#define HID_MAKRO_WINDOW (HID_BASE + 35) +#define HID_ENVELOP_FORMAT (HID_BASE + 37) +#define HID_ENVELOP_PRINTER (HID_BASE + 38) + +#define HID_HEADER_FOOTER_DLG (HID_BASE + 39) +#define HID_GRID_DLG (HID_BASE + 40) +#define HID_USER_ADDRESS_DLG (HID_BASE + 41) +#define HID_SELECT_FAX_DLG (HID_BASE + 42) + +#define HID_LABEL_FORMAT (HID_BASE + 43) +#define HID_BRSORT (HID_BASE + 44) +#define HID_BRSEEK (HID_BASE + 45) +#define HID_BRCFG (HID_BASE + 46) + +#define HID_FORMEDT_CONTENT (HID_BASE + 47) +#define HID_FORMEDT_USER (HID_BASE + 48) +#define HID_FORMEDT_INDEX (HID_BASE + 49) + +#define HID_SCRL_PAGEUP (HID_BASE + 50) +#define HID_SCRL_PAGEDOWN (HID_BASE + 51) + +#define HID_DRAW_WIN (HID_BASE + 52) +#define HID_EDIT_WIN (HID_BASE + 53) + +#define HID_INSERT_CTRL (HID_BASE + 54) // TbxControl Einfuegen +#define HID_INSERT_OBJ_CTRL (HID_BASE + 55) +#define HID_INSERT_FIELD_CTRL (HID_BASE + 56) + +#define HID_SOURCEVIEW (HID_BASE + 57) +#define HID_TBL_OPT_CTRL (HID_BASE + 58) +#define HID_AUTOFORMAT_CLB (HID_BASE + 59) + +#define HID_SCRL_NAVI (HID_BASE + 60) +#define HID_NAVI_DRAG_HYP (HID_BASE + 61) +#define HID_NAVI_DRAG_LINK (HID_BASE + 62) +#define HID_NAVI_DRAG_COPY (HID_BASE + 63) +#define HID_NAVI_OUTLINES (HID_BASE + 64) + +#define HID_AUTOFORMAT_EXEC (HID_BASE + 65) +#define HID_AUTOFORMAT_CLOSE (HID_BASE + 66) + +#define HID_PAGEPREVIEW (HID_BASE + 67) +#define HID_SOURCE_EDITWIN (HID_BASE + 68) + +// Dialog Help-IDs ********************************************************** + +#define HID_CONVERT_FROM (HID_BASE + 200) +#define HID_CONVERT_TO (HID_BASE + 201) +#define HID_EDIT_POSTIT (HID_BASE + 202) +#define HID_INSERT_CHART (HID_BASE + 203) +#define HID_PAGE_PREVIEW (HID_BASE + 204) +#define HID_INSERT_HYPERLINK (HID_BASE + 205) +#define HID_NAVIGATOR_TREELIST (HID_BASE + 206) +#define HID_DLG_CAPTION (HID_BASE + 207) +#define HID_DLG_GLOSS_DECIDE (HID_BASE + 208) +#define HID_NAVIGATOR_TOOLBOX (HID_BASE + 209) +#define HID_NAVIGATOR_LISTBOX (HID_BASE + 210) +#define HID_NUM_BULLET_DLG (HID_BASE + 211) +#define HID_VS_SINGLENUM (HID_BASE + 212) +#define HID_VS_NUM (HID_BASE + 213) +#define HID_VS_BULLET (HID_BASE + 214) +#define HID_VS_NUMBMP (HID_BASE + 215) +#define HID_VS_RULER (HID_BASE + 216) +#define HID_RULER_DIALOG (HID_BASE + 217) +#define HID_INSERT_ABSTRACT (HID_BASE + 218) +#define HID_NAVI_TBX1 (HID_BASE + 219) +#define HID_NAVI_TBX2 (HID_BASE + 220) +#define HID_NAVI_TBX3 (HID_BASE + 221) +#define HID_NAVI_TBX4 (HID_BASE + 222) +#define HID_NAVI_TBX5 (HID_BASE + 223) +#define HID_NAVI_TBX6 (HID_BASE + 224) +#define HID_NAVI_TBX7 (HID_BASE + 225) +#define HID_NAVI_TBX8 (HID_BASE + 226) +#define HID_NAVI_TBX9 (HID_BASE + 227) +#define HID_NAVI_TBX10 (HID_BASE + 228) +#define HID_NAVI_TBX11 (HID_BASE + 229) +#define HID_NAVI_TBX12 (HID_BASE + 230) +#define HID_NAVI_TBX13 (HID_BASE + 231) +#define HID_NAVI_TBX14 (HID_BASE + 232) +#define HID_NAVI_TBX15 (HID_BASE + 233) +#define HID_NAVI_VS (HID_BASE + 234) +#define HID_NUM_FORMAT_BTN (HID_BASE + 235) +#define HID_PPREV_ZOOM (HID_BASE + 236) +#define HID_NAVI_TBX16 (HID_BASE + 237) +#define HID_LTEMPL_TEXT (HID_BASE + 238) +#define HID_LTEMPL_FRAME (HID_BASE + 239) +#define HID_LTEMPL_PAGE (HID_BASE + 240) +#define HID_LTEMPL_OVERRIDE (HID_BASE + 241) +#define HID_LTEMPL_TEMPLATES (HID_BASE + 242) +#define HID_NAVI_TBX17 (HID_BASE + 243) +#define HID_NAVI_TBX18 (HID_BASE + 244) +#define HID_NAVI_TBX19 (HID_BASE + 245) +#define HID_NAVI_TBX20 (HID_BASE + 246) +#define HID_NAVI_TBX21 (HID_BASE + 247) +#define HID_NAVI_TBX22 (HID_BASE + 248) +#define HID_NAVI_TBX23 (HID_BASE + 249) +#define HID_NAVI_TBX24 (HID_BASE + 250) +#define HID_NAVIGATOR_GLOBAL_TOOLBOX (HID_BASE + 251) +#define HID_NAVIGATOR_GLOB_TREELIST (HID_BASE + 252) +#define HID_GLOS_GROUP_TREE (HID_BASE + 253) +#define HID_GLBLTREE_UPDATE (HID_BASE + 254) +#define HID_GLBLTREE_INSERT (HID_BASE + 255) +#define HID_GLBLTREE_EDIT (HID_BASE + 256) +#define HID_GLBLTREE_DEL (HID_BASE + 257) +#define HID_GLBLTREE_INS_IDX (HID_BASE + 258) +#define HID_GLBLTREE_INS_CNTIDX (HID_BASE + 259) +#define HID_GLBLTREE_INS_USRIDX (HID_BASE + 260) +#define HID_GLBLTREE_INS_FILE (HID_BASE + 261) +#define HID_GLBLTREE_INS_NEW_FILE (HID_BASE + 262) +#define HID_GLBLTREE_INS_TEXT (HID_BASE + 263) +#define HID_GLBLTREE_UPD_SEL (HID_BASE + 264) +#define HID_GLBLTREE_UPD_IDX (HID_BASE + 265) +#define HID_GLBLTREE_UPD_LINK (HID_BASE + 266) +#define HID_GLBLTREEUPD_ALL (HID_BASE + 267) +#define HID_NUM_OUTL_NAMED_NUMS (HID_BASE + 268) +#define HID_NUM_OUTL_NUM_SAVEAS (HID_BASE + 269) +#define HID_NUM_NAMED_NUMS (HID_BASE + 270) +#define HID_NUM_NUM_SAVEAS (HID_BASE + 271) +#define HID_NUM_STD_NUMBER (HID_BASE + 272) +#define HID_NUM_DEL_NUMBER (HID_BASE + 273) +#define HID_NUM_STD_BULLET (HID_BASE + 274) +#define HID_NUM_DEL_BULLET (HID_BASE + 275) +#define HID_NAVI_CONTENT (HID_BASE + 276) +#define HID_NAVI_GLOBAL (HID_BASE + 277) +#define HID_LTEMPL_NUMBERING (HID_BASE + 278) +#define HID_FLDVAR_APPLY (HID_BASE + 279) +#define HID_FLDVAR_DELETE (HID_BASE + 280) +#define HID_FLDEDT_ADDRESS (HID_BASE + 281) +#define HID_SORT_ACTION (HID_BASE + 282) +#define HID_SORT_AUTHOR (HID_BASE + 283) +#define HID_SORT_DATE (HID_BASE + 284) +#define HID_SORT_COMMENT (HID_BASE + 285) +#define HID_SW_SORT_POSITION (HID_BASE + 286) +#define HID_SYNC_BTN (HID_BASE + 287) +#define HID_EDIT_COMMENT (HID_BASE + 288) +#define HID_SEL_TEMPLATE (HID_BASE + 289) +#define HID_DLG_SEQUENCE_OPTION (HID_BASE + 290) +#define HID_DLG_FLDEDT_NEXT (HID_BASE + 291) +#define HID_DLG_FLDEDT_PREV (HID_BASE + 292) +#define HID_DLG_FLDEDT_ADDRESS (HID_BASE + 293) +#define HID_DLG_PRV_PRT_OPTIONS (HID_BASE + 294) + +#define HID_FILEDLG_CHARDLG (HID_BASE + 295) +#define HID_FILEDLG_LOADTEMPLATE (HID_BASE + 296) +#define HID_FILEDLG_ROMENU (HID_BASE + 297) +#define HID_FILEDLG_MAILMRGE1 (HID_BASE + 298) +#define HID_FILEDLG_MAILMRGE2 (HID_BASE + 299) +#define HID_FILEDLG_FRMPAGE (HID_BASE + 300) +#define HID_FILEDLG_SRCVIEW (HID_BASE + 301) +#define HID_FILEDLG_WIZDOKU (HID_BASE + 302) +#define HID_PREVIEW_ZOOM (HID_BASE + 303) + +#define HID_REDLINE_AUTOFMT_ACCEPT (HID_BASE + 304) +#define HID_MULTI_TOX_DLG (HID_BASE + 305) +#define HID_ASCII_FILTER (HID_BASE + 306) +#define HID_GLBLTREE_EDIT_LINK (HID_BASE + 307) +#define HID_FORMAT_NAME_OBJECT_NAME (HID_BASE + 308)// #100286# + +// TabPage Help-IDs ********************************************************* + +#define HID_DROPCAPS (HID_BASE + 400) +#define HID_FRM_EXT (HID_BASE + 401) +#define HID_FRM_STD (HID_BASE + 402) +#define HID_GRF_EXT (HID_BASE + 403) +#define HID_COLUMN (HID_BASE + 404) +#define HID_DOC_STAT (HID_BASE + 405) +#define HID_MACROASSIGN (HID_BASE + 406) +#define HID_FOOTNOTE_PAGE (HID_BASE + 407) +#define HID_OPTDOCDISP_PAGE (HID_BASE + 408) +#define HID_OPTGRID_PAGE (HID_BASE + 409) +#define HID_OPTTEST_PAGE (HID_BASE + 410) +#define HID_OPTPRINT_PAGE (HID_BASE + 411) +#define HID_FORMAT_TABLE (HID_BASE + 412) +#define HID_TABLE_COLUMN (HID_BASE + 413) +#define HID_LAB_LAB (HID_BASE + 414) +#define HID_LAB_PRT (HID_BASE + 415) +#define HID_ENV_PRT (HID_BASE + 416) +#define HID_LAB_FMT (HID_BASE + 417) +#define HID_ENV_ENV (HID_BASE + 418) +#define HID_ENV_FMT (HID_BASE + 419) +#define HID_FRM_URL (HID_BASE + 421) +#define HID_CHAR_URL (HID_BASE + 422) +#define HID_CONTENT_OPT (HID_BASE + 423) +#define HID_LAYOUT_OPT (HID_BASE + 424) +#define HID_STD_FONT (HID_BASE + 425) +#define HID_COND_COLL (HID_BASE + 426) +#define HID_FRM_ADD (HID_BASE + 427) +#define HID_TABLE_TEXTFLOW (HID_BASE + 428) +#define HID_AUTOFMT_BY_INPUT (HID_BASE + 429) +#define HID_AUTOFMT_APPLY (HID_BASE + 430) +#define HID_OPTTABLE_PAGE (HID_BASE + 431) +#define HID_PICK_SINGLE_NUM (HID_BASE + 432) +#define HID_PICK_BULLET (HID_BASE + 433) +#define HID_PICK_NUM (HID_BASE + 434) +#define HID_PICK_BMP (HID_BASE + 435) + +#define HID_FLD_DB (HID_BASE + 437) +#define HID_FLD_DOKINF (HID_BASE + 438) +#define HID_FLD_VAR (HID_BASE + 439) +#define HID_FLD_DOK (HID_BASE + 440) +#define HID_FLD_FUNC (HID_BASE + 441) +#define HID_FLD_REF (HID_BASE + 442) +#define HID_OPTSHDWCRSR (HID_BASE + 443) +#define HID_NUM_OPTIONS (HID_BASE + 444) +#define HID_NUM_POSITION (HID_BASE + 445) +#define HID_NUMPARA (HID_BASE + 446) +#define HID_FOOTNOTE_OPTIONS (HID_BASE + 447) +#define HID_ENDNOTE_OPTIONS (HID_BASE + 448) +#define HID_REDLINE_OPT (HID_BASE + 449) + +#define HID_REDLINE_ACCEPT (HID_BASE + 451) +#define HID_EDIT_FLD_DB (HID_BASE + 452) +#define HID_EDIT_FLD_DOKINF (HID_BASE + 453) +#define HID_EDIT_FLD_VAR (HID_BASE + 454) +#define HID_EDIT_FLD_DOK (HID_BASE + 455) +#define HID_EDIT_FLD_FUNC (HID_BASE + 456) +#define HID_EDIT_FLD_REF (HID_BASE + 457) +#define HID_REDLINE_CTRL (HID_BASE + 458) +#define HID_TP_OUTLINE_NUM (HID_BASE + 459) +#define HID_OPTINSERT_PAGE (HID_BASE + 460) +#define HID_OPTCAPTION_PAGE (HID_BASE + 461) +#define HID_OPTLOAD_PAGE (HID_BASE + 462) +#define HID_INSERT_TOX_PAGE (HID_BASE + 463) +#define HID_TOX_FORM_ENTRY_PAGE (HID_BASE + 464) +#define HID_TOX_FORM_STYLES_PAGE (HID_BASE + 465) +#define HID_INSERT_TOX_TABDLG (HID_BASE + 466) +#define HID_INSERT_SECTION_PAGE (HID_BASE + 467) +#define HID_INSERT_SECTION_DLG (HID_BASE + 468) +#define HID_SECTION_PROPERTIES_DLG (HID_BASE + 469) +#define HID_RENAME_XNAMED (HID_BASE + 470) +#define HID_TP_TOX_SELECT (HID_BASE + 471) +#define HID_TP_TOX_ENTRY (HID_BASE + 472) +#define HID_TOX_STYLES_PAGE (HID_BASE + 473) +#define HID_TP_VISITING_CARDS (HID_BASE + 474) +#define HID_DLG_ADD_IDX_STYLES (HID_BASE + 475) +#define HID_ADD_STYLES_TLB (HID_BASE + 476) +#define HID_OLE_CHECKLB (HID_BASE + 477) +#define HID_DLG_CREATE_AUTH_ENTRY (HID_BASE + 478) +#define HID_TP_PRIVATE_DATA (HID_BASE + 479) +#define HID_TP_BUSINESS_DATA (HID_BASE + 480) +#define HID_SECTION_FTNENDNOTES_PAGE (HID_BASE + 481) +#define HID_TEXTGRID_PAGE (HID_BASE + 482) + +// AutoPilot Help-IDs ********************************************************* + +#define HID_LETTER_PAGE1 (HID_BASE + 501) +#define HID_LETTER_PAGE2 (HID_BASE + 502) +#define HID_LETTER_PAGE3 (HID_BASE + 503) +#define HID_LETTER_PAGE4 (HID_BASE + 504) +#define HID_LETTER_PAGE5 (HID_BASE + 505) +#define HID_LETTER_PAGE6 (HID_BASE + 506) +#define HID_LETTER_PAGE7 (HID_BASE + 507) +#define HID_LETTER_PAGE8 (HID_BASE + 508) +#define HID_LETTER_PAGE9 (HID_BASE + 509) + +#define HID_FAX_PAGE1 (HID_BASE + 511) +#define HID_FAX_PAGE2 (HID_BASE + 512) +#define HID_FAX_PAGE3 (HID_BASE + 513) +#define HID_FAX_PAGE4 (HID_BASE + 514) +#define HID_FAX_PAGE5 (HID_BASE + 515) +#define HID_FAX_PAGE6 (HID_BASE + 516) +#define HID_FAX_PAGE7 (HID_BASE + 517) +#define HID_FAX_PAGE8 (HID_BASE + 518) + +#define HID_MEMO_PAGE1 (HID_BASE + 521) +#define HID_MEMO_PAGE2 (HID_BASE + 522) +#define HID_MEMO_PAGE3 (HID_BASE + 523) +#define HID_MEMO_PAGE4 (HID_BASE + 524) +#define HID_MEMO_PAGE5 (HID_BASE + 525) + +#define HID_AGENDA_PAGE1 (HID_BASE + 531) +#define HID_AGENDA_PAGE2 (HID_BASE + 532) +#define HID_AGENDA_PAGE3 (HID_BASE + 533) +#define HID_AGENDA_PAGE4 (HID_BASE + 534) +#define HID_AGENDA_PAGE5 (HID_BASE + 535) +#define HID_AGENDA_PAGE6 (HID_BASE + 536) + +#define HID_AUTOPILOT_NEXT (HID_BASE + 537) +#define HID_AUTOPILOT_PREV (HID_BASE + 538) +#define HID_AUTOPILOT_OK (HID_BASE + 539) + +// HelpIds fuers Menue ***************************************************** + +#define HID_MN_SUB_TBLROW (HID_BASE + 600) +#define HID_MN_SUB_TBLCOL (HID_BASE + 601) +#define HID_MN_SUB_AUTOFORMAT (HID_BASE + 602) +#define HID_MN_SUB_TOOLBAR (HID_BASE + 603) +#define HID_MN_SUB_FIELD (HID_BASE + 604) +#define HID_MN_SUB_GRAPHIC (HID_BASE + 605) +#define HID_MN_SUB_TEMPLATES (HID_BASE + 606) +#define HID_MN_SUB_ARRANGE (HID_BASE + 607) +#define HID_MN_SUB_SPELLING (HID_BASE + 608) +#define HID_MN_SUB_UPDATE (HID_BASE + 609) +#define HID_MN_SUB_MIRROR (HID_BASE + 610) +#define HID_MN_SUB_ALIGN (HID_BASE + 611) +#define HID_MN_SUB_OPTIONS (HID_BASE + 612) + +#define HID_MN_CALC_PHD (HID_BASE + 613) +#define HID_MN_CALC_SQRT (HID_BASE + 614) +#define HID_MN_CALC_OR (HID_BASE + 615) +#define HID_MN_CALC_XOR (HID_BASE + 616) +#define HID_MN_CALC_AND (HID_BASE + 617) +#define HID_MN_CALC_NOT (HID_BASE + 618) +#define HID_MN_CALC_EQ (HID_BASE + 619) +#define HID_MN_CALC_NEQ (HID_BASE + 620) +#define HID_MN_CALC_LEQ (HID_BASE + 621) +#define HID_MN_CALC_GEQ (HID_BASE + 622) +#define HID_MN_CALC_LES (HID_BASE + 623) +#define HID_MN_CALC_GRE (HID_BASE + 624) +#define HID_MN_CALC_SUM (HID_BASE + 625) +#define HID_MN_CALC_MEAN (HID_BASE + 626) +#define HID_MN_CALC_MIN (HID_BASE + 627) +#define HID_MN_CALC_MAX (HID_BASE + 628) +#define HID_MN_CALC_SIN (HID_BASE + 629) +#define HID_MN_CALC_COS (HID_BASE + 630) +#define HID_MN_CALC_TAN (HID_BASE + 631) +#define HID_MN_CALC_ASIN (HID_BASE + 632) +#define HID_MN_CALC_ACOS (HID_BASE + 633) +#define HID_MN_CALC_ATAN (HID_BASE + 634) +#define HID_MN_CALC_POW (HID_BASE + 635) +#define HID_MN_CALC_LISTSEP (HID_BASE + 636) +#define HID_MN_POP_OPS (HID_BASE + 637) +#define HID_MN_POP_STATISTICS (HID_BASE + 638) +#define HID_MN_POP_FUNC (HID_BASE + 639) +#define HID_MN_RSC_END (HID_BASE + 640) +#define HID_MN_CALC_ROUND (HID_BASE + 641) +#define HID_MN_SUB_MACRO (HID_BASE + 642) + +#define HID_MN_READONLY_SAVEGRAPHIC (HID_BASE + 645) +#define HID_MN_READONLY_GRAPHICTOGALLERY (HID_BASE + 646) +#define HID_MN_READONLY_TOGALLERYLINK (HID_BASE + 647) +#define HID_MN_READONLY_TOGALLERYCOPY (HID_BASE + 648) +#define HID_MN_READONLY_SAVEBACKGROUND (HID_BASE + 649) +#define HID_MN_READONLY_BACKGROUNDTOGALLERY (HID_BASE + 650) +#define HID_MN_READONLY_COPYLINK (HID_BASE + 651) +#define HID_MN_READONLY_COPYGRAPHIC (HID_BASE + 652) +#define HID_MN_READONLY_LOADGRAPHIC (HID_BASE + 653) +#define HID_MN_READONLY_GRAPHICOFF (HID_BASE + 654) +#define HID_MN_READONLY_PLUGINOFF (HID_BASE + 655) + +#define HID_MD_GLOS_DEFINE (HID_BASE + 656) +#define HID_MD_GLOS_REPLACE (HID_BASE + 657) +#define HID_MD_GLOS_RENAME (HID_BASE + 658) +#define HID_MD_GLOS_DELETE (HID_BASE + 659) +#define HID_MD_GLOS_EDIT (HID_BASE + 660) +#define HID_MD_GLOS_MACRO (HID_BASE + 661) +#define HID_LINGU_ADD_WORD (HID_BASE + 662) +#define HID_LINGU_IGNORE_WORD (HID_BASE + 663) +#define HID_LINGU_SPELLING_DLG (HID_BASE + 664) +#define HID_LINGU_AUTOCORR (HID_BASE + 665) +#define HID_LINGU_REPLACE (HID_BASE + 666) +#define HID_MD_GLOS_CATEGORY (HID_BASE + 667) +#define HID_REGION_TREE (HID_BASE + 668) +#define HID_LINGU_WORD_LANGUAGE (HID_BASE + 669) +#define HID_LINGU_PARA_LANGUAGE (HID_BASE + 670) +#define HID_MD_GLOS_DEFINE_TEXT (HID_BASE + 671) +#define HID_DLG_PASSWD_SECTION (HID_BASE + 672) +#define HID_MD_COPY_TO_CLIPBOARD (HID_BASE + 673) +#define HID_MD_GLOS_IMPORT (HID_BASE + 674) + +// Weiter Help-IDs ********************************************************** + +#define HID_CLOSE_FILE (HID_BASE + 1001) +#define HID_LAUNCH_REGISTRY (HID_BASE + 1002) +#define HID_MERGE_FILE (HID_BASE + 1003) +#define HID_MERGE_FILE_DLG (HID_BASE + 1004) +#define HID_NEW_FILE (HID_BASE + 1005) +#define HID_OPEN_FILE (HID_BASE + 1007) +#define HID_OPEN_LASTVERSION (HID_BASE + 1009) +#define HID_PRINT_FILE (HID_BASE + 1010) +#define HID_PRINT_FILE_OPTIONS (HID_BASE + 1011) +#define HID_SAVE_FILE_AS (HID_BASE + 1012) +#define HID_SAVE_FILE (HID_BASE + 1013) +#define HID_SETUP_PRINTER_DLG (HID_BASE + 1015) +#define HID_EXIT (HID_BASE + 1017) +#define HID_CREATE_DOCUMENT (HID_BASE + 1019) +#define HID_DOCSTAT_DLG (HID_BASE + 1020) +#define HID_LOAD_TEMPLATE_DLG (HID_BASE + 1021) +#define HID_SAVE_ALL (HID_BASE + 1023) +#define HID_NEW_FILE_DEFAULT (HID_BASE + 1024) +#define HID_PRINT_FILE_DEFAULT (HID_BASE + 1025) +#define HID_FAX (HID_BASE + 1028) +#define HID_SELECT_DATABASE (HID_BASE + 1030) +#define HID_DOC_INFO_DLG (HID_BASE + 1031) +#define HID_DOC_MGR_DLG (HID_BASE + 1032) +#define HID_OPTCAPTION_CLB (HID_BASE + 1033) + +#define HID_COPY (HID_BASE + 1102) +#define HID_CUT (HID_BASE + 1103) +#define HID_EDIT_FIELD (HID_BASE + 1104) +#define HID_EDIT_FILE_INFO_DLG (HID_BASE + 1107) +#define HID_EDIT_LINK_DLG (HID_BASE + 1109) +#define HID_EDIT_OBJECT (HID_BASE + 1110) +#define HID_GOTO (HID_BASE + 1111) +#define HID_SET_FIELD_VALUE (HID_BASE + 1112) +#define HID_PASTE (HID_BASE + 1113) +#define HID_REDO (HID_BASE + 1116) +#define HID_SEARCH (HID_BASE + 1117) +#define HID_REPLACE (HID_BASE + 1118) +#define HID_SELECT_ALL (HID_BASE + 1119) +#define HID_UNDO (HID_BASE + 1120) +#define HID_REPEAT (HID_BASE + 1122) +#define HID_BUFFER_UPDATE (HID_BASE + 1124) +#define HID_UPDATE_FIELDS (HID_BASE + 1126) +#define HID_EXECUTE_MACROFIELD (HID_BASE + 1127) +#define HID_EDIT_FORMULA (HID_BASE + 1128) +#define HID_CALC_TABLE (HID_BASE + 1129) +#define HID_NUM_BULLET_DOWN (HID_BASE + 1130) +#define HID_NUM_BULLET_UP (HID_BASE + 1131) +#define HID_NUM_BULLET_PREV (HID_BASE + 1132) +#define HID_NUM_BULLET_NEXT (HID_BASE + 1133) +#define HID_NUM_BULLET_MOVEUP (HID_BASE + 1134) +#define HID_NUM_BULLET_MOVEDOWN (HID_BASE + 1135) +#define HID_NUM_BULLET_NONUM (HID_BASE + 1136) +#define HID_NUM_BULLET_OFF (HID_BASE + 1137) +#define HID_NUM_BULLET_ON (HID_BASE + 1138) +#define HID_NUM_BULLET_OUTLINE_DOWN (HID_BASE + 1139) +#define HID_NUM_BULLET_OUTLINE_UP (HID_BASE + 1140) +#define HID_NUM_BULLET_OUTLINE_MOVEUP (HID_BASE + 1141) +#define HID_NUM_BULLET_OUTLINE_MOVEDOWN (HID_BASE + 1142) +#define HID_UPDATE_INPUTFIELDS (HID_BASE + 1143) +#define HID_NUM_NUMBERING_ON (HID_BASE + 1144) +#define HID_REPEAT_SEARCH (HID_BASE + 1150) +#define HID_REPAGINATE (HID_BASE + 1161) + +#define HID_REFRESH_VIEW (HID_BASE + 1201) +#define HID_RIBBON (HID_BASE + 1210) +#define HID_RULER (HID_BASE + 1211) +#define HID_STATUSBAR (HID_BASE + 1212) +#define HID_TOOLBOX (HID_BASE + 1213) +#define HID_VIEW_BOUNDS (HID_BASE + 1214) +#define HID_VIEW_FIELDS (HID_BASE + 1215) +#define HID_VLINEAL (HID_BASE + 1216) +#define HID_VSCROLLBAR (HID_BASE + 1217) +#define HID_HSCROLLBAR (HID_BASE + 1218) +#define HID_VIEW_META_CHARS (HID_BASE + 1224) +#define HID_VIEW_MARKS (HID_BASE + 1225) +#define HID_VIEW_FIELDNAME (HID_BASE + 1226) +#define HID_VIEW_TABLEGRID (HID_BASE + 1227) +#define HID_ZOOM (HID_BASE + 1231) + +#define HID_DELETE_BOOKMARK (HID_BASE + 1301) +#define HID_INSERT_BREAK (HID_BASE + 1303) +#define HID_INSERT_COLUMN_BREAK (HID_BASE + 1305) +#define HID_INSERT_FILE (HID_BASE + 1309) +#define HID_INSERT_FOOTNOTE (HID_BASE + 1311) +#define HID_INSERT_GRAFIC (HID_BASE + 1315) +#define HID_INSERT_LINEBREAK (HID_BASE + 1318) +#define HID_INSERT_MERGEFIELD_DLG (HID_BASE + 1320) +#define HID_INSERT_OBJECT_DLG (HID_BASE + 1322) +#define HID_INSERT_PAGEBREAK (HID_BASE + 1323) +#define HID_INSERT_RECORD (HID_BASE + 1326) +#define HID_MERGE_RECORD (HID_BASE + 1327) +#define HID_INSERT_SYMBOL (HID_BASE + 1328) +#define HID_INSERT_STRING (HID_BASE + 1331) +#define HID_INSERT_COLS (HID_BASE + 1332) +#define HID_INSERT_FRAME_INTERACT (HID_BASE + 1333) +#define HID_INSERT_FRAME (HID_BASE + 1334) +#define HID_INSERT_IDX_ENTRY (HID_BASE + 1340) +#define HID_INSERT_USERIDX_ENTRY (HID_BASE + 1341) +#define HID_INSERT_CNTNTIDX_ENTRY (HID_BASE + 1342) +#define HID_INSERT_SOFT_HYPHEN (HID_BASE + 1350) +#define HID_INSERT_HARD_SPACE (HID_BASE + 1351) + +#define HID_SET_FONT (HID_BASE + 1401) +#define HID_SET_FONT_SIZE (HID_BASE + 1402) +#define HID_GROW_FONT_SIZE (HID_BASE + 1403) +#define HID_SHRINK_FONT_SIZE (HID_BASE + 1404) +#define HID_SET_BOLD (HID_BASE + 1405) +#define HID_SET_ITALIC (HID_BASE + 1406) +#define HID_SET_SHADOW (HID_BASE + 1407) +#define HID_SET_OUTLINE (HID_BASE + 1408) +#define HID_SET_UNDERLINE (HID_BASE + 1409) +#define HID_SET_STRIKEOUT (HID_BASE + 1410) +#define HID_SET_SUPER_SCRIPT (HID_BASE + 1411) +#define HID_SET_SUB_SCRIPT (HID_BASE + 1412) +#define HID_SET_COLOR (HID_BASE + 1413) +#define HID_SET_CASEMAP (HID_BASE + 1414) +#define HID_SET_LANGUAGE (HID_BASE + 1415) +#define HID_SET_KERNING (HID_BASE + 1416) +#define HID_INDENT_TO_TABSTOP (HID_BASE + 1417) +#define HID_SET_LEFT_PARA (HID_BASE + 1418) +#define HID_SET_RIGHT_PARA (HID_BASE + 1419) +#define HID_SET_CENTER_PARA (HID_BASE + 1420) +#define HID_SET_JUSTIFY_PARA (HID_BASE + 1421) +#define HID_SET_LINE_SPACE_1 (HID_BASE + 1422) +#define HID_SET_LINE_SPACE_15 (HID_BASE + 1423) +#define HID_SET_LINE_SPACE_2 (HID_BASE + 1424) +#define HID_FLIP_HORZ_GRAFIC (HID_BASE + 1425) +#define HID_FLIP_VERT_GRAFIC (HID_BASE + 1426) +#define HID_SET_ADJUST (HID_BASE + 1428) +#define HID_SET_LRMARGIN (HID_BASE + 1429) +#define HID_SET_ULMARGIN (HID_BASE + 1430) +#define HID_UNINDENT_TO_TABSTOP (HID_BASE + 1431) +#define HID_SET_HYPHEN_ZONE (HID_BASE + 1432) +#define HID_SET_PAGE_BREAK (HID_BASE + 1433) +#define HID_SET_KEEP_TOGETHER (HID_BASE + 1434) +#define HID_SET_WIDOW (HID_BASE + 1436) +#define HID_SET_ORPHAN (HID_BASE + 1437) +#define HID_FORMAT_SHADOW (HID_BASE + 1438) +#define HID_FORMAT_BORDER (HID_BASE + 1439) +#define HID_FORMAT_CHAR_DLG (HID_BASE + 1441) +#define HID_FORMAT_PARA_DLG (HID_BASE + 1443) +#define HID_FORMAT_TAB (HID_BASE + 1444) +#define HID_FORMAT_TAB_DLG (HID_BASE + 1445) +#define HID_FORMAT_BORDER_DLG (HID_BASE + 1447) +#define HID_FORMAT_BACKGROUND (HID_BASE + 1448) +#define HID_FORMAT_BACKGROUND_DLG (HID_BASE + 1450) +#define HID_FORMAT_PAGE (HID_BASE + 1451) +#define HID_FORMAT_PAGE_DLG (HID_BASE + 1452) +#define HID_FORMAT_DROPCAPS (HID_BASE + 1454) +#define HID_FORMAT_FRAME_DLG (HID_BASE + 1456) +#define HID_FORMAT_GRAFIC_DLG (HID_BASE + 1458) +#define HID_FORMAT_TABLE_DLG (HID_BASE + 1460) +#define HID_NEW_STYLE_BY_EXAMPLE (HID_BASE + 1462) +#define HID_UPDATE_STYLE_BY_EXAMPLE (HID_BASE + 1463) +#define HID_STYLE_SHEET_FRAME_DLG (HID_BASE + 1464) +#define HID_STYLE_SHEET_DOC_DLG (HID_BASE + 1465) +#define HID_FORMAT_RESET (HID_BASE + 1469) +#define HID_FRAME_TO_TOP (HID_BASE + 1470) +#define HID_FRAME_TO_BOTTOM (HID_BASE + 1471) +#define HID_FRAME_NOWRAP (HID_BASE + 1472) +#define HID_FRAME_WRAP (HID_BASE + 1473) +#define HID_FRAME_WRAPTHRU (HID_BASE + 1474) +#define HID_FRAME_ALIGN_HORZ_LEFT (HID_BASE + 1475) +#define HID_FRAME_ALIGN_HORZ_RIGHT (HID_BASE + 1476) +#define HID_FRAME_ALIGN_HORZ_CENTER (HID_BASE + 1477) +#define HID_FRAME_ALIGN_VERT_TOP (HID_BASE + 1478) +#define HID_FRAME_ALIGN_VERT_BOTTOM (HID_BASE + 1479) +#define HID_FRAME_ALIGN_VERT_CENTER (HID_BASE + 1480) +#define HID_SET_FRM_SIZE (HID_BASE + 1481) +#define HID_SET_FRM_POSITION (HID_BASE + 1482) +#define HID_SET_FRM_ANCHOR (HID_BASE + 1483) +#define HID_SET_FRM_WRAP (HID_BASE + 1484) +#define HID_SET_FRM_DIST (HID_BASE + 1485) +#define HID_SET_FRM_OPTIONS (HID_BASE + 1486) +#define HID_SET_GRF_MIRROR (HID_BASE + 1488) +#define HID_SET_TABLE_WIDTH (HID_BASE + 1489) +#define HID_SET_TABLE_ALIGN (HID_BASE + 1490) +#define HID_SET_CHAR_STYLE (HID_BASE + 1491) +#define HID_SET_PARA_STYLE (HID_BASE + 1492) +#define HID_SET_PAGE_STYLE (HID_BASE + 1493) +#define HID_SET_FRM_MACRO (HID_BASE + 1494) +#define HID_SET_FRM_COLUMNS (HID_BASE + 1495) +#define HID_SET_FRM_COLUMN_WIDTH (HID_BASE + 1496) +#define HID_UPDATE_STYLES_DIRECT (HID_BASE + 1497) + +#define HID_TABLE_INSERT_ROW (HID_BASE + 1501) +#define HID_TABLE_DELETE_ROW (HID_BASE + 1503) +#define HID_TABLE_DELETE_COL (HID_BASE + 1504) +#define HID_TABLE_MERGE_CELLS (HID_BASE + 1506) +#define HID_AUTOFMT_TABLE (HID_BASE + 1507) +#define HID_SWDLG_STRINPUT (HID_BASE + 1508) +#define HID_TABLE_SET_ULSPACE (HID_BASE + 1509) +#define HID_TABLE_SET_GRID (HID_BASE + 1510) +#define HID_TABLE_SET_SHADOW (HID_BASE + 1511) +#define HID_TABLE_SELECT_ROW (HID_BASE + 1513) +#define HID_TABLE_SELECT_COL (HID_BASE + 1514) +#define HID_TABLE_SELECT_ALL (HID_BASE + 1515) +#define HID_TABLE_SET_READ_ONLY_CELLS (HID_BASE + 1517) +#define HID_TABLE_UNSET_READ_ONLY_CELLS (HID_BASE + 1519) +#define HID_PAGE_STYLE_SET_COLS (HID_BASE + 1538) +#define HID_SET_PROP_LINE_SPACE (HID_BASE + 1540) +#define HID_SET_ABS_LINE_SPACE (HID_BASE + 1541) + +#define HID_SPELLING_DLG (HID_BASE + 1601) +#define HID_THESAURUS_DLG (HID_BASE + 1604) +#define HID_HYPHENATE_OPT_DLG (HID_BASE + 1607) +#define HID_SORTING (HID_BASE + 1613) +#define HID_SORTING_DLG (HID_BASE + 1614) +#define HID_CALCULATE (HID_BASE + 1615) +#define HID_RECORD_MACRO_DLG (HID_BASE + 1622) +#define HID_PLAY_MACRO_DLG (HID_BASE + 1624) +#define HID_CONFIG_DLG (HID_BASE + 1627) +#define HID_EXPAND_GLOSSARY (HID_BASE + 1628) +#define HID_RENAME_GLOSSARY (HID_BASE + 1629) +#define HID_CONFIG_MENU (HID_BASE + 1630) +#define HID_CONFIG_KEY (HID_BASE + 1631) +#define HID_ASSIGN_LOCAL_MACRO_DLG (HID_BASE + 1632) +#define HID_COMPILE_MACRO (HID_BASE + 1633) +#define HID_CONFIG_VIEWOPTIONS (HID_BASE + 1635) +#define HID_CONFIG_COLORS (HID_BASE + 1636) +#define HID_INSERT_GLOSSARY (HID_BASE + 1640) +#define HID_AUTO_CORRECT (HID_BASE + 1649) +#define HID_AUTO_CORRECT_DLG (HID_BASE + 1650) +#define HID_HELP_PI (HID_BASE + 1655) +#define HID_NAVIGATION_PI (HID_BASE + 1656) +#define HID_TEMPLATE_PI (HID_BASE + 1657) +#define HID_ADDR_PI (HID_BASE + 1658) +#define HID_NAVIGATION_PI_GOTO_PAGE (HID_BASE + 1659) +#define HID_LETTER_WIZZARD (HID_BASE + 1660) +#define HID_FAX_WIZZARD (HID_BASE + 1661) +#define HID_MEMO_WIZZARD (HID_BASE + 1662) +#define HID_AGENDA_WIZZARD (HID_BASE + 1663) + +#define HID_NEW_WINDOW (HID_BASE + 1701) +#define HID_ARRANGE_ALL_WIN (HID_BASE + 1702) +#define HID_ARRANGE_CASCADE_WIN (HID_BASE + 1703) +#define HID_ARRANGE_HORZ_WIN (HID_BASE + 1704) +#define HID_ARRANGE_VERT_WIN (HID_BASE + 1705) + +#define HID_SHOW_HELP_INDEX (HID_BASE + 1802) +#define HID_SHOW_KEYBOARD_HELP (HID_BASE + 1803) +#define HID_SHOW_HELP_MANUAL (HID_BASE + 1804) +#define HID_SHOW_UPDATE_HELP (HID_BASE + 1805) + +#define HID_CHAR_LEFT (HID_BASE + 1901) +#define HID_CHAR_RIGHT (HID_BASE + 1902) +#define HID_LINE_UP (HID_BASE + 1903) +#define HID_LINE_DOWN (HID_BASE + 1904) +#define HID_START_OF_LINE (HID_BASE + 1905) +#define HID_END_OF_LINE (HID_BASE + 1906) +#define HID_START_OF_DOCUMENT (HID_BASE + 1907) +#define HID_END_OF_DOCUMENT (HID_BASE + 1908) +#define HID_START_OF_NEXT_PAGE (HID_BASE + 1909) +#define HID_END_OF_NEXT_PAGE (HID_BASE + 1910) +#define HID_START_OF_PREV_PAGE (HID_BASE + 1911) +#define HID_END_OF_PREV_PAGE (HID_BASE + 1912) +#define HID_START_OF_PAGE (HID_BASE + 1913) +#define HID_END_OF_PAGE (HID_BASE + 1914) +#define HID_START_OF_COLUMN (HID_BASE + 1917) +#define HID_END_OF_COLUMN (HID_BASE + 1918) +#define HID_START_OF_PARA (HID_BASE + 1919) +#define HID_END_OF_PARA (HID_BASE + 1920) +#define HID_NEXT_WORD (HID_BASE + 1921) +#define HID_PREV_WORD (HID_BASE + 1922) +#define HID_NEXT_SENT (HID_BASE + 1923) +#define HID_PREV_SENT (HID_BASE + 1924) +#define HID_DELETE (HID_BASE + 1925) +#define HID_BACKSPACE (HID_BASE + 1926) +#define HID_DELETE_SENT (HID_BASE + 1927) +#define HID_DELETE_BACK_SENT (HID_BASE + 1928) +#define HID_DELETE_WORD (HID_BASE + 1929) +#define HID_DELETE_BACK_WORD (HID_BASE + 1930) +#define HID_DELETE_LINE (HID_BASE + 1931) +#define HID_DELETE_BACK_LINE (HID_BASE + 1932) +#define HID_DELETE_PARA (HID_BASE + 1933) +#define HID_DELETE_BACK_PARA (HID_BASE + 1934) +#define HID_DELETE_WHOLE_LINE (HID_BASE + 1935) +#define HID_SET_INS_MODE (HID_BASE + 1936) +#define HID_PAGEUP (HID_BASE + 1937) +#define HID_PAGEDOWN (HID_BASE + 1938) +#define HID_SET_ADD_MODE (HID_BASE + 1939) +#define HID_SET_EXT_MODE (HID_BASE + 1940) +#define HID_ESCAPE (HID_BASE + 1941) +#define HID_SELECT_WORD (HID_BASE + 1943) +#define HID_START_TABLE (HID_BASE + 1947) +#define HID_END_TABLE (HID_BASE + 1948) +#define HID_NEXT_TABLE (HID_BASE + 1949) +#define HID_PREV_TABLE (HID_BASE + 1950) +#define HID_START_OF_NEXT_COLUMN (HID_BASE + 1951) +#define HID_END_OF_NEXT_COLUMN (HID_BASE + 1952) +#define HID_START_OF_PREV_COLUMN (HID_BASE + 1953) +#define HID_END_OF_PREV_COLUMN (HID_BASE + 1954) +#define HID_FOOTNOTE_TO_ANCHOR (HID_BASE + 1955) +#define HID_NEXT_FOOTNOTE (HID_BASE + 1956) +#define HID_PREV_FOOTNOTE (HID_BASE + 1957) +#define HID_CNTNT_TO_NEXT_FRAME (HID_BASE + 1958) +#define HID_FRAME_TO_ANCHOR (HID_BASE + 1959) +#define HID_TO_HEADER (HID_BASE + 1960) +#define HID_TO_FOOTER (HID_BASE + 1961) +#define HID_IDX_MARK_TO_IDX (HID_BASE + 1962) + +#define HID_ENVELOP (HID_BASE + 2050) +#define HID_LABEL (HID_BASE + 2051) +#define HID_ENVELOP_PRINT (HID_BASE + 2052) + +#define HID_NAVIGATION_IMGBTN (HID_BASE + 2054) +#define HID_ENVELOP_INSERT (HID_BASE + 2055) + +#define HID_WEBTOOLS_TOOLBOX (HID_BASE + 2056) +#define HID_WEBTEXT_TOOLBOX (HID_BASE + 2057) +#define HID_WEBFRAME_TOOLBOX (HID_BASE + 2058) +#define HID_TEXT_TOOLBOX (HID_BASE + 2059) +#define HID_TABLE_TOOLBOX (HID_BASE + 2060) +#define HID_FRAME_TOOLBOX (HID_BASE + 2061) +#define HID_GRAFIK_TOOLBOX (HID_BASE + 2062) +#define HID_OLE_TOOLBOX (HID_BASE + 2063) +#define HID_DRAW_TOOLBOX (HID_BASE + 2064) +#define HID_BEZIER_TOOLBOX (HID_BASE + 2066) +#define HID_DRAW_TEXT_TOOLBOX (HID_BASE + 2067) +#define HID_NUM_TOOLBOX (HID_BASE + 2068) +#define HID_TOOLS_TOOLBOX (HID_BASE + 2069) +#define HID_SRCVIEW_TOOLBOX (HID_BASE + 2070) + +#define HID_LABEL_INSERT (HID_BASE + 2071) +#define HID_CALC_TOOLBOX (HID_BASE + 2072) +#define HID_PVIEW_TOOLBOX (HID_BASE + 2073) + +#define HID_FIELD_INSERT (HID_BASE + 2074) +#define HID_FIELD_CLOSE (HID_BASE + 2075) + +#define HID_COND_COLL_TABLIST (HID_BASE + 2076) + +#define HID_DB_SELECTION_TLB (HID_BASE + 2077) +#define HID_FIELD_DINF_TYPE (HID_BASE + 2078) + +#define HID_DRAWFORM_TOOLBOX (HID_BASE + 2079) +#define HID_SELECT_TEMPLATE (HID_BASE + 2080) + +#define HID_AP_INSERT_DB_SEL (HID_BASE + 2081) +#define HID_WEBGRAPHIC_TOOLBOX (HID_BASE + 2082) +#define HID_OUTLINE_FORM (HID_BASE + 2083) +#define HID_NUM_RESET (HID_BASE + 2084) + +#define HID_AUTOFORMAT_REJECT (HID_BASE + 2085) +#define HID_AUTOFORMAT_ACCEPT (HID_BASE + 2086) +#define HID_AUTOFORMAT_EDIT_CHG (HID_BASE + 2087) + +//insert index/entries/Pattern buttons and edits +#define HID_TOX_ENTRY_BUTTON (HID_BASE + 2088) +#define HID_TOX_ENTRY_EDIT (HID_BASE + 2089) + +#define HID_DLG_NEW_USER_IDX (HID_BASE + 2090) +#define HID_INSERT_IDX_MRK_OK (HID_BASE + 2091) +#define HID_INSERT_IDX_MRK_CLOSE (HID_BASE + 2092) +#define HID_INSERT_AUTH_MRK_OK (HID_BASE + 2093) +#define HID_INSERT_AUTH_MRK_CLOSE (HID_BASE + 2094) +#define HID_INSERT_IDX_MRK_DELETE (HID_BASE + 2095) +#define HID_INSERT_IDX_MRK_NEW (HID_BASE + 2096) +#define HID_INSERT_IDX_MRK_PREV (HID_BASE + 2097) +#define HID_INSERT_IDX_MRK_PREV_SAME (HID_BASE + 2098) +#define HID_INSERT_IDX_MRK_NEXT (HID_BASE + 2099) +#define HID_INSERT_IDX_MRK_NEXT_SAME (HID_BASE + 2100) +#define HID_INSERT_IDX_MRK_TYPE (HID_BASE + 2101) +#define HID_INSERT_IDX_MRK_ENTRY (HID_BASE + 2102) +#define HID_INSERT_IDX_MRK_PRIM_KEY (HID_BASE + 2103) +#define HID_INSERT_IDX_MRK_SEC_KEY (HID_BASE + 2104) +#define HID_INSERT_IDX_MRK_LEVEL (HID_BASE + 2105) +#define HID_INSERT_IDX_MRK_MAIN_ENTRY (HID_BASE + 2106) +#define HID_INSERT_IDX_MRK_APPLY_ALL (HID_BASE + 2107) +#define HID_INSERT_AUTH_MRK_ENTRY (HID_BASE + 2108) +#define HID_INSERT_AUTH_MRK_CREATE_ENTRY (HID_BASE + 2109) +#define HID_INSERT_AUTH_MRK_EDIT_ENTRY (HID_BASE + 2110) +#define HID_TOKEN_WINDOW (HID_BASE + 2111) + +#define HID_AUTH_FIELD_IDENTIFIER (HID_BASE + 2112 ) +#define HID_AUTH_FIELD_AUTHORITY_TYPE (HID_BASE + 2113 ) +#define HID_AUTH_FIELD_ADDRESS (HID_BASE + 2114 ) +#define HID_AUTH_FIELD_ANNOTE (HID_BASE + 2115 ) +#define HID_AUTH_FIELD_AUTHOR (HID_BASE + 2116 ) +#define HID_AUTH_FIELD_BOOKTITLE (HID_BASE + 2117 ) +#define HID_AUTH_FIELD_CHAPTER (HID_BASE + 2118 ) +#define HID_AUTH_FIELD_EDITION (HID_BASE + 2119 ) +#define HID_AUTH_FIELD_EDITOR (HID_BASE + 2120 ) +#define HID_AUTH_FIELD_HOWPUBLISHED (HID_BASE + 2121 ) +#define HID_AUTH_FIELD_INSTITUTION (HID_BASE + 2122 ) +#define HID_AUTH_FIELD_JOURNAL (HID_BASE + 2123 ) +#define HID_AUTH_FIELD_MONTH (HID_BASE + 2124 ) +#define HID_AUTH_FIELD_NOTE (HID_BASE + 2125 ) +#define HID_AUTH_FIELD_NUMBER (HID_BASE + 2126 ) +#define HID_AUTH_FIELD_ORGANIZATIONS (HID_BASE + 2127 ) +#define HID_AUTH_FIELD_PAGES (HID_BASE + 2128 ) +#define HID_AUTH_FIELD_PUBLISHER (HID_BASE + 2129 ) +#define HID_AUTH_FIELD_SCHOOL (HID_BASE + 2130 ) +#define HID_AUTH_FIELD_SERIES (HID_BASE + 2131 ) +#define HID_AUTH_FIELD_TITLE (HID_BASE + 2132 ) +#define HID_AUTH_FIELD_REPORT_TYPE (HID_BASE + 2133 ) +#define HID_AUTH_FIELD_VOLUME (HID_BASE + 2134 ) +#define HID_AUTH_FIELD_YEAR (HID_BASE + 2135 ) +#define HID_AUTH_FIELD_URL (HID_BASE + 2136 ) +#define HID_AUTH_FIELD_CUSTOM1 (HID_BASE + 2137 ) +#define HID_AUTH_FIELD_CUSTOM2 (HID_BASE + 2138 ) +#define HID_AUTH_FIELD_CUSTOM3 (HID_BASE + 2139 ) +#define HID_AUTH_FIELD_CUSTOM4 (HID_BASE + 2140 ) +#define HID_AUTH_FIELD_CUSTOM5 (HID_BASE + 2141 ) +#define HID_AUTH_FIELD_ISBN (HID_BASE + 2142 ) + +#define HID_AUTH_MARK_DLG_FROM_COMP_RB (HID_BASE + 2143 ) +#define HID_AUTH_MARK_DLG_FROM_DOC_RB (HID_BASE + 2144 ) +#define HID_AUTH_MARK_DLG_ID_LISTBOX (HID_BASE + 2145 ) + +#define HID_INSERT_INDEX_ENTRY_LEVEL_LB (HID_BASE + 2146 ) +#define HID_INSERT_IDX_MRK_SRCH_CASESENSITIVE (HID_BASE + 2147 ) +#define HID_INSERT_IDX_MRK_SRCH_WORDONLY (HID_BASE + 2148 ) +#define HID_DLG_CREATE_AUTOMARK (HID_BASE + 2149 ) +#define HID_BUSINESS_CARD_CONTENT (HID_BASE + 2150 ) +#define HID_SAVE_LABEL_DLG (HID_BASE + 2151 ) +#define HID_BUSINESS_FMT_PAGE (HID_BASE + 2152 ) +#define HID_BUSINESS_FMT_PAGE_CONT (HID_BASE + 2153 ) +#define HID_BUSINESS_FMT_PAGE_SHEET (HID_BASE + 2154 ) +#define HID_BUSINESS_FMT_PAGE_BRAND (HID_BASE + 2155 ) +#define HID_BUSINESS_FMT_PAGE_TYPE (HID_BASE + 2156 ) +#define HID_SEND_MASTER_DIALOG (HID_BASE + 2157 ) +#define HID_SEND_MASTER_CTRL_PUSHBUTTON_OK (HID_BASE + 2158 ) +#define HID_SEND_MASTER_CTRL_PUSHBUTTON_CANCEL (HID_BASE + 2159 ) +#define HID_SEND_MASTER_CTRL_LISTBOX_FILTER (HID_BASE + 2160 ) +#define HID_SEND_MASTER_CTRL_CONTROL_FILEVIEW (HID_BASE + 2161 ) +#define HID_SEND_MASTER_CTRL_EDIT_FILEURL (HID_BASE + 2162 ) +#define HID_SEND_MASTER_CTRL_CHECKBOX_AUTOEXTENSION (HID_BASE + 2163 ) +#define HID_SEND_MASTER_CTRL_LISTBOX_TEMPLATE (HID_BASE + 2164 ) +#define HID_SEND_MASTER_CTRL_DUMMY (HID_BASE + 2165 ) + +#define HID_SEND_HTML_DIALOG (HID_BASE + 2166 ) +#define HID_SEND_HTML_CTRL_PUSHBUTTON_OK (HID_BASE + 2167 ) +#define HID_SEND_HTML_CTRL_PUSHBUTTON_CANCEL (HID_BASE + 2168 ) +#define HID_SEND_HTML_CTRL_LISTBOX_FILTER (HID_BASE + 2169 ) +#define HID_SEND_HTML_CTRL_CONTROL_FILEVIEW (HID_BASE + 2170 ) +#define HID_SEND_HTML_CTRL_EDIT_FILEURL (HID_BASE + 2171 ) +#define HID_SEND_HTML_CTRL_CHECKBOX_AUTOEXTENSION (HID_BASE + 2172 ) +#define HID_SEND_HTML_CTRL_LISTBOX_TEMPLATE (HID_BASE + 2173 ) +#define HID_SEND_HTML_CTRL_DUMMY (HID_BASE + 2174 ) + +#define HID_INSERT_IDX_MRK_PHONETIC_READING (HID_BASE + 2175 ) +#define HID_COLUMN_VALUESET (HID_BASE + 2176 ) +#define HID_PVIEW_ZOOM_LB (HID_BASE + 2177 ) +#define HID_MAIL_MERGE_SELECT (HID_BASE + 2178 ) +#define HID_MAIL_MERGE_CREATE_FROM (HID_BASE + 2179 ) +#define HID_MAIL_MERGE_INSERT_FIELDS (HID_BASE + 2180 ) +#define HID_PRINT_AS_MERGE (HID_BASE + 2181 ) +#define HID_MERGE_SOURCE_UNAVAILABLE (HID_BASE + 2182 ) +#define HID_DATA_SOURCES_UNAVAILABLE (HID_BASE + 2183 ) +#define HID_MODULE_TOOLBOX (HID_BASE + 2184 ) +#define HID_SECTION_INDENTS_PAGE (HID_BASE + 2185 ) + +#define HID_FLD_DROPDOWN (HID_BASE + 2186 ) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/hfspacingitem.hxx b/inc/bf_sw/hfspacingitem.hxx new file mode 100644 index 000000000..481f6debc --- /dev/null +++ b/inc/bf_sw/hfspacingitem.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SW_HF_EAT_SPACINGITEM_HXX +#define _SW_HF_EAT_SPACINGITEM_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/eitem.hxx> +#include <format.hxx> +class IntlWrapper; +namespace binfilter { + + + +class SwHeaderAndFooterEatSpacingItem : public SfxBoolItem +{ +public: + SwHeaderAndFooterEatSpacingItem( USHORT nId = RES_HEADER_FOOTER_EAT_SPACING, + BOOL bPrt = FALSE ) : SfxBoolItem( nId, bPrt ) {} + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual SfxItemPresentation GetPresentation( + SfxItemPresentation /* ePres */, + SfxMapUnit /* eCoreMetric */, + SfxMapUnit /* ePresMetric */, + String& /* rText */, + const ::IntlWrapper* /* pIntl */ = 0 + ) const + { return SFX_ITEM_PRESENTATION_NONE; } + + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +inline const SwHeaderAndFooterEatSpacingItem &SwAttrSet::GetHeaderAndFooterEatSpacing(BOOL bInP) const + { return (const SwHeaderAndFooterEatSpacingItem&)Get( RES_HEADER_FOOTER_EAT_SPACING,bInP); } + +inline const SwHeaderAndFooterEatSpacingItem &SwFmt::GetHeaderAndFooterEatSpacing(BOOL bInP) const + { return aSet.GetHeaderAndFooterEatSpacing(bInP); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/hintids.hxx b/inc/bf_sw/hintids.hxx new file mode 100644 index 000000000..07f8dede1 --- /dev/null +++ b/inc/bf_sw/hintids.hxx @@ -0,0 +1,471 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _HINTIDS_HXX +#define _HINTIDS_HXX + +#include <bf_svtools/bf_solar.h> + +#include <sal/types.h> // for sal_Unicode + + +// fuer SwTxtHints ohne Endindex wird folgendes Zeichen eingefuegt: +//JP 24.05.00: for the new UniCode Version: +#define CH_TXTATR_BREAKWORD ((sal_Unicode)0x01) +#define CH_TXTATR_INWORD ((sal_Unicode)0x02) + + +/* + * Hier kommen erst mal die enums fuer die Hints + */ + +#define HINT_BEGIN 1 + +#define POOLATTR_BEGIN HINT_BEGIN +#define POOLATTR_END RES_UNKNOWNATR_END + +// Bereiche fuer die Id's der einzelnen Format-Attribute +// die Which-Werte fuer die Charakter-Format Attribute +enum RES_CHRATR +{ +RES_CHRATR_BEGIN = HINT_BEGIN, + RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN, // 1 + RES_CHRATR_CHARSETCOLOR, // 2 + RES_CHRATR_COLOR, // 3 + RES_CHRATR_CONTOUR, // 4 + RES_CHRATR_CROSSEDOUT, // 5 + RES_CHRATR_ESCAPEMENT, // 6 + RES_CHRATR_FONT, // 7 + RES_CHRATR_FONTSIZE, // 8 + RES_CHRATR_KERNING, // 9 + RES_CHRATR_LANGUAGE, // 10 + RES_CHRATR_POSTURE, // 11 + RES_CHRATR_PROPORTIONALFONTSIZE, // 12 + RES_CHRATR_SHADOWED, // 13 + RES_CHRATR_UNDERLINE, // 14 + RES_CHRATR_WEIGHT, // 15 + RES_CHRATR_WORDLINEMODE, // 16 + RES_CHRATR_AUTOKERN, // 17 + RES_CHRATR_BLINK, // 18 + RES_CHRATR_NOHYPHEN, // 19 + RES_CHRATR_NOLINEBREAK, // 20 + RES_CHRATR_BACKGROUND, // 21 + RES_CHRATR_CJK_FONT, // 22 + RES_CHRATR_CJK_FONTSIZE, // 23 + RES_CHRATR_CJK_LANGUAGE, // 24 + RES_CHRATR_CJK_POSTURE, // 25 + RES_CHRATR_CJK_WEIGHT, // 26 + RES_CHRATR_CTL_FONT, // 27 + RES_CHRATR_CTL_FONTSIZE, // 28 + RES_CHRATR_CTL_LANGUAGE, // 29 + RES_CHRATR_CTL_POSTURE, // 30 + RES_CHRATR_CTL_WEIGHT, // 31 + RES_CHRATR_ROTATE, // 32 + RES_CHRATR_EMPHASIS_MARK, // 33 + RES_CHRATR_TWO_LINES, // 34 + RES_CHRATR_SCALEW, // 35 + RES_CHRATR_RELIEF, // 36 + RES_CHRATR_DUMMY1, // 37 +RES_CHRATR_END +}; + +// diese Attribute stehen nur im SwpAttr-Array vom TextNode +enum RES_TXTATR +{ +RES_TXTATR_BEGIN = RES_CHRATR_END, + +// alle TextAttribute mit einem Ende +// JP 12.07.96: die Ids RES_TXTATR_NOLINEBREAK und RES_TXTATR_NOHYPHEN +// wanderten in den Bereich der CharAttr. Die Ids selbst muessen +// aber als Dummies noch erhalten bleiben. Der SwG-/Sw3 Reader +// merkt sich die Ids immer als Offset zum Start der Gruppe!!! +// Aus dem RES_TXTATR_NOLINEBREAK ist jetzt RES_TXTATR_INETFMT geworden. +RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN , + RES_TXTATR_INETFMT = RES_TXTATR_WITHEND_BEGIN, // 38 + RES_TXTATR_DUMMY4, // 39 + RES_TXTATR_REFMARK, // 40 + RES_TXTATR_TOXMARK, // 41 + RES_TXTATR_CHARFMT, // 42 + RES_TXTATR_DUMMY5, // 43 + RES_TXTATR_CJK_RUBY, // 44 + RES_TXTATR_UNKNOWN_CONTAINER, // 45 + RES_TXTATR_DUMMY6, // 46 + RES_TXTATR_DUMMY7, // 47 +RES_TXTATR_WITHEND_END, + +// alle TextAttribute ohne ein Ende +RES_TXTATR_NOEND_BEGIN = RES_TXTATR_WITHEND_END, + RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN, // 48 + RES_TXTATR_FLYCNT, // 49 + RES_TXTATR_FTN, // 50 + RES_TXTATR_SOFTHYPH, // 51 + RES_TXTATR_HARDBLANK, // 52 + RES_TXTATR_DUMMY1, // 53 + RES_TXTATR_DUMMY2, // 54 +RES_TXTATR_NOEND_END, +RES_TXTATR_END = RES_TXTATR_NOEND_END +}; + +enum RES_PARATR +{ +RES_PARATR_BEGIN = RES_TXTATR_END, + RES_PARATR_LINESPACING = RES_PARATR_BEGIN, // 55 + RES_PARATR_ADJUST, // 56 + RES_PARATR_SPLIT, // 57 + RES_PARATR_ORPHANS, // 58 + RES_PARATR_WIDOWS, // 59 + RES_PARATR_TABSTOP, // 60 + RES_PARATR_HYPHENZONE, // 61 + RES_PARATR_DROP, // 62 + RES_PARATR_REGISTER, // 63 + RES_PARATR_NUMRULE, // 64 + RES_PARATR_SCRIPTSPACE, // 65 + RES_PARATR_HANGINGPUNCTUATION, // 66 + RES_PARATR_FORBIDDEN_RULES, // 67 + RES_PARATR_VERTALIGN, // 68 + RES_PARATR_SNAPTOGRID, // 69 + RES_PARATR_CONNECT_BORDER, // 70 + RES_PARATR_DUMMY5, // 71 + RES_PARATR_DUMMY6, // 72 + RES_PARATR_DUMMY7, // 73 + RES_PARATR_DUMMY8, // 74 +RES_PARATR_END +}; + + +enum RES_FRMATR +{ +RES_FRMATR_BEGIN = RES_PARATR_END, + RES_FILL_ORDER = RES_FRMATR_BEGIN, // 75 + RES_FRM_SIZE, // 76 + RES_PAPER_BIN, // 77 + RES_LR_SPACE, // 78 + RES_UL_SPACE, // 79 + RES_PAGEDESC, // 80 + RES_BREAK, // 81 + RES_CNTNT, // 82 + RES_HEADER, // 83 + RES_FOOTER, // 84 + RES_PRINT, // 85 + RES_OPAQUE, // 86 + RES_PROTECT, // 87 + RES_SURROUND, // 88 + RES_VERT_ORIENT, // 89 + RES_HORI_ORIENT, // 90 + RES_ANCHOR, // 91 + RES_BACKGROUND, // 92 + RES_BOX, // 93 + RES_SHADOW, // 94 + RES_FRMMACRO, // 95 + RES_COL, // 96 + RES_KEEP, // 97 + RES_URL, // 98 + RES_EDIT_IN_READONLY, // 99 + RES_LAYOUT_SPLIT, // 100 + RES_CHAIN, // 101 + RES_TEXTGRID, // 102 + RES_LINENUMBER , // 103 + RES_FTN_AT_TXTEND, // 104 + RES_END_AT_TXTEND, // 105 + RES_COLUMNBALANCE, // 106 + RES_FRAMEDIR, // 107 + RES_HEADER_FOOTER_EAT_SPACING, // 108 + RES_FRMATR_DUMMY9, // 109 +RES_FRMATR_END +}; + +enum RES_GRFATR +{ +RES_GRFATR_BEGIN = RES_FRMATR_END, + RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 110 + RES_GRFATR_CROPGRF, // 111 + + RES_GRFATR_ROTATION, // 112 + RES_GRFATR_LUMINANCE, // 113 + RES_GRFATR_CONTRAST, // 114 + RES_GRFATR_CHANNELR, // 115 + RES_GRFATR_CHANNELG, // 116 + RES_GRFATR_CHANNELB, // 117 + RES_GRFATR_GAMMA, // 118 + RES_GRFATR_INVERT, // 119 + RES_GRFATR_TRANSPARENCY, // 120 + RES_GRFATR_DRAWMODE, // 121 + + RES_GRFATR_DUMMY1, // 122 + RES_GRFATR_DUMMY2, // 123 + RES_GRFATR_DUMMY3, // 124 + RES_GRFATR_DUMMY4, // 125 + RES_GRFATR_DUMMY5, // 126 +RES_GRFATR_END +}; + +enum RES_BOXATR +{ +RES_BOXATR_BEGIN = RES_GRFATR_END, + RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 127 + RES_BOXATR_FORMULA, // 128 + RES_BOXATR_VALUE, // 129 +RES_BOXATR_END +}; + +enum RES_UNKNOWNATR +{ +RES_UNKNOWNATR_BEGIN = RES_BOXATR_END, + RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN, // 120 +RES_UNKNOWNATR_END +}; + + + +// ID-s fuer die Formate +enum RES_FMT +{ +RES_FMT_BEGIN = RES_UNKNOWNATR_END, + RES_CHRFMT = RES_FMT_BEGIN, + RES_FRMFMT, + RES_FLYFRMFMT, + RES_TXTFMTCOLL, + RES_GRFFMTCOLL, + RES_DRAWFRMFMT, + RES_CONDTXTFMTCOLL, +RES_FMT_END +}; + +// die ID's fuer Messages in den Formaten +enum RES_MSG +{ +RES_MSG_BEGIN = RES_FMT_END, + RES_OBJECTDYING = RES_MSG_BEGIN, + RES_FMT_CHG, + RES_ATTRSET_CHG, + RES_FRM_SIZECHG, + RES_TXTATR_FLDCHG, + RES_TXTATR_EMPTYCHG, + RES_INS_CHR, + RES_INS_TXT, + RES_DEL_CHR, + RES_DEL_TXT, + RES_UPDATE_ATTR, + RES_PAGEDESC_FTNINFO, + RES_REFMARKFLD_UPDATE, + RES_DOCPOS_UPDATE, + RES_TABLEFML_UPDATE, + RES_UPDATEDDETBL, + RES_TBLHEADLINECHG, + RES_AUTOFMT_DOCNODE, + RES_REPAINT, + RES_DOC_DTOR, + RES_SECTION_HIDDEN, + RES_SECTION_NOT_HIDDEN, + RES_GRAPHIC_ARRIVED, + RES_GRAPHIC_PIECE_ARRIVED, + RES_HIDDENPARA_PRINT, + RES_CONDCOLL_CONDCHG, + RES_VIRTPAGENUM_INFO, + RES_GETNUMNODES, + RES_GETLOWERNUMLEVEL, + RES_RESET_FMTWRITTEN, + RES_REMOVE_UNO_OBJECT, + RES_GRF_REREAD_AND_INCACHE, + RES_SECTION_RESETHIDDENFLAG, + RES_FINDNEARESTNODE, + RES_CONTENT_VISIBLE, + RES_FOOTNOTE_DELETED, + RES_REFMARK_DELETED, + RES_TOXMARK_DELETED, + RES_GRAPHIC_SWAPIN, + RES_FIELD_DELETED, + RES_NAME_CHANGED, + RES_ALT_TEXT_CHANGED, + RES_UNOCURSOR_LEAVES_SECTION, +RES_MSG_END +}; + + +// eine ID fuer den RTF-Reader. Die Stylesheets werden wie +// Attribute behandelt, d.H. es gibt ein StyleSheet Attribut. Um +// nicht mit anderen Which()-Werten zu kollidieren, ist der Wert +// hier mit aufgefuehrt. (Auch das Hilfesystem definiert neue +// Attribute !!) +enum RES_FLTRATTR +{ +RES_FLTRATTR_BEGIN = RES_MSG_END, + RES_FLTR_STYLESHEET = RES_FLTRATTR_BEGIN, + RES_FLTR_BOOKMARK, + RES_FLTR_ANCHOR, + RES_FLTR_BORDER, + RES_FLTR_NUMRULE, + RES_FLTR_NUMRULE_NUM, + RES_FLTR_SDR_ANCHOR, + RES_FLTR_TOX, + RES_FLTR_SECTION, + RES_FLTR_REDLINE, + RES_FLTR_SCRIPTTYPE, +RES_FLTRATTR_END +}; + +#define RES_TBX_DUMMY RES_FLTRATTR_END + 1 + +#define HINT_END RES_TBX_DUMMY + +// Fehler-Erkennung !! +#define INVALID_HINT HINT_END +#define RES_WHICHHINT_END HINT_END + + +/* + * hole aus der statischen Default-Attribut Tabelle ueber den Which-Wert + * das entsprechende default Attribut. + * Ist keines vorhanden, returnt ein 0-Pointer !!! + * + * Diese Funktion ist im Init.CXX implementiert. Damit die Formate darauf + * zugreifen koennen, ist sie hier als extern deklariert. + * Im PRODUCT ist das Teil inline. + */ +namespace binfilter { + +class SfxPoolItem; +struct SfxItemInfo; + +typedef SfxPoolItem* SwDfltAttrTab[ POOLATTR_END - POOLATTR_BEGIN ]; + +extern SwDfltAttrTab aAttrTab; +extern SfxItemInfo aSlotTab[]; + + +#ifdef DBG_UTIL +const SfxPoolItem* GetDfltAttr( USHORT nWhich ); +#else +inline const SfxPoolItem* GetDfltAttr( USHORT nWhich ) +{ + return aAttrTab[ nWhich - POOLATTR_BEGIN ]; +} +#endif + +USHORT GetWhichOfScript( USHORT nWhich, USHORT nScript ); + +// return for the given TextAttribut without an end the correct character. +// This function returns +// CH_TXTATR_BREAKWORD for Textattribut which breaks a word (default) +// CH_TXTATR_INWORD for Textattribut which dont breaks a word +class SwTxtAttr; +sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr ); + +// alle Sets stehen im init.cxx + +// AttrSet-Range fuer die 3 Break-Attribute +extern USHORT aBreakSetRange[]; +// AttrSet-Range fuer die TxtFmtColl +extern USHORT aTxtFmtCollSetRange[]; +// AttrSet-Range fuer die GrfFmtColl +extern USHORT aGrfFmtCollSetRange[]; +// AttrSet-Range fuer die TextNode +extern USHORT aTxtNodeSetRange[]; +// AttrSet-Range fuer die NoTxtNode +extern USHORT aNoTxtNodeSetRange[]; +// AttrSet-Range fuer die SwTable +extern USHORT aTableSetRange[]; +// AttrSet-Range fuer die SwTableLine +extern USHORT aTableLineSetRange[]; +// AttrSet-Range fuer die SwTableBox +extern USHORT aTableBoxSetRange[]; +// AttrSet-Range fuer die SwFrmFmt +extern USHORT aFrmFmtSetRange[]; +// AttrSet-Range fuer die SwCharFmt +extern USHORT aCharFmtSetRange[]; +// AttrSet-Range fuer die SwPageDescFmt +extern USHORT aPgFrmFmtSetRange[]; + +// check if ID is InRange of AttrSet-Ids +BOOL IsInRange( const USHORT* pRange, const USHORT nId ); + +} //namespace binfilter + +#define ITEMID_FONT RES_CHRATR_FONT +#define ITEMID_POSTURE RES_CHRATR_POSTURE +#define ITEMID_WEIGHT RES_CHRATR_WEIGHT +#define ITEMID_SHADOWED RES_CHRATR_SHADOWED +#define ITEMID_AUTOKERN RES_CHRATR_AUTOKERN +#define ITEMID_CONTOUR RES_CHRATR_CONTOUR +#define ITEMID_CROSSEDOUT RES_CHRATR_CROSSEDOUT +#define ITEMID_UNDERLINE RES_CHRATR_UNDERLINE +#define ITEMID_FONTHEIGHT RES_CHRATR_FONTSIZE +#define ITEMID_PROPSIZE RES_CHRATR_PROPORTIONALFONTSIZE +#define ITEMID_COLOR RES_CHRATR_COLOR +#define ITEMID_CHARSETCOLOR RES_CHRATR_CHARSETCOLOR +#define ITEMID_KERNING RES_CHRATR_KERNING +#define ITEMID_CASEMAP RES_CHRATR_CASEMAP +#define ITEMID_LANGUAGE RES_CHRATR_LANGUAGE +#define ITEMID_ESCAPEMENT RES_CHRATR_ESCAPEMENT +#define ITEMID_BLINK RES_CHRATR_BLINK +#define ITEMID_NOHYPHENHERE RES_CHRATR_NOHYPHEN +#define ITEMID_NOLINEBREAK RES_CHRATR_NOLINEBREAK +#define ITEMID_WORDLINEMODE RES_CHRATR_WORDLINEMODE +#define ITEMID_EMPHASISMARK RES_CHRATR_EMPHASIS_MARK +#define ITEMID_TWOLINES RES_CHRATR_TWO_LINES +#define ITEMID_CHARSCALE_W RES_CHRATR_SCALEW +#define ITEMID_CHARROTATE RES_CHRATR_ROTATE +#define ITEMID_CHARRELIEF RES_CHRATR_RELIEF + +//Defines fuer die ehemaligen FrmAttribute, die jetzt in frmitems.hxx +//von svx zu finden sind. +#define ITEMID_PAPERBIN RES_PAPER_BIN +#define ITEMID_LRSPACE RES_LR_SPACE +#define ITEMID_ULSPACE RES_UL_SPACE +#define ITEMID_PRINT RES_PRINT +#define ITEMID_OPAQUE RES_OPAQUE +#define ITEMID_PROTECT RES_PROTECT +#define ITEMID_BRUSH RES_BACKGROUND +#define ITEMID_BOX RES_BOX +#define ITEMID_SHADOW RES_SHADOW +#define ITEMID_MACRO RES_FRMMACRO +#define ITEMID_FMTKEEP RES_KEEP +#define ITEMID_FMTBREAK RES_BREAK +#define ITEMID_FRAMEDIR RES_FRAMEDIR + +//Defines fuer die ehemaligen ParAttribute, die jetzt in paraitem.hxx +//bzw. tabsitem.hxx von svx zu finden sind. + +#define ITEMID_LINESPACING RES_PARATR_LINESPACING +#define ITEMID_ADJUST RES_PARATR_ADJUST +#define ITEMID_FMTSPLIT RES_PARATR_SPLIT +#define ITEMID_WIDOWS RES_PARATR_WIDOWS +#define ITEMID_ORPHANS RES_PARATR_ORPHANS +#define ITEMID_TABSTOP RES_PARATR_TABSTOP +#define ITEMID_HYPHENZONE RES_PARATR_HYPHENZONE +#define ITEMID_SCRIPTSPACE RES_PARATR_SCRIPTSPACE +#define ITEMID_HANGINGPUNCTUATION RES_PARATR_HANGINGPUNCTUATION +#define ITEMID_FORBIDDENRULE RES_PARATR_FORBIDDEN_RULES +#define ITEMID_PARAVERTALIGN RES_PARATR_VERTALIGN +#define ITEMID_PARAGRID RES_PARATR_SNAPTOGRID + +//Defines fuer die ehemaligen GrfAttribute, die jetzt im svx zu finden sind. +#define ITEMID_GRF_CROP RES_GRFATR_CROPGRF + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/hints.hxx b/inc/bf_sw/hints.hxx new file mode 100644 index 000000000..fa5fde3f9 --- /dev/null +++ b/inc/bf_sw/hints.hxx @@ -0,0 +1,277 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _HINTS_HXX +#define _HINTS_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_tools/table.hxx> +#include <swatrset.hxx> +class OutputDevice; +namespace binfilter { + +class SwFmt; + +class SwTable; +class SwNode; +class SwNodes; +class SwCntntNode; +class SwPageFrm; +class SwFrm; +class SwTxtNode; +class SwHistory; + +// Basis-Klasse fuer alle Message-Hints: +// "Overhead" vom SfxPoolItem wird hier behandelt +class SwMsgPoolItem : public SfxPoolItem +{ +public: + SwMsgPoolItem( USHORT nWhich ); + + // "Overhead" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; +}; + + +// --------------------------------------- +// SwPtrMsgPoolItem (altes SwObjectDying!) +// --------------------------------------- + +class SwPtrMsgPoolItem : public SwMsgPoolItem +{ +public: + void * pObject; + + SwPtrMsgPoolItem( USHORT nId, void * pObj ) + : SwMsgPoolItem( nId ), pObject( pObj ) + {} +}; + + + +/* + * SwFmtChg wird verschickt, wenn ein Format gegen ein anderes + * Format ausgewechselt worden ist. Es werden immer 2. Hints verschickt, + * das alte und neue Format. + */ +class SwFmtChg: public SwMsgPoolItem +{ +public: + SwFmt *pChangedFmt; + SwFmtChg( SwFmt *pFmt ); +}; + + +class SwInsChr: public SwMsgPoolItem +{ +public: + xub_StrLen nPos; + + SwInsChr( USHORT nP ); +}; + +class SwInsTxt: public SwMsgPoolItem +{ +public: + xub_StrLen nPos; + xub_StrLen nLen; + + SwInsTxt( xub_StrLen nP, xub_StrLen nL ); +}; + +class SwDelChr: public SwMsgPoolItem +{ +public: + xub_StrLen nPos; + + SwDelChr( xub_StrLen nP ); +}; + +class SwDelTxt: public SwMsgPoolItem +{ +public: + xub_StrLen nStart; + xub_StrLen nLen; + + SwDelTxt( xub_StrLen nS, xub_StrLen nL ); +}; + +class SwUpdateAttr: public SwMsgPoolItem +{ +public: + xub_StrLen nStart; + xub_StrLen nEnd; + USHORT nWhichAttr; + SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, USHORT nW ); +}; + + +// SwRefMarkFldUpdate wird verschickt, wenn sich die ReferenzMarkierungen +// Updaten sollen. Um Seiten-/KapitelNummer feststellen zu koennen, muss +// der akt. Frame befragt werden. Dafuer wird das akt. OutputDevice benoetigt. + +// SwDocPosUpdate wird verschickt, um zu signalisieren, dass nur die +// Frames ab oder bis zu einer bestimmten dokument-globalen Position +// geupdated werden brauchen. Zur Zeit wird dies nur beim Updaten +// von Seitennummernfeldern benoetigt. + +class SwDocPosUpdate : public SwMsgPoolItem +{ +public: + const long nDocPos; + SwDocPosUpdate( const long nDocPos ); +}; + +// SwTableFmlUpdate wird verschickt, wenn sich die Tabelle neu berechnen soll +// JP 16.02.99: oder wenn die Tabelle selbst gemergt oder gesplittet wird +enum TableFmlUpdtFlags { TBL_CALC = 0, + TBL_BOXNAME, + TBL_BOXPTR, + TBL_RELBOXNAME, + TBL_MERGETBL, + TBL_SPLITTBL + }; +class SwTableFmlUpdate : public SwMsgPoolItem +{ +public: + const SwTable* pTbl; // Pointer auf die zu aktuelle Tabelle + union { + const SwTable* pDelTbl; // Merge: Ptr auf die zu loeschende Tabelle + const String* pNewTblNm; // Split: der Name der neuen Tabelle + } DATA; + SwHistory* pHistory; + USHORT nSplitLine; // Split: ab dieser BaseLine wird gespl. + TableFmlUpdtFlags eFlags; + BOOL bModified : 1; + BOOL bBehindSplitLine : 1; + + SwTableFmlUpdate( const SwTable* ); +}; + + +class SwAutoFmtGetDocNode: public SwMsgPoolItem +{ +public: + const SwCntntNode* pCntntNode; + const SwNodes* pNodes; + + SwAutoFmtGetDocNode( const SwNodes* pNds ); +}; + +/* + * SwAttrSetChg wird verschicht, wenn sich in dem SwAttrSet rTheChgdSet + * etwas veraendert hat. Es werden immer 2. Hints + * verschickt, die alten und neuen Items in dem rTheChgdSet. + */ +class SwAttrSetChg: public SwMsgPoolItem +{ + BOOL bDelSet; + SwAttrSet* pChgSet; // was sich veraendert hat + const SwAttrSet* pTheChgdSet; // wird nur zum Vergleichen gebraucht !! +public: + SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet ); + SwAttrSetChg( const SwAttrSetChg& ); + ~SwAttrSetChg(); + + // was sich veraendert hat + const SwAttrSet* GetChgSet() const { return pChgSet; } + SwAttrSet* GetChgSet() { return pChgSet; } + + // wo es sich geaendert hat + const SwAttrSet* GetTheChgdSet() const { return pTheChgdSet; } + + SfxItemState GetItemState( USHORT nWhichIn, BOOL bSrchInParent = TRUE, + const SfxPoolItem **ppItem = 0 ) const + { return pChgSet->GetItemState( nWhichIn, bSrchInParent, ppItem ); } + + USHORT Count() const { return pChgSet->Count(); } + void ClearItem( USHORT nWhichIn = 0 ) +#ifndef DBG_UTIL + { + pChgSet->ClearItem( nWhichIn ); + } +#else + ; +#endif +}; + +class SwCondCollCondChg: public SwMsgPoolItem +{ +public: + SwFmt *pChangedFmt; + SwCondCollCondChg( SwFmt *pFmt ); +}; + +class SwVirtPageNumInfo: public SwMsgPoolItem +{ + const SwPageFrm *pPage; + const SwPageFrm *pOrigPage; + const SwFrm *pFrm; //An einem Absatz/Tabelle koennen mehrere + //Attribute sitzen. Der Frame muss dann + //muss dann letztlich bei bestimmen + //welches Attribut gilt und um welche physikalische + //Seite es sich handelt. +public: + SwVirtPageNumInfo( const SwPageFrm *pPg ); + + const SwPageFrm *GetPage() { return pPage; } + const SwPageFrm *GetOrigPage() { return pOrigPage;} + const SwFrm *GetFrm() { return pFrm; } + void SetInfo( const SwPageFrm *pPg, + const SwFrm *pF ) { pFrm = pF, pPage = pPg; } +}; + + +DECLARE_TABLE( SwTxtNodeTable, SwTxtNode* ) + +class SwNumRuleInfo : public SwMsgPoolItem +{ + SwTxtNodeTable aList; + const String& rName; +public: + SwNumRuleInfo( const String& rRuleName ); + + const String& GetName() const { return rName; } + void AddNode( SwTxtNode& rNd ); + + // erzeuge die Liste aller Nodes der NumRule in dem angegebenem Doc + // Der Code steht im docnum.cxx + void MakeList( SwDoc& rDoc ); + SwTxtNodeTable& GetList() const { return (SwTxtNodeTable&)aList; } +}; + + + +class SwStringMsgPoolItem : public SwMsgPoolItem +{ + String sStr; +public: + + const String& GetString() const { return sStr; } + + SwStringMsgPoolItem( USHORT nId, const String& rStr ) + : SwMsgPoolItem( nId ), sStr( rStr ) + {} +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/horiornt.hxx b/inc/bf_sw/horiornt.hxx new file mode 100644 index 000000000..d5ca9ba33 --- /dev/null +++ b/inc/bf_sw/horiornt.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _HORIORNT_HXX +#define _HORIORNT_HXX +namespace binfilter { + + +//SwFmtHoriOrient, wie und woran orientiert -- +// sich der FlyFrm in der Hoizontalen ---------- + +enum SwHoriOrient +{ + HORI_NONE, //Der Wert in nYPos gibt die RelPos direkt an. + HORI_RIGHT, //Der Rest ist fuer automatische Ausrichtung. + HORI_CENTER, + HORI_LEFT, + HORI_INSIDE, + HORI_OUTSIDE, + HORI_FULL, //Spezialwert fuer Tabellen + HORI_LEFT_AND_WIDTH //Auch fuer Tabellen + + //Die Verwendung fuer FlyFrms ist klar. Fuer Tabellen ist die + //Auswertung folgendermassen definiert: + //NONE == Die Randattribute zaehlen. + //LEFT, CENTER, RIGHT == Wunschbreite wird falls moegliche eingehalten + // und wenn noch Platz zur Verfuegung steht wird + // ausgerichtet. + //FULL == Die Tabelle nutzt die ganze verfuegbare Breite. + //LEFT_AND_WIDTH == Linker Rand und Wunschbreite werden beruecksichtigt. +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/index.hxx b/inc/bf_sw/index.hxx new file mode 100644 index 000000000..a51d45993 --- /dev/null +++ b/inc/bf_sw/index.hxx @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _INDEX_HXX +#define _INDEX_HXX + +#include <bf_svtools/bf_solar.h> + +#include <limits.h> + +#include <tools/rtti.hxx> // for RTTI of SwIndexReg +/*N*/ #include <tools/debug.hxx> //for stripping +namespace binfilter { +#define INVALID_INDEX STRING_NOTFOUND + +// Maximale Anzahl von Indizies im IndexArray (zum Abtesten auf Ueberlaeufe) +class SwIndex; +class SwIndexReg; + +class SwIndex +{ + friend class SwIndexReg; + +#ifdef DBG_UTIL + static int nSerial; + int MySerial; +#endif + + xub_StrLen nIndex; + SwIndexReg* pArray; + SwIndex *pNext, *pPrev; + + SwIndex& ChgValue( const SwIndex& rIdx, xub_StrLen nNewValue ); + void Remove(); // Ausketten + +public: + SwIndex( SwIndexReg * pReg, xub_StrLen nIdx = 0 ); + SwIndex( const SwIndex & ); + ~SwIndex() { Remove(); } + + inline xub_StrLen operator++(); + inline xub_StrLen operator++(int); + inline xub_StrLen operator--(int); + + inline xub_StrLen operator+=( xub_StrLen ); + inline xub_StrLen operator+=( const SwIndex& ); + + inline BOOL operator<( const SwIndex& ) const; + inline BOOL operator<=( const SwIndex& ) const; + inline BOOL operator>( const SwIndex& ) const; + inline BOOL operator>=( const SwIndex& ) const; + BOOL operator==( const SwIndex& rSwIndex ) const + { return (nIndex == rSwIndex.nIndex) && (pArray == rSwIndex.pArray); } + + BOOL operator!=( const SwIndex& rSwIndex ) const + { return (nIndex != rSwIndex.nIndex) || (pArray != rSwIndex.pArray); } + + BOOL operator<( xub_StrLen nWert ) const { return nIndex < nWert; } + BOOL operator<=( xub_StrLen nWert ) const { return nIndex <= nWert; } + BOOL operator>( xub_StrLen nWert ) const { return nIndex > nWert; } + BOOL operator>=( xub_StrLen nWert ) const { return nIndex >= nWert; } + BOOL operator==( xub_StrLen nWert ) const { return nIndex == nWert; } + BOOL operator!=( xub_StrLen nWert ) const { return nIndex != nWert; } + + inline SwIndex& operator=( xub_StrLen ); + SwIndex& operator=( const SwIndex & ); + + // gebe den Wert vom Index als xub_StrLen zurueck + xub_StrLen GetIndex() const { return nIndex; } + + // ermoeglicht Zuweisungen ohne Erzeugen eines temporaeren + // Objektes + SwIndex &Assign(SwIndexReg *,xub_StrLen); + + // Herausgabe des Pointers auf das IndexArray, + // (fuers RTTI am SwIndexReg) + const SwIndexReg* GetIdxReg() const { return pArray; } +}; + +#undef inline + +class SwIndexReg +{ + friend class SwIndex; + const SwIndex *pFirst, *pLast, *pMiddle; + + // ein globales Array, in das Indizies verschoben werden, die mal + // temporaer "ausgelagert" werden muessen; oder die zum Zeitpunkt des + // anlegens kein gueltiges Array kennen (SwPaM/SwPosition!) + friend void _InitCore(); + friend void _FinitCore(); + static SwIndexReg* pEmptyIndexArray; + +protected: + virtual void Update( const SwIndex & aPos, xub_StrLen nLen, + BOOL bNegativ = FALSE ); + + + BOOL HasAnyIndex() const { return 0 != pFirst; } + + // fuer das Move am RegArray: + +public: + SwIndexReg(); + virtual ~SwIndexReg(); + + // rtti, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun + // kann ueber das SwIndexReg typsicher gecastet werden. + TYPEINFO(); + + void SetDefMiddle( const SwIndex* pIdx ) { pMiddle = pIdx; } + void MoveTo( SwIndexReg& rArr ); +}; + + +inline xub_StrLen SwIndex::operator++() {DBG_BF_ASSERT(0, "STRIP"); return 0;} +inline xub_StrLen SwIndex::operator++(int) {DBG_BF_ASSERT(0, "STRIP"); return 0;} + inline xub_StrLen SwIndex::operator--(int) + { + xub_StrLen nOldIndex = nIndex; + ChgValue( *this, nIndex-1 ); + return nOldIndex; + } + +inline xub_StrLen SwIndex::operator+=( xub_StrLen nWert ) +{ + return ChgValue( *this, nIndex + nWert ).nIndex; +} +inline xub_StrLen SwIndex::operator+=( const SwIndex& rIndex ) +{ + return ChgValue( *this, nIndex + rIndex.nIndex ).nIndex; +} + +inline BOOL SwIndex::operator<( const SwIndex& rIndex ) const +{ + return nIndex < rIndex.nIndex; +} +inline BOOL SwIndex::operator<=( const SwIndex& rIndex ) const +{ + return nIndex <= rIndex.nIndex; +} +inline BOOL SwIndex::operator>( const SwIndex& rIndex ) const +{ + return nIndex > rIndex.nIndex; +} +inline BOOL SwIndex::operator>=( const SwIndex& rIndex ) const +{ + return nIndex >= rIndex.nIndex; +} +inline SwIndex& SwIndex::operator=( xub_StrLen nWert ) +{ + if( nIndex != nWert ) + ChgValue( *this, nWert ); + return *this; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/inetfld.hxx b/inc/bf_sw/inetfld.hxx new file mode 100644 index 000000000..7a19f9972 --- /dev/null +++ b/inc/bf_sw/inetfld.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _INETFLD_HXX +#define _INETFLD_HXX + +#include <bf_svtools/bf_solar.h> + + +#include "fldbas.hxx" + +namespace binfilter { +class SvxMacro; +class SvxMacroTableDtor; + +class SwINetField; +class SwCharFmt; +class SwDoc; + +/*-------------------------------------------------------------------- + Beschreibung: InterNet-FieldType -> Lade Document mit der URL + --------------------------------------------------------------------*/ + +class SwINetFieldType : public SwFieldType +{ + SwDepend aNormalFmt; + SwDepend aVisitFmt; + SwDoc* pDoc; + +public: + SwINetFieldType( SwDoc* pDoc ); + + virtual SwFieldType* Copy() const; + + SwCharFmt* GetCharFmt( const SwINetField& rFld ); + + SwDoc* GetDoc() const { return pDoc; } +}; + +/*-------------------------------------------------------------------- + Beschreibung: InterNet-Field -> Lade Document mit der URL + --------------------------------------------------------------------*/ + +class SwINetField : public SwField +{ + friend class SwINetFieldType; + + String sTargetFrameName; // in diesen Frame soll die URL + String sURL; + String sText; + SvxMacroTableDtor* pMacroTbl; + +public: + // Direkte Eingabe alten Wert loeschen + SwINetField( SwINetFieldType* pTyp, USHORT nFmt, + const String& rURL, const String& rText ); + virtual ~SwINetField(); + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual String Expand() const; + virtual SwField* Copy() const; + + // URL + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + // HinweisText + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + + // das ist das akt. Zeichenformat + SwCharFmt* GetCharFmt(); + const SwCharFmt* GetCharFmt() const + { return ((SwINetField*)this)->GetCharFmt(); } + + const String& GetTargetFrameName() const { return sTargetFrameName; } + void SetTargetFrameName( const String& rNm ) { sTargetFrameName = rNm; } + + // setze eine neue oder loesche die akt. MakroTabelle + void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 ); + const SvxMacroTableDtor* GetMacroTbl() const { return pMacroTbl; } + + // setze / erfrage ein Makro + void SetMacro( USHORT nEvent, const SvxMacro& rMacro ); + const SvxMacro* GetMacro( USHORT nEvent ) const; +}; + + +} //namespace binfilter +#endif // _INETFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/init.hxx b/inc/bf_sw/init.hxx new file mode 100644 index 000000000..e9a4ded8c --- /dev/null +++ b/inc/bf_sw/init.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _INIT_HXX +#define _INIT_HXX +namespace binfilter { + +void _InitCore(); // bastyp/init.cxx +void _FinitCore(); + +void _InitFilter(); // basflt/fltini.cxx +void _FinitFilter(); + +// layout/frame.cxx +void _FrmInit(); + +// text/txtfrm.cxx +void _TextInit(); +void _TextFinit(); + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/iodetect.hxx b/inc/bf_sw/iodetect.hxx new file mode 100644 index 000000000..e4d14dd76 --- /dev/null +++ b/inc/bf_sw/iodetect.hxx @@ -0,0 +1,623 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ + +#ifndef _IODETECT_HXX +#define _IODETECT_HXX + +#include <bf_svtools/bf_solar.h> + +#ifdef IS_SW_DLL +#include <shellio.hxx> +#endif +#include <osl/endian.h> +namespace binfilter { + +class Reader; + +struct SwIoDetect +{ +// eigentlich privat, aber der Compiler kann sonst die +// Tabelle nicht initialisieren + const sal_Char* pName; + USHORT nLen; + + inline int IsFilter( const String& rNm ) + { + return rNm.EqualsAscii( pName, 0, nLen ); + } + +#ifdef IS_SW_DLL + Reader* pReader; + BOOL bDelReader; + + inline Reader* GetReader() const { return pReader; } +#endif + + const sal_Char* IsReader(const sal_Char* pHeader, ULONG nInLen) const; +}; + + +#ifdef IS_SW_DLL +#define SwIoEntry(sNm, cCharLen, bDel) sNm, cCharLen, 0, bDel +#else +#define SwIoEntry(sNm, cCharLen, bDel) sNm, cCharLen +#endif + +#ifdef DEBUG_SH + +#define DEB_SH_SwIoEntry(sNm, cCharLen, pWrt, bDel) , SwIoEntry(sNm, cCharLen, pWrt, bDel) + +#else + +#define DEB_SH_SwIoEntry(sNm, cCharLen, pWrt, bDel) + +#endif + +#if !( !defined(DBG_UTIL) || defined(PM2)) +#define DEB_DBWRT_SwIoEntry(sNm, cCharLen, pWrt, bDel) , SwIoEntry(sNm, cCharLen, pWrt, bDel) +#else +#define DEB_DBWRT_SwIoEntry(sNm, cCharLen, pWrt, bDel) +#endif + + +const USHORT MAXFILTER = 12; + +#define FORAMTNAME_SW4 "StarWriter 4.0" +#define FORAMTNAME_SW3 "StarWriter 3.0" +#define FORAMTNAME_SWGLOB "StarWriter/Global 4.0" + + +#define IO_DETECT_IMPL1 \ +sal_Char FILTER_SWG[] = "SWG"; \ +sal_Char FILTER_SW3[] = "CSW3"; \ +sal_Char FILTER_SW4[] = "CSW4"; \ +sal_Char FILTER_SW5[] = "CSW5"; \ +sal_Char FILTER_BAS[] = "BAS"; \ +sal_Char FILTER_RTF[] = "RTF"; \ +sal_Char FILTER_SWGV[] = "SWGV"; \ +sal_Char FILTER_SW3V[] = "CSW3V"; \ +sal_Char FILTER_SW4V[] = "CSW4V"; \ +sal_Char FILTER_SW5V[] = "CSW5V"; \ +sal_Char FILTER_SWW4V[] = "CSW4VWEB"; \ +sal_Char FILTER_SWW5V[] = "CSW5VWEB"; \ +sal_Char sSwg1[] = "SWG1"; \ +sal_Char sRtfWH[] = "WH_RTF"; \ +sal_Char sCExcel[] = "CEXCEL"; \ +sal_Char sExcel[] = "EXCEL"; \ +sal_Char sLotusD[] = "LOTUSD"; \ +sal_Char sLotusW[] = "LOTUSW"; \ +sal_Char sHTML[] = "HTML"; \ +sal_Char sWW1[] = "WW1"; \ +sal_Char sWW5[] = "WW6"; \ +sal_Char sWW6[] = "CWW6"; \ +sal_Char FILTER_WW8[] = "CWW8"; \ +sal_Char FILTER_TEXT_DLG[] = "TEXT_DLG"; \ +sal_Char FILTER_TEXT[] = "TEXT"; \ +sal_Char sDebug[] = "DEBUG"; \ +sal_Char sUndo[] = "UNDO"; \ +sal_Char FILTER_XML[] = "CXML"; \ +sal_Char FILTER_XMLV[] = "CXMLV"; \ +sal_Char FILTER_XMLVW[] = "CXMLVWEB"; \ +sal_Char sSwDos[] = "SW6"; \ + \ + \ +SwIoDetect aReaderWriter[ MAXFILTER ] = { \ + {/* 0*/ SwIoEntry(FILTER_SW5, 4, TRUE)}, \ + {/* 1*/ SwIoEntry(FILTER_SW4, 4, FALSE)}, \ + {/* 2*/ SwIoEntry(FILTER_SW3, 4, FALSE)}, \ + {/* 3*/ SwIoEntry(FILTER_SWG, STRING_LEN, TRUE)}, \ + {/* 4*/ SwIoEntry(FILTER_SWGV, 4, FALSE)}, \ + {/* 5*/ SwIoEntry(sSwDos, STRING_LEN, TRUE)}, \ + {/* 6*/ SwIoEntry(FILTER_BAS, STRING_LEN, FALSE)}, \ + {/* 7*/ SwIoEntry(sCExcel, 5, TRUE)}, \ + {/* 8*/ SwIoEntry(sExcel, 4, FALSE)}, \ + {/* 9*/ SwIoEntry(sLotusD, 5, TRUE)}, \ + {/*10*/ SwIoEntry(sSwg1, 4, FALSE)}, \ + {/*11*/ SwIoEntry(FILTER_TEXT, 4, TRUE)} \ +}; + +// Filter erkennung +struct W1_FIB +{ + SVBT16 wIdent; // 0x0 int magic number + SVBT16 nFib; // 0x2 FIB version written + SVBT16 nProduct; // 0x4 product version written by + SVBT16 nlocale; // 0x6 language stamp---localized version; + SVBT16 pnNext; // 0x8 + SVBT16 fFlags; + + USHORT nFibGet() { return SVBT16ToShort(nFib); } + USHORT wIdentGet() { return SVBT16ToShort(wIdent); } + USHORT fFlagsGet() { return SVBT16ToShort(fFlags); } + BOOL fComplexGet() { return ((fFlagsGet() >> 2) & 1); } +}; + +#define IO_DETECT_IMPL2 \ +const sal_Char* SwIoDetect::IsReader(const sal_Char* pHeader, ULONG nInLen )\ + const \ +{ \ + int bRet = FALSE; \ + if( FILTER_SWG == pName ) \ + bRet = 0 == strncmp( FILTER_SWG, pHeader, 3 ) && \ + '1' != *(pHeader + 3); \ + else if( sSwg1 == pName ) \ + bRet = 0 == strncmp( FILTER_SWG, pHeader, 3 ) && \ + '1' == *(pHeader + 3); \ + else if( sLotusD == pName ) \ + bRet = 0 == *pHeader++ && 0 == *pHeader++ && \ + 2 == *pHeader++ && 0 == *pHeader++ && \ + ( 4 == *pHeader || 6 == *pHeader ) && 4 == *++pHeader; \ + else if( sExcel == pName ) \ + { \ + if( 0x09 == *pHeader++ ) \ + { \ + if( 0x00 == *pHeader ) \ + bRet = 0x04 == *++pHeader && 0 == *++pHeader; \ + else if( 0x02 == *pHeader || 0x04 == *pHeader ) \ + bRet = 0x06 == *++pHeader && 0 == *++pHeader; \ + } \ + } \ + else if( sWW5 == pName ) \ + { \ + bRet = (( ((W1_FIB*)pHeader)->wIdentGet() == 0xA5DC \ + && ((W1_FIB*)pHeader)->nFibGet() == 0x65 ) \ + /*&& ((W1_FIB*)pHeader)->fComplexGet() == 0*/); \ + } \ + else if( sWW1 == pName ) \ + { \ + bRet = (( ((W1_FIB*)pHeader)->wIdentGet() == 0xA59C \ + && ((W1_FIB*)pHeader)->nFibGet() == 0x21) \ + && ((W1_FIB*)pHeader)->fComplexGet() == 0); \ + } \ + else if( sSwDos == pName ) \ + { \ + sal_Char const sSw6_FormatStt[] = ".\\\\\\ WRITER "; \ + sal_Char const sSw6_FormatEnd[] = " \\\\\\"; \ + \ + bRet = 0 == strncmp( sSw6_FormatStt, pHeader, 12 ) && \ + 0 == strncmp( sSw6_FormatEnd, pHeader + 12 + 1, 4 ); \ + } \ + else if (FILTER_TEXT == pName) \ + bRet = SwIoSystem::IsDetectableText(pHeader, nInLen); \ + return bRet ? pName : 0; \ +} \ + +#define IO_DETECT_IMPL3 \ +const String SwIoSystem::GetSubStorageName( const SfxFilter& rFltr ) \ +{ \ + /* bei den StorageFiltern noch den SubStorageNamen setzen */ \ + const String& rUserData = rFltr.GetUserData(); \ + if( rUserData.EqualsAscii(FILTER_SW5) || rUserData.EqualsAscii(FILTER_SW5V) || \ + rUserData.EqualsAscii(FILTER_SWW5V) || \ + rUserData.EqualsAscii(FILTER_SW4 )|| rUserData.EqualsAscii(FILTER_SW4V) || \ + rUserData.EqualsAscii(FILTER_SWW4V) || \ + rUserData.EqualsAscii(FILTER_SW3 )|| rUserData.EqualsAscii(FILTER_SW3V) ) \ + return String::CreateFromAscii( \ + RTL_CONSTASCII_STRINGPARAM( "StarWriterDocument" )); \ + if( rUserData.EqualsAscii(FILTER_XML) || \ + rUserData.EqualsAscii(FILTER_XMLV) || \ + rUserData.EqualsAscii(FILTER_XMLVW) ) \ + return String::CreateFromAscii( \ + RTL_CONSTASCII_STRINGPARAM( "content.xml" )); \ + if( rUserData.EqualsAscii(sWW6) || rUserData.EqualsAscii(FILTER_WW8) ) \ + return String::CreateFromAscii( \ + RTL_CONSTASCII_STRINGPARAM( "WordDocument" )); \ + if( rUserData.EqualsAscii(sExcel) || rUserData.EqualsAscii(sCExcel) ) \ + return String::CreateFromAscii( \ + RTL_CONSTASCII_STRINGPARAM( "Book" )); \ + return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "" )); \ +} \ +const SfxFilter* SwIoSystem::GetFilterOfFormat( const String& rFmtNm, \ + const SfxFactoryFilterContainer* pCnt ) \ +{ \ + const SfxFactoryFilterContainer* pFltCnt = pCnt ? pCnt : \ + ( IsDocShellRegistered() \ + ? SwDocShell::Factory().GetFilterContainer() \ + : SwWebDocShell::Factory().GetFilterContainer() ); \ + \ + do { \ + if( pFltCnt ) \ + { \ + const SfxFilter* pFilter; \ + USHORT nCount = pFltCnt->GetFilterCount(); \ + for( USHORT i = 0; i < nCount; ++i ) \ + if( ( pFilter = pFltCnt->GetFilter( i ))->GetUserData() == rFmtNm ) \ + return pFilter; \ + } \ + if( pCnt || pFltCnt == SwWebDocShell::Factory().GetFilterContainer()) \ + break; \ + pFltCnt = SwWebDocShell::Factory().GetFilterContainer(); \ + } while( TRUE ); \ + \ + return 0; \ +} \ + \ +bool SwIoSystem::IsValidStgFilter( SvStorage& rStg, const SfxFilter& rFilter ) \ +{ \ + ULONG nStgFmtId = rStg.GetFormat(); \ + /*#i8409# We cannot trust the clipboard id anymore :-(*/ \ + if( rFilter.GetUserData().EqualsAscii(FILTER_WW8) || \ + rFilter.GetUserData().EqualsAscii(sWW6) ) \ + { \ + nStgFmtId = 0; \ + } \ +\ + BOOL bRet = SVSTREAM_OK == rStg.GetError() && \ + ( !nStgFmtId || rFilter.GetFormat() == nStgFmtId ) && \ + ( rStg.IsContained( SwIoSystem::GetSubStorageName( rFilter )) || \ + (rFilter.GetUserData().EqualsAscii(FILTER_XML) && \ + rStg.IsContained( String::CreateFromAscii("Content.xml") )) ); \ + if( bRet ) \ + { \ + /* Bug 53445 - es gibt Excel Docs ohne ClipBoardId! */ \ + /* Bug 62703 - und auch WinWord Docs ohne ClipBoardId! */ \ + if( rFilter.GetUserData().EqualsAscii(FILTER_WW8) || \ + rFilter.GetUserData().EqualsAscii(sWW6) ) \ + {\ + bRet = !((rStg.IsContained( String::CreateFromAscii("0Table" )) || \ + rStg.IsContained( String::CreateFromAscii("1Table" ))) ^ \ + rFilter.GetUserData().EqualsAscii(FILTER_WW8)); \ + if (bRet && !rFilter.IsAllowedAsTemplate()) \ + { \ + SvStorageStreamRef xRef = \ + rStg.OpenStream(String::CreateFromAscii("WordDocument"), \ + STREAM_STD_READ | STREAM_NOCREATE ); \ + xRef->Seek(10); \ + BYTE nByte; \ + *xRef >> nByte; \ + bRet = !(nByte & 1); \ + } \ + }\ + else if( rFilter.GetUserData().EqualsAscii(FILTER_XML, 0, sizeof(FILTER_XML)-1) ) \ + bRet = !nStgFmtId || rFilter.GetFormat() == nStgFmtId; \ + else if( !rFilter.GetUserData().EqualsAscii(sCExcel) ) \ + bRet = rFilter.GetFormat() == nStgFmtId; \ + } \ + return bRet; \ +} \ + \ + /* Feststellen ob das File in dem entsprechenden Format vorliegt. */ \ + /* Z.z werden nur unsere eigene Filter unterstuetzt */ \ +bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName, \ + const SfxFilter** ppFilter ) \ +{ \ + bool bRet = FALSE; \ + const SfxFilter* pFltr; \ + const SfxFactoryFilterContainer& rFltContainer = IsDocShellRegistered() \ + ? *SwDocShell::Factory().GetFilterContainer() \ + : *SwWebDocShell::Factory().GetFilterContainer(); \ + USHORT nFltCount = rFltContainer.GetFilterCount(); \ + SvStorageRef xStg; \ + if( rMedium.IsStorage() ) \ + xStg = rMedium.GetStorage(); \ + for( USHORT n = 0; n < nFltCount; ++n ) \ + if( ( pFltr = rFltContainer.GetFilter( n ))->GetUserData() == rFmtName ) \ + { \ + if( 'C' == *pFltr->GetUserData().GetBuffer() ) \ + { \ + bRet = xStg.Is() && IsValidStgFilter( *xStg, *pFltr ); \ + } \ + else if( !xStg.Is() ) \ + { \ + SvStream* pStrm = rMedium.GetInStream(); \ + if( pStrm && !pStrm->GetError() ) \ + { \ + sal_Char aBuffer[ 4097 ]; \ + ULONG nBytesRead = pStrm->Read( aBuffer, 4096 ); \ + pStrm->Seek( STREAM_SEEK_TO_BEGIN ); \ + if( nBytesRead<=80 ) \ + { \ + aBuffer[nBytesRead] = '\0'; \ + aBuffer[nBytesRead+1] = '\0'; \ + if( (nBytesRead & 0x00000001) != 0 ) \ + aBuffer[nBytesRead+2] = '\0'; \ + } \ + \ + for( USHORT i = 0; i < MAXFILTER; ++i ) \ + if( aReaderWriter[i].IsFilter( rFmtName ) ) \ + { \ + bRet = 0 != aReaderWriter[i].IsReader( aBuffer, nBytesRead ); \ + break; \ + } \ + } \ + } \ + \ + if( bRet && ppFilter ) \ + *ppFilter = pFltr; \ + \ + break; \ + } \ + \ + return bRet; \ +} \ + + +#ifdef OSL_LITENDIAN +# define ENDHACK bool bNativeLE = true; +#else +# define ENDHACK bool bNativeLE = false; +#endif + + +#define IO_DETECT_IMPL4 \ +/* die Methode stellt fest, von welchem Typ der stream (File) ist. */ \ +/* Es wird versucht, eine dem Filter entsprechende Byte-Folge zu finden. */ \ +/* Wird kein entsprechender gefunden, wird zur Zeit der ASCII-Reader */ \ +/* returnt !! Der Returnwert ist der interne Filtername! */ \ +const SfxFilter* SwIoSystem::GetFileFilter( const String& rFileName, \ + SfxMedium* pMedium ) \ +{ \ + SfxFactoryFilterContainer* pFCntnr = IsDocShellRegistered() \ + ? SwDocShell::Factory().GetFilterContainer() \ + : SwWebDocShell::Factory().GetFilterContainer(); \ + \ + USHORT nFltrCount; \ + if( !pFCntnr || 0 == ( nFltrCount = pFCntnr->GetFilterCount() ) ) \ + return 0; \ + \ + const SfxFilter* pFilter; \ + if( pMedium ? pMedium->IsStorage() \ + : SvStorage::IsStorageFile( rFileName ) ) \ + { \ + /* Storage: Suchen nach einem Sub-Storage, dessen Name */ \ + /* dem in einem Filter stehenden DLL-Namen entspricht */ \ + SvStorageRef xStg; \ + if( pMedium ) \ + xStg = pMedium->GetStorage(); \ + else \ + xStg = new SvStorage( rFileName, STREAM_STD_READ ); \ + \ + if( xStg.Is() && ( xStg->GetError() == SVSTREAM_OK ) ) \ + { \ + USHORT nCnt; \ + for( nCnt = 0; nCnt < nFltrCount; ++nCnt ) \ + if( 'C' == *( pFilter = pFCntnr->GetFilter( nCnt ))-> \ + GetUserData().GetBuffer() && \ + IsValidStgFilter( *xStg, *pFilter )) \ + return pFilter; \ + \ + if( IsDocShellRegistered() && 0 != ( pFCntnr = \ + SwWebDocShell::Factory().GetFilterContainer() ) && \ + 0 != ( nFltrCount = pFCntnr->GetFilterCount() ) ) \ + for( nCnt = 0; nCnt < nFltrCount; ++nCnt ) \ + if( 'C' == *( pFilter = pFCntnr->GetFilter( nCnt ))-> \ + GetUserData().GetBuffer() && \ + IsValidStgFilter( *xStg, *pFilter )) \ + return pFilter; \ + } \ + return 0; \ + } \ + \ + sal_Char aBuffer[ 4098 ]; \ + ULONG nBytesRead(0); \ + if( pMedium ) \ + { \ + SvStream* pIStrm = pMedium->GetInStream(); \ + if( !pIStrm || SVSTREAM_OK != pIStrm->GetError() ) \ + return 0; \ + ULONG nCurrPos = pIStrm->Tell(); \ + nBytesRead = pIStrm->Read( aBuffer, 4096 ); \ + pIStrm->Seek( nCurrPos ); \ + } \ + else \ + { \ + SvFileStream aStrm( rFileName, STREAM_READ ); \ + \ + /* ohne FileName oder ohne Stream gibts nur den ANSI-Filter */ \ + if( !rFileName.Len() || SVSTREAM_OK != aStrm.GetError() ) \ + return 0; \ + \ + nBytesRead = aStrm.Read( aBuffer, 4096 ); \ + aStrm.Close(); \ + } \ + DBG_ASSERT( nBytesRead<=4096, "zu viele Bytes gelesen?" ); \ + if( nBytesRead <= 4096 ) \ + { \ + aBuffer[nBytesRead] = '\0'; \ + aBuffer[nBytesRead+1] = '\0'; \ + if( (nBytesRead & 0x00000001) != 0 ) \ + aBuffer[nBytesRead+2] = '\0'; \ + } \ + \ + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ \ + /* suche nach dem bestimmten Filter, falls kein entsprechender */ \ + /* gefunden wird, so wird der ASCII-Filter returnt. */ \ + /* Gibt es Filter ohne einen Identifizierungs-String, so werden diese */ \ + /* nie erkannt und es wird auch der ASCII-Filter returnt. */ \ + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ \ + { \ + const SfxFilter* pLclFilter=NULL; \ + const sal_Char* pNm; \ + for( USHORT n = 0; n < MAXFILTER; ++n ) \ + if( 0 != ( pNm = aReaderWriter[n].IsReader(aBuffer, nBytesRead)) && \ + 0 != ( pLclFilter = SwIoSystem::GetFilterOfFormat( \ + String::CreateFromAscii(pNm), pFCntnr ))) \ + return pLclFilter; \ + } \ + \ + /* Ok, bis jetzt kein Filter gefunden, also befrage mal die */ \ + /* "WORD 4 WORD" Filter */ \ + if( rFileName.Len() ) \ + { \ + if( pMedium ) \ + pMedium->CloseInStream(); \ + } \ + return SwIoSystem::GetTextFilter( aBuffer, nBytesRead); \ +} \ +\ +bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, ULONG &rLen, \ + CharSet *pCharSet, bool *pSwap, LineEnd *pLineEnd) \ +{ \ + bool bSwap = false; \ + CharSet eCharSet = RTL_TEXTENCODING_DONTKNOW; \ + bool bLE = true; \ + ULONG nHead=0; \ + /*See if its a known unicode type*/\ + if (rLen >= 2)\ + {\ + if (rLen > 2 && BYTE(pBuf[0]) == 0xEF && BYTE(pBuf[1]) == 0xBB && \ + BYTE(pBuf[2]) == 0xBF)\ + {\ + eCharSet = RTL_TEXTENCODING_UTF8;\ + nHead = 3;\ + }\ + else if (BYTE(pBuf[0]) == 0xFE && BYTE(pBuf[1]) == 0xFF)\ + {\ + eCharSet = RTL_TEXTENCODING_UCS2;\ + bLE = false;\ + nHead = 2;\ + }\ + else if (BYTE(pBuf[1]) == 0xFE && BYTE(pBuf[0]) == 0xFF)\ + {\ + eCharSet = RTL_TEXTENCODING_UCS2;\ + nHead = 2;\ + }\ + pBuf+=nHead;\ + rLen-=nHead;\ + }\ +\ + bool bCR = false, bLF = false, \ + bIsBareUnicode = false;\ +\ + if (eCharSet != RTL_TEXTENCODING_DONTKNOW)\ + {\ + String sWork;\ + sal_Unicode *pNewBuf = sWork.AllocBuffer(rLen);\ + sal_Size nNewLen;\ + if (eCharSet != RTL_TEXTENCODING_UCS2)\ + {\ + nNewLen = rLen;\ + rtl_TextToUnicodeConverter hConverter = \ + rtl_createTextToUnicodeConverter(eCharSet);\ + rtl_TextToUnicodeContext hContext = \ + rtl_createTextToUnicodeContext(hConverter);\ +\ + sal_Size nCntBytes;\ + sal_uInt32 nInfo;\ + nNewLen = rtl_convertTextToUnicode( hConverter, hContext, pBuf, \ + rLen, pNewBuf, nNewLen, \ + (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT | \ + RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT | \ + RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT), &nInfo, &nCntBytes);\ +\ + rtl_destroyTextToUnicodeContext(hConverter, hContext);\ + rtl_destroyTextToUnicodeConverter(hConverter);\ + }\ + else\ + {\ + nNewLen = rLen/2;\ + memcpy(pNewBuf, pBuf, rLen);\ + ENDHACK\ + if (bLE != bNativeLE)\ + {\ + bSwap = true;\ + sal_Char* pF = (sal_Char*)pNewBuf;\ + sal_Char* pN = pF+1;\ + for(xub_StrLen n = 0; n < nNewLen; ++n, pF+=2, pN+=2)\ + {\ + sal_Char c = *pF;\ + *pF = *pN;\ + *pN = c;\ + }\ + }\ + }\ +\ + sWork.ReleaseBufferAccess(nNewLen);\ + pNewBuf = sWork.GetBufferAccess();\ + \ + for (ULONG nCnt = 0; nCnt < nNewLen; ++nCnt, ++pNewBuf)\ + {\ + switch (*pNewBuf) \ + {\ + case 0xA: \ + bLF = true; \ + break;\ + case 0xD:\ + bCR = true; \ + break;\ + default:\ + break;\ + }\ + }\ + }\ + else\ + {\ + for( ULONG nCnt = 0; nCnt < rLen; ++nCnt, ++pBuf )\ + {\ + switch (*pBuf) \ + {\ + case 0x0:\ + if( nCnt + 1 < rLen && !*(pBuf+1) )\ + return 0;\ + bIsBareUnicode = true; \ + break;\ + case 0xA:\ + bLF = true; \ + break;\ + case 0xD:\ + bCR = true; \ + break;\ + case 0xC:\ + case 0x1A:\ + case 0x9:\ + break;\ + default:\ + break;\ + }\ + }\ + }\ +\ + LineEnd eSysLE = GetSystemLineEnd();\ + LineEnd eLineEnd;\ + if (!bCR && !bLF)\ + eLineEnd = eSysLE;\ + else \ + eLineEnd = bCR ? ( bLF ? LINEEND_CRLF : LINEEND_CR ) : LINEEND_LF; \ +\ + if (pCharSet)\ + *pCharSet = eCharSet;\ + if (pSwap)\ + *pSwap = bSwap;\ + if (pLineEnd)\ + *pLineEnd = eLineEnd;\ + \ + return (!bIsBareUnicode && eSysLE == eLineEnd);\ +}\ +\ +\ +const SfxFilter* SwIoSystem::GetTextFilter( const sal_Char* pBuf, ULONG nInLen)\ +{ \ + bool bAuto = IsDetectableText(pBuf, nInLen); \ + const sal_Char* pNm = bAuto ? FILTER_TEXT : FILTER_TEXT_DLG; \ + return SwIoSystem::GetFilterOfFormat( String::CreateFromAscii(pNm), 0 ); \ +} \ + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/itabenum.hxx b/inc/bf_sw/itabenum.hxx new file mode 100644 index 000000000..166556fad --- /dev/null +++ b/inc/bf_sw/itabenum.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _ITABENUM_HXX +#define _ITABENUM_HXX +namespace binfilter { + +enum SwTableInsMode +{ + DEFAULT_BORDER = 0x01, + HEADLINE = 0x02, + REPEAT = 0x04, + HEADLINE_REPEAT = 0x06, // Headline + Repeat + SPLIT_LAYOUT = 0x08, + HEADLINE_NO_BORDER = HEADLINE_REPEAT|SPLIT_LAYOUT, + ALL_TBL_INS_ATTR = DEFAULT_BORDER|HEADLINE_REPEAT|SPLIT_LAYOUT +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/lineinfo.hxx b/inc/bf_sw/lineinfo.hxx new file mode 100644 index 000000000..d57c70d8f --- /dev/null +++ b/inc/bf_sw/lineinfo.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SW_LINEINFO_HXX +#define SW_LINEINFO_HXX + +#include <bf_svtools/bf_solar.h> + + +#include "calbck.hxx" +#include "numrule.hxx" +namespace binfilter { + +class SwCharFmt; +class SwDoc; + +enum LineNumberPosition +{ + LINENUMBER_POS_LEFT, + LINENUMBER_POS_RIGHT, + LINENUMBER_POS_INSIDE, + LINENUMBER_POS_OUTSIDE +}; + +class SwLineNumberInfo : public SwClient //purpose of derivation from SwClient: + //character style for displaying the numbers. +{ + SvxNumberType aType; //e.g. roman linenumbers + String aDivider; //String for aditional interval (vert. lines user defined) + USHORT nPosFromLeft; //Position for paint + USHORT nCountBy; //Paint only for every n line + USHORT nDividerCountBy; //Interval for display of an user defined + //string every n lines + LineNumberPosition ePos; //Where should the display occur (number and divicer) + BOOL bPaintLineNumbers; //Should anything be displayed? + BOOL bCountBlankLines; //Count empty lines? + BOOL bCountInFlys; //Count also within FlyFrames? + BOOL bRestartEachPage; //Restart counting at the first paragraph of each page + //(even on follows when paragraphs are splitted) + +public: + SwLineNumberInfo(); + SwLineNumberInfo(const SwLineNumberInfo&); + + SwLineNumberInfo& operator=(const SwLineNumberInfo&); + BOOL operator==( const SwLineNumberInfo& rInf ) const; + + SwCharFmt *GetCharFmt(SwDoc &rDoc) const; + void SetCharFmt( SwCharFmt* ); + + const SvxNumberType &GetNumType() const { return aType; } + void SetNumType( SvxNumberType aNew ){ aType = aNew; } + + const String &GetDivider() const { return aDivider; } + void SetDivider( const String &r ) { aDivider = r; } + USHORT GetDividerCountBy() const { return nDividerCountBy; } + void SetDividerCountBy( USHORT n ) { nDividerCountBy = n; } + + USHORT GetPosFromLeft() const { return nPosFromLeft; } + void SetPosFromLeft( USHORT n) { nPosFromLeft = n; } + + USHORT GetCountBy() const { return nCountBy; } + void SetCountBy( USHORT n) { nCountBy = n; } + + LineNumberPosition GetPos() const { return ePos; } + void SetPos( LineNumberPosition eP ){ ePos = eP; } + + BOOL IsPaintLineNumbers() const { return bPaintLineNumbers; } + void SetPaintLineNumbers( BOOL b ){ bPaintLineNumbers = b; } + + BOOL IsCountBlankLines() const { return bCountBlankLines; } + void SetCountBlankLines( BOOL b ) { bCountBlankLines = b; } + + BOOL IsCountInFlys() const { return bCountInFlys; } + void SetCountInFlys( BOOL b ) { bCountInFlys = b; } + + BOOL IsRestartEachPage() const { return bRestartEachPage; } + void SetRestartEachPage( BOOL b ) { bRestartEachPage = b; } + + virtual void Modify( SfxPoolItem*, SfxPoolItem* ); +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/linetype.hxx b/inc/bf_sw/linetype.hxx new file mode 100644 index 000000000..32a0cde06 --- /dev/null +++ b/inc/bf_sw/linetype.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _LINETYPE_HXX +#define _LINETYPE_HXX + +#include <bf_svtools/bf_solar.h> +namespace binfilter { + +/*-------------------------------------------------------------------- + Beschreibung: Ein Linientyp wird durch die 3 Werte festgelegt + --------------------------------------------------------------------*/ + +enum SwLineWidth +{ + LIN_0 = 0, + LIN_1 = 1, + LIN_2 = 20, + LIN_3 = 50, + LIN_4 = 80, + LIN_5 = 100 +}; + +struct SwLineType +{ + USHORT nIn; + USHORT nOut; + USHORT nDist; +}; + +USHORT GetLineTypeCount(); +const SwLineType& GetLineType(USHORT nIdx); + +} //namespace binfilter +#endif // _LINETYPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/linkenum.hxx b/inc/bf_sw/linkenum.hxx new file mode 100644 index 000000000..de951ebaa --- /dev/null +++ b/inc/bf_sw/linkenum.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _LINKENUM_HXX +#define _LINKENUM_HXX +namespace binfilter { + +enum UpdateLinks +{ + NEVER, + MANUAL, + AUTOMATIC, + GLOBALSETTING +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/mdiexp.hxx b/inc/bf_sw/mdiexp.hxx new file mode 100644 index 000000000..32607330b --- /dev/null +++ b/inc/bf_sw/mdiexp.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _MDIEXP_HXX +#define _MDIEXP_HXX + +#include <bf_svtools/bf_solar.h> + +class UniString; +class Size; +class Dialog; + +namespace binfilter { + + +class SwRect; +class ViewShell; +class SwDoc; +class SwDocShell; +class SfxObjectShell; +class SfxFrame; + +extern void ScrollMDI(ViewShell* pVwSh, const SwRect &, USHORT nRangeX, USHORT nRangeY); +extern BOOL IsScrollMDI(ViewShell* pVwSh, const SwRect &); +extern void SizeNotify(ViewShell* pVwSh, const Size &); + +//Update der Statusleiste, waehrend einer Action. +extern void PageNumNotify( ViewShell* pVwSh, + USHORT nPhyNum, + USHORT nVirtNum, + const UniString& rPg ); + +enum FlyMode { FLY_DRAG_START, FLY_DRAG, FLY_DRAG_END }; +extern void FrameNotify( ViewShell* pVwSh, FlyMode eMode = FLY_DRAG ); + +void StartProgress ( USHORT nMessId, long nStartVal, long nEndVal, SwDocShell *pDocSh = 0 ); +void EndProgress ( SwDocShell *pDocSh = 0 ); +void SetProgressState ( long nPosition, SwDocShell *pDocShell ); + +void EnableCmdInterface(BOOL bEnable = TRUE); + +Dialog* GetSearchDialog(); + +void RepaintPagePreview( ViewShell* pVwSh, const SwRect& rRect ); + +// ndgrf.cxx +// alle QuickDraw-Bitmaps des speziellen Docs loeschen +void DelAllGrfCacheEntries( SwDoc* pDoc ); + +extern void JavaScriptScrollMDI( SfxFrame* pFrame, INT32 nX, INT32 nY ); + +// ChgMode fuer Tabellen aus der Konfiguration lesen +USHORT GetTblChgDefaultMode(); + +BOOL JumpToSwMark( ViewShell* pVwSh, const UniString& rMark ); + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndarr.hxx b/inc/bf_sw/ndarr.hxx new file mode 100644 index 000000000..14b900c90 --- /dev/null +++ b/inc/bf_sw/ndarr.hxx @@ -0,0 +1,276 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _NDARR_HXX +#define _NDARR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/svarray.hxx> + +#include <bparr.hxx> +#include <ndtyp.hxx> + +class Graphic; +class UniString; + +namespace binfilter { +class SvInPlaceObject; +class BfGraphicObject; + +class SwAttrSet; +class SwCntntFrm; +class SwCntntNode; +class SwDoc; +class SwGrfFmtColl; +class SwGrfNode; +class SwHistory; +class SwNode; +class SwNodeIndex; +class SwNodeRange; +class SwOLENode; +class SwOutlineNodes; +class SwPaM; +class SwSection; +class SwSectionFmt; +class SwSectionNode; +class SwStartNode; +class SwTableBoxFmt; +class SwTableFmt; +class SwTableLine; +class SwTableLineFmt; +class SwTableNode; +class SwTblToTxtSaves; +class SwTxtFmtColl; +class SwTxtNode; +struct SwPosition; + + +// -------------------- +// class SwNodes +// -------------------- + +typedef SwNode * SwNodePtr; +typedef BOOL (*FnForEach_SwNodes)( const SwNodePtr&, void* pArgs ); + +SV_DECL_PTRARR_SORT( SwOutlineNodes, SwNodePtr, 0, 10 ) + +class SwNodes: private BigPtrArray +{ + friend class SwDoc; + friend class SwNode; + friend class SwNodeIndex; + + SwNodePtr operator[]( USHORT n ) const; + SwNodePtr operator[]( int n ) const; + + SwNodeIndex* pRoot; // Liste aller Indizies auf Nodes + + void Insert( const SwNodePtr pNode, const SwNodeIndex& rPos ); + void Insert( const SwNodePtr pNode, ULONG nPos); + + SwDoc* pMyDoc; // in diesem Doc ist das Nodes-Array + + SwNode *pEndOfPostIts, *pEndOfInserts, // das sind die festen Bereiche + *pEndOfAutotext, *pEndOfRedlines, + *pEndOfContent; + + SwOutlineNodes* pOutlineNds; // Array aller GliederiungsNodes + + BOOL bInNodesDel : 1; // falls rekursiv aufgerufen wird + // Num/Outline nicht aktualisierem + BOOL bInDelUpdOutl : 1; // Flags fuers aktualisieren von Outl. + BOOL bInDelUpdNum : 1; // Flags fuers aktualisieren von Outl. + + // fuer dier Verwaltung der Indizies + void RegisterIndex( SwNodeIndex& rIdx ); + void DeRegisterIndex( SwNodeIndex& rIdx ); + void RemoveNode( ULONG nDelPos, ULONG nLen, bool bDel ); + + // Aktionen auf die Nodes + void SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEnd ); + void DelNodes( const SwNodeIndex& rStart, ULONG nCnt = 1 ); + + void UpdtOutlineIdx( const SwNode& ); // Update ab Node alle OutlineNodes + + void _CopyNodes( const SwNodeRange&, const SwNodeIndex&, + BOOL bNewFrms = TRUE, BOOL bTblInsDummyNode = FALSE ) const; + void _DelDummyNodes( const SwNodeRange& rRg ); + +protected: + SwNodes( SwDoc* pDoc ); + +public: + ~SwNodes(); + + SwNodePtr operator[]( ULONG n ) const + { return (SwNodePtr)BigPtrArray::operator[] ( n ); } + +//JP 29.09.97: impl. steht im ndindex.hxx - sollte moeglichst bald auf die +// neue Schnittstelle angepasst werden + inline SwNodePtr operator[]( const SwNodeIndex& rIdx ) const; + + ULONG Count() const { return BigPtrArray::Count(); } + void ForEach( FnForEach_SwNodes fnForEach, void* pArgs = 0 ) + { + BigPtrArray::ForEach( 0, BigPtrArray::Count(), + (FnForEach) fnForEach, pArgs ); + } + void ForEach( ULONG nStt, ULONG nEnd, FnForEach_SwNodes fnForEach, void* pArgs = 0 ) + { + BigPtrArray::ForEach( nStt, nEnd, (FnForEach) fnForEach, pArgs ); + } + void ForEach( const SwNodeIndex& rStart, const SwNodeIndex& rEnd, + FnForEach_SwNodes fnForEach, void* pArgs = 0 ); + + // eine noch leere Section + SwNode& GetEndOfPostIts() const { return *pEndOfPostIts; } + // Section fuer alle Fussnoten + SwNode& GetEndOfInserts() const { return *pEndOfInserts; } + // Section fuer alle Flys/Header/Footers + SwNode& GetEndOfAutotext() const { return *pEndOfAutotext; } + // Section fuer alle Redlines + SwNode& GetEndOfRedlines() const { return *pEndOfRedlines; } + // das ist der letzte EndNode einer SonderSection. Hier nach kommt nur + // noch die normale ContentSection (also der BodyText) + SwNode& GetEndOfExtras() const { return *pEndOfRedlines; } + // die normale ContentSection (also der BodyText) + SwNode& GetEndOfContent() const { return *pEndOfContent; } + + // ist das NodesArray das normale vom Doc? (nicht das UndoNds, .. ) + // Implementierung steht im doc.hxx (weil man dazu Doc kennen muss) ! + inline BOOL IsDocNodes() const; + + void Delete(const SwNodeIndex &rPos, ULONG nNodes = 1); + + void _Copy( const SwNodeRange& rRg, const SwNodeIndex& rInsPos, + BOOL bNewFrms = TRUE ) const + { _CopyNodes( rRg, rInsPos, bNewFrms ); } + + void SectionDown( SwNodeRange *pRange, SwStartNodeType = SwNormalStartNode ); + + BOOL CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd ) const; + + void GoStartOfSection(SwNodeIndex *) const {} // DBG_BF_ASSERT + void GoEndOfSection(SwNodeIndex *) const; + + SwCntntNode* GoNext(SwNodeIndex *) const; + SwCntntNode* GoPrevious(SwNodeIndex *) const; + + //Gehe zum naechsten/vorherigen Cntnt/Tabellennode, fuer den + //es LayoutFrames gibt, dabei Kopf-/Fusszeilen/Rahmen etc. nicht verlassen + SwNode* GoNextWithFrm(SwNodeIndex *) const; + + // zum naechsten Content-Node, der nicht geschuetzt oder versteckt ist + // (beides auf FALSE ==> GoNext/GoPrevious!!!) + SwCntntNode* GoNextSection( SwNodeIndex *, int bSkipHidden = TRUE, + int bSkipProtect = TRUE ) const; + SwCntntNode* GoPrevSection( SwNodeIndex *, int bSkipHidden = TRUE, + int bSkipProtect = TRUE ) const; + + // erzeuge ein leere Section von Start und EndNode. Darf nur gerufen + // werden, wenn eine neue Section mit Inhalt erzeugt werden soll. + // Zum Beispiel bei den Filtern/Undo/... + SwStartNode* MakeEmptySection( const SwNodeIndex& rIdx, + SwStartNodeType = SwNormalStartNode ); + + + // die Impl. von "Make...Node" stehen in den angegebenen .ccx-Files + SwTxtNode *MakeTxtNode( const SwNodeIndex & rWhere, + SwTxtFmtColl *pColl, + SwAttrSet* pAutoAttr = 0 ); // in ndtxt.cxx + SwStartNode* MakeTextSection( const SwNodeIndex & rWhere, + SwStartNodeType eSttNdTyp, + SwTxtFmtColl *pColl, + SwAttrSet* pAutoAttr = 0 ); + + SwGrfNode *MakeGrfNode( const SwNodeIndex & rWhere, + const UniString& rGrfName, + const UniString& rFltName, + const Graphic* pGraphic, + SwGrfFmtColl *pColl, + SwAttrSet* pAutoAttr = 0, + BOOL bDelayed = FALSE ); // in ndgrf.cxx + + SwGrfNode *MakeGrfNode( const SwNodeIndex & rWhere, + const BfGraphicObject& rGrfObj, + SwGrfFmtColl *pColl, + SwAttrSet* pAutoAttr = 0 ); // in ndgrf.cxx + + SwOLENode *MakeOLENode( const SwNodeIndex & rWhere, + SvInPlaceObject *pObj, + SwGrfFmtColl *pColl, + SwAttrSet* pAutoAttr = 0 ); // in ndole.cxx + SwOLENode *MakeOLENode( const SwNodeIndex & rWhere, + UniString &rName, + SwGrfFmtColl *pColl, + SwAttrSet* pAutoAttr = 0 ); // in ndole.cxx + + // Array aller GliederiungsNodes; + const SwOutlineNodes& GetOutLineNds() const { return *pOutlineNds; } + // ab einem bestimmten TextNode alle Updaten + void UpdateOutlineNode( const SwNode&, BYTE nOldLevel, BYTE nNewLevel ); + // alle Nodes Updaten - Rule/Format-Aenderung + void UpdateOutlineNodes(); + + // fuege die Nodes fuer die Tabelle ein + // wenn Lines angegeben, erzeuge die Matrix aus Lines & Boxen + // ansonsten nur die Anzahl von Boxen. + /* #109161# + + New parameter pAttrSet: If pAttrSet is non-null and contains an + adjust item it is propagated to the table cells. If there is an + adjust in pCntntTxtColl or pHeadlineTxtColl this adjust item + overrides the item in pAttrSet. + + */ + SwTableNode* InsertTable( const SwNodeIndex& rNdIdx, + USHORT nBoxes, SwTxtFmtColl* pCntntTxtColl, + USHORT nLines=0, SwTxtFmtColl* pHeadlineTxtColl=0, + const SwAttrSet * pAttrSet = 0); + + // Splittet eine Tabelle in der Grund-Zeile, in der der Index steht. + // Alle GrundZeilen dahinter wandern in eine neue Tabelle/-Node. + // Ist das Flag bCalcNewSize auf TRUE, wird fuer beide neuen Tabellen + // die neue SSize aus dem Max der Boxen errechnet; vorrausgesetzt, + // die SSize ist "absolut" gesetzt (LONG_MAX) + // (Wird zur Zeit nur fuer den RTF-Parser benoetigt) + // fuegt 2 Tabellen, die hintereinander stehen, wieder zusammen + + // fuege eine neue SwSection ein + SwSectionNode* InsertSection( const SwNodeIndex& rNdIdx, + SwSectionFmt& rSectionFmt, + const SwSection&, + const SwNodeIndex* pEnde, + BOOL bInsAtStart = TRUE ); + + // in welchem Doc steht das Nodes-Array ? + SwDoc* GetDoc() { return pMyDoc; } + const SwDoc* GetDoc() const { return pMyDoc; } +private: + // privater Constructor, weil nie kopiert werden darf !! + SwNodes( const SwNodes & rNodes ); +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndgrf.hxx b/inc/bf_sw/ndgrf.hxx new file mode 100644 index 000000000..a44e788d1 --- /dev/null +++ b/inc/bf_sw/ndgrf.hxx @@ -0,0 +1,183 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDGRF_HXX +#define _NDGRF_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_so3/lnkbase.hxx> +#include <bf_goodies/graphicobject.hxx> +#include <ndnotxt.hxx> +namespace binfilter { + +class SvStorage; +class SwGrfFmtColl; +class SwDoc; +class BfGraphicAttr; + + +// -------------------- +// SwGrfNode +// -------------------- +class SwGrfNode: public SwNoTxtNode +{ + friend class SwNodes; + friend class SwGrfFrm; + + BfGraphicObject aGrfObj; + ::binfilter::SvBaseLinkRef refLink; // falls Grafik nur als Link, dann Pointer gesetzt + Size nGrfSize; + String aNewStrmName; // SW3/XML: new stream name (either SW3 stream + // name or package url) + String aLowResGrf; // HTML: LowRes Grafik (Ersatzdarstellung bis + // die normale (HighRes) geladen ist. + + BOOL bTransparentFlagValid :1; + BOOL bInSwapIn :1; + BOOL bGrafikArrived :1; + BOOL bChgTwipSize :1; + BOOL bChgTwipSizeFromPixel :1; + BOOL bLoadLowResGrf :1; + BOOL bFrameInPaint :1; //Um Start-/EndActions im Paint (ueber + //SwapIn zu verhindern. + BOOL bScaleImageMap :1; //Image-Map in SetTwipSize skalieren + + SwGrfNode( const SwNodeIndex& rWhere, + const String& rGrfName, const String& rFltName, + const Graphic* pGraphic, + SwGrfFmtColl* pGrfColl, + SwAttrSet* pAutoAttr = 0 ); + // Ctor fuer Einlesen (SW/G) ohne Grafik + SwGrfNode( const SwNodeIndex& rWhere, + const String& rGrfName, const String& rFltName, + SwGrfFmtColl* pGrfColl, + SwAttrSet* pAutoAttr = 0 ); + SwGrfNode( const SwNodeIndex& rWhere, + const BfGraphicObject& rGrfObj, + SwGrfFmtColl* pGrfColl, + SwAttrSet* pAutoAttr = 0 ); + + void InsertLink( const String& rGrfName, const String& rFltName ); + BOOL ImportGraphic( SvStream& ){DBG_BF_ASSERT(0, "STRIP"); return FALSE;} + BOOL HasStreamName() const { return aGrfObj.HasUserData(); } + BOOL GetStreamStorageNames( String& rStrmName, String& rStgName ) const; + + DECL_LINK( SwapGraphic, BfGraphicObject* ); + +public: + virtual ~SwGrfNode(); + + const Graphic& GetGrf() const { return aGrfObj.GetGraphic(); } + const BfGraphicObject& GetGrfObj() const { return aGrfObj; } + BfGraphicObject& GetGrfObj() { return aGrfObj; } + + virtual SwCntntNode *SplitNode( const SwPosition & ); + + virtual Size GetTwipSize() const; +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED + void SetTwipSize( const Size& rSz ); + + inline BOOL IsAnimated() const { return aGrfObj.IsAnimated(); } + + inline BOOL IsChgTwipSize() const { return bChgTwipSize; } + inline BOOL IsChgTwipSizeFromPixel() const { return bChgTwipSizeFromPixel; } + inline void SetChgTwipSize( BOOL b, BOOL bFromPx=FALSE ) { bChgTwipSize = b; bChgTwipSizeFromPixel = bFromPx; } + + inline BOOL IsGrafikArrived() const { return bGrafikArrived; } + inline void SetGrafikArrived( BOOL b ) { bGrafikArrived = b; } + + inline BOOL IsFrameInPaint() const { return bFrameInPaint; } + inline void SetFrameInPaint( BOOL b ) { bFrameInPaint = b; } + + inline BOOL IsScaleImageMap() const { return bScaleImageMap; } + inline void SetScaleImageMap( BOOL b ) { bScaleImageMap = b; } + + // alles fuers Laden der LowRes-Grafiken + inline BOOL IsLoadLowResGrf() const { return bLoadLowResGrf; } + inline void SetLoadLowResGrf( BOOL b ) { bLoadLowResGrf = b; } + const String& GetLowResGrfName() const { return aLowResGrf; } + void SetLowResGrfName( const String& r ) { aLowResGrf = r; } +#endif + // steht in ndcopy.cxx + virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED + // erneutes Einlesen, falls Graphic nicht Ok ist. Die + // aktuelle wird durch die neue ersetzt. + BOOL ReRead( const String& rGrfName, const String& rFltName, + const Graphic* pGraphic = 0, + const BfGraphicObject* pGrfObj = 0, + BOOL bModify = TRUE ); + // Laden der Grafik unmittelbar vor der Anzeige + short SwapIn( BOOL bWaitForData = FALSE ); + void SetStreamName( const String& r ) { aGrfObj.SetUserData( r ); } + void SetNewStreamName( const String& r ) { aNewStrmName = r; } + // is this node selected by any shell? + BOOL IsSelected() const{DBG_BF_ASSERT(0, "STRIP");return FALSE;} ; +#endif + + // Der Grafik sagen, dass sich der Node im Undobereich befindet + +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED + // Abfrage der Link-Daten + BOOL IsGrfLink() const { return refLink.Is(); } + inline BOOL IsLinkedFile() const; + inline BOOL IsLinkedDDE() const; + ::binfilter::SvBaseLinkRef GetLink() const { return refLink; } + BOOL GetFileFilterNms( String* pFileNm, String* pFilterNm ) const; + + // Prioritaet beim Laden der Grafik setzen. Geht nur, wenn der Link + // ein FileObject gesetzt hat + + // Skalieren einer Image-Map: Die Image-Map wird um den Faktor + // zwischen Grafik-Groesse und Rahmen-Groesse vergroessert/verkleinert + + // returns the with our graphic attributes filled Graphic-Attr-Structure + +#endif +}; + + +// ---------------------------------------------------------------------- +// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! +inline SwGrfNode *SwNode::GetGrfNode() +{ + return ND_GRFNODE == nNodeType ? (SwGrfNode*)this : 0; +} +inline const SwGrfNode *SwNode::GetGrfNode() const +{ + return ND_GRFNODE == nNodeType ? (const SwGrfNode*)this : 0; +} + +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED +inline BOOL SwGrfNode::IsLinkedFile() const +{ + return refLink.Is() && OBJECT_CLIENT_GRF == refLink->GetObjType(); +} +inline BOOL SwGrfNode::IsLinkedDDE() const +{ + return refLink.Is() && OBJECT_CLIENT_DDE == refLink->GetObjType(); +} +#endif + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndhints.hxx b/inc/bf_sw/ndhints.hxx new file mode 100644 index 000000000..ca4e9756a --- /dev/null +++ b/inc/bf_sw/ndhints.hxx @@ -0,0 +1,215 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDHINTS_HXX +#define _NDHINTS_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/svarray.hxx> + +#include <tools/mempool.hxx> + +#include "numrule.hxx" +#include <vector> +namespace binfilter { + +class SwTxtNode; +class SwRegHistory; // steht im RolBck.hxx +class SwTxtAttr; + +/* + * Ableitung der Klasse SwpHints ueber den Umweg ueber SwpHts, da + * lediglich die Klasse SwTxtNode Attribute einfuegen und + * loeschen koennen soll. Anderen Klassen wie den Frames steht + * lediglich ein lesender Zugriff ueber den Index-Operator zur + * Verfuegung. + * Groesse beim Anlegen gleich 1, weil nur dann ein Array erzeug wird, wenn + * auch ein Hint eingefuegt wird. + */ + +/************************************************************************* + * class SwpHtStart/End + *************************************************************************/ + +SV_DECL_PTRARR_SORT(SwpHtStart,SwTxtAttr*,1,1) +SV_DECL_PTRARR_SORT(SwpHtEnd,SwTxtAttr*,1,1) + +/************************************************************************* + * class SwpHintsArr + *************************************************************************/ + +// Das neue Hintsarray: +class SwpHintsArr : private SwpHtStart +{ + +protected: + SwpHtEnd aHtEnd; + +public: + void Insert( const SwTxtAttr *pHt ); + void Delete( const SwTxtAttr *pHt ); + void DeleteAtPos( const USHORT nPosInStart ); + BOOL Resort(); + SwTxtAttr *Cut( const USHORT nPosInStart ); + + inline const SwTxtAttr *GetStart( const USHORT nPos ) const { return (*this)[nPos]; } + inline const SwTxtAttr *GetEnd( const USHORT nPos ) const { return aHtEnd[nPos]; } + inline SwTxtAttr *GetStart( const USHORT nPos ) { return GetHt(nPos); } + inline SwTxtAttr *GetEnd( const USHORT nPos ) { return aHtEnd[nPos]; } + inline USHORT GetEndCount() const { return aHtEnd.Count(); } + inline USHORT GetStartCount() const { return Count(); } + inline USHORT GetStartOf( const SwTxtAttr *pHt ) const; + inline USHORT GetEndOf( const SwTxtAttr *pHt ) const; + inline USHORT GetPos( const SwTxtAttr *pHt ) const { return SwpHtStart::GetPos( pHt ); } + +#ifdef USED + // Der Zugriffsoperator soll bald nur noch const sein! + inline SwTxtAttr *operator[]( const USHORT nIdx ) { return SwpHtStart::operator[](nIdx); } +#endif + + + inline SwTxtAttr *GetHt( const USHORT nIdx ) { return SwpHtStart::operator[](nIdx); } + inline const SwTxtAttr *operator[]( const USHORT nIdx )const + { return SwpHtStart::operator[](nIdx); } + inline USHORT Count() const { return SwpHtStart::Count(); } + + // Methoden vom PtrArr weiterreichen, wird fuer Node::_Cut benoetigt + const SwTxtAttr** GetData() const { return SwpHtStart::GetData(); } + +#ifdef DBG_UTIL + BOOL Check() const; +#endif +}; + +/************************************************************************* + * class SwpHints + *************************************************************************/ + +// Die public-Schnittstelle zum Node hin +class SwpHints: public SwpHintsArr +{ +private: + SwRegHistory* pHistory; + // Numerierung + BOOL bVis :1; // HiddenParaFld + BOOL bFntChg :1; // Fontwechsel + BOOL bFtn :1; // Fussnoten + BOOL bInSplitNode: 1; // TRUE: der Node ist im Split und die Frames + // werden verschoben! + BOOL bDDEFlds : 1; // es sind DDE-Felder am TextNode vorhanden + BOOL bCalcVis : 1; // bVis ist invalid, CalcVisibleFlag() rufen + + BOOL Resort( const USHORT nPos ); + // loescht Hints, die keinen Zustaendigkeitsbereich mehr haben + void ClearDummies( SwTxtNode &rNode ); + // Merge verschmilzt aneinanderreichende Hints mit gleichen Attributen + // und gleichen Werten, falls nichts dagegen spricht, d.h. wenn dadurch + // keine Ueberlappungen mit gleichartigen Attr. entstehen, + // Ist der Rueckgabewert TRUE, so wurde verschmolzen und dabei u.a. auch + // ein Resort ausgeloest. + BOOL Merge( SwTxtNode &rNode, SwTxtAttr* pAttr = 0 ); + // Haelt ein neues Attribut in pHistory fest. + + void CalcFlags( ); + + // die Delete Methoden duerfen nur vom TextNode gerufen werden !! + // Dieser sorgt dafuer, das bei Attributen ohne Ende auch das + // entsp. Zeichen entfernt wird !! + friend class SwTxtNode; + void DeleteAtPos( const USHORT nPos ); + // Ist der Hint schon bekannt, dann suche die Position und loesche ihn. + // Ist er nicht im Array, so gibt es ein ASSERT !! + void Delete( SwTxtAttr* pTxtHt ); + +public: + inline BOOL CanBeDeleted() const { return !Count(); } + + // damit das SwDoc::Undo ueber alle Attributaenderungen informiert + // wird, gibt es hier einen Pointer auf die History. Nur wenn dieser + // != 0 ist, muessen alle Attributaenderungen "gemeldet" werden. + void Register( SwRegHistory* pHist ) { pHistory = pHist; } + void DeRegister() { Register(0); } + + void Insert( SwTxtAttr *pHt, SwTxtNode &rNode, USHORT nMode = 0 ); + + // Forget signalisiert, dass es ueberfluessig ist, das Attribut einzu- + // fuegen, da es keinen Zustaendigkeitsbereich haette. + BOOL Forget( const std::vector< const SwTxtAttr* >* pExclude, + const USHORT i, const USHORT nWhich, + const xub_StrLen nStrt, const xub_StrLen nEnd ); + + inline void SetCalcVisible(){ bCalcVis = TRUE; } + inline void SetVisible( const BOOL bNew ) { bVis = bNew; } + inline BOOL IsVisible() const + { if( bCalcVis ) ((SwpHints*)this)->CalcVisibleFlag(); return bVis; } + inline BOOL HasFntChg() const { return bFntChg; } + inline BOOL HasFtn() const { return bFtn; } + inline BOOL IsInSplitNode() const { return bInSplitNode; } + inline BOOL HasDDEFld() const { return bDDEFlds; } + + // Konstruktor (wird im nur einmal benutzt!) + SwpHints() + { + pHistory = 0; + bFntChg = bVis = TRUE; + bDDEFlds = bFtn = bInSplitNode = bCalcVis = FALSE; + } + + // Berechnung von bVis, return-Wert TRUE bei Aenderung + BOOL CalcVisibleFlag(); + + DECL_FIXEDMEMPOOL_NEWDEL(SwpHints) +}; + +// Ausgabeoperator fuer die Texthints +SvStream &operator<<(SvStream &aS, const SwpHints &rHints); //$ ostream + +/************************************************************************* + * Inline-Implementationen + *************************************************************************/ + +inline USHORT SwpHintsArr::GetStartOf( const SwTxtAttr *pHt ) const +{ + USHORT nPos; + if( !Seek_Entry( pHt, &nPos ) ) + nPos = USHRT_MAX; + return nPos; +} + +inline USHORT SwpHintsArr::GetEndOf( const SwTxtAttr *pHt ) const +{ + USHORT nPos; + if( !aHtEnd.Seek_Entry( pHt, &nPos ) ) + nPos = USHRT_MAX; + return nPos; +} + +inline SwTxtAttr *SwpHintsArr::Cut( const USHORT nPosInStart ) +{ + SwTxtAttr *pHt = GetHt(nPosInStart); + DeleteAtPos( nPosInStart ); + return pHt; +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndindex.hxx b/inc/bf_sw/ndindex.hxx new file mode 100644 index 000000000..be7031fb8 --- /dev/null +++ b/inc/bf_sw/ndindex.hxx @@ -0,0 +1,246 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDINDEX_HXX +#define _NDINDEX_HXX + +#include <bf_svtools/bf_solar.h> + +#include <limits.h> +#include "node.hxx" +#include "ndarr.hxx" +namespace binfilter { + +class SwNode; +class SwNodes; + +class SwNodeIndex +{ + friend void SwNodes::RegisterIndex( SwNodeIndex& ); + friend void SwNodes::DeRegisterIndex( SwNodeIndex& ); + friend void SwNodes::RemoveNode( ULONG, ULONG, bool ); + +#ifdef DBG_UTIL + static int nSerial; + int MySerial; +#endif + + SwNode* pNd; + SwNodeIndex *pNext, *pPrev; + + void Remove(); // Ausketten + + // diese sind nicht erlaubt! + SwNodeIndex( SwNodes& rNds, USHORT nIdx ); + SwNodeIndex( SwNodes& rNds, int nIdx ); + +public: + SwNodeIndex( SwNodes& rNds, ULONG nIdx = 0 ); + SwNodeIndex( const SwNodeIndex &, long nDiff = 0 ); + SwNodeIndex( const SwNode&, long nDiff = 0 ); + ~SwNodeIndex() { Remove(); } + + inline ULONG operator++(); + inline ULONG operator--(); +#ifndef CFRONT + inline ULONG operator++(int); + inline ULONG operator--(int); +#endif + + inline ULONG operator+=( ULONG ); + inline ULONG operator-=( ULONG ); + inline ULONG operator+=( const SwNodeIndex& ); + inline ULONG operator-=( const SwNodeIndex& ); + + inline BOOL operator< ( const SwNodeIndex& ) const; + inline BOOL operator<=( const SwNodeIndex& ) const; + inline BOOL operator> ( const SwNodeIndex& ) const; + inline BOOL operator>=( const SwNodeIndex& ) const; + inline BOOL operator==( const SwNodeIndex& ) const; + inline BOOL operator!=( const SwNodeIndex& ) const; + + inline BOOL operator< ( ULONG nWert ) const; + inline BOOL operator<=( ULONG nWert ) const; + inline BOOL operator> ( ULONG nWert ) const; + inline BOOL operator>=( ULONG nWert ) const; + inline BOOL operator==( ULONG nWert ) const; + inline BOOL operator!=( ULONG nWert ) const; + + inline SwNodeIndex& operator=( ULONG ); + SwNodeIndex& operator=( const SwNodeIndex& ); + SwNodeIndex& operator=( const SwNode& ); + + // gebe den Wert vom Index als ULONG zurueck + inline ULONG GetIndex() const; + + // ermoeglicht Zuweisungen ohne Erzeugen eines temporaeren Objektes + SwNodeIndex& Assign( const SwNode& rNd, long nOffset = 0 ); + + // Herausgabe des Pointers auf das NodesArray, + inline const SwNodes& GetNodes() const; + inline SwNodes& GetNodes(); + + SwNode& GetNode() const { return *pNd; } +}; + +/* + * SwRange + */ +class SwNodeRange +{ +public: + SwNodeIndex aStart; + SwNodeIndex aEnd; + + SwNodeRange( const SwNodeIndex &rS, const SwNodeIndex &rE ); + SwNodeRange( const SwNodeRange &rRange ); + + SwNodeRange( const SwNodeIndex& rS, long nSttDiff, + const SwNodeIndex& rE, long nEndDiff = 0 ); + SwNodeRange( const SwNode& rS, long nSttDiff, + const SwNode& rE, long nEndDiff = 0 ); +}; + + + + +// fuer die inlines wird aber der node.hxx benoetigt. Dieses braucht aber +// auch wieder dieses. Also alle Inlines, die auf pNd zugreifen werden +// hier implementiert. + +inline ULONG SwNodeIndex::GetIndex() const +{ + return pNd->GetIndex(); +} +inline const SwNodes& SwNodeIndex::GetNodes() const +{ + return pNd->GetNodes(); +} +inline SwNodes& SwNodeIndex::GetNodes() +{ + return pNd->GetNodes(); +} +inline BOOL SwNodeIndex::operator< ( ULONG nWert ) const +{ + return pNd->GetIndex() < nWert; +} +inline BOOL SwNodeIndex::operator<=( ULONG nWert ) const +{ + return pNd->GetIndex() <= nWert; +} +inline BOOL SwNodeIndex::operator> ( ULONG nWert ) const +{ + return pNd->GetIndex() > nWert; +} +inline BOOL SwNodeIndex::operator>=( ULONG nWert ) const +{ + return pNd->GetIndex() >= nWert; +} +inline BOOL SwNodeIndex::operator==( ULONG nWert ) const +{ + return pNd->GetIndex() == nWert; +} +inline BOOL SwNodeIndex::operator!=( ULONG nWert ) const +{ + return pNd->GetIndex() != nWert; +} +inline BOOL SwNodeIndex::operator<( const SwNodeIndex& rIndex ) const +{ + return pNd->GetIndex() < rIndex.GetIndex(); +} +inline BOOL SwNodeIndex::operator<=( const SwNodeIndex& rIndex ) const +{ + return pNd->GetIndex() <= rIndex.GetIndex(); +} +inline BOOL SwNodeIndex::operator>( const SwNodeIndex& rIndex ) const +{ + return pNd->GetIndex() > rIndex.GetIndex(); +} +inline BOOL SwNodeIndex::operator>=( const SwNodeIndex& rIndex ) const +{ + return pNd->GetIndex() >= rIndex.GetIndex(); +} +inline BOOL SwNodeIndex::operator==( const SwNodeIndex& rIdx ) const +{ + return pNd == rIdx.pNd; +} +inline BOOL SwNodeIndex::operator!=( const SwNodeIndex& rIdx ) const +{ + return pNd != rIdx.pNd; +} + +inline ULONG SwNodeIndex::operator++() +{ + return ( pNd = GetNodes()[ pNd->GetIndex()+1 ] )->GetIndex(); +} +inline ULONG SwNodeIndex::operator--() +{ + return ( pNd = GetNodes()[ pNd->GetIndex()-1 ] )->GetIndex(); +} +#ifndef CFRONT +inline ULONG SwNodeIndex::operator++(int) +{ + ULONG nOldIndex = pNd->GetIndex(); + pNd = GetNodes()[ nOldIndex + 1 ]; + return nOldIndex; +} +inline ULONG SwNodeIndex::operator--(int) +{ + ULONG nOldIndex = pNd->GetIndex(); + pNd = GetNodes()[ nOldIndex - 1 ]; + return nOldIndex; +} +#endif + +inline ULONG SwNodeIndex::operator+=( ULONG nWert ) +{ + return ( pNd = GetNodes()[ pNd->GetIndex() + nWert ] )->GetIndex(); +} +inline ULONG SwNodeIndex::operator-=( ULONG nWert ) +{ + return ( pNd = GetNodes()[ pNd->GetIndex() - nWert ] )->GetIndex(); +} +inline ULONG SwNodeIndex::operator+=( const SwNodeIndex& rIndex ) +{ + return ( pNd = GetNodes()[ pNd->GetIndex() + rIndex.GetIndex() ] )->GetIndex(); +} +inline ULONG SwNodeIndex::operator-=( const SwNodeIndex& rIndex ) +{ + return ( pNd = GetNodes()[ pNd->GetIndex() - rIndex.GetIndex() ] )->GetIndex(); +} + +inline SwNodeIndex& SwNodeIndex::operator=( ULONG nWert ) +{ + pNd = GetNodes()[ nWert ]; + return *this; +} + + + +//JP 29.09.97: impl. steht im ndindex.hxx - sollte moeglichst bald auf die +// neue Schnittstelle angepasst werden +inline SwNode* SwNodes::operator[]( const SwNodeIndex& rIdx ) const +{ + return &rIdx.GetNode(); +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndnotxt.hxx b/inc/bf_sw/ndnotxt.hxx new file mode 100644 index 000000000..c090b8bc1 --- /dev/null +++ b/inc/bf_sw/ndnotxt.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDNOTXT_HXX +#define _NDNOTXT_HXX + +#include <bf_svtools/bf_solar.h> + +#include "node.hxx" +class PolyPolygon; +namespace binfilter { + + + +// -------------------- +// SwNoTxtNode +// -------------------- + +class SwNoTxtNode : public SwCntntNode +{ + friend class SwNodes; + friend class SwNoTxtFrm; + + String aAlternateText; // alternativer Text (HTML) + + PolyPolygon *pContour; // Polygon fuer Konturumlauf + BOOL bAutomaticContour : 1; // automatic contour polygon, not manipulated + BOOL bContourMapModeValid : 1; // contour map mode is not the graphics's + // prefered map mode, but either + // MM100 or or pixel + BOOL bPixelContour : 1; // contour map mode is invalid and pixel. + + // erzeugt fuer alle Ableitungen einen AttrSet mit Bereichen + // fuer Frame- und Grafik-Attributen (wird nur vom SwCntntNode gerufen) + virtual void NewAttrSet( SwAttrPool& ); + + SwNoTxtNode( const SwNoTxtNode& ); //nicht erlaubt + SwNoTxtNode &operator=( const SwNoTxtNode& ); //nicht erlaubt + +protected: + SwNoTxtNode( const SwNodeIndex &rWhere, const BYTE nNdType, + SwGrfFmtColl *pGrColl, SwAttrSet* pAutoAttr = 0 ); + +public: + ~SwNoTxtNode(); + + virtual SwCntntFrm *MakeFrm(); + + inline SwGrfFmtColl *GetGrfColl() const; + + virtual Size GetTwipSize() const = 0; + + + // alternativen Text abfragen/setzen + const String& GetAlternateText() const { return aAlternateText; } + void SetAlternateText( const String& rTxt, sal_Bool bBroadcast=sal_False ); + + void SetContour( const PolyPolygon *pPoly, + BOOL bAutomatic = FALSE ); + const PolyPolygon *HasContour() const; + BOOL _HasContour() const { return pContour!=0; }; + + void SetAutomaticContour( BOOL bSet ) { bAutomaticContour = bSet; } + BOOL HasAutomaticContour() const { return bAutomaticContour; } + + // get either a MM100 or pixel contour, return FALSE if no contour is set. + BOOL GetContourAPI( PolyPolygon &rPoly ) const; + + void SetPixelContour( BOOL bSet ) { bPixelContour = bSet; } + BOOL IsPixelContour() const; + + BOOL IsContourMapModeValid() const { return bContourMapModeValid; } + + //Besorgt die Graphic, mit SwapIn fuer GrfNode, per GetData fuer OLE. + Graphic GetGraphic() const; +}; + +inline SwGrfFmtColl* SwNoTxtNode::GetGrfColl() const +{ + return (SwGrfFmtColl*)GetRegisteredIn(); +} + +// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! +inline SwNoTxtNode *SwNode::GetNoTxtNode() +{ + return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0; +} + +inline const SwNoTxtNode *SwNode::GetNoTxtNode() const +{ + return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0; +} + +} //namespace binfilter +#endif // _NDNOTXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndole.hxx b/inc/bf_sw/ndole.hxx new file mode 100644 index 000000000..a72886231 --- /dev/null +++ b/inc/bf_sw/ndole.hxx @@ -0,0 +1,135 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDOLE_HXX +#define _NDOLE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <ndnotxt.hxx> + +namespace binfilter { + +class SvInPlaceObjectRef; +class SvInPlaceObject; + +class SwGrfFmtColl; +class SwDoc; +class SwOLENode; +class SwOLELink; +class SwOLELRUCache; + + +class SwOLEObj +{ + friend class SwOLENode; + + static SwOLELRUCache* pOLELRU_Cache; + + const SwOLENode* pOLENd; + + //Entweder Ref oder Name sind bekannt, wenn nur der Name bekannt ist, wird + //dir Ref bei Anforderung durch GetOleRef() vom Sfx besorgt. + SvInPlaceObjectRef *pOLERef; //new/delete, damit so2.hxx wegfaellt. + String aName; + + SwOLEObj( const SwOLEObj& rObj ); //nicht erlaubt. + SwOLEObj(); + + void SetNode( SwOLENode* pNode ); + +public: + SwOLEObj( SvInPlaceObject *pObj ); + SwOLEObj( const String &rName ); + ~SwOLEObj(); + + BOOL RemovedFromLRU(); + +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED + SvInPlaceObjectRef GetOleRef(); + const String &GetName() const { return aName; } + + BOOL IsOleRef() const; //Damit das Objekt nicht unnoetig geladen werden muss. +#endif +}; + + +// -------------------- +// SwOLENode +// -------------------- + +struct SwPersistentOleData; + +class SwOLENode: public SwNoTxtNode +{ + friend class SwNodes; + SwOLEObj aOLEObj; + SwPersistentOleData* pSavedData; + String sChartTblName; // bei Chart Objecten: Name der ref. Tabelle + BOOL bOLESizeInvalid; //Soll beim SwDoc::PrtOLENotify beruecksichtig + //werden (zum Beispiel kopiert). Ist nicht + //Persistent. + + SwOLENode( const SwNodeIndex &rWhere, + SvInPlaceObject *, + SwGrfFmtColl *pGrfColl, + SwAttrSet* pAutoAttr = 0 ); + + SwOLENode( const SwNodeIndex &rWhere, + const String &rName, + SwGrfFmtColl *pGrfColl, + SwAttrSet* pAutoAttr = 0 ); + + // aOLEObj besitzt einen privaten Copy-CTOR, wir brauchen auch einen: + SwOLENode( const SwOLENode & ); + +public: + const SwOLEObj& GetOLEObj() const { return aOLEObj; } + SwOLEObj& GetOLEObj() { return aOLEObj; } + + virtual SwCntntNode *SplitNode( const SwPosition & ); + // steht in ndcopy.cxx + virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; + + virtual Size GetTwipSize() const; + + BOOL IsOLESizeInvalid() const { return bOLESizeInvalid; } + void SetOLESizeInvalid( BOOL b ){ bOLESizeInvalid = b; } + +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED + const String& GetChartTblName() const { return sChartTblName; } + void SetChartTblName( const String& rNm ) { sChartTblName = rNm; } +#endif +}; + + +// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! +inline SwOLENode *SwNode::GetOLENode() +{ + return ND_OLENODE == nNodeType ? (SwOLENode*)this : 0; +} + +inline const SwOLENode *SwNode::GetOLENode() const +{ + return ND_OLENODE == nNodeType ? (const SwOLENode*)this : 0; +} + +} //namespace binfilter +#endif // _NDOLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndtxt.hxx b/inc/bf_sw/ndtxt.hxx new file mode 100644 index 000000000..9531051a2 --- /dev/null +++ b/inc/bf_sw/ndtxt.hxx @@ -0,0 +1,330 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _NDTXT_HXX +#define _NDTXT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <node.hxx> +#include <hintids.hxx> +#include <ndhints.hxx> +#include <osl/diagnose.h> +namespace com { namespace sun { namespace star { namespace uno { + template < class > class Sequence; +}}}} +class OutputDevice; +namespace utl { + class TransliterationWrapper; +} +namespace binfilter { + + + +class SwNumRules; +class SwTxtFmtColl; +class SwCntntFrm; +class SwTxtFld; // Fuer GetTxtFld() +class SwAttrSet; + + +struct SwSpellArgs; // for Spell(), splargs.hxx +struct SwConversionArgs; // for Convert(), splargs.hxx +class SwInterHyphInfo; // for Hyphenate(), splargs.hxx +class SwWrongList; // fuer OnlineSpelling +class SwNodeNum; + + +// Konstanten fuer das Text-Insert: +#define INS_DEFAULT 0x0000 // keine Extras +#define INS_EMPTYEXPAND 0x0001 // leere Hints beim Einfuegen aufspannen +#define INS_NOHINTEXPAND 0x0002 // Hints an der InsPos nicht aufspannen + + +// -------------------- +// SwTxtNode +// -------------------- +class SwTxtNode: public SwCntntNode +{ + // fuer das Erzeugen des ersten TextNode + friend class SwDoc; // CTOR und AppendTxtNode() + friend class SwNodes; + friend class SwTxtFrm; + friend void SwpHints::Insert( SwTxtAttr*, SwTxtNode&, USHORT ); + + //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen. + //Also niemals direkt zugreifen! + SwpHints *pSwpHints; + SwWrongList *pWrong; // Rechtschreibfehler nach Online-Spelling + SwNodeNum *pNdNum; // Numerierung fuer diesen Absatz + SwNodeNum *pNdOutl; // Outline fuer diesen Absatz + XubString aText; + + SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl, + SwAttrSet* pAutoAttr = 0 ); + + // Kopiert die Attribute an nStart nach pDest. + void CopyAttr( SwTxtNode *pDest, const xub_StrLen nStart, const xub_StrLen nOldPos); + + SwTxtNode* _MakeNewTxtNode( const SwNodeIndex&, BOOL bNext = TRUE, + BOOL bChgFollow = TRUE ); + + void _Cut( SwTxtNode *pDest, const SwIndex &rDestStart, + const SwIndex &rStart, xub_StrLen nLen, BOOL bUpdate = TRUE ); + + SwTxtAttr* MakeTxtAttr( const SfxPoolItem& rNew, xub_StrLen nStt, xub_StrLen nEnd, + BOOL bPool = TRUE ); + + // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes + + // lege den spz. AttrSet an + virtual void NewAttrSet( SwAttrPool& ); + + void Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt, + xub_StrLen nEndPos, BOOL bExpandFlds ) const; + +public: + const String& GetTxt() const { return aText; } + + // Zugriff auf SwpHints + inline SwpHints &GetSwpHints(); + inline const SwpHints &GetSwpHints() const; + inline SwpHints *GetpSwpHints() { return pSwpHints; } + inline const SwpHints *GetpSwpHints() const { return pSwpHints; } + void SetWrong( SwWrongList *pNew ); + inline SwWrongList *GetWrong() { return pWrong; } + inline const SwWrongList *GetWrong() const { return pWrong; } + inline BOOL HasHints() const { return pSwpHints ? TRUE : FALSE; } + inline SwpHints &GetOrCreateSwpHints(); + + virtual ~SwTxtNode(); + + virtual xub_StrLen Len() const; + + // steht in itratr + + /* + * Einfuegen anderer Datentypen durch Erzeugen eines + * temporaeren Strings. + */ + SwTxtNode& Insert( xub_Unicode c, const SwIndex &rIdx ); + SwTxtNode& Insert( const XubString &rStr, const SwIndex &rIdx, + const USHORT nMode = INS_DEFAULT ); + + SwTxtNode& Erase( const SwIndex &rIdx, xub_StrLen nCount = STRING_LEN, + const USHORT nMode = INS_DEFAULT ); + + // Aktionen auf Attributen + // loesche alle TextAttribute die als Attribut im Set vorhanden sind + // (Set-Pointer != 0 ) oder alle deren Which-Wert mit nWhich mappen + // oder wenn Which = 0, alle. + void RstAttr( const SwIndex &rIdx ); + + // loesche das Text-Attribut (muss beim Pool abgemeldet werden!) + void DestroyAttr( SwTxtAttr* pAttr ); + + // loesche alle Attribute aus dem SwpHintsArray. + + // uebernehme den Pointer auf das Text-Attribut + BOOL Insert( SwTxtAttr *pAttr, USHORT nMode = 0 ); + // lege ein neues TextAttribut an und fuege es ins SwpHints-Array ein + // returne den neuen Pointer (oder 0 bei Fehlern)! + SwTxtAttr* Insert( const SfxPoolItem& rAttr, + xub_StrLen nStt, xub_StrLen nEnd, USHORT nMode = 0 ); + + // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt, + // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr) + BOOL SetAttr( const SfxItemSet& rSet, + xub_StrLen nStt, xub_StrLen nEnd, USHORT nMode = 0 ); + // erfrage die Attribute vom TextNode ueber den Bereich + BOOL GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, + BOOL bOnlyTxtAttr = FALSE, + BOOL bGetFromChrFmt = TRUE ) const; + + // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray + void FmtToTxtAttr( SwTxtNode* pNd ); + + // loeschen eines einzelnen Attributes (fuer SwUndoAttr) + // ( nur das Attribut loeschen, dass mit Which,Start und End oder + // mit pTxtHint identisch ist (es gibt nur ein gueltiges)) + // AUSNAHME: ToxMarks !!! + void Delete( USHORT nTxtWhich, xub_StrLen nStart, xub_StrLen nEnd = 0 ); + void Delete( SwTxtAttr * pTxtAttr, BOOL bThisOnly = FALSE ); + + // Aktionen auf Text und Attributen + void Copy(SwTxtNode *pDest, const SwIndex &rStart, USHORT nLen); + void Copy(SwTxtNode *pDest, const SwIndex &rDestStart, + const SwIndex &rStart, xub_StrLen nLen); + void Cut(SwTxtNode *pDest, const SwIndex &rStart, xub_StrLen nLen); + inline void Cut(SwTxtNode *pDest, const SwIndex &rDestStart, + const SwIndex &rStart, xub_StrLen nLen); + // ersetze im String an Position nIdx das Zeichen + void Replace( const SwIndex& rStart, xub_Unicode cCh ); + + // virtuelle Methoden aus dem CntntNode + virtual SwCntntFrm *MakeFrm(); + virtual SwCntntNode *SplitNode( const SwPosition & ); + virtual SwCntntNode *JoinNext(); + virtual SwCntntNode *JoinPrev(); + + SwCntntNode *AppendNode( const SwPosition & ); + + // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen + + // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx) + // gesetzt ist zurueck. Gibt es keines, returne 0-Pointer + // gesetzt heisst: Start <= rIdx < End + SwTxtAttr *GetTxtAttr( const SwIndex& rIdx, USHORT nWhichHt, + BOOL bExpand = FALSE ) const; + + // Diese Methode liefert nur Textattribute auf der Position nIdx + // zurueck, die kein EndIdx besitzen und denselben Which besitzen. + // Ueblicherweise steht an dieser Position ein CH_TXTATR. + // Bei RES_TXTATR_END entfaellt die Pruefung auf den Which-Wert. + SwTxtAttr *GetTxtAttr( const xub_StrLen nIdx, + const USHORT nWhichHt = RES_TXTATR_END ) const; + + SwTxtFld *GetTxtFld( const SwIndex& rIdx ) + { return (SwTxtFld *)GetTxtAttr( rIdx, RES_TXTATR_FIELD ); } + + // Aktuelles Wort zurueckliefern + USHORT Convert( SwConversionArgs & ); + + inline SwTxtFmtColl *GetTxtColl() const; + virtual SwFmtColl *ChgFmtColl( SwFmtColl* ); + void _ChgTxtCollUpdateNum( const SwTxtFmtColl* pOld, + const SwTxtFmtColl* pNew ); + + // kopiere die Collection mit allen Autoformaten zum Dest-Node + // dieser kann auch in einem anderen Dokument stehen! + // (Methode steht im ndcopy.cxx!!) + + // Numerierung + const SwNodeNum* UpdateNum( const SwNodeNum& ); + const SwNumRule *GetNumRule() const; + const SwNodeNum* GetNum() const { return pNdNum; } + // OutlineNumerierung + const SwNodeNum* UpdateOutlineNum( const SwNodeNum& ); + const SwNodeNum* GetOutlineNum() const { return pNdOutl; } + void NumRuleChgd(); // Frames benachrichtigen + XubString GetNumString() const; // returnt Outline oder Num - String + long GetLeftMarginWithNum( BOOL bTxtLeft = FALSE ) const; + BOOL GetFirstLineOfsWithNum( short& rFirstOffset ) const; + +#ifdef VERTICAL_LAYOUT + USHORT GetLang( const xub_StrLen nBegin, const xub_StrLen nLen = 0, + USHORT nScript = 0 ) const; +#else + USHORT GetLang( const xub_StrLen nBegin, const xub_StrLen nLen = 0) const; +#endif + // steht in ndcopy.cxx + virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; + + // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph + + // Liefert einen String mit expandierten Feldern zurueck + // opt. die Kapitel/Nummer-String zurueck + XubString GetExpandTxt( const xub_StrLen nIdx = 0, + const xub_StrLen nLen = STRING_LEN, + const BOOL bWithNum = FALSE ) const; + //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen + //bei nWishLen == 0 die des ersten Wortes + USHORT GetDropLen( USHORT nWishLen) const; + + // Berechnung des Visible-Flags + inline BOOL CalcVisibleFlag() + { if(pSwpHints) return pSwpHints->CalcVisibleFlag(); return FALSE; } + // Setzen des CalcVisible-Flags + inline void SetCalcVisible(){ if(pSwpHints) pSwpHints->SetCalcVisible(); } + + // Ist der Absatz sichtbar + inline BOOL IsVisible() const + { return pSwpHints ? pSwpHints->IsVisible() : TRUE; } + + // Besitzt der Absatz Fussnoten? + inline BOOL HasFtn() const {return pSwpHints ? pSwpHints->HasFtn() : FALSE;} + + inline SwTxtAttr* MakeTmpTxtAttr( const SfxPoolItem& rNew ) + { return MakeTxtAttr( rNew, 0, 0, FALSE ); } + + TYPEINFO(); // fuer rtti + + // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!) + virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + + // aus SwIndexReg + virtual void Update( const SwIndex & aPos, USHORT xub_StrLen, + BOOL bNegativ = FALSE ); + + + // change text to Upper/Lower/Hiragana/Katagana/... + + + DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode) +}; + +//----------------------------------------------------------------------------- + +inline SwpHints &SwTxtNode::GetSwpHints() +{ + OSL_ASSERT( pSwpHints ); + return *pSwpHints; +} +inline const SwpHints &SwTxtNode::GetSwpHints() const +{ + OSL_ASSERT( pSwpHints ); + return *pSwpHints; +} + +inline SwpHints& SwTxtNode::GetOrCreateSwpHints() +{ + if( !pSwpHints ) + pSwpHints = new SwpHints; + return *pSwpHints; +} + +inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const +{ + return (SwTxtFmtColl*)GetRegisteredIn(); +} + +// fuer den IBM-Compiler nicht inlinen wg. 42876 +#ifndef ICC +// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! +inline SwTxtNode *SwNode::GetTxtNode() +{ + return ND_TEXTNODE == nNodeType ? (SwTxtNode*)this : 0; +} + +inline const SwTxtNode *SwNode::GetTxtNode() const +{ + return ND_TEXTNODE == nNodeType ? (const SwTxtNode*)this : 0; +} +#endif + +inline void SwTxtNode::Cut(SwTxtNode *pDest, const SwIndex &rDestStart, + const SwIndex &rStart, xub_StrLen nLen) +{ + _Cut( pDest, rDestStart, rStart, nLen, TRUE ); +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ndtyp.hxx b/inc/bf_sw/ndtyp.hxx new file mode 100644 index 000000000..aee29e561 --- /dev/null +++ b/inc/bf_sw/ndtyp.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _NDTYP_HXX +#define _NDTYP_HXX + +#include <bf_svtools/bf_solar.h> +namespace binfilter { + +// Ids fuer die verschiedenden Nodes; in der Basisklasse steht der Member, +// der angibt, um was fuer einen es sich handelt +const BYTE ND_ENDNODE = 0x01; +const BYTE ND_STARTNODE = 0x02; +const BYTE ND_TABLENODE = 0x06; +const BYTE ND_TEXTNODE = 0x08; +const BYTE ND_GRFNODE = 0x10; +const BYTE ND_OLENODE = 0x20; + +const BYTE ND_CONTENTNODE = 0x38; // ContentNode (eines von den 3 Bits) +const BYTE ND_NOTXTNODE = 0x30; // NoTxtNode (eines von den 2 Bits) + +const BYTE ND_SECTIONNODE = 0x42; +// nur fuer internen Gebrauch!! +const BYTE ND_SECTIONDUMMY = 0x40; //(ND_SECTIONNODE & ~ND_STARTNODE); + +// spezielle Types der StartNodes, die keine Ableitungen sind, aber +// "Bereiche" zusammenhalten. +enum SwStartNodeType +{ + SwNormalStartNode = 0, + SwTableBoxStartNode, + SwFlyStartNode, + SwFootnoteStartNode, + SwHeaderStartNode, + SwFooterStartNode +}; + +// is the node the first and/or last node of a section? +// This information is used for the export filters. Our layout never have a +// distance before or after if the node is the first or last in a section. +const BYTE ND_HAS_PREV_LAYNODE = 0x01; +const BYTE ND_HAS_NEXT_LAYNODE = 0x02; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/node.hxx b/inc/bf_sw/node.hxx new file mode 100644 index 000000000..5a9843c48 --- /dev/null +++ b/inc/bf_sw/node.hxx @@ -0,0 +1,643 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _NODE_HXX +#define _NODE_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <tools/mempool.hxx> +#include <tools/gen.hxx> + +#include <ndarr.hxx> +#include <ndtyp.hxx> +#include <index.hxx> +#include <fmtcol.hxx> +namespace binfilter { +class SvUShorts; +class SwCntntFrm; +class SwCntntNode; +class SwDoc; +class SwEndNode; +class SwFrm; +class SwFrmFmt; +class SwGrfNode; +class SwNoTxtNode; +class SwNodeIndex; +class SwNodeRange; +class SwOLENode; +class SwRect; +class SwSection; +class SwSectionFmt; +class SwSectionNode; +class SwStartNode; +class SwTabFrm; +class SwTable; +class SwTableNode; +class SwTableBox; +class SwTxtNode; +class SwPageDesc; +class ViewShell; +struct SwPosition; + +#define INLINE inline + +// -------------------- +// class SwNode +// -------------------- +class SwNode : private /* public*/ BigPtrEntry +{ + friend class SwNodes; + + BYTE nNodeType; + BOOL bWrongDirty : 1; // Ist das Wrong-Feld auf invalid? (nur TxtNodes) + BOOL bACmplWrdDirty : 1; // die ACompl-Liste muss angepasst werden (erstmal nur TxtNodes) + + // JP 28.03.96 + // fuer Textnodes: Stufungslevel der Autoformatierung. Ist erstmal hier + // gelandet, weil noch Bits frei sind + BYTE nAFmtNumLvl : 3; + BOOL bSetNumLSpace : 1; // fuer Numerierung: TRUE Einzug setzen + BOOL bIgnoreDontExpand : 1; // for Text Attributes - ignore the flag + +protected: + SwStartNode* pStartOfSection; + + SwNode( const SwNodeIndex &rWhere, const BYTE nNodeId ); + + // fuer den initialen StartNode + SwNode( SwNodes& rNodes, ULONG nPos, const BYTE nNodeId ); + +public: + virtual ~SwNode(); + + inline ULONG StartOfSectionIndex() const; + inline const SwStartNode* StartOfSectionNode() const; + inline SwStartNode* StartOfSectionNode(); + inline ULONG EndOfSectionIndex() const; + inline const SwEndNode* EndOfSectionNode() const; + inline SwEndNode* EndOfSectionNode(); + + inline BOOL IsWrongDirty() const { return bWrongDirty; } + inline void SetWrongDirty( BOOL bNew ) { bWrongDirty = bNew; } + + inline BOOL IsAutoCompleteWordDirty() const { return bACmplWrdDirty; } + inline void SetAutoCompleteWordDirty( BOOL bNew ) { bACmplWrdDirty = bNew; } + + inline BYTE GetAutoFmtLvl() const { return nAFmtNumLvl; } + inline void SetAutoFmtLvl( BYTE nVal ) { nAFmtNumLvl = nVal; } + + inline BOOL IsSetNumLSpace() const { return bSetNumLSpace; } + inline void SetNumLSpace( BOOL bFlag ) { bSetNumLSpace = bFlag; } + + inline BOOL IsIgnoreDontExpand() const { return bIgnoreDontExpand; } + inline void SetIgnoreDontExpand( BOOL bNew ) { bIgnoreDontExpand = bNew; } + + BYTE GetNodeType() const { return nNodeType; } + + inline SwStartNode *GetStartNode(); + inline const SwStartNode *GetStartNode() const; + inline SwCntntNode *GetCntntNode(); + inline const SwCntntNode *GetCntntNode() const; + inline SwEndNode *GetEndNode(); + inline const SwEndNode *GetEndNode() const; +#ifndef ICC + INLINE +#endif + SwTxtNode *GetTxtNode(); + +#ifndef ICC + INLINE +#endif + const SwTxtNode *GetTxtNode() const; +#ifndef COMPACT + INLINE SwOLENode *GetOLENode(); + INLINE const SwOLENode *GetOLENode() const; + INLINE SwNoTxtNode *GetNoTxtNode(); + INLINE const SwNoTxtNode *GetNoTxtNode() const; + INLINE SwGrfNode *GetGrfNode(); + INLINE const SwGrfNode *GetGrfNode() const; +#endif + inline SwTableNode *GetTableNode(); + inline const SwTableNode *GetTableNode() const; + inline SwSectionNode *GetSectionNode(); + inline const SwSectionNode *GetSectionNode() const; + + inline BOOL IsStartNode() const; + inline BOOL IsCntntNode() const; + inline BOOL IsEndNode() const; + inline BOOL IsTxtNode() const; + inline BOOL IsTableNode() const; + inline BOOL IsSectionNode() const; +#ifndef COMPACT + inline BOOL IsOLENode() const; + inline BOOL IsNoTxtNode() const; + inline BOOL IsGrfNode() const; +#endif + + // suche den TabellenNode, in dem dieser steht. Wenn in keiner + // Tabelle wird 0 returnt. + SwTableNode *FindTableNode(); + inline const SwTableNode *FindTableNode() const; + + // suche den SectionNode, in dem dieser steht. Wenn es in keiner + // Section steht wird 0 returnt. + SwSectionNode *FindSectionNode(); + inline const SwSectionNode *FindSectionNode() const; + + const SwStartNode *FindStartNode() const { return pStartOfSection; } + SwStartNode *FindStartNode() { return pStartOfSection; } + + SwStartNode* FindSttNodeByType( SwStartNodeType eTyp ); + inline const SwStartNode* FindSttNodeByType( SwStartNodeType eTyp ) const; + + const SwStartNode* FindTableBoxStartNode() const + { return FindSttNodeByType( SwTableBoxStartNode ); } + const SwStartNode* FindFlyStartNode() const + { return FindSttNodeByType( SwFlyStartNode ); } + const SwStartNode* FindFootnoteStartNode() const + { return FindSttNodeByType( SwFootnoteStartNode ); } + const SwStartNode* FindHeaderStartNode() const + { return FindSttNodeByType( SwHeaderStartNode ); } + const SwStartNode* FindFooterStartNode() const + { return FindSttNodeByType( SwFooterStartNode ); } + + // in welchem Nodes-Array/Doc steht der Node ? + inline SwNodes& GetNodes(); + inline const SwNodes& GetNodes() const; + inline SwDoc* GetDoc(); + inline const SwDoc* GetDoc() const; + + // liegt der Node im Sichtbarenbereich der Shell ? + // befindet sich der Node in einem geschuetzten Bereich? + BOOL IsInProtectSect() const; + // befindet sich der Node in irgendetwas geschuetzten ? + // (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei + // Rahmen/Fussnoten/..) + BOOL IsProtect() const; + // suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das + // Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur + // die harte Tour ueber die Nodes nach vorne suchen!! + // OD 18.03.2003 #106326# + + // falls der Node in einem Fly steht, dann wird das entsprechende Format + // returnt + SwFrmFmt* GetFlyFmt() const; + + // liefert das Format, an dem die LayoutFrames des StartNodes registriert sind, + // wird von SwSectionNode::MakeFrms benutzt + + // falls der Node in einer Tabelle steht, dann wird die entsprechende + // TabellenBox returnt + SwTableBox* GetTblBox() const; + + inline ULONG GetIndex() const { return GetPos(); } + + const SwTxtNode* FindOutlineNodeOfLevel( BYTE nLvl ) const; + + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwNode( const SwNode & rNodes ); +}; + +// -------------------- +// class SwStartNode +// -------------------- +class SwStartNode: public SwNode +{ + friend class SwNode; + friend class SwNodes; + friend class SwEndNode; // um theEndOfSection zu setzen !! + + SwEndNode* pEndOfSection; + SwStartNodeType eSttNdTyp; + + // fuer den initialen StartNode + SwStartNode( SwNodes& rNodes, ULONG nPos ); + +protected: + SwStartNode( const SwNodeIndex &rWhere, + const BYTE nNodeType = ND_STARTNODE, + SwStartNodeType = SwNormalStartNode ); +public: + DECL_FIXEDMEMPOOL_NEWDEL(SwStartNode) + + SwStartNodeType GetStartNodeType() const { return eSttNdTyp; } + + // an alle ContentNodes der Section das ChkCondColl rufen + void CheckSectionCondColl() const; + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwStartNode( const SwStartNode & rNode ); +}; + + +// -------------------- +// class SwEndNode +// -------------------- +class SwEndNode : public SwNode +{ + friend class SwNodes; + friend class SwTableNode; // um seinen EndNode anlegen zukoennen + friend class SwSectionNode; // um seinen EndNode anlegen zukoennen + + // fuer den initialen StartNode + SwEndNode( SwNodes& rNodes, ULONG nPos, SwStartNode& rSttNd ); + +protected: + SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd ); + + DECL_FIXEDMEMPOOL_NEWDEL(SwEndNode) + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwEndNode( const SwEndNode & rNode ); +}; + + +// -------------------- +// SwCntntNode +// -------------------- +class SwCntntNode: public SwModify, public SwNode, public SwIndexReg +{ + // Der Reader darf NewAttrSet() aufrufen! + friend class SwSwgReader; + friend class Sw3IoImp; + +//FEATURE::CONDCOLL + SwDepend* pCondColl; +//FEATURE::CONDCOLL + +protected: + SwCntntNode( const SwNodeIndex &rWhere, const BYTE nNodeType, + SwFmtColl *pFmtColl ); + virtual ~SwCntntNode(); + + // Attribut-Set fuer alle AUTO-Attribute eines CntntNodes + // ( z.B: TxtNode oder NoTxtNode + SwAttrSet *pAttrSet; + // lasse von den entsprechenden Nodes die spz. AttrSets anlegen + virtual void NewAttrSet( SwAttrPool& ) = 0; + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + virtual SwCntntFrm *MakeFrm() = 0; + virtual SwCntntNode *SplitNode(const SwPosition & ) = 0; + virtual SwCntntNode *JoinNext(); + virtual SwCntntNode *JoinPrev(); + // koennen 2 Nodes zusammengefasst werden ? + // in pIdx kann die 2. Position returnt werden. + int CanJoinNext( SwNodeIndex* pIdx =0 ) const; + int CanJoinPrev( SwNodeIndex* pIdx =0 ) const; + + void MakeStartIndex( SwIndex * pIdx ) { pIdx->Assign( this, 0 ); } + void MakeEndIndex( SwIndex * pIdx ) { pIdx->Assign( this, Len() ); } + + BOOL GoNext(SwIndex *, USHORT nMode ) const; + BOOL GoPrevious(SwIndex *, USHORT nMode ) const; + + SwCntntFrm *GetFrm( const Point* pDocPos = 0, + const SwPosition *pPos = 0, + const BOOL bCalcFrm = TRUE ) const; + // Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres + // Rechteck, wenn kein Layout existiert. + // Wird fuer die Export Filter benoetigt. + /* + * Methode erzeugt fuer den angegebenen Node alle Ansichten vom + * Dokument. Die erzeugten Contentframes werden in das entsprechende + * Layout gehaengt. + */ + void MakeFrms( SwCntntNode& rNode ); + /* + * Methode loescht fuer den Node alle Ansichten vom + * Dokument. Die Contentframes werden aus dem entsprechenden + * Layout ausgehaengt. + */ + void DelFrms(); + + /* + * liefert die Anzahl der Elemente des Inhalts des Nodes; + * Default ist 1, Unterschiede gibt es beim TextNode und beim + * Formelnode. + */ + virtual xub_StrLen Len() const; + + virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const = 0; + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + + // SS fuer die PoolItems: (Harte-(Fmt)Attrbutierung) + + // Ist bInParent FALSE, wird nur in diesem Node nach dem Attribut gesucht. + const SfxPoolItem& GetAttr( USHORT nWhich, BOOL bInParent=TRUE ) const; + BOOL GetAttr( SfxItemSet& rSet, BOOL bInParent=TRUE ) const; + BOOL SetAttr( const SfxPoolItem& ); + BOOL SetAttr( const SfxItemSet& rSet ); + BOOL ResetAttr( USHORT nWhich1, USHORT nWhich2 = 0 ); + USHORT ResetAllAttr(); + // liefert das Attribut, das nicht ueber die bedingte Vorlage kommt! + const SfxPoolItem* GetNoCondAttr( USHORT nWhich, BOOL bInParents ) const; + + // hat der Node schon eigene Auto-Attribute ? + // Zugriff auf SwAttrSet + inline SwAttrSet &GetSwAttrSet(); + inline const SwAttrSet &GetSwAttrSet() const; + inline SwAttrSet *GetpSwAttrSet() { return pAttrSet; } + inline const SwAttrSet *GetpSwAttrSet() const { return pAttrSet; } + inline BOOL HasSwAttrSet() const { return pAttrSet ? TRUE : FALSE; } + + virtual SwFmtColl* ChgFmtColl( SwFmtColl* ); + SwFmtColl* GetFmtColl() const { return (SwFmtColl*)GetRegisteredIn(); } + +//FEATURE::CONDCOLL + inline SwFmtColl& GetAnyFmtColl() const; + void SetCondFmtColl( SwFmtColl* ); + inline SwFmtColl* GetCondFmtColl() const; + + void ChkCondColl(); +//FEATURE::CONDCOLL + + // invalidiert die am Node gesetzte NumRule. Diese wird + // spaetestend in EndAction einer Shell geupdatet + BOOL InvalidateNumRule(); + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwCntntNode( const SwCntntNode & rNode ); +}; + + + +//--------- +// SwTableNode +//--------- +class SwTableNode : public SwStartNode +{ + friend class SwNodes; + SwTable* pTable; +protected: + virtual ~SwTableNode(); + +public: + SwTableNode( const SwNodeIndex & ); + + const SwTable& GetTable() const { return *pTable; } + SwTable& GetTable() { return *pTable; } + SwTabFrm *MakeFrm(); + + //Legt die Frms fuer den TableNode (also die TabFrms) an. + void MakeFrms( SwNodeIndex* pIdxBehind ); + + //Methode loescht fuer den Node alle Ansichten vom + //Dokument. Die Contentframes werden aus dem entsprechenden + //Layout ausgehaengt. + void DelFrms(); + + SwTableNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwTableNode( const SwTableNode & rNode ); +}; + + +//--------- +// SwSectionNode +//--------- +class SwSectionNode : public SwStartNode +{ + friend class SwNodes; + SwSection* pSection; +protected: + virtual ~SwSectionNode(); + +public: + SwSectionNode( const SwNodeIndex&, SwSectionFmt& rFmt ); + + const SwSection& GetSection() const { return *pSection; } + SwSection& GetSection() { return *pSection; } + + // setze ein neues SectionObject. Erstmal nur gedacht fuer die + // neuen VerzeichnisSections. Der geht ueber in den Besitz des Nodes! + void SetNewSection( SwSection* pNewSection ); + + SwFrm *MakeFrm(); + + //Legt die Frms fuer den SectionNode (also die SectionFrms) an. + //Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt, + //uebergibt man einen weiteren NodeIndex pEnd, so wird bis zu diesem + //ein MakeFrms gerufen, genutzt wird dies von TableToText + void MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = NULL ); + + //Methode loescht fuer den Node alle Ansichten vom + //Dokument. Die Contentframes werden aus dem entsprechenden + //Layout ausgehaengt. + void DelFrms(); + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwSectionNode( const SwSection& rNode ); +}; + + + +// ---------------------- einige Inline Methoden ---------------------- +inline SwEndNode *SwNode::GetEndNode() +{ + return ND_ENDNODE == nNodeType ? (SwEndNode*)this : 0; +} +inline const SwEndNode *SwNode::GetEndNode() const +{ + return ND_ENDNODE == nNodeType ? (const SwEndNode*)this : 0; +} +inline SwStartNode *SwNode::GetStartNode() +{ + return ND_STARTNODE & nNodeType ? (SwStartNode*)this : 0; +} +inline const SwStartNode *SwNode::GetStartNode() const +{ + return ND_STARTNODE & nNodeType ? (const SwStartNode*)this : 0; +} +inline SwTableNode *SwNode::GetTableNode() +{ + return ND_TABLENODE == nNodeType ? (SwTableNode*)this : 0; +} +inline const SwTableNode *SwNode::GetTableNode() const +{ + return ND_TABLENODE == nNodeType ? (const SwTableNode*)this : 0; +} +inline SwSectionNode *SwNode::GetSectionNode() +{ + return ND_SECTIONNODE == nNodeType ? (SwSectionNode*)this : 0; +} +inline const SwSectionNode *SwNode::GetSectionNode() const +{ + return ND_SECTIONNODE == nNodeType ? (const SwSectionNode*)this : 0; +} +inline SwCntntNode *SwNode::GetCntntNode() +{ + return ND_CONTENTNODE & nNodeType ? (SwCntntNode*)this : 0; +} +inline const SwCntntNode *SwNode::GetCntntNode() const +{ + return ND_CONTENTNODE & nNodeType ? (const SwCntntNode*)this : 0; +} + + +inline BOOL SwNode::IsStartNode() const +{ + return ND_STARTNODE & nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsCntntNode() const +{ + return ND_CONTENTNODE & nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsEndNode() const +{ + return ND_ENDNODE == nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsTxtNode() const +{ + return ND_TEXTNODE == nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsTableNode() const +{ + return ND_TABLENODE == nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsSectionNode() const +{ + return ND_SECTIONNODE == nNodeType ? TRUE : FALSE; +} +#ifndef COMPACT +inline BOOL SwNode::IsNoTxtNode() const +{ + return ND_NOTXTNODE & nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsOLENode() const +{ + return ND_OLENODE == nNodeType ? TRUE : FALSE; +} +inline BOOL SwNode::IsGrfNode() const +{ + return ND_GRFNODE == nNodeType ? TRUE : FALSE; +} +#endif + +inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const +{ + return ((SwNode*)this)->FindSttNodeByType( eTyp ); +} +inline const SwTableNode* SwNode::FindTableNode() const +{ + return ((SwNode*)this)->FindTableNode(); +} +inline const SwSectionNode* SwNode::FindSectionNode() const +{ + return ((SwNode*)this)->FindSectionNode(); +} +inline ULONG SwNode::StartOfSectionIndex() const +{ + return pStartOfSection->GetIndex(); +} +inline const SwStartNode* SwNode::StartOfSectionNode() const +{ + return pStartOfSection; +} +inline SwStartNode* SwNode::StartOfSectionNode() +{ + return pStartOfSection; +} +inline ULONG SwNode::EndOfSectionIndex() const +{ + const SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection; + return pStNd->pEndOfSection->GetIndex(); +} +inline const SwEndNode* SwNode::EndOfSectionNode() const +{ + const SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection; + return pStNd->pEndOfSection; +} +inline SwEndNode* SwNode::EndOfSectionNode() +{ + SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection; + return pStNd->pEndOfSection; +} + +inline SwNodes& SwNode::GetNodes() +{ + return (SwNodes&)GetArray(); +} +inline const SwNodes& SwNode::GetNodes() const +{ + return (SwNodes&)GetArray(); +} + +inline SwDoc* SwNode::GetDoc() +{ + return GetNodes().GetDoc(); +} +inline const SwDoc* SwNode::GetDoc() const +{ + return GetNodes().GetDoc(); +} + +inline SwFmtColl* SwCntntNode::GetCondFmtColl() const +{ + return pCondColl ? (SwFmtColl*)pCondColl->GetRegisteredIn() : 0; +} + + +inline SwFmtColl& SwCntntNode::GetAnyFmtColl() const +{ + return pCondColl && pCondColl->GetRegisteredIn() + ? *(SwFmtColl*)pCondColl->GetRegisteredIn() + : *(SwFmtColl*)GetRegisteredIn(); +} + +inline SwAttrSet& SwCntntNode::GetSwAttrSet() +{ + return pAttrSet ? ( (SwAttrSet &) ( *pAttrSet ) ) + : ( (SwAttrSet &) ( GetAnyFmtColl().GetAttrSet() ) ); +} +inline const SwAttrSet& SwCntntNode::GetSwAttrSet() const +{ + return pAttrSet ? ( (SwAttrSet &) ( *pAttrSet ) ) + : ( (SwAttrSet &) ( GetAnyFmtColl().GetAttrSet() ) ); +} +//FEATURE::CONDCOLL + +inline const SfxPoolItem& SwCntntNode::GetAttr( USHORT nWhich, + BOOL bInParents ) const +{ + return GetSwAttrSet().Get( nWhich, bInParents ); +} + + +#undef INLINE + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/numrule.hxx b/inc/bf_sw/numrule.hxx new file mode 100644 index 000000000..f3f70313a --- /dev/null +++ b/inc/bf_sw/numrule.hxx @@ -0,0 +1,290 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _NUMRULE_HXX +#define _NUMRULE_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <tools/link.hxx> +#include <tools/gen.hxx> +#include <bf_tools/string.hxx> +#include <bf_svx/svxenum.hxx> + +#include <swtypes.hxx> +#include <calbck.hxx> +#include <osl/diagnose.h> +#include <bf_svx/numitem.hxx> +class Font; +namespace binfilter { + + +class SvxBrushItem; +class SvxNumRule; +class SwCharFmt; +class SwDoc; +class SwFmtVertOrient; +class SwNodeNum; +class SwTxtNode; + +extern char sOutlineStr[]; // SWG-Filter + +inline BYTE GetRealLevel( const BYTE nLvl ) +{ + return nLvl & (NO_NUMLEVEL - 1); +} +const sal_Unicode cBulletChar = 0x2022; // Charakter fuer Aufzaehlungen + +class SwNumFmt : public SvxNumberFormat, public SwClient +{ + SwFmtVertOrient* pVertOrient; + + void UpdateNumNodes( SwDoc* pDoc ); + virtual void NotifyGraphicArrived() { DBG_BF_ASSERT(0, "STRIP"); } +public: + SwNumFmt(); + SwNumFmt( const SwNumFmt& ); + SwNumFmt( const SvxNumberFormat&, SwDoc* pDoc); + + virtual ~SwNumFmt(); + + SwNumFmt& operator=( const SwNumFmt& ); + BOOL operator==( const SwNumFmt& ) const; + BOOL operator!=( const SwNumFmt& r ) const { return !(*this == r); } + + SwCharFmt* GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; } + void SetCharFmt( SwCharFmt* ); + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + virtual void SetCharFmtName(const String& rSet); + virtual const String& GetCharFmtName()const; + + virtual void SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize = 0, const SvxFrameVertOrient* pOrient = 0); + + virtual void SetVertOrient(SvxFrameVertOrient) { DBG_BF_ASSERT(0, "STRIP"); } + virtual SvxFrameVertOrient GetVertOrient() const; +}; + +enum SwNumRuleType { OUTLINE_RULE = 0, NUM_RULE = 1, RULE_END = 2 }; +class SwNumRule +{ + friend void _FinitCore(); + + static SwNumFmt* aBaseFmts [ RULE_END ][ MAXLEVEL ]; + static USHORT aDefNumIndents[ MAXLEVEL ]; + static USHORT nRefCount; + static Font* pDefBulletFont; + static const char* pDefOutlineName; + + SwNumFmt* aFmts[ MAXLEVEL ]; + + String sName; + SwNumRuleType eRuleType; + USHORT nPoolFmtId; // Id-fuer "automatich" erzeugte NumRules + USHORT nPoolHelpId; // HelpId fuer diese Pool-Vorlage + BYTE nPoolHlpFileId; // FilePos ans Doc auf die Vorlagen-Hilfen + BOOL bAutoRuleFlag : 1; + BOOL bInvalidRuleFlag : 1; + BOOL bContinusNum : 1; // Fortlaufende Numerierung - ohne Ebenen + BOOL bAbsSpaces : 1; // die Ebenen repraesentieren absol. Einzuege + + static void _MakeDefBulletFont(); + +public: + SwNumRule( const String& rNm, SwNumRuleType = NUM_RULE, + BOOL bAutoFlg = TRUE ); + + SwNumRule( const SwNumRule& ); + ~SwNumRule(); + + SwNumRule& operator=( const SwNumRule& ); + BOOL operator==( const SwNumRule& ) const; + BOOL operator!=( const SwNumRule& r ) const { return !(*this == r); } + + inline const SwNumFmt* GetNumFmt( USHORT i ) const; + inline const SwNumFmt& Get( USHORT i ) const; + void Set( USHORT i, const SwNumFmt* ); + void Set( USHORT i, const SwNumFmt& ); + String MakeNumString( const SwNodeNum&, BOOL bInclStrings = TRUE, + BOOL bOnlyArabic = FALSE ) const; + + inline sal_Unicode GetBulletChar( const SwNodeNum& ) const; + inline const Font* GetBulletFont( const SwNodeNum& ) const; + static inline const Font& GetDefBulletFont(); + + static const char* GetOutlineRuleName() { return pDefOutlineName; } + + static inline USHORT GetNumIndent( BYTE nLvl ); + static inline USHORT GetBullIndent( BYTE nLvl ); + + SwNumRuleType GetRuleType() const { return eRuleType; } + void SetRuleType( SwNumRuleType eNew ) { eRuleType = eNew; + bInvalidRuleFlag = TRUE; } + + // eine Art Copy-Constructor, damit die Num-Formate auch an den + // richtigen CharFormaten eines Dokumentes haengen !! + // (Kopiert die NumFormate und returnt sich selbst) + SwNumRule& CopyNumRule( SwDoc*, const SwNumRule& ); + + // testet ob die CharFormate aus dem angegeben Doc sind und kopiert + // die gegebenfalls + void CheckCharFmts( SwDoc* pDoc ); + + // test ob der Einzug von dieser Numerierung kommt. + BOOL IsRuleLSpace( SwTxtNode& rNd ) const; + + const String& GetName() const { return sName; } + void SetName( const String& rNm ) { sName = rNm; } + + BOOL IsAutoRule() const { return bAutoRuleFlag; } + void SetAutoRule( BOOL bFlag ) { bAutoRuleFlag = bFlag; } + + BOOL IsInvalidRule() const { return bInvalidRuleFlag; } + void SetInvalidRule( BOOL bFlag ) { bInvalidRuleFlag = bFlag; } + + BOOL IsContinusNum() const { return bContinusNum; } + void SetContinusNum( BOOL bFlag ) { bContinusNum = bFlag; } + + BOOL IsAbsSpaces() const { return bAbsSpaces; } + void SetAbsSpaces( BOOL bFlag ) { bAbsSpaces = bFlag; } + + // erfragen und setzen der Poolvorlagen-Id's + USHORT GetPoolFmtId() const { return nPoolFmtId; } + void SetPoolFmtId( USHORT nId ) { nPoolFmtId = nId; } + + // erfragen und setzen der Hilfe-Id's fuer die Document-Vorlagen + USHORT GetPoolHelpId() const { return nPoolHelpId; } + void SetPoolHelpId( USHORT nId ) { nPoolHelpId = nId; } + BYTE GetPoolHlpFileId() const { return nPoolHlpFileId; } + void SetPoolHlpFileId( BYTE nId ) { nPoolHlpFileId = nId; } + + /** + #109308# Sets adjustment in all formats of the numbering rule. + + @param eNum adjustment to be set + */ + void SetNumAdjust(SvxAdjust eNum); + + void SetSvxRule(const SvxNumRule&, SwDoc* pDoc); + SvxNumRule MakeSvxNumRule() const; +}; + + +class SwNodeNum +{ + USHORT nLevelVal[ MAXLEVEL ]; // Nummern aller Levels + USHORT nSetValue; // vorgegeben Nummer + BYTE nMyLevel; // akt. Level + BOOL bStartNum; // Numerierung neu starten + +public: + inline SwNodeNum( BYTE nLevel = NO_NUM, USHORT nSetVal = USHRT_MAX ); + inline SwNodeNum& operator=( const SwNodeNum& rCpy ); + + BOOL operator==( const SwNodeNum& ) const; + + BYTE GetLevel() const { return nMyLevel; } + void SetLevel( BYTE nVal ) { nMyLevel = nVal; } + + BOOL IsStart() const { return bStartNum; } + void SetStart( BOOL bFlag = TRUE ) { bStartNum = bFlag; } + + USHORT GetSetValue() const { return nSetValue; } + void SetSetValue( USHORT nVal ) { nSetValue = nVal; } + + const USHORT* GetLevelVal() const { return nLevelVal; } + USHORT* GetLevelVal() { return nLevelVal; } +}; + + + + +// ------------ inline Methoden ---------------------------- + +inline const SwNumFmt& SwNumRule::Get( USHORT i ) const +{ + OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END ); + return aFmts[ i ] ? *aFmts[ i ] + : *aBaseFmts[ eRuleType ][ i ]; +} + +inline const SwNumFmt* SwNumRule::GetNumFmt( USHORT i ) const +{ + OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END ); + return aFmts[ i ]; +} +inline const Font& SwNumRule::GetDefBulletFont() +{ + if( !pDefBulletFont ) + SwNumRule::_MakeDefBulletFont(); + return *pDefBulletFont; +} + +inline USHORT SwNumRule::GetNumIndent( BYTE nLvl ) +{ + OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" ); + return aDefNumIndents[ nLvl ]; +} +inline USHORT SwNumRule::GetBullIndent( BYTE nLvl ) +{ + OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" ); + return aDefNumIndents[ nLvl ]; +} + +inline sal_Unicode SwNumRule::GetBulletChar( const SwNodeNum& rNum ) const +{ + return Get( rNum.GetLevel() & ~NO_NUMLEVEL ).GetBulletChar(); +} +inline const Font* SwNumRule::GetBulletFont( const SwNodeNum& rNum ) const +{ + return Get( rNum.GetLevel() & ~NO_NUMLEVEL ).GetBulletFont(); +} + + + +SwNodeNum::SwNodeNum( BYTE nLevel, USHORT nSetVal ) + : nSetValue( nSetVal ), nMyLevel( nLevel ), bStartNum( FALSE ) +{ + memset( nLevelVal, 0, sizeof( nLevelVal ) ); +} + +inline SwNodeNum& SwNodeNum::operator=( const SwNodeNum& rCpy ) +{ + nSetValue = rCpy.nSetValue; + nMyLevel = rCpy.nMyLevel; + bStartNum = rCpy.bStartNum; + + memcpy( nLevelVal, rCpy.nLevelVal, sizeof( nLevelVal ) ); + return *this; +} + + +} //namespace binfilter +#endif // _NUMRULE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/orntenum.hxx b/inc/bf_sw/orntenum.hxx new file mode 100644 index 000000000..70e435d0e --- /dev/null +++ b/inc/bf_sw/orntenum.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _ORNTENUM_HXX +#define _ORNTENUM_HXX +namespace binfilter { + +//SwFmtVertOrient, wie und woran orientiert -- +// sich der FlyFrm in der Vertikalen ----------- + +enum SwRelationOrient +{ + FRAME, // Absatz inkl. Raender + PRTAREA, // Absatz ohne Raender + REL_CHAR, // an einem Zeichen + REL_PG_LEFT, // im linken Seitenrand + REL_PG_RIGHT, // im rechten Seitenrand + REL_FRM_LEFT, // im linken Absatzrand + REL_FRM_RIGHT, // im rechten Absatzrand + REL_PG_FRAME, // Seite inkl. Raender, bei seitengeb. identisch mit FRAME + REL_PG_PRTAREA, // Seite ohne Raender, bei seitengeb. identisch mit PRTAREA + // Wenn neue enums benoetigt werden, muessen die Ausweich-Arrays mitgepflegt + // werden, LAST_ENUM_DUMMY muss immer das letzte enum bleiben + LAST_ENUM_DUMMY +}; + +enum SwVertOrient +{ + VERT_NONE, //Der Wert in nYPos gibt die RelPos direkt an. + VERT_TOP, //Der Rest ist fuer automatische Ausrichtung. + VERT_CENTER, + VERT_BOTTOM, + VERT_CHAR_TOP, //Ausrichtung _nur_ fuer Zeichengebundene Rahmen + VERT_CHAR_CENTER, //wie der Name jew. sagt wird der RefPoint des Rahmens + VERT_CHAR_BOTTOM, //entsprechend auf die Oberkante, Mitte oder Unterkante + VERT_LINE_TOP, //der Zeile gesetzt. Der Rahmen richtet sich dann + VERT_LINE_CENTER, //entsprechend aus. + VERT_LINE_BOTTOM +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/pagedesc.hxx b/inc/bf_sw/pagedesc.hxx new file mode 100644 index 000000000..a5dc02121 --- /dev/null +++ b/inc/bf_sw/pagedesc.hxx @@ -0,0 +1,304 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _PAGEDESC_HXX +#define _PAGEDESC_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/fract.hxx> + +#include <tools/color.hxx> +#include <bf_tools/string.hxx> +#include <swtypes.hxx> //fuer SwTwips +#include <frmfmt.hxx> +#include <numrule.hxx> +namespace binfilter { + +class SfxPoolItem; +class SwTxtFmtColl; +class SwNode; + +//Separator line adjustment +enum SwFtnAdj +{ + FTNADJ_LEFT, + FTNADJ_CENTER, + FTNADJ_RIGHT +}; + +//footnote information +class SwPageFtnInfo +{ + SwTwips nMaxHeight; //maximum height of the footnote area. + ULONG nLineWidth; //width of separator line + Color aLineColor; //color of the separator line + Fraction aWidth; //percentage width of the separator line. + SwFtnAdj eAdj; //line adjustment. + SwTwips nTopDist; //distance between body and separator. + SwTwips nBottomDist; //distance between separator and first footnote +public: + SwTwips GetHeight() const { return nMaxHeight; } + ULONG GetLineWidth() const { return nLineWidth; } + const Color& GetLineColor() const { return aLineColor;} + const Fraction& GetWidth() const { return aWidth; } + SwFtnAdj GetAdj() const { return eAdj; } + SwTwips GetTopDist()const { return nTopDist; } + SwTwips GetBottomDist() const { return nBottomDist; } + + void SetHeight( SwTwips nNew ) { nMaxHeight = nNew; } + void SetLineWidth(ULONG nSet ) { nLineWidth = nSet; } + void SetLineColor(const Color& rCol ) { aLineColor = rCol;} + void SetWidth( const Fraction &rNew){ aWidth = rNew; } + void SetAdj ( SwFtnAdj eNew ) { eAdj = eNew; } + void SetTopDist ( SwTwips nNew ) { nTopDist = nNew; } + void SetBottomDist( SwTwips nNew ) { nBottomDist = nNew; } + + SwPageFtnInfo(); + SwPageFtnInfo( const SwPageFtnInfo& ); + SwPageFtnInfo& operator=( const SwPageFtnInfo& ); + + BOOL operator ==( const SwPageFtnInfo& ) const; +}; + +/* + * Verwendung des UseOnPage (eUse) und der FrmFmt'e + * + * RIGHT - aMaster nur fuer rechte Seiten, linke Seiten immer leer. + * LEFT - aLeft fuer linke Seiten, rechte Seiten immer leer. + * aLeft ist eine Kopie des Master. + * ALL - aMaster fuer rechte Seiten, aLeft fuer Linke Seiten. + * aLeft ist eine Kopie des Master. + * MIRROR - aMaster fuer rechte Seiten, aLeft fuer linke Seiten. + * aLeft ist eine Kopie des Master, Raender sind gespiegelt. + * + * UI dreht auschliesslich am Master! aLeft wird beim Chg am Dokument + * enstprechend dem eUse eingestellt. + * + * Damit es die Filter etwas einfacher haben werden weitere Werte im + * eUse untergebracht: + * + * HEADERSHARE - Headerinhalt auf beiden Seiten gleich + * FOOTERSHARE - Footerinhalt auf beiden Seiten gleich + * + * Die Werte werden bei den entsprechenden Get-/Set-Methden ausmaskiert. + * Zugriff auf das volle eUse inclusive der Header-Footer information + * per ReadUseOn(), WriteUseOn() (fuer Filter und CopyCTor)! + * + * Die FrmFormate fuer Header/Footer werden anhand der Attribute fuer + * Header/Footer vom UI am Master eingestellt (Hoehe, Raender, Hintergrund...); + * Header/Footer fuer die Linke Seite werden entsprechen kopiert bzw. + * gespielt (Chg am Dokument). + * Das jew. Attribut fuer den Inhalt wird automatisch beim Chg am + * Dokument versorgt (entsprechen den SHARE-informationen werden Inhalte + * erzeugt bzw. entfernt). + * + */ + +enum UseOnPage +{ PD_NONE = 0x0000, //for internal use only. + PD_LEFT = 0x0001, + PD_RIGHT = 0x0002, + PD_ALL = 0x0003, + PD_MIRROR = 0x0007, + PD_HEADERSHARE = 0x0040, + PD_FOOTERSHARE = 0x0080, + PD_NOHEADERSHARE = 0x00BF, //for internal use only + PD_NOFOOTERSHARE = 0x007F //for internal use only +}; + +class SwPageDesc : public SwModify +{ + friend class SwDoc; + + //nicht (mehr) implementiert. + SwPageDesc& operator=( const SwPageDesc& ); + + String aDescName; + SvxNumberType aNumType; + SwFrmFmt aMaster; + SwFrmFmt aLeft; + SwDepend aDepend; // wg. Registerhaltigkeit + SwPageDesc *pFollow; + USHORT nRegHeight; // Zeilenabstand und Fontascent der Vorlage + USHORT nRegAscent; // fuer die Registerhaltigkeit + UseOnPage eUse; + BOOL bLandscape; + + //Fussnoteninformationen + SwPageFtnInfo aFtnInfo; + + //Wird zum Spiegeln vom Chg (Doc) gerufen. + //Kein Abgleich an anderer Stelle. + void Mirror(); + + void ResetAllAttr( sal_Bool bLeft ); + + SwPageDesc(const String&, SwFrmFmt*, SwDoc *pDc ); +public: + const String &GetName() const { return aDescName; } + void SetName( const String& rNewName ) { aDescName = rNewName; } + + BOOL GetLandscape() const { return bLandscape; } + void SetLandscape( BOOL bNew ) { bLandscape = bNew; } + + const SvxNumberType &GetNumType() const { return aNumType; } + void SetNumType( const SvxNumberType& rNew ) { aNumType = rNew; } + + const SwPageFtnInfo &GetFtnInfo() const { return aFtnInfo; } + SwPageFtnInfo &GetFtnInfo() { return aFtnInfo; } + void SetFtnInfo( const SwPageFtnInfo &rNew ) { aFtnInfo = rNew; } + + inline BOOL IsHeaderShared() const; + inline BOOL IsFooterShared() const; + inline void ChgHeaderShare( BOOL bNew ); + inline void ChgFooterShare( BOOL bNew ); + + inline void SetUseOn( UseOnPage eNew ); + inline UseOnPage GetUseOn() const; + + void WriteUseOn( UseOnPage eNew ) { eUse = eNew; } + UseOnPage ReadUseOn () const { return eUse; } + + SwFrmFmt &GetMaster() { return aMaster; } + SwFrmFmt &GetLeft() { return aLeft; } + const SwFrmFmt &GetMaster() const { return aMaster; } + const SwFrmFmt &GetLeft() const { return aLeft; } + + // Reset all attrs of the format but keep the ones a pagedesc + // cannot live without. + inline void ResetAllMasterAttr(); + inline void ResetAllLeftAttr(); + + //Mit den folgenden Methoden besorgt sich das Layout ein Format + //um eine Seite erzeugen zu koennen + inline SwFrmFmt *GetRightFmt(); + inline const SwFrmFmt *GetRightFmt() const; + inline SwFrmFmt *GetLeftFmt(); + inline const SwFrmFmt *GetLeftFmt() const; + + USHORT GetRegHeight() const { return nRegHeight; } + USHORT GetRegAscent() const { return nRegAscent; } + void SetRegHeight( USHORT nNew ){ nRegHeight = nNew; } + void SetRegAscent( USHORT nNew ){ nRegAscent = nNew; } + + inline void SetFollow( const SwPageDesc* pNew ); + const SwPageDesc* GetFollow() const { return pFollow; } + SwPageDesc* GetFollow() { return pFollow; } + + void SetRegisterFmtColl( const SwTxtFmtColl* rFmt ); + const SwTxtFmtColl* GetRegisterFmtColl() const; + virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); + void RegisterChange(); + + // erfragen und setzen der PoolFormat-Id + USHORT GetPoolFmtId() const { return aMaster.GetPoolFmtId(); } + void SetPoolFmtId( USHORT nId ) { aMaster.SetPoolFmtId( nId ); } + USHORT GetPoolHelpId() const { return aMaster.GetPoolHelpId(); } + void SetPoolHelpId( USHORT nId ) { aMaster.SetPoolHelpId( nId ); } + BYTE GetPoolHlpFileId() const { return aMaster.GetPoolHlpFileId(); } + void SetPoolHlpFileId( BYTE nId ) { aMaster.SetPoolHlpFileId( nId ); } + // erfrage die Attribut-Beschreibung, returnt den reingereichten String + void GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText ) const; + + // erfrage vom Client Informationen + + + //Given a SwNode return the pagedesc in use at that location. + static const SwPageDesc* GetPageDescOfNode(const SwNode& rNd); + + SwPageDesc( const SwPageDesc& ); + ~SwPageDesc(); +}; + +inline void SwPageDesc::SetFollow( const SwPageDesc* pNew ) +{ + pFollow = pNew ? (SwPageDesc*)pNew : this; +} + +inline BOOL SwPageDesc::IsHeaderShared() const +{ + return eUse & PD_HEADERSHARE ? TRUE : FALSE; +} +inline BOOL SwPageDesc::IsFooterShared() const +{ + return eUse & PD_FOOTERSHARE ? TRUE : FALSE; +} +inline void SwPageDesc::ChgHeaderShare( BOOL bNew ) +{ + if ( bNew ) + eUse = (UseOnPage) (eUse | PD_HEADERSHARE); + else + eUse = (UseOnPage) (eUse & PD_NOHEADERSHARE); +} +inline void SwPageDesc::ChgFooterShare( BOOL bNew ) +{ + if ( bNew ) + eUse = (UseOnPage) (eUse | PD_FOOTERSHARE); + else + eUse = (UseOnPage) (eUse & PD_NOFOOTERSHARE); +} +inline void SwPageDesc::SetUseOn( UseOnPage eNew ) +{ + UseOnPage eTmp = PD_NONE; + if ( eUse & PD_HEADERSHARE ) + eTmp = PD_HEADERSHARE; + if ( eUse & PD_FOOTERSHARE ) + eTmp = (UseOnPage) (eTmp | PD_FOOTERSHARE); + eUse = (UseOnPage) (eTmp | eNew); +} +inline UseOnPage SwPageDesc::GetUseOn() const +{ + UseOnPage eRet = eUse; + eRet = (UseOnPage) (eRet & PD_NOHEADERSHARE); + eRet = (UseOnPage) (eRet & PD_NOFOOTERSHARE); + return eRet; +} + +inline void SwPageDesc::ResetAllMasterAttr() +{ + ResetAllAttr( sal_False ); +} + +inline void SwPageDesc::ResetAllLeftAttr() +{ + ResetAllAttr( sal_True ); +} + +inline SwFrmFmt *SwPageDesc::GetRightFmt() +{ + return PD_RIGHT & eUse ? &aMaster : 0; +} +inline const SwFrmFmt *SwPageDesc::GetRightFmt() const +{ + return PD_RIGHT & eUse ? &aMaster : 0; +} +inline SwFrmFmt *SwPageDesc::GetLeftFmt() +{ + return PD_LEFT & eUse ? &aLeft : 0; +} +inline const SwFrmFmt *SwPageDesc::GetLeftFmt() const +{ + return PD_LEFT & eUse ? &aLeft : 0; +} + +} //namespace binfilter +#endif //_PAGEDESC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/pam.hxx b/inc/bf_sw/pam.hxx new file mode 100644 index 000000000..0ec65fdfe --- /dev/null +++ b/inc/bf_sw/pam.hxx @@ -0,0 +1,188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _PAM_HXX +#define _PAM_HXX + +#include <bf_svtools/bf_solar.h> + +#include <stddef.h> // fuer MemPool +#include <tools/gen.hxx> +#include <tools/mempool.hxx> + +#include <cshtyp.hxx> // fuer die Funktions-Definitionen +#include <ring.hxx> // Superklasse +#include <index.hxx> // fuer SwIndex +#include <ndindex.hxx> // fuer SwNodeIndex +namespace com { namespace sun { namespace star { namespace util { + struct SearchOptions; +} } } } +namespace binfilter { +class SfxPoolItem; +class SfxItemSet; + + +class SwFmt; + +class SwDoc; +class SwNode; +class SwCntntNode; +class SwNodes; +class SwPaM; + + +namespace utl { + class TextSearch; +} + +struct SwPosition +{ + SwNodeIndex nNode; + SwIndex nContent; + + SwPosition( ); + SwPosition( const SwNode& rNode ); + SwPosition( const SwNodeIndex &rNode ); + SwPosition( const SwNodeIndex &rNode, const SwIndex &rCntnt ); + SwPosition( const SwPosition & ); + + SwPosition &operator=(const SwPosition &); + + bool operator < (const SwPosition &) const; + bool operator > (const SwPosition &) const; + bool operator <=(const SwPosition &) const; + bool operator >=(const SwPosition &) const; + bool operator ==(const SwPosition &) const; + bool operator !=(const SwPosition &) const; +}; + + +// SwPointAndMark / SwPaM +struct SwMoveFnCollection; +typedef SwMoveFnCollection* SwMoveFn; +extern SwMoveFn fnMoveForward, fnMoveBackward; + +typedef bool (*SwGoInDoc)( SwPaM& rPam, SwMoveFn fnMove ); +extern SwGoInDoc fnGoDoc, fnGoNode, fnGoCntnt, fnGoCntntCells; + +class SwPaM : public Ring +{ + SwPosition aBound1; + SwPosition aBound2; + SwPosition *pPoint; + SwPosition *pMark; + + +public: + SwPaM(){}; + SwPaM( const SwPosition& rPos, SwPaM* pRing = 0 ); + SwPaM( const SwPosition& rMk, const SwPosition& rPt, SwPaM* pRing = 0 ); + SwPaM( SwPaM & ); + SwPaM( const SwNode& rMk, const SwNode& rPt, + long nMkOffset = 0, long nPtOffset = 0, SwPaM* pRing = 0 ); + SwPaM( const SwNode& rMk, xub_StrLen nMkCntnt, + const SwNode& rPt, xub_StrLen nPtCntnt, SwPaM* pRing = 0 ); + SwPaM( const SwNode& rNd, xub_StrLen nCntnt = 0, SwPaM* pRing = 0 ); + SwPaM( const SwNodeIndex& rNd, xub_StrLen nCntnt = 0, SwPaM* pRing = 0 ); + virtual ~SwPaM(); + + // Bewegen des Cursors + bool Move( SwMoveFn fnMove = fnMoveForward, + SwGoInDoc fnGo = fnGoCntnt ); + + // Suchen + + virtual void SetMark(); + void DeleteMark() { pMark = pPoint; } +#ifndef DBG_UTIL + void Exchange() + { + if(pPoint != pMark) + { + SwPosition *pTmp = pPoint; + pPoint = pMark; + pMark = pTmp; + } + } +#else + void Exchange(); +#endif + /* + * Undokumented Feature: Liefert zurueck, ob das Pam ueber + * eine Selektion verfuegt oder nicht. Definition einer + * Selektion: Point und Mark zeigen auf unterschiedliche + * Puffer. + */ + bool HasMark() const { return pPoint == pMark? FALSE : TRUE; } + + const SwPosition *GetPoint() const { return pPoint; } + SwPosition *GetPoint() { return pPoint; } + const SwPosition *GetMark() const { return pMark; } + SwPosition *GetMark() { return pMark; } + + const SwPosition *Start() const + { return (*pPoint) <= (*pMark)? pPoint: pMark; } + SwPosition *Start() + { return (*pPoint) <= (*pMark)? pPoint: pMark; } + const SwPosition *End() const + { return (*pPoint) > (*pMark)? pPoint: pMark; } + SwPosition *End() + { return (*pPoint) > (*pMark)? pPoint: pMark; } + + SwPaM& operator=( SwPaM & ); + + // erfrage vom SwPaM den aktuellen Node/ContentNode am SPoint / Mark + SwNode* GetNode( BOOL bPoint = TRUE ) const + { + return &( bPoint ? pPoint->nNode : pMark->nNode ).GetNode(); + } + SwCntntNode* GetCntntNode( BOOL bPoint = TRUE ) const + { + return ( bPoint ? pPoint->nNode : pMark->nNode ).GetNode().GetCntntNode(); + } + + /** + Normalizes PaM, i.e. sort point and mark. + + @param bPointFirst TRUE: If the point is behind the mark then swap. + FALSE: If the mark is behind the point then swap. + */ + SwPaM & Normalize(BOOL bPointFirst = TRUE); + + // erfrage vom SwPaM das Dokument, in dem er angemeldet ist + SwDoc* GetDoc() const { return pPoint->nNode.GetNode().GetDoc(); } + SwPosition& GetBound( BOOL bOne = TRUE ) + { return bOne ? aBound1 : aBound2; } + const SwPosition& GetBound( BOOL bOne = TRUE ) const + { return bOne ? aBound1 : aBound2; } + + // erfrage die Seitennummer auf der der Cursor steht + USHORT GetPageNum( BOOL bAtPoint = TRUE, const Point* pLayPos = 0 ); + + DECL_FIXEDMEMPOOL_NEWDEL(SwPaM) +}; + + +bool CheckNodesRange( const SwNodeIndex&, const SwNodeIndex&, bool ); +bool GoInCntnt( SwPaM & rPam, SwMoveFn fnMove ); + + +} //namespace binfilter +#endif // _PAM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/paratr.hxx b/inc/bf_sw/paratr.hxx new file mode 100644 index 000000000..caea0f50a --- /dev/null +++ b/inc/bf_sw/paratr.hxx @@ -0,0 +1,266 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _PARATR_HXX +#define _PARATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/eitem.hxx> +#include <bf_svtools/stritem.hxx> +#include <format.hxx> +#include <swtypes.hxx> +class IntlWrapper; +namespace binfilter { + +class SwCharFmt; + + +/************************************************************************* +|* class SwFmtDrop +*************************************************************************/ + +#define DROP_WHOLEWORD ((USHORT)0x0001) + +//Wenn ein SwFmtDrop Client ist, so ist dies das CharFmt welches den Font fuer +//die DropCaps beschreibt. Ist es kein Client, so wird von der Formatierung +//das CharFmt des Absatzes benutzt. +//Wird das CharFmt verandert, so wird diese Aenderung ueber das Modify des +//SwFmtDrop an die Absatze propagiert. +class SwFmtDrop: public SfxPoolItem, public SwClient +{ + SwModify* pDefinedIn; // Modify-Object, in dem der DropCaps steht + // kann nur TxtFmtCollection/TxtNode sein + USHORT nDistance; // Abstand zum Textbeginn + USHORT nReadFmt; // fuer den Sw3-Reader: CharFormat-Id (Pool laden!) + BYTE nLines; // Anzahl der Zeilen + BYTE nChars; // Anzahl der Zeichen + BOOL bWholeWord; // Erstes Wort als Initialen +public: + TYPEINFO(); //Bereits in der Basisklasse SwClient + + SwFmtDrop(); + SwFmtDrop( const SwFmtDrop & ); + ~SwFmtDrop(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual USHORT GetVersion( USHORT nFFVer ) const; + + inline BYTE GetLines() const { return nLines; } + inline BYTE &GetLines() { return nLines; } + + inline BYTE GetChars() const { return nChars; } + inline BYTE &GetChars() { return nChars; } + + inline BOOL GetWholeWord() const { return bWholeWord; } + inline BYTE &GetWholeWord() { return bWholeWord; } + + inline USHORT GetDistance() const { return nDistance; } + inline USHORT &GetDistance() { return nDistance; } + + // fuer den Sw3-Reader: CharFormat-Id (Pool laden!) + inline USHORT GetReadFmt() const { return nReadFmt; } + inline void SetReadFmt( USHORT n ) { nReadFmt = n; } + + inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; } + inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)pRegisteredIn; } + void SetCharFmt( SwCharFmt *pNew ); + virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + + // erfrage und setze den Modify-Pointer + inline const SwModify* GetDefinedIn() const { return pDefinedIn; } + inline void ChgDefinedIn( const SwModify* pNew ) + { pDefinedIn = (SwModify*)pNew; } +}; + +class SwRegisterItem : public SfxBoolItem +{ +public: + TYPEINFO(); + + inline SwRegisterItem( const BOOL bRegister = FALSE ); + inline SwRegisterItem& operator=( const SwRegisterItem& rRegister ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT ) const; + virtual SvStream& Store( SvStream& rStream, USHORT ) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; +}; + +inline SwRegisterItem::SwRegisterItem( const BOOL bRegister ) : + SfxBoolItem( RES_PARATR_REGISTER, bRegister ) +{} + +inline SwRegisterItem& SwRegisterItem::operator=( + const SwRegisterItem& rRegister ) +{ + SetValue( rRegister.GetValue() ); + return *this; +} + +class SwNumRuleItem : public SfxStringItem +{ + SwModify* pDefinedIn; // Modify-Object, in dem das NumRule steht + // kann nur TxtFmtCollection/TxtNode sein +public: + TYPEINFO(); + + SwNumRuleItem() + : SfxStringItem( RES_PARATR_NUMRULE, aEmptyStr ), pDefinedIn(0) {} + + SwNumRuleItem( const String& rRuleName ) + : SfxStringItem( RES_PARATR_NUMRULE, rRuleName ), pDefinedIn(0) {} + + SwNumRuleItem( const SwNumRuleItem& rCpy ) + : SfxStringItem( RES_PARATR_NUMRULE, rCpy.GetValue() ), pDefinedIn(0) {} + + + SwNumRuleItem& operator=( const SwNumRuleItem& rCpy ) + { SetValue( rCpy.GetValue() ); pDefinedIn=0; return *this; } + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT ) const; + virtual SvStream& Store( SvStream& rStream, USHORT ) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId ); + + // erfrage und setze den Modify-Pointer + inline const SwModify* GetDefinedIn() const { return pDefinedIn; } + inline void ChgDefinedIn( const SwModify* pNew ) + { pDefinedIn = (SwModify*)pNew; } +}; +class SwParaConnectBorderItem : public SfxBoolItem +{ +public: + TYPEINFO(); + + inline SwParaConnectBorderItem( const BOOL bConnect = TRUE ); + inline SwParaConnectBorderItem& operator=( const SwParaConnectBorderItem& rConnect ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + String &rText, + const ::IntlWrapper* pIntl = 0 ) const; +}; + +inline SwParaConnectBorderItem::SwParaConnectBorderItem( const BOOL bConnect ) : + SfxBoolItem( RES_PARATR_CONNECT_BORDER, bConnect ) +{} + +inline SwParaConnectBorderItem& SwParaConnectBorderItem::operator=( + const SwParaConnectBorderItem& rConnect ) +{ + SetValue( rConnect.GetValue() ); + return *this; +} + + + +/****************************************************************************** + * Implementierung der Paragraph-Attribut Methoden vom SwAttrSet + ******************************************************************************/ + +inline const SvxLineSpacingItem &SwAttrSet::GetLineSpacing(BOOL bInP) const + { return (const SvxLineSpacingItem&)Get( RES_PARATR_LINESPACING,bInP); } +inline const SvxAdjustItem &SwAttrSet::GetAdjust(BOOL bInP) const + { return (const SvxAdjustItem&)Get( RES_PARATR_ADJUST,bInP); } +inline const SvxFmtSplitItem &SwAttrSet::GetSplit(BOOL bInP) const + { return (const SvxFmtSplitItem&)Get( RES_PARATR_SPLIT,bInP); } +inline const SwRegisterItem &SwAttrSet::GetRegister(BOOL bInP) const + { return (const SwRegisterItem&)Get( RES_PARATR_REGISTER,bInP); } +inline const SvxWidowsItem &SwAttrSet::GetWidows(BOOL bInP) const + { return (const SvxWidowsItem&)Get( RES_PARATR_WIDOWS,bInP); } +inline const SvxOrphansItem &SwAttrSet::GetOrphans(BOOL bInP) const + { return (const SvxOrphansItem&)Get( RES_PARATR_ORPHANS,bInP); } +inline const SvxTabStopItem &SwAttrSet::GetTabStops(BOOL bInP) const + { return (const SvxTabStopItem&)Get( RES_PARATR_TABSTOP,bInP); } +inline const SvxHyphenZoneItem &SwAttrSet::GetHyphenZone(BOOL bInP) const + { return (const SvxHyphenZoneItem&)Get(RES_PARATR_HYPHENZONE,bInP); } +inline const SwFmtDrop &SwAttrSet::GetDrop(BOOL bInP) const + { return (const SwFmtDrop&)Get(RES_PARATR_DROP,bInP); } +inline const SwNumRuleItem &SwAttrSet::GetNumRule(BOOL bInP) const + { return (const SwNumRuleItem&)Get(RES_PARATR_NUMRULE,bInP); } +inline const SvxScriptSpaceItem& SwAttrSet::GetScriptSpace(BOOL bInP) const + { return (const SvxScriptSpaceItem&)Get(RES_PARATR_SCRIPTSPACE,bInP); } +inline const SvxHangingPunctuationItem &SwAttrSet::GetHangingPunctuation(BOOL bInP) const + { return (const SvxHangingPunctuationItem&)Get(RES_PARATR_HANGINGPUNCTUATION,bInP); } +inline const SvxForbiddenRuleItem &SwAttrSet::GetForbiddenRule(BOOL bInP) const + { return (const SvxForbiddenRuleItem&)Get(RES_PARATR_FORBIDDEN_RULES, bInP); } +inline const SvxParaVertAlignItem &SwAttrSet::GetParaVertAlign(BOOL bInP) const + { return (const SvxParaVertAlignItem&)Get( RES_PARATR_VERTALIGN, bInP ); } +inline const SvxParaGridItem &SwAttrSet::GetParaGrid(BOOL bInP) const + { return (const SvxParaGridItem&)Get( RES_PARATR_SNAPTOGRID, bInP ); } +inline const SwParaConnectBorderItem &SwAttrSet::GetParaConnectBorder(BOOL bInP) const + { return (const SwParaConnectBorderItem&)Get( RES_PARATR_CONNECT_BORDER, bInP ); } + +/****************************************************************************** + * Implementierung der Paragraph-Attribut Methoden vom SwFmt + ******************************************************************************/ + +inline const SvxLineSpacingItem &SwFmt::GetLineSpacing(BOOL bInP) const + { return aSet.GetLineSpacing(bInP); } +inline const SvxAdjustItem &SwFmt::GetAdjust(BOOL bInP) const + { return aSet.GetAdjust(bInP); } +inline const SvxFmtSplitItem &SwFmt::GetSplit(BOOL bInP) const + { return aSet.GetSplit(bInP); } +inline const SwRegisterItem &SwFmt::GetRegister(BOOL bInP) const + { return aSet.GetRegister(bInP); } +inline const SvxWidowsItem &SwFmt::GetWidows(BOOL bInP) const + { return aSet.GetWidows(bInP); } +inline const SvxOrphansItem &SwFmt::GetOrphans(BOOL bInP) const + { return aSet.GetOrphans(bInP); } +inline const SvxTabStopItem &SwFmt::GetTabStops(BOOL bInP) const + { return aSet.GetTabStops(bInP); } +inline const SvxHyphenZoneItem &SwFmt::GetHyphenZone(BOOL bInP) const + { return aSet.GetHyphenZone(bInP); } +inline const SwFmtDrop &SwFmt::GetDrop(BOOL bInP) const + { return aSet.GetDrop(bInP); } +inline const SwNumRuleItem &SwFmt::GetNumRule(BOOL bInP) const + { return aSet.GetNumRule(bInP); } +inline const SvxScriptSpaceItem& SwFmt::GetScriptSpace(BOOL bInP) const + { return aSet.GetScriptSpace(bInP) ; } +inline const SvxHangingPunctuationItem &SwFmt::GetHangingPunctuation(BOOL bInP) const + { return aSet.GetHangingPunctuation(bInP) ; } +inline const SvxForbiddenRuleItem &SwFmt::GetForbiddenRule(BOOL bInP) const + { return (const SvxForbiddenRuleItem&)aSet.Get(RES_PARATR_FORBIDDEN_RULES, bInP); } +inline const SvxParaVertAlignItem &SwFmt::GetParaVertAlign(BOOL bInP) const + { return (const SvxParaVertAlignItem&)aSet.Get( RES_PARATR_VERTALIGN, bInP ); } +inline const SvxParaGridItem &SwFmt::GetParaGrid(BOOL bInP) const + { return (const SvxParaGridItem&)aSet.Get( RES_PARATR_SNAPTOGRID, bInP ); } +inline const SwParaConnectBorderItem &SwFmt::GetParaConnectBorder(BOOL bInP) const + { return (const SwParaConnectBorderItem&)aSet.Get( RES_PARATR_CONNECT_BORDER, bInP ); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/poolfmt.awk b/inc/bf_sw/poolfmt.awk new file mode 100644 index 000000000..8ce5a76f2 --- /dev/null +++ b/inc/bf_sw/poolfmt.awk @@ -0,0 +1,71 @@ +#************************************************************************* +#* +#* $Workfile: dbgxtor.awk +#* +#* $Revision: 1.1.1.1 $ +#* +#* $Logfile: T:/sw/inc/poolfmt.awv $ +#* +#* Copyright (c) 1990-1996, STAR DIVISION +#* +#************************************************************************* + +# +# Dieses awk-script generiert ein cxx-file, das alle PoolIds der Vorlage dumpt. +# wird fuer den HelpPI gebraucht. +# Aufruf: awk -f poolid.awk poolfmt.hxx > poolid.cxx +# cl poolid.cxx +# poolid.exe > ???.hrc +# + +function Header() { + print "// This is an outputfile of an awk-script: $Workfile: poolfmt.awk $" + print "#include <solar.h> " + print + print "#include <stdio.h>" + print "#include <stdlib.h>" + print + print "#pragma hdrstop" + print + print "#include <iostream.hxx> " + print "#include \"poolfmt.hxx\"" + print +} + +function Main() { + print + print "void main( int , char *[] ) {" + sStr = "#define" + print " int nSize = (sizeof(ppPoolIds) / sizeof(PoolFmtIds)) - 1;" + print " for( int n = 0; n < nSize; n++ )" + print " printf( \"" sStr " %s\\t%8d\\n\", ppPoolIds[ n ].pStr, ppPoolIds[ n ].nId );" + print "}" +} + +function TableHead() { + print + print "struct PoolFmtIds { int nId; const char* pStr; };" + print "static PoolFmtIds ppPoolIds[] = {" +} + +function TableTail() { + print " 0, \"\" };" + print +} + +BEGIN { + Header(); + TableHead(); +} + +/^[ \t]*RES_/ && !index( $1, "_BEGIN" ) && !index( $1, "_END" ) && !index( $1, "_POOL_" ) { + sStr = $1; + split( $1, sStr, "," ); + print " " sStr[1] ", \"" sStr[1] "\"," +} + +END { + TableTail(); + Main(); +} + diff --git a/inc/bf_sw/poolfmt.hrc b/inc/bf_sw/poolfmt.hrc new file mode 100644 index 000000000..6c55a6283 --- /dev/null +++ b/inc/bf_sw/poolfmt.hrc @@ -0,0 +1,262 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _POOLFMT_HRC +#define _POOLFMT_HRC + +#include "rcid.hrc" + +// --------------- +// die Formate +// --------------- + +// Zeichenvorlagen: +#define STR_POOLCHR_FOOTNOTE (RC_POOLCHRFMT_BEGIN+ 0) +#define STR_POOLCHR_PAGENO (RC_POOLCHRFMT_BEGIN+ 1) +#define STR_POOLCHR_LABEL (RC_POOLCHRFMT_BEGIN+ 2) +#define STR_POOLCHR_DROPCAPS (RC_POOLCHRFMT_BEGIN+ 3) +#define STR_POOLCHR_NUM_LEVEL (RC_POOLCHRFMT_BEGIN+ 4) +#define STR_POOLCHR_BUL_LEVEL (RC_POOLCHRFMT_BEGIN+ 5) +#define STR_POOLCHR_INET_NORMAL (RC_POOLCHRFMT_BEGIN+ 6) +#define STR_POOLCHR_INET_VISIT (RC_POOLCHRFMT_BEGIN+ 7) +#define STR_POOLCHR_JUMPEDIT (RC_POOLCHRFMT_BEGIN+ 8) +#define STR_POOLCHR_TOXJUMP (RC_POOLCHRFMT_BEGIN+ 9) +#define STR_POOLCHR_ENDNOTE (RC_POOLCHRFMT_BEGIN+ 10) +#define STR_POOLCHR_LINENUM (RC_POOLCHRFMT_BEGIN+ 11) +#define STR_POOLCHR_IDX_MAIN_ENTRY (RC_POOLCHRFMT_BEGIN+ 12) +#define STR_POOLCHR_FOOTNOTE_ANCHOR (RC_POOLCHRFMT_BEGIN+ 13) +#define STR_POOLCHR_ENDNOTE_ANCHOR (RC_POOLCHRFMT_BEGIN+ 14) +#define STR_POOLCHR_RUBYTEXT (RC_POOLCHRFMT_BEGIN+ 15) +#define STR_POOLCHR_VERT_NUM (RC_POOLCHRFMT_BEGIN+ 16) + +#define STR_POOLCHR_HTML_EMPHASIS (RC_POOLCHRFMT_HTML_BEGIN+ 0) +#define STR_POOLCHR_HTML_CITIATION (RC_POOLCHRFMT_HTML_BEGIN+ 1) +#define STR_POOLCHR_HTML_STRONG (RC_POOLCHRFMT_HTML_BEGIN+ 2) +#define STR_POOLCHR_HTML_CODE (RC_POOLCHRFMT_HTML_BEGIN+ 3) +#define STR_POOLCHR_HTML_SAMPLE (RC_POOLCHRFMT_HTML_BEGIN+ 4) +#define STR_POOLCHR_HTML_KEYBOARD (RC_POOLCHRFMT_HTML_BEGIN+ 5) +#define STR_POOLCHR_HTML_VARIABLE (RC_POOLCHRFMT_HTML_BEGIN+ 6) +#define STR_POOLCHR_HTML_DEFINSTANCE (RC_POOLCHRFMT_HTML_BEGIN+ 7) +#define STR_POOLCHR_HTML_TELETYPE (RC_POOLCHRFMT_HTML_BEGIN+ 8) + +// Rahmen-Vorlagen: +#define STR_POOLFRM_FRAME (RC_POOLFRMFMT_BEGIN+ 0) +#define STR_POOLFRM_GRAPHIC (RC_POOLFRMFMT_BEGIN+ 1) +#define STR_POOLFRM_OLE (RC_POOLFRMFMT_BEGIN+ 2) +#define STR_POOLFRM_FORMEL (RC_POOLFRMFMT_BEGIN+ 3) +#define STR_POOLFRM_MARGINAL (RC_POOLFRMFMT_BEGIN+ 4) +#define STR_POOLFRM_WATERSIGN (RC_POOLFRMFMT_BEGIN+ 5) +#define STR_POOLFRM_LABEL (RC_POOLFRMFMT_BEGIN+ 6) + +// --------------- +// die Vorlagen +// --------------- +// Gruppe Text +#define STR_POOLCOLL_STANDARD (RC_POOLCOLL_TEXT_BEGIN+ 0) +#define STR_POOLCOLL_TEXT (RC_POOLCOLL_TEXT_BEGIN+ 1) +#define STR_POOLCOLL_TEXT_IDENT (RC_POOLCOLL_TEXT_BEGIN+ 2) +#define STR_POOLCOLL_TEXT_NEGIDENT (RC_POOLCOLL_TEXT_BEGIN+ 3) +#define STR_POOLCOLL_TEXT_MOVE (RC_POOLCOLL_TEXT_BEGIN+ 4) +#define STR_POOLCOLL_GREETING (RC_POOLCOLL_TEXT_BEGIN+ 5) +#define STR_POOLCOLL_SIGNATURE (RC_POOLCOLL_TEXT_BEGIN+ 6) +#define STR_POOLCOLL_CONFRONTATION (RC_POOLCOLL_TEXT_BEGIN+ 7) +#define STR_POOLCOLL_MARGINAL (RC_POOLCOLL_TEXT_BEGIN+ 8) + + // Untergruppierung Ueberschriften +#define STR_POOLCOLL_HEADLINE_BASE (RC_POOLCOLL_TEXT_BEGIN+ 9) +#define STR_POOLCOLL_HEADLINE1 (RC_POOLCOLL_TEXT_BEGIN+ 10) +#define STR_POOLCOLL_HEADLINE2 (RC_POOLCOLL_TEXT_BEGIN+ 11) +#define STR_POOLCOLL_HEADLINE3 (RC_POOLCOLL_TEXT_BEGIN+ 12) +#define STR_POOLCOLL_HEADLINE4 (RC_POOLCOLL_TEXT_BEGIN+ 13) +#define STR_POOLCOLL_HEADLINE5 (RC_POOLCOLL_TEXT_BEGIN+ 14) +#define STR_POOLCOLL_HEADLINE6 (RC_POOLCOLL_TEXT_BEGIN+ 15) +#define STR_POOLCOLL_HEADLINE7 (RC_POOLCOLL_TEXT_BEGIN+ 16) +#define STR_POOLCOLL_HEADLINE8 (RC_POOLCOLL_TEXT_BEGIN+ 17) +#define STR_POOLCOLL_HEADLINE9 (RC_POOLCOLL_TEXT_BEGIN+ 18) +#define STR_POOLCOLL_HEADLINE10 (RC_POOLCOLL_TEXT_BEGIN+ 19) + +// Gruppe Listen +#define STR_POOLCOLL_NUMBUL_BASE (RC_POOLCOLL_LISTS_BEGIN+ 0) + // Untergruppe Nummerierung +#define STR_POOLCOLL_NUM_LEVEL1S (RC_POOLCOLL_LISTS_BEGIN+ 1) +#define STR_POOLCOLL_NUM_LEVEL1 (RC_POOLCOLL_LISTS_BEGIN+ 2) +#define STR_POOLCOLL_NUM_LEVEL1E (RC_POOLCOLL_LISTS_BEGIN+ 3) +#define STR_POOLCOLL_NUM_NONUM1 (RC_POOLCOLL_LISTS_BEGIN+ 4) +#define STR_POOLCOLL_NUM_LEVEL2S (RC_POOLCOLL_LISTS_BEGIN+ 5) +#define STR_POOLCOLL_NUM_LEVEL2 (RC_POOLCOLL_LISTS_BEGIN+ 6) +#define STR_POOLCOLL_NUM_LEVEL2E (RC_POOLCOLL_LISTS_BEGIN+ 7) +#define STR_POOLCOLL_NUM_NONUM2 (RC_POOLCOLL_LISTS_BEGIN+ 8) +#define STR_POOLCOLL_NUM_LEVEL3S (RC_POOLCOLL_LISTS_BEGIN+ 9) +#define STR_POOLCOLL_NUM_LEVEL3 (RC_POOLCOLL_LISTS_BEGIN+ 10) +#define STR_POOLCOLL_NUM_LEVEL3E (RC_POOLCOLL_LISTS_BEGIN+ 11) +#define STR_POOLCOLL_NUM_NONUM3 (RC_POOLCOLL_LISTS_BEGIN+ 12) +#define STR_POOLCOLL_NUM_LEVEL4S (RC_POOLCOLL_LISTS_BEGIN+ 13) +#define STR_POOLCOLL_NUM_LEVEL4 (RC_POOLCOLL_LISTS_BEGIN+ 14) +#define STR_POOLCOLL_NUM_LEVEL4E (RC_POOLCOLL_LISTS_BEGIN+ 15) +#define STR_POOLCOLL_NUM_NONUM4 (RC_POOLCOLL_LISTS_BEGIN+ 16) +#define STR_POOLCOLL_NUM_LEVEL5S (RC_POOLCOLL_LISTS_BEGIN+ 17) +#define STR_POOLCOLL_NUM_LEVEL5 (RC_POOLCOLL_LISTS_BEGIN+ 18) +#define STR_POOLCOLL_NUM_LEVEL5E (RC_POOLCOLL_LISTS_BEGIN+ 19) +#define STR_POOLCOLL_NUM_NONUM5 (RC_POOLCOLL_LISTS_BEGIN+ 20) + + // Untergruppe Aufzaehlung +#define STR_POOLCOLL_BUL_LEVEL1S (RC_POOLCOLL_LISTS_BEGIN+ 21) +#define STR_POOLCOLL_BUL_LEVEL1 (RC_POOLCOLL_LISTS_BEGIN+ 22) +#define STR_POOLCOLL_BUL_LEVEL1E (RC_POOLCOLL_LISTS_BEGIN+ 23) +#define STR_POOLCOLL_BUL_NONUM1 (RC_POOLCOLL_LISTS_BEGIN+ 24) +#define STR_POOLCOLL_BUL_LEVEL2S (RC_POOLCOLL_LISTS_BEGIN+ 25) +#define STR_POOLCOLL_BUL_LEVEL2 (RC_POOLCOLL_LISTS_BEGIN+ 26) +#define STR_POOLCOLL_BUL_LEVEL2E (RC_POOLCOLL_LISTS_BEGIN+ 27) +#define STR_POOLCOLL_BUL_NONUM2 (RC_POOLCOLL_LISTS_BEGIN+ 28) +#define STR_POOLCOLL_BUL_LEVEL3S (RC_POOLCOLL_LISTS_BEGIN+ 29) +#define STR_POOLCOLL_BUL_LEVEL3 (RC_POOLCOLL_LISTS_BEGIN+ 30) +#define STR_POOLCOLL_BUL_LEVEL3E (RC_POOLCOLL_LISTS_BEGIN+ 31) +#define STR_POOLCOLL_BUL_NONUM3 (RC_POOLCOLL_LISTS_BEGIN+ 32) +#define STR_POOLCOLL_BUL_LEVEL4S (RC_POOLCOLL_LISTS_BEGIN+ 33) +#define STR_POOLCOLL_BUL_LEVEL4 (RC_POOLCOLL_LISTS_BEGIN+ 34) +#define STR_POOLCOLL_BUL_LEVEL4E (RC_POOLCOLL_LISTS_BEGIN+ 35) +#define STR_POOLCOLL_BUL_NONUM4 (RC_POOLCOLL_LISTS_BEGIN+ 36) +#define STR_POOLCOLL_BUL_LEVEL5S (RC_POOLCOLL_LISTS_BEGIN+ 37) +#define STR_POOLCOLL_BUL_LEVEL5 (RC_POOLCOLL_LISTS_BEGIN+ 38) +#define STR_POOLCOLL_BUL_LEVEL5E (RC_POOLCOLL_LISTS_BEGIN+ 39) +#define STR_POOLCOLL_BUL_NONUM5 (RC_POOLCOLL_LISTS_BEGIN+ 40) + +// Sonderbereiche + // Untergruppe Header +#define STR_POOLCOLL_HEADER (RC_POOLCOLL_EXTRA_BEGIN+ 0) +#define STR_POOLCOLL_HEADERL (RC_POOLCOLL_EXTRA_BEGIN+ 1) +#define STR_POOLCOLL_HEADERR (RC_POOLCOLL_EXTRA_BEGIN+ 2) + + // Untergruppe Footer +#define STR_POOLCOLL_FOOTER (RC_POOLCOLL_EXTRA_BEGIN+ 3) +#define STR_POOLCOLL_FOOTERL (RC_POOLCOLL_EXTRA_BEGIN+ 4) +#define STR_POOLCOLL_FOOTERR (RC_POOLCOLL_EXTRA_BEGIN+ 5) + + // Untergruppe Tabelle +#define STR_POOLCOLL_TABLE (RC_POOLCOLL_EXTRA_BEGIN+ 6) +#define STR_POOLCOLL_TABLE_HDLN (RC_POOLCOLL_EXTRA_BEGIN+ 7) + + // Untergruppe Labels +#define STR_POOLCOLL_LABEL (RC_POOLCOLL_EXTRA_BEGIN+ 8) +#define STR_POOLCOLL_LABEL_ABB (RC_POOLCOLL_EXTRA_BEGIN+ 9) +#define STR_POOLCOLL_LABEL_TABLE (RC_POOLCOLL_EXTRA_BEGIN+ 10) +#define STR_POOLCOLL_LABEL_FRAME (RC_POOLCOLL_EXTRA_BEGIN+ 11) + + // sonstiges +#define STR_POOLCOLL_FRAME (RC_POOLCOLL_EXTRA_BEGIN+ 12) +#define STR_POOLCOLL_FOOTNOTE (RC_POOLCOLL_EXTRA_BEGIN+ 13) +#define STR_POOLCOLL_JAKETADRESS (RC_POOLCOLL_EXTRA_BEGIN+ 14) +#define STR_POOLCOLL_SENDADRESS (RC_POOLCOLL_EXTRA_BEGIN+ 15) +#define STR_POOLCOLL_ENDNOTE (RC_POOLCOLL_EXTRA_BEGIN+ 16) + +#define STR_POOLCOLL_LABEL_DRAWING (RC_POOLCOLL_EXTRA_BEGIN+ 17) + +// Gruppe Verzeichnisse +#define STR_POOLCOLL_REGISTER_BASE (RC_POOLCOLL_REGISTER_BEGIN+ 0) + // Untergruppe Index-Verzeichnisse +#define STR_POOLCOLL_TOX_IDXH (RC_POOLCOLL_REGISTER_BEGIN+ 1) +#define STR_POOLCOLL_TOX_IDX1 (RC_POOLCOLL_REGISTER_BEGIN+ 2) +#define STR_POOLCOLL_TOX_IDX2 (RC_POOLCOLL_REGISTER_BEGIN+ 3) +#define STR_POOLCOLL_TOX_IDX3 (RC_POOLCOLL_REGISTER_BEGIN+ 4) +#define STR_POOLCOLL_TOX_IDXBREAK (RC_POOLCOLL_REGISTER_BEGIN+ 5) + + // Untergruppe Inhalts-Verzeichnisse +#define STR_POOLCOLL_TOX_CNTNTH (RC_POOLCOLL_REGISTER_BEGIN+ 6) +#define STR_POOLCOLL_TOX_CNTNT1 (RC_POOLCOLL_REGISTER_BEGIN+ 7) +#define STR_POOLCOLL_TOX_CNTNT2 (RC_POOLCOLL_REGISTER_BEGIN+ 8) +#define STR_POOLCOLL_TOX_CNTNT3 (RC_POOLCOLL_REGISTER_BEGIN+ 9) +#define STR_POOLCOLL_TOX_CNTNT4 (RC_POOLCOLL_REGISTER_BEGIN+ 10) +#define STR_POOLCOLL_TOX_CNTNT5 (RC_POOLCOLL_REGISTER_BEGIN+ 11) + + // Untergruppe Benutzer-Verzeichnisse: +#define STR_POOLCOLL_TOX_USERH (RC_POOLCOLL_REGISTER_BEGIN+ 12) +#define STR_POOLCOLL_TOX_USER1 (RC_POOLCOLL_REGISTER_BEGIN+ 13) +#define STR_POOLCOLL_TOX_USER2 (RC_POOLCOLL_REGISTER_BEGIN+ 14) +#define STR_POOLCOLL_TOX_USER3 (RC_POOLCOLL_REGISTER_BEGIN+ 15) +#define STR_POOLCOLL_TOX_USER4 (RC_POOLCOLL_REGISTER_BEGIN+ 16) +#define STR_POOLCOLL_TOX_USER5 (RC_POOLCOLL_REGISTER_BEGIN+ 17) + + // Untergruppe Inhalts-Verzeichnisse mehr Ebenen 5 - 10 +#define STR_POOLCOLL_TOX_CNTNT6 (RC_POOLCOLL_REGISTER_BEGIN+ 18) +#define STR_POOLCOLL_TOX_CNTNT7 (RC_POOLCOLL_REGISTER_BEGIN+ 19) +#define STR_POOLCOLL_TOX_CNTNT8 (RC_POOLCOLL_REGISTER_BEGIN+ 20) +#define STR_POOLCOLL_TOX_CNTNT9 (RC_POOLCOLL_REGISTER_BEGIN+ 21) +#define STR_POOLCOLL_TOX_CNTNT10 (RC_POOLCOLL_REGISTER_BEGIN+ 22) + +// illustrations index +#define STR_POOLCOLL_TOX_ILLUSH (RC_POOLCOLL_REGISTER_BEGIN+ 23) +#define STR_POOLCOLL_TOX_ILLUS1 (RC_POOLCOLL_REGISTER_BEGIN+ 24) + +// object index +#define STR_POOLCOLL_TOX_OBJECTH (RC_POOLCOLL_REGISTER_BEGIN+ 25) +#define STR_POOLCOLL_TOX_OBJECT1 (RC_POOLCOLL_REGISTER_BEGIN+ 26) + +// tables index +#define STR_POOLCOLL_TOX_TABLESH (RC_POOLCOLL_REGISTER_BEGIN+ 27) +#define STR_POOLCOLL_TOX_TABLES1 (RC_POOLCOLL_REGISTER_BEGIN+ 28) + +// index of authorities +#define STR_POOLCOLL_TOX_AUTHORITIESH (RC_POOLCOLL_REGISTER_BEGIN+ 29) +#define STR_POOLCOLL_TOX_AUTHORITIES1 (RC_POOLCOLL_REGISTER_BEGIN+ 30) + + // Untergruppe Benutzer-Verzeichnisse mehr Ebenen 5 - 10 +#define STR_POOLCOLL_TOX_USER6 (RC_POOLCOLL_REGISTER_BEGIN+ 31) +#define STR_POOLCOLL_TOX_USER7 (RC_POOLCOLL_REGISTER_BEGIN+ 32) +#define STR_POOLCOLL_TOX_USER8 (RC_POOLCOLL_REGISTER_BEGIN+ 33) +#define STR_POOLCOLL_TOX_USER9 (RC_POOLCOLL_REGISTER_BEGIN+ 34) +#define STR_POOLCOLL_TOX_USER10 (RC_POOLCOLL_REGISTER_BEGIN+ 35) + + +// Gruppe Kapitel/Dokument +#define STR_POOLCOLL_DOC_TITEL (RC_POOLCOLL_DOC_BEGIN+ 0) +#define STR_POOLCOLL_DOC_SUBTITEL (RC_POOLCOLL_DOC_BEGIN+ 1) + +// Gruppe HTML-Vorlagen +#define STR_POOLCOLL_HTML_BLOCKQUOTE (RC_POOLCOLL_HTML_BEGIN+ 0) +#define STR_POOLCOLL_HTML_PRE (RC_POOLCOLL_HTML_BEGIN+ 1) +#define STR_POOLCOLL_HTML_HR (RC_POOLCOLL_HTML_BEGIN+ 2) +#define STR_POOLCOLL_HTML_DD (RC_POOLCOLL_HTML_BEGIN+ 3) +#define STR_POOLCOLL_HTML_DT (RC_POOLCOLL_HTML_BEGIN+ 4) + +//----------------- +// Page styles +//----------------- +#define STR_POOLPAGE_STANDARD (RC_POOLPAGEDESC_BEGIN+ 0) +#define STR_POOLPAGE_FIRST (RC_POOLPAGEDESC_BEGIN+ 1) +#define STR_POOLPAGE_LEFT (RC_POOLPAGEDESC_BEGIN+ 2) +#define STR_POOLPAGE_RIGHT (RC_POOLPAGEDESC_BEGIN+ 3) +#define STR_POOLPAGE_JAKET (RC_POOLPAGEDESC_BEGIN+ 4) +#define STR_POOLPAGE_REGISTER (RC_POOLPAGEDESC_BEGIN+ 5) +#define STR_POOLPAGE_HTML (RC_POOLPAGEDESC_BEGIN+ 6) +#define STR_POOLPAGE_FOOTNOTE (RC_POOLPAGEDESC_BEGIN+ 7) +#define STR_POOLPAGE_ENDNOTE (RC_POOLPAGEDESC_BEGIN+ 8) + +//----------------- +// Numbering styles +//----------------- +#define STR_POOLNUMRULE_NUM1 (RC_POOLNUMRULE_BEGIN+ 0) +#define STR_POOLNUMRULE_NUM2 (RC_POOLNUMRULE_BEGIN+ 1) +#define STR_POOLNUMRULE_NUM3 (RC_POOLNUMRULE_BEGIN+ 2) +#define STR_POOLNUMRULE_NUM4 (RC_POOLNUMRULE_BEGIN+ 3) +#define STR_POOLNUMRULE_NUM5 (RC_POOLNUMRULE_BEGIN+ 4) +#define STR_POOLNUMRULE_BUL1 (RC_POOLNUMRULE_BEGIN+ 5) +#define STR_POOLNUMRULE_BUL2 (RC_POOLNUMRULE_BEGIN+ 6) +#define STR_POOLNUMRULE_BUL3 (RC_POOLNUMRULE_BEGIN+ 7) +#define STR_POOLNUMRULE_BUL4 (RC_POOLNUMRULE_BEGIN+ 8) +#define STR_POOLNUMRULE_BUL5 (RC_POOLNUMRULE_BEGIN+ 9) + +#endif diff --git a/inc/bf_sw/poolfmt.hxx b/inc/bf_sw/poolfmt.hxx new file mode 100644 index 000000000..37fa2a67b --- /dev/null +++ b/inc/bf_sw/poolfmt.hxx @@ -0,0 +1,432 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _POOLFMT_HXX +#define _POOLFMT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <limits.h> + +#include <bf_svx/frmdir.hxx> +namespace binfilter { + +// POOLCOLL-IDs: +// +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ +// !User! Bereich ! 0 ! Offset ! +// +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ +// +// Bereich: 1 - Text +// 2 - Listen +// 3 - Sonderbereiche +// 4 - Verzeichnisse +// 5 - Kapitel / Dokument +// 6 - HTML-Vorlagen + +// Andere IDs: +// +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ +// !User! Bereich ! 1 ! Offset ! +// +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ +// Bereich: 0 - Zeichenvorlagen +// 1 - Frame-Vorlagen +// 2 - Seitenvorlagen +// 3 - Absatzformate (?) +// 4 - Grafikformate (?) + +// F�r alle IDs gilt: +// Herkunft: 0 -Pool +// 1 -Benutzer +// Offset: innerhalb der Gruppe + + +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// +// ACHTUNG: neue ID's koennen nur noch am Ende der jeweiligen Gruppe +// zugefuegt werden. Diese Id's werden vom Reader/Writer ge- +// lesen und geschrieben. Diese kennen nur den Offset zum Start +// +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +// Maske fuer Erkennung von COLLPOOL-Ids: + +const USHORT POOLGRP_NOCOLLID = (1 << 10); + +// POLLCOLL-Gruppen: + +const USHORT USER_FMT = (1 << 15); +const USHORT POOL_FMT = (0 << 15); + +const USHORT COLL_TEXT_BITS = (1 << 11); +const USHORT COLL_LISTS_BITS = (2 << 11); +const USHORT COLL_EXTRA_BITS = (3 << 11); +const USHORT COLL_REGISTER_BITS = (4 << 11); +const USHORT COLL_DOC_BITS = (5 << 11); +const USHORT COLL_HTML_BITS = (6 << 11); +const USHORT COLL_GET_RANGE_BITS = (15 << 11); + +// Sonstige Gruppen: + +const USHORT POOLGRP_CHARFMT = (0 << 11) + POOLGRP_NOCOLLID; +const USHORT POOLGRP_FRAMEFMT = (1 << 11) + POOLGRP_NOCOLLID; +const USHORT POOLGRP_PAGEDESC = (2 << 11) + POOLGRP_NOCOLLID; +const USHORT POOLGRP_NUMRULE = (3 << 11) + POOLGRP_NOCOLLID; +//const USHORT POOLGRP_GRFFMT = (4 << 11) + POOLGRP_NOCOLLID; // ? + +// fuer Erkennung ob Benutzer-Vorlage oder nicht: +const USHORT POOL_IDUSER_FMT = + USHRT_MAX & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID); + +inline BOOL IsPoolUserFmt( USHORT nId ) +{ + return POOL_IDUSER_FMT == + (nId & ~(COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID)) + ? TRUE : FALSE; +} + + +// ID-s fuer die Bereiche +enum RES_POOLFMT +{ +RES_POOLFMT_BEGIN = 1, // HIER GEHT'S LOS !!! +RES_POOL_CHRFMT = RES_POOLFMT_BEGIN, +RES_POOL_FRMFMT, +RES_POOL_TXTCOLL, +RES_POOL_PAGEFMT, + +RES_POOL_PARFMT, // ??? +RES_POOL_GRFFMT, // ??? +RES_POOLFMT_END +}; + +// Bereiche fuer die Id's der einzelnen Formate + +// die Id's fuer die Zeichen-Vorlagen +enum RES_POOL_CHRFMT_TYPE +{ +RES_POOLCHR_BEGIN = POOLGRP_CHARFMT, +RES_POOLCHR_NORMAL_BEGIN = POOLGRP_CHARFMT, + +RES_POOLCHR_FOOTNOTE = RES_POOLCHR_NORMAL_BEGIN, // Fussnote +RES_POOLCHR_PAGENO, // Seiten/Feld +RES_POOLCHR_LABEL, // Beschriftung +RES_POOLCHR_DROPCAPS, // Initialienzeichen +RES_POOLCHR_NUM_LEVEL, // Nummerierungszeichen +RES_POOLCHR_BUL_LEVEL, // Aufzaehlungszeichen + +RES_POOLCHR_INET_NORMAL, // Internet normal +RES_POOLCHR_INET_VISIT, // Internet besucht +RES_POOLCHR_JUMPEDIT, // Platzhalter +RES_POOLCHR_TOXJUMP, // Sprung aus Verzeichnis +RES_POOLCHR_ENDNOTE, // Endnote +RES_POOLCHR_LINENUM, // Zeilennummerierung +RES_POOLCHR_IDX_MAIN_ENTRY, // main entry in indexes +RES_POOLCHR_FOOTNOTE_ANCHOR, // Fussnotenanker +RES_POOLCHR_ENDNOTE_ANCHOR, // Endnotenanker +RES_POOLCHR_RUBYTEXT, // Rubytext +RES_POOLCHR_VERT_NUM, // Vertical numbering symbols + +RES_POOLCHR_NORMAL_END, + +RES_POOLCHR_HTML_BEGIN = RES_POOLCHR_BEGIN + 50, // HTML-Vorlagen +RES_POOLCHR_HTML_EMPHASIS= RES_POOLCHR_HTML_BEGIN, +RES_POOLCHR_HTML_CITIATION, +RES_POOLCHR_HTML_STRONG, +RES_POOLCHR_HTML_CODE, +RES_POOLCHR_HTML_SAMPLE, +RES_POOLCHR_HTML_KEYBOARD, +RES_POOLCHR_HTML_VARIABLE, +RES_POOLCHR_HTML_DEFINSTANCE, +RES_POOLCHR_HTML_TELETYPE, +RES_POOLCHR_HTML_END, + +RES_POOLCHR_END = RES_POOLCHR_HTML_END +}; + + +// die Id's fuer die Rahmen-Vorlagen +enum RES_POOL_FRMFMT_TYPE +{ +RES_POOLFRM_BEGIN = POOLGRP_FRAMEFMT, + +RES_POOLFRM_FRAME = RES_POOLFRM_BEGIN, // Rahmen +RES_POOLFRM_GRAPHIC, // Graphic +RES_POOLFRM_OLE, // OLE +RES_POOLFRM_FORMEL, // Formeln +RES_POOLFRM_MARGINAL, // Marginalen +RES_POOLFRM_WATERSIGN, // Wasserzeichen +RES_POOLFRM_LABEL, // Etikette + +RES_POOLFRM_END +}; + +// die Id's fuer die Seiten-Vorlagen +enum RES_POOL_PAGEFMT_TYPE +{ +RES_POOLPAGE_BEGIN = POOLGRP_PAGEDESC, + +RES_POOLPAGE_STANDARD = RES_POOLPAGE_BEGIN, // Standard-Seite +RES_POOLPAGE_FIRST, // Erste Seite +RES_POOLPAGE_LEFT, // Linke Seite +RES_POOLPAGE_RIGHT, // Rechte Seite +RES_POOLPAGE_JAKET, // Umschlag +RES_POOLPAGE_REGISTER, // Verzeichnis +RES_POOLPAGE_HTML, // HTML +RES_POOLPAGE_FOOTNOTE, // Fussnote bei Dokumentende +RES_POOLPAGE_ENDNOTE, // Endnotensseite + +RES_POOLPAGE_END +}; + +// die Id's fuer die NumRule-Vorlagen +enum RES_POOL_NUMRULE_TYPE +{ +RES_POOLNUMRULE_BEGIN = POOLGRP_NUMRULE, +RES_POOLNUMRULE_NUM1 = RES_POOLNUMRULE_BEGIN, // NumRule Numerierung 1 +RES_POOLNUMRULE_NUM2, // NumRule Numerierung 2 +RES_POOLNUMRULE_NUM3, // NumRule Numerierung 3 +RES_POOLNUMRULE_NUM4, // NumRule Numerierung 4 +RES_POOLNUMRULE_NUM5, // NumRule Numerierung 5 +RES_POOLNUMRULE_BUL1, // NumRule Bullets 1 +RES_POOLNUMRULE_BUL2, // NumRule Bullets 2 +RES_POOLNUMRULE_BUL3, // NumRule Bullets 3 +RES_POOLNUMRULE_BUL4, // NumRule Bullets 4 +RES_POOLNUMRULE_BUL5, // NumRule Bullets 5 +RES_POOLNUMRULE_END +}; + +// die Id's fuer die Absatz-Vorlagen +enum RES_POOL_COLLFMT_TYPE +{ +// Gruppe Text +RES_POOLCOLL_TEXT_BEGIN = COLL_TEXT_BITS, + +RES_POOLCOLL_STANDARD = RES_POOLCOLL_TEXT_BEGIN, // Standard +RES_POOLCOLL_TEXT, // Textkoerper +RES_POOLCOLL_TEXT_IDENT, // Textkoerper Einzug +RES_POOLCOLL_TEXT_NEGIDENT, // Textkoerper neg. Einzug +RES_POOLCOLL_TEXT_MOVE, // Textkoerper Einrueckung +RES_POOLCOLL_GREETING, // Grussformel +RES_POOLCOLL_SIGNATURE, // Unterschrift +RES_POOLCOLL_CONFRONTATION, // Gegenueberstellung +RES_POOLCOLL_MARGINAL, // Marginalie + + // Untergruppierung Ueberschriften +RES_POOLCOLL_HEADLINE_BASE, // Basis-Ueberschrift +RES_POOLCOLL_HEADLINE1, // Ueberschrift 1 +RES_POOLCOLL_HEADLINE2, // Ueberschrift 2 +RES_POOLCOLL_HEADLINE3, // Ueberschrift 3 +RES_POOLCOLL_HEADLINE4, // Ueberschrift 4 +RES_POOLCOLL_HEADLINE5, // Ueberschrift 5 +RES_POOLCOLL_HEADLINE6, // Ueberschrift 6 +RES_POOLCOLL_HEADLINE7, // Ueberschrift 7 +RES_POOLCOLL_HEADLINE8, // Ueberschrift 8 +RES_POOLCOLL_HEADLINE9, // Ueberschrift 9 +RES_POOLCOLL_HEADLINE10, // Ueberschrift 10 + +RES_POOLCOLL_TEXT_END, + + +// Gruppe Listen +RES_POOLCOLL_LISTS_BEGIN = COLL_LISTS_BITS, + +RES_POOLCOLL_NUMBUL_BASE = RES_POOLCOLL_LISTS_BEGIN, // Basis-Liste + + // Untergruppe Nummerierung +RES_POOLCOLL_NUM_LEVEL1S, // Start Level1 +RES_POOLCOLL_NUM_LEVEL1, // 1. Level +RES_POOLCOLL_NUM_LEVEL1E, // Ende Level1 +RES_POOLCOLL_NUM_NONUM1, // keine Nummerierung +RES_POOLCOLL_NUM_LEVEL2S, // Start 2. Level +RES_POOLCOLL_NUM_LEVEL2, // 2. Level +RES_POOLCOLL_NUM_LEVEL2E, // Ende 2. Level +RES_POOLCOLL_NUM_NONUM2, // keine Nummerierung +RES_POOLCOLL_NUM_LEVEL3S, // Start 3. Level +RES_POOLCOLL_NUM_LEVEL3, // 3. Level +RES_POOLCOLL_NUM_LEVEL3E, // Ende 3. Level +RES_POOLCOLL_NUM_NONUM3, // keine Nummerierung +RES_POOLCOLL_NUM_LEVEL4S, // Start 4. Level +RES_POOLCOLL_NUM_LEVEL4, // 4. Level +RES_POOLCOLL_NUM_LEVEL4E, // Ende 4. Level +RES_POOLCOLL_NUM_NONUM4, // keine Nummerierung +RES_POOLCOLL_NUM_LEVEL5S, // Start 5. Level +RES_POOLCOLL_NUM_LEVEL5, // 5. Level +RES_POOLCOLL_NUM_LEVEL5E, // Ende 5. Level +RES_POOLCOLL_NUM_NONUM5, // keine Nummerierung + + // Untergruppe Aufzaehlung +RES_POOLCOLL_BUL_LEVEL1S, // Start Level1 +RES_POOLCOLL_BUL_LEVEL1, // 1. Level +RES_POOLCOLL_BUL_LEVEL1E, // Ende Level1 +RES_POOLCOLL_BUL_NONUM1, // keine Nummerierung +RES_POOLCOLL_BUL_LEVEL2S, // Start 2. Level +RES_POOLCOLL_BUL_LEVEL2, // 2. Level +RES_POOLCOLL_BUL_LEVEL2E, // Ende 2. Level +RES_POOLCOLL_BUL_NONUM2, // keine Nummerierung +RES_POOLCOLL_BUL_LEVEL3S, // Start 3. Level +RES_POOLCOLL_BUL_LEVEL3, // 3. Level +RES_POOLCOLL_BUL_LEVEL3E, // Ende 3. Level +RES_POOLCOLL_BUL_NONUM3, // keine Nummerierung +RES_POOLCOLL_BUL_LEVEL4S, // Start 4. Level +RES_POOLCOLL_BUL_LEVEL4, // 4. Level +RES_POOLCOLL_BUL_LEVEL4E, // Ende 4. Level +RES_POOLCOLL_BUL_NONUM4, // keine Nummerierung +RES_POOLCOLL_BUL_LEVEL5S, // Start 5. Level +RES_POOLCOLL_BUL_LEVEL5, // 5. Level +RES_POOLCOLL_BUL_LEVEL5E, // Ende 5. Level +RES_POOLCOLL_BUL_NONUM5, // keine Nummerierung + +RES_POOLCOLL_LISTS_END, + + +// Sonderbereiche +RES_POOLCOLL_EXTRA_BEGIN = COLL_EXTRA_BITS, + + // Untergruppe Header +RES_POOLCOLL_HEADER = RES_POOLCOLL_EXTRA_BEGIN, // Header Left&Right +RES_POOLCOLL_HEADERL, // Header Left +RES_POOLCOLL_HEADERR, // Header Right + + // Untergruppe Footer +RES_POOLCOLL_FOOTER, // Footer Left&Right +RES_POOLCOLL_FOOTERL, // Footer Left +RES_POOLCOLL_FOOTERR, // Footer Right + + // Untergruppe Tabelle +RES_POOLCOLL_TABLE, // Tabelle "Inhalt" +RES_POOLCOLL_TABLE_HDLN, // Tabellen-Headline + + + // Untergruppe Beschriftung +RES_POOLCOLL_LABEL, // Beschriftung-Basis +RES_POOLCOLL_LABEL_ABB, // Beschriftung-Abbildung +RES_POOLCOLL_LABEL_TABLE, // Beschriftung-Tabelle +RES_POOLCOLL_LABEL_FRAME, // Beschriftung-Rahmen + + // sonstiges +RES_POOLCOLL_FRAME, // Rahmen +RES_POOLCOLL_FOOTNOTE, // Fussnoten +RES_POOLCOLL_JAKETADRESS, // UmschlagAdresse +RES_POOLCOLL_SENDADRESS, // AbsenderAdresse +RES_POOLCOLL_ENDNOTE, // Endnoten + +RES_POOLCOLL_LABEL_DRAWING, // Beschriftung-Zeichen-Objekte +RES_POOLCOLL_EXTRA_END, + + +// Gruppe Verzeichnisse +RES_POOLCOLL_REGISTER_BEGIN = COLL_REGISTER_BITS, + +RES_POOLCOLL_REGISTER_BASE = RES_POOLCOLL_REGISTER_BEGIN, // Basis-Verzeichnis + + // Untergruppe Index-Verzeichnisse +RES_POOLCOLL_TOX_IDXH, // Header +RES_POOLCOLL_TOX_IDX1, // 1. Ebene +RES_POOLCOLL_TOX_IDX2, // 2. Ebene +RES_POOLCOLL_TOX_IDX3, // 3. Ebene +RES_POOLCOLL_TOX_IDXBREAK, // Trenner + + // Untergruppe Inhalts-Verzeichnisse +RES_POOLCOLL_TOX_CNTNTH, // Header +RES_POOLCOLL_TOX_CNTNT1, // 1. Ebene +RES_POOLCOLL_TOX_CNTNT2, // 2. Ebene +RES_POOLCOLL_TOX_CNTNT3, // 3. Ebene +RES_POOLCOLL_TOX_CNTNT4, // 4. Ebene +RES_POOLCOLL_TOX_CNTNT5, // 5. Ebene + + // Untergruppe Benutzer-Verzeichnisse: +RES_POOLCOLL_TOX_USERH, // Header +RES_POOLCOLL_TOX_USER1, // 1. Ebene +RES_POOLCOLL_TOX_USER2, // 2. Ebene +RES_POOLCOLL_TOX_USER3, // 3. Ebene +RES_POOLCOLL_TOX_USER4, // 4. Ebene +RES_POOLCOLL_TOX_USER5, // 5. Ebene + + +RES_POOLCOLL_TOX_CNTNT6, // Inhalt 6. Ebene +RES_POOLCOLL_TOX_CNTNT7, // Inhalt 7. Ebene +RES_POOLCOLL_TOX_CNTNT8, // Inhalt 8. Ebene +RES_POOLCOLL_TOX_CNTNT9, // Inhalt 9. Ebene +RES_POOLCOLL_TOX_CNTNT10, // Inhalt 10. Ebene + +// illustrations index +RES_POOLCOLL_TOX_ILLUSH, // illustrations header +RES_POOLCOLL_TOX_ILLUS1, // illustrations all levels + +// object index +RES_POOLCOLL_TOX_OBJECTH, // objects header +RES_POOLCOLL_TOX_OBJECT1, // objects all levels + +// tables index +RES_POOLCOLL_TOX_TABLESH, // tables header +RES_POOLCOLL_TOX_TABLES1, // tables all levels + +// index of authorities +RES_POOLCOLL_TOX_AUTHORITIESH, // authorities header +RES_POOLCOLL_TOX_AUTHORITIES1, // authorities all levels + +// user index 6..10 +RES_POOLCOLL_TOX_USER6, // level 6 +RES_POOLCOLL_TOX_USER7, // level 7 +RES_POOLCOLL_TOX_USER8, // level 8 +RES_POOLCOLL_TOX_USER9, // level 9 +RES_POOLCOLL_TOX_USER10, // level 10 + +RES_POOLCOLL_REGISTER_END, + + +// Gruppe Kapitel/Dokument +RES_POOLCOLL_DOC_BEGIN = COLL_DOC_BITS, + +RES_POOLCOLL_DOC_TITEL = RES_POOLCOLL_DOC_BEGIN, // Doc. Titel +RES_POOLCOLL_DOC_SUBTITEL, // Doc. UnterTitel + +RES_POOLCOLL_DOC_END, + +// Gruppe HTML-Vorlagen +RES_POOLCOLL_HTML_BEGIN = COLL_HTML_BITS, + +RES_POOLCOLL_HTML_BLOCKQUOTE = RES_POOLCOLL_HTML_BEGIN, +RES_POOLCOLL_HTML_PRE, +RES_POOLCOLL_HTML_HR, +RES_POOLCOLL_HTML_DD, +RES_POOLCOLL_HTML_DT, + +RES_POOLCOLL_HTML_END + +// Ende der Textformat-Vorlagen Sammlung +}; + + + +// erfrage den definierten Parent zu einer POOL-Id +// returnt: 0 -> Standard +// USHRT_MAX -> kein Parent +// sonst -> den Parent +USHORT GetPoolParent( USHORT nId ); + +SvxFrameDirection GetDefaultFrameDirection(ULONG nLanguage); + +inline BOOL IsConditionalByPoolId(USHORT nId) + { + return RES_POOLCOLL_TEXT == nId; + } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/printdata.hxx b/inc/bf_sw/printdata.hxx new file mode 100644 index 000000000..6f62b9eb7 --- /dev/null +++ b/inc/bf_sw/printdata.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SW_PRINTDATA_HXX +#define _SW_PRINTDATA_HXX + + +#include <sal/types.h> +#include "rtl/ustring.hxx" +namespace binfilter { + +struct SwPrintData +{ + sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground, + bPrintBlackFont, bPrintLeftPage, bPrintRightPage, bPrintReverse, bPrintProspect, + bPrintSingleJobs, bPaperFromSetup, bModified; + + sal_Int16 nPrintPostIts; + ::rtl::OUString sFaxName; + + SwPrintData() + { + bPrintGraphic = + bPrintTable = + bPrintDraw = + bPrintControl = + bPrintLeftPage = + bPrintRightPage = + bPrintPageBackground = sal_True; + + bPaperFromSetup = + bPrintReverse = + bPrintProspect = + bPrintSingleJobs = + bModified = + bPrintBlackFont = sal_False; + + nPrintPostIts = 0; + } + + virtual ~SwPrintData() {} + + sal_Bool operator==(const SwPrintData& rData)const + { + return + bPrintGraphic == rData.bPrintGraphic && + bPrintTable == rData.bPrintTable && + bPrintDraw == rData.bPrintDraw && + bPrintControl == rData.bPrintControl && + bPrintPageBackground== rData.bPrintPageBackground&& + bPrintBlackFont == rData.bPrintBlackFont && + bPrintLeftPage == rData.bPrintLeftPage && + bPrintRightPage == rData.bPrintRightPage && + bPrintReverse == rData.bPrintReverse && + bPrintProspect == rData.bPrintProspect && + bPrintSingleJobs == rData.bPrintSingleJobs && + bPaperFromSetup == rData.bPaperFromSetup && + nPrintPostIts == rData.nPrintPostIts && + sFaxName == rData.sFaxName; + } + sal_Bool IsPrintGraphic() const { return bPrintGraphic; } + sal_Bool IsPrintTable() const { return bPrintTable; } + sal_Bool IsPrintDraw() const { return bPrintDraw; } + sal_Bool IsPrintControl() const { return bPrintControl; } + sal_Bool IsPrintLeftPage() const { return bPrintLeftPage; } + sal_Bool IsPrintRightPage() const { return bPrintRightPage; } + sal_Bool IsPrintReverse() const { return bPrintReverse; } + sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } + sal_Bool IsPrintProspect() const { return bPrintProspect; } + sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } + sal_Bool IsPrintBlackFont() const { return bPrintBlackFont;} + sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs;} + sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } + const ::rtl::OUString GetFaxName() const{return sFaxName;} + + void SetPrintGraphic ( sal_Bool b ) { doSetModified(); bPrintGraphic = b;} + void SetPrintTable ( sal_Bool b ) { doSetModified(); bPrintTable = b;} + void SetPrintDraw ( sal_Bool b ) { doSetModified(); bPrintDraw = b;} + void SetPrintControl ( sal_Bool b ) { doSetModified(); bPrintControl = b; } + void SetPrintLeftPage ( sal_Bool b ) { doSetModified(); bPrintLeftPage = b;} + void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPage = b;} + void SetPrintReverse ( sal_Bool b ) { doSetModified(); bPrintReverse = b;} + void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b;} + void SetPrintPostIts ( sal_Int16 n){ doSetModified(); nPrintPostIts = n; } + void SetPrintProspect ( sal_Bool b ) { doSetModified(); bPrintProspect = b; } + void SetPrintPageBackground(sal_Bool b){ doSetModified(); bPrintPageBackground = b;} + void SetPrintBlackFont(sal_Bool b){ doSetModified(); bPrintBlackFont = b;} + void SetPrintSingleJobs(sal_Bool b){ doSetModified(); bPrintSingleJobs = b;} + void SetFaxName(const ::rtl::OUString& rSet){sFaxName = rSet;} + virtual void doSetModified () { bModified = sal_True;} + sal_Bool WasModified () { return bModified; } +}; + +} //namespace binfilter +#endif //_SW_PRINTDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/pvprtdat.hxx b/inc/bf_sw/pvprtdat.hxx new file mode 100644 index 000000000..01f872c86 --- /dev/null +++ b/inc/bf_sw/pvprtdat.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _PVPRTDAT_HXX +#define _PVPRTDAT_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { + +class SwPagePreViewPrtData +{ + ULONG nLeftSpace, nRightSpace, nTopSpace, nBottomSpace, + nHorzSpace, nVertSpace; + BYTE nRow, nCol; + BOOL bLandscape : 1; + BOOL bStretch : 1; +public: + SwPagePreViewPrtData() + : nLeftSpace(0), nRightSpace(0), nTopSpace(0), nBottomSpace(0), + nHorzSpace(0), nVertSpace(0), nRow(1), nCol(1), + bLandscape(0),bStretch(0) + {} + + ULONG GetLeftSpace() const { return nLeftSpace; } + void SetLeftSpace( ULONG n ) { nLeftSpace = n; } + + ULONG GetRightSpace() const { return nRightSpace; } + void SetRightSpace( ULONG n ) { nRightSpace = n; } + + ULONG GetTopSpace() const { return nTopSpace; } + void SetTopSpace( ULONG n ) { nTopSpace = n; } + + ULONG GetBottomSpace() const { return nBottomSpace; } + void SetBottomSpace( ULONG n ) { nBottomSpace = n; } + + ULONG GetHorzSpace() const { return nHorzSpace; } + void SetHorzSpace( ULONG n ) { nHorzSpace = n; } + + ULONG GetVertSpace() const { return nVertSpace; } + void SetVertSpace( ULONG n ) { nVertSpace = n; } + + BYTE GetRow() const { return nRow; } + void SetRow(BYTE n ) { nRow = n; } + + BYTE GetCol() const { return nCol; } + void SetCol( BYTE n ) { nCol = n; } + + BOOL GetLandscape() const { return bLandscape; } + void SetLandscape( BOOL b ) { bLandscape = b; } + + // JP 19.08.98: wird zur Zeit nicht ausgewertet, weil der Font sich + // nicht enstprechend stretch laesst. + BOOL GetStretch() const { return bStretch; } + void SetStretch( BOOL b ) { bStretch = b; } +}; + + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/rcid.hrc b/inc/bf_sw/rcid.hrc new file mode 100644 index 000000000..ede6b4426 --- /dev/null +++ b/inc/bf_sw/rcid.hrc @@ -0,0 +1,242 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _RDIC_HRC +#define _RDIC_HRC + +#ifndef _SFXSIDS_HRC //autogen +#include <bf_sfx2/sfxsids.hrc> +#endif + +#define IMAGE_MASK_COLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +// ---------------------------------------------------------------- +// Bereiche fuer die UI-Verzeichnisse +// ---------------------------------------------------------------- + +#define RC_BASE RID_SW_START // aus solar.hrc + +#define RC_APP RC_BASE +#define RC_DIALOG (RC_BASE + 200) +#define RC_DOCVW (RC_BASE + 300) +#define RC_WEB (RC_BASE + 400) +#define RC_GLOBDOC (RC_BASE + 500) +#define RC_VIEW (RC_BASE + 600) +#define RC_CHRDLG (RC_BASE + 700) +#define RC_RIBBAR (RC_BASE + 720) +#define RC_GLOBALS (RC_BASE + 800) +#define RC_FMTUI (RC_BASE + 920) +#define RC_FRMDLG (RC_BASE + 1000) +#define RC_FLDDLG (RC_BASE + 1100) +#define RC_UTLUI (RC_BASE + 1250) +#define RC_ATTR (RC_BASE + 1350) +#define RC_TABLE (RC_BASE + 1450) +#define RC_CONFIG (RC_BASE + 1550) +#define RC_MISC (RC_BASE + 1650) +#define RC_WRTSH (RC_BASE + 1750) +#define RC_INDEX (RC_BASE + 1950) +#define RC_DBUI (RC_BASE + 2050) +#define RC_DOCHDL (RC_BASE + 2150) +#define RC_POOLCHRFMT (RC_BASE + 2250) +#define RC_POOLHTMLCHRFMT (RC_BASE + 2290) +#define RC_POOLFRMFMT (RC_BASE + 2330) +#define RC_POOLTXTCOLL (RC_BASE + 2360) +#define RC_POOLPAGEDESC (RC_BASE + 2550) +#define RC_POOLNUMRULE (RC_BASE + 2650) +#define RC_ENVELP (RC_BASE + 2750) +#define RC_STATLIN_STR (RC_BASE + 2850) +#define RC_COMMON_CORE (RC_BASE + 2950) +#define RC_WIZARD (RC_BASE + 3050) +#define RC_POPUPS (RC_BASE + 3150) +#define RC_SHELLS (RC_BASE + 3250) +#define RC_CFGITEMS (RC_BASE + 3350) +#define RC_LINGU (RC_BASE + 3450) +#define RC_ACCESS (RC_BASE + 3550) + +/*-------------------------------------------------------------------- + Beschreibung: Bereiche ausspannen + --------------------------------------------------------------------*/ + +// App-Verzeichnis +#define RC_APP_BEGIN RC_APP +#define RC_APP_END (RC_APP_BEGIN + 199) + + + +// Dialog-Verzeichnis +#define RC_DIALOG_BEGIN RC_DIALOG +#define RC_DIALOG_END (RC_DIALOG_BEGIN + 99) + +// Editwin & Co +#define RC_DOCVW_BEGIN RC_DOCVW +#define RC_DOCVW_END (RC_DOCVW_BEGIN + 99) + +// SW/Web +#define RC_WEB_BEGIN RC_WEB +#define RC_WEB_END (RC_WEB_BEGIN + 199) + +//Globaldocument +#define RC_GLOBDOC_BEGIN RC_GLOBDOC +#define RC_GLOBDOC_END (RC_GLOBDOC_BEGIN + 99) + +// UI-View +#define RC_VIEW_BEGIN RC_VIEW +#define RC_VIEW_END (RC_VIEW_BEGIN + 99) + +// Zeichen Absatz Tab-Dialog +#define RC_CHRDLG_BEGIN RC_CHRDLG +#define RC_CHRDLG_END (RC_CHRDLG_BEGIN + 9) + +// Unsere Shell +#define RC_WRTSH_BEGIN RC_WRTSH +#define RC_WRTSH_END (RC_WRTSH_BEGIN + 199) + +// Verzeichnisse +#define RC_INDEX_BEGIN RC_INDEX +#define RC_INDEX_END (RC_INDEX + 99) + +// +#define RC_RIBBAR_BEGIN RC_RIBBAR +#define RC_RIBBAR_END (RC_RIBBAR_BEGIN + 79) + +// globale Ressourcen +#define RC_GLOBALS_BEGIN RC_GLOBALS +#define RC_GLOBALS_END (RC_GLOBALS_BEGIN + 119) + +// Format-Vorlagen +#define RC_FMTUI_BEGIN RC_FMTUI +#define RC_FMTUI_END (RC_FMTUI_BEGIN + 69) + + +// Grafik Dialoge +#define RC_GRFDLG_BEGIN RC_GRFDLG +#define RC_GRFDLG_END (RC_GRFDLG_BEGIN + 99) + +// ???? +#define RC_FSTDLG_BEGIN RC_FSTDLG +#define RC_FSTDLG_END (RC_FSTDLG_BEGIN + 99) + +// Rahmen Dialoge +#define RC_FRMDLG_BEGIN RC_FRMDLG +#define RC_FRMDLG_END (RC_FRMDLG_BEGIN + 99) + +// Feld Dialoge +#define RC_FLDDLG_BEGIN RC_FLDDLG +#define RC_FLDDLG_END (RC_FLDDLG_BEGIN + 149) + +// Utilities UI +#define RC_UTLUI_BEGIN RC_UTLUI +#define RC_UTLUI_END (RC_UTLUI + 99) + +// Utilities UI-Attribute +#define RC_ATTR_BEGIN RC_ATTR +#define RC_ATTR_END (RC_ATTR + 99) + +// Tabellen +#define RC_TABLE_BEGIN RC_TABLE +#define RC_TABLE_END (RC_TABLE + 99) + +// Konfiguration +#define RC_CONFIG_BEGIN RC_CONFIG +#define RC_CONFIG_END (RC_CONFIG + 99) + + +// Verschiedenes +#define RC_MISC_BEGIN RC_MISC +#define RC_MISC_END (RC_MISC + 99) + +// DBMgr +#define RC_DBUI_BEGIN RC_DBUI +#define RC_DBUI_END (RC_DBUI + 99) + +// Der Rest der Imp-Klassen +#define RC_DOCHDL_BEGIN RC_DOCHDL +#define RC_DOCHDL_END (RC_DOCHDL + 99) + +// Zeichenvorlagen +#define RC_POOLCHRFMT_BEGIN RC_POOLCHRFMT +#define RC_POOLCHRFMT_END (RC_POOLCHRFMT + 29) +#define RC_POOLCHRFMT_HTML_BEGIN RC_POOLHTMLCHRFMT +#define RC_POOLCHRFMT_HTML_END (RC_POOLHTMLCHRFMT+ 30) + + +// Rahmenvorlagen +#define RC_POOLFRMFMT_BEGIN RC_POOLFRMFMT +#define RC_POOLFRMFMT_END (RC_POOLFRMFMT + 20) + +// Collections +#define RC_POOLTXTCOLL_BEGIN RC_POOLTXTCOLL + +#define RC_POOLCOLL_TEXT_BEGIN RC_POOLTXTCOLL +#define RC_POOLCOLL_TEXT_END (RC_POOLTXTCOLL + 19) +#define RC_POOLCOLL_LISTS_BEGIN (RC_POOLTXTCOLL + 20) +#define RC_POOLCOLL_LISTS_END (RC_POOLTXTCOLL + 69) +#define RC_POOLCOLL_EXTRA_BEGIN (RC_POOLTXTCOLL + 70) +#define RC_POOLCOLL_EXTRA_END (RC_POOLTXTCOLL + 89) +#define RC_POOLCOLL_REGISTER_BEGIN (RC_POOLTXTCOLL + 90) +#define RC_POOLCOLL_REGISTER_END (RC_POOLTXTCOLL + 119) +#define RC_POOLCOLL_DOC_BEGIN (RC_POOLTXTCOLL + 130) +#define RC_POOLCOLL_DOC_END (RC_POOLTXTCOLL + 139) +#define RC_POOLCOLL_HTML_BEGIN (RC_POOLTXTCOLL + 140) +#define RC_POOLCOLL_HTML_END (RC_POOLTXTCOLL + 169) + +#define RC_POOLTXTCOLL_END RC_POOLCOLL_HTML_END + +// Poolvorlagen Seite +#define RC_POOLPAGEDESC_BEGIN RC_POOLPAGEDESC +#define RC_POOLPAGEDESC_END (RC_POOLPAGEDESC + 10) + +// Poolvorlagen Numerierung +#define RC_POOLNUMRULE_BEGIN RC_POOLNUMRULE +#define RC_POOLNUMRULE_END (RC_POOLNUMRULE + 10) + +// Envelp-Verzeichnis +#define RC_ENVELP_BEGIN (RC_ENVELP ) +#define RC_ENVELP_END (RC_ENVELP + 99) + +// Statuszeile mit Laufbalken +#define RC_STATLIN_STR_BEGIN (RC_STATLIN_STR) +#define RC_STATLIN_STR_END (RC_STATLIN_STR + 49) + +// Gemeinsame Core-Strings +#define RC_COMCORE_BEGIN (RC_COMMON_CORE) +#define RC_COMCORE_END (RC_COMMON_CORE + 49) + +// Wizzards +#define RC_WIZARD_BEGIN RC_WIZARD +#define RC_WIZARD_END (RC_WIZARD + 99) + +// Shell-Verzeichnis +#define RC_SHELLS_BEGIN RC_SHELLS +#define RC_SHELLS_END (RC_SHELLS + 99) + +// PopUpMenu's +#define RC_POPUPS_BEGIN RC_POPUPS +#define RC_POPUPS_END (RC_POPUPS + 99) + +// Strings fuer ConfigItems in div. Verzeichnissen +#define RC_CFGITEMS_BEGIN RC_CFGITEMS +#define RC_CFGITEMS_END (RC_CFGITEMS + 99) + +// Lingu +#define RC_LINGU_BEGIN RC_LINGU +#define RC_LINGU_END (RC_LINGU + 99) + +// Accessibility +#define RC_ACCESS_BEGIN RC_ACCESS +#define RC_ACCESS_END (RC_ACCESS + 99) + +#endif diff --git a/inc/bf_sw/redlenum.hxx b/inc/bf_sw/redlenum.hxx new file mode 100644 index 000000000..44ce0b2a4 --- /dev/null +++ b/inc/bf_sw/redlenum.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _REDLENUM_HXX +#define _REDLENUM_HXX +namespace binfilter { + + +// Redline Typen +enum SwRedlineType +{ + // die RedlineTypen gehen von 0 bis 127 + REDLINE_INSERT, // Inhalt wurde eingefuegt + REDLINE_DELETE, // Inhalt wurde geloescht + REDLINE_FORMAT, // Attributierung wurde angewendet + REDLINE_TABLE, // TabellenStruktur wurde veraendert + REDLINE_FMTCOLL, // FormatVorlage wurde veraendert (Autoformat!) + + // ab 128 koennen Flags hineinverodert werden + REDLINE_NO_FLAG_MASK = 0x007f, + REDLINE_FLAG_MASK = 0xff80, + REDLINE_FORM_AUTOFMT = 0x0080 // kann als Flag im RedlineType stehen +}; + + +// Redline Modus vom Doc +enum SwRedlineMode +{ + REDLINE_NONE, // kein RedlineMode + REDLINE_ON = 0x01, // RedlineMode on + REDLINE_IGNORE = 0x02, // auf Redlines nicht reagieren + + REDLINE_SHOW_INSERT = 0x10, // alle Einfuegungen anzeigen + REDLINE_SHOW_DELETE = 0x20, // alle Loeschungen anzeigen + + REDLINE_SHOW_MASK = REDLINE_SHOW_INSERT | REDLINE_SHOW_DELETE, + + // fuer die interne Verwaltung: + // die originalen Redlines inclusive des Contents entfernen + // (ClipBoard/Textbausteine) + REDLINE_DELETE_REDLINES = 0x100, + // beim Loeschen innerhalb ein RedlineObjectes, waehrend des Appends, + // das DeleteRedline ignorieren + REDLINE_IGNOREDELETE_REDLINES = 0x200, + // don't combine any readlines. This flags is may only used in the Undo. + REDLINE_DONTCOMBINE_REDLINES = 0x400 +}; + +inline bool IsShowChanges( const USHORT eM ) +{ + return (REDLINE_SHOW_INSERT | REDLINE_SHOW_DELETE) == + (eM & REDLINE_SHOW_MASK); +} +inline bool IsHideChanges( const USHORT eM ) +{ + return REDLINE_SHOW_INSERT == (eM & REDLINE_SHOW_MASK); +} +inline bool IsShowOriginal( const USHORT eM ) +{ + return REDLINE_SHOW_DELETE == (eM & REDLINE_SHOW_MASK); +} +inline bool IsRedlineOn( const USHORT eM ) +{ + return REDLINE_ON == (eM & (REDLINE_ON | REDLINE_IGNORE )); +} + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/redline.hxx b/inc/bf_sw/redline.hxx new file mode 100644 index 000000000..27a7a5967 --- /dev/null +++ b/inc/bf_sw/redline.hxx @@ -0,0 +1,185 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _REDLINE_HXX +#define _REDLINE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/datetime.hxx> +#include <bf_tools/string.hxx> + +#define _SVSTDARR_USHORTS +#include <bf_svtools/svstdarr.hxx> + +#include <pam.hxx> +#include <redlenum.hxx> +namespace binfilter { +class SfxItemSet; + + + +class SwRedlineData +{ + friend class SwRedline; + SwRedlineData* pNext; // Verweis auf weitere Daten + + String sComment; + DateTime aStamp; + SwRedlineType eType; + USHORT nAuthor, nSeqNo; + +public: + SwRedlineData( const SwRedlineData& rCpy, BOOL bCpyNext = TRUE ); + + // fuer sw3io: pNext/pExtraData gehen in eigenen Besitz ueber! + SwRedlineData( SwRedlineType eT, USHORT nAut, const DateTime& rDT, + const String& rCmnt, SwRedlineData* pNxt ); + + ~SwRedlineData(); + + int operator==( const SwRedlineData& rCmp ) const + { + return nAuthor == rCmp.nAuthor + && eType == rCmp.eType + && sComment == rCmp.sComment + && ( ( !pNext && !rCmp.pNext ) + || ( pNext + && rCmp.pNext + && *pNext == *rCmp.pNext + ) + ); + } + int operator!=( const SwRedlineData& rCmp ) const + { return !operator==( rCmp ); } + + SwRedlineType GetType() const + { return SwRedlineType( eType & REDLINE_NO_FLAG_MASK); } + SwRedlineType GetRealType() const { return eType; } + USHORT GetAuthor() const { return nAuthor; } + const String& GetComment() const { return sComment; } + const DateTime& GetTimeStamp() const { return aStamp; } + inline const SwRedlineData* Next() const{ return pNext; } + + void SetTimeStamp( const DateTime& rDT) + { aStamp = rDT; aStamp.SetSec( 0 ); aStamp.Set100Sec( 0 ); } + void SetComment( const String& rS ) { sComment = rS; } + void SetAutoFmtFlag() + { eType = SwRedlineType( eType | REDLINE_FORM_AUTOFMT ); } + int CanCombine( const SwRedlineData& rCmp ) const + { + return nAuthor == rCmp.nAuthor + && eType == rCmp.eType + && sComment == rCmp.sComment + && GetTimeStamp() == rCmp.GetTimeStamp() + && ( ( !pNext + && !rCmp.pNext + ) + || ( pNext + && rCmp.pNext + && pNext->CanCombine( *rCmp.pNext ) + ) + ); + } + + // fuers UI-seitige zusammenfassen von Redline-Actionen. Wird z.Z. nur + // fuers Autoformat mit Redline benoetigt. Der Wert != 0 bedeutet dabei, + // das es noch weitere geben kann! + USHORT GetSeqNo() const { return nSeqNo; } + void SetSeqNo( USHORT nNo ) { nSeqNo = nNo; } +}; + + +class SwRedline : public SwPaM +{ + SwRedlineData* pRedlineData; + SwNodeIndex* pCntntSect; + BOOL bDelLastPara : 1; + BOOL bIsLastParaDelete : 1; + BOOL bIsVisible : 1; + + +public: + SwRedline( const SwRedlineData& rData, const SwPosition& rPos ); + // fuer sw3io: pData geht in eigenen Besitz ueber! + SwRedline(SwRedlineData* pData, const SwPosition& rPos, BOOL bVsbl, + BOOL bDelLP, BOOL bIsPD) : + SwPaM( rPos ), pRedlineData( pData ), pCntntSect( 0 ), + bDelLastPara( bDelLP ), bIsLastParaDelete( bIsPD ), bIsVisible( bVsbl ) + {} + SwRedline( const SwRedline& ); + virtual ~SwRedline(); + + SwNodeIndex* GetContentIdx() const { return pCntntSect; } + + BOOL IsVisible() const { return bIsVisible; } + BOOL IsDelLastPara() const { return bDelLastPara; } + BOOL IsLastParaDelete() const { return bIsLastParaDelete; } + + // das BOOL besagt, ob nach dem setzen der Pos kein Bereich mehr + // aufgespannt ist. -> TRUE, ansonten Bereich und FALSE + void SetStart( const SwPosition& rPos, SwPosition* pSttPtr = 0 ) + { + if( !pSttPtr ) pSttPtr = Start(); + *pSttPtr = rPos; + } + void SetEnd( const SwPosition& rPos, SwPosition* pEndPtr = 0 ) + { + if( !pEndPtr ) pEndPtr = End(); + *pEndPtr = rPos; + } + // liegt eine gueltige Selektion vor? +/*N*/ BOOL HasValidRange() const; //SW50.SDW + + USHORT GetAuthor() const { return pRedlineData->GetAuthor(); } + const DateTime& GetTimeStamp() const { return pRedlineData->GetTimeStamp(); } + SwRedlineType GetType() const { return pRedlineData->GetType(); } + SwRedlineType GetRealType() const { return pRedlineData->GetRealType(); } + const SwRedlineData& GetRedlineData() const { return *pRedlineData; } + int operator==( const SwRedlineData& rCmp ) const + { return *pRedlineData == rCmp; } + int operator!=( const SwRedlineData& rCmp ) const + { return *pRedlineData != rCmp; } + void SetAutoFmtFlag() { pRedlineData->SetAutoFmtFlag(); } + + const String& GetAuthorString( USHORT nPos = 0 ) const; + + const String& GetComment() const { return pRedlineData->GetComment(); } + void SetComment( const String& rS ) { pRedlineData->SetComment( rS ); } + + // fuers UI-seitige zusammenfassen von Redline-Actionen. Wird z.Z. nur + // fuers Autoformat mit Redline benoetigt. Der Wert != 0 bedeutet dabei, + // das es noch weitere geben kann! + USHORT GetSeqNo() const { return pRedlineData->GetSeqNo(); } + void SetSeqNo( USHORT nNo ) { pRedlineData->SetSeqNo( nNo ); } + + // calculates the intersection with text node number nNdIdx + + BOOL IsOwnRedline( const SwRedline& rRedl ) const + { return GetAuthor() == rRedl.GetAuthor(); } + BOOL CanCombine( const SwRedline& rRedl ) const; + + + int operator==( const SwRedline& ) const; + int operator<( const SwRedline& ) const; +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/reffld.hxx b/inc/bf_sw/reffld.hxx new file mode 100644 index 000000000..f285c7f0a --- /dev/null +++ b/inc/bf_sw/reffld.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _REFFLD_HXX +#define _REFFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <fldbas.hxx> +namespace binfilter { + +class SfxPoolItem; +class SwDoc; +class SwTxtAttr; +class SwTxtNode; + +enum REFERENCESUBTYPE +{ + REF_SETREFATTR = 0, + REF_SEQUENCEFLD, + REF_BOOKMARK, + REF_OUTLINE, + REF_FOOTNOTE, + REF_ENDNOTE +}; + +enum REFERENCEMARK +{ + REF_BEGIN, + REF_PAGE = REF_BEGIN, + REF_CHAPTER, + REF_CONTENT, + REF_UPDOWN, + REF_PAGE_PGDESC, + REF_ONLYNUMBER, + REF_ONLYCAPTION, + REF_ONLYSEQNO, + REF_END +}; + + +/*-------------------------------------------------------------------- + Beschreibung: Referenz holen + --------------------------------------------------------------------*/ + +class SwGetRefFieldType : public SwFieldType +{ + SwDoc* pDoc; +public: + SwGetRefFieldType(SwDoc* pDoc ); + virtual SwFieldType* Copy() const { DBG_BF_ASSERT(0, "STRIP"); return NULL; } + + SwDoc* GetDoc() const { return pDoc; } + // ueberlagert, um alle Ref-Felder zu updaten + virtual void Modify( SfxPoolItem *, SfxPoolItem * ); + + static SwTxtNode* FindAnchor( SwDoc* pDoc, const String& rRefMark, + USHORT nSubType, USHORT nSeqNo, + USHORT* pStt, USHORT* pEnd = 0 ); +}; + +/*-------------------------------------------------------------------- + Beschreibung: Referenzfeld + --------------------------------------------------------------------*/ + +class SwGetRefField : public SwField +{ + String sSetRefName; + String sTxt; + USHORT nSubType; + USHORT nSeqNo; +public: + SwGetRefField( SwGetRefFieldType*, const String& rSetRef, + USHORT nSubType, USHORT nSeqNo, ULONG nFmt ); + + virtual String GetCntnt(BOOL bName = FALSE) const; + virtual String Expand() const; + virtual SwField* Copy() const; + + const String& GetSetRefName() const { return sSetRefName; } + + void UpdateField(); + void SetExpand( const String& rStr ) { sTxt = rStr; } + + // SubType erfragen/setzen + virtual USHORT GetSubType() const; + virtual void SetSubType( USHORT n ); + + // SequenceNo erfragen/setzen (nur fuer REF_SEQUENCEFLD interressant) + USHORT GetSeqNo() const { return nSeqNo; } + void SetSeqNo( USHORT n ) { nSeqNo = n; } + + // Name der Referenz + virtual const String& GetPar1() const; + virtual void SetPar1(const String& rStr); + + virtual String GetPar2() const; + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + + +} //namespace binfilter +#endif // _REFFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/ring.hxx b/inc/bf_sw/ring.hxx new file mode 100644 index 000000000..60d5589f9 --- /dev/null +++ b/inc/bf_sw/ring.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _RING_HXX +#define _RING_HXX +namespace binfilter { + +class Ring +{ + Ring *pNext; + Ring* pPrev; // zur Optimierung, damit das ein/ausketten schneller geht! + +protected: + Ring() { pNext = this; pPrev = this; } + Ring( Ring * ); +public: + virtual ~Ring(); + void MoveTo( Ring *pDestRing ); + + Ring* GetNext() const { return pNext; } + Ring* GetPrev() const { return pPrev; } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/rubylist.hxx b/inc/bf_sw/rubylist.hxx new file mode 100644 index 000000000..2c05414ca --- /dev/null +++ b/inc/bf_sw/rubylist.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _RUBYLIST_HXX +#define _RUBYLIST_HXX + + +#include <swtypes.hxx> +#include <fmtruby.hxx> +namespace binfilter { + +class SwRubyListEntry +{ + String sText; + SwFmtRuby aRubyAttr; +public: + SwRubyListEntry() : aRubyAttr( aEmptyStr ) {} + ~SwRubyListEntry(); + + const String& GetText() const { return sText; } + void SetText( const String& rStr ) { sText = rStr; } + + const SwFmtRuby& GetRubyAttr() const { return aRubyAttr; } + SwFmtRuby& GetRubyAttr() { return aRubyAttr; } + void SetRubyAttr( const SwFmtRuby& rAttr ) { aRubyAttr = rAttr; } +}; + +typedef SwRubyListEntry* SwRubyListEntryPtr; +SV_DECL_PTRARR_DEL( SwRubyList, SwRubyListEntryPtr, 0, 32 ) + + +} //namespace binfilter +#endif //_RUBYLIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/section.hxx b/inc/bf_sw/section.hxx new file mode 100644 index 000000000..26234ce27 --- /dev/null +++ b/inc/bf_sw/section.hxx @@ -0,0 +1,271 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SECTION_HXX +#define _SECTION_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <com/sun/star/uno/Sequence.hxx> +#include <bf_so3/lnkbase.hxx> +#include <frmfmt.hxx> +namespace binfilter { + +// Forward Deklaration +class SwSectionFmt; +class SwSectionNode; +class SwDoc; +class SwSection; +class SwTOXBase; + +#ifndef SW_DECL_SWSERVEROBJECT_DEFINED +#define SW_DECL_SWSERVEROBJECT_DEFINED +SV_DECL_REF( SwServerObject ) +#endif + +SV_DECL_PTRARR( SwSections, SwSection*, 0, 4 ) + +enum SectionType { CONTENT_SECTION, + TOX_HEADER_SECTION, + TOX_CONTENT_SECTION, + DDE_LINK_SECTION = OBJECT_CLIENT_DDE, + FILE_LINK_SECTION = OBJECT_CLIENT_FILE +/* +// verbleiben noch: + OBJECT_CLIENT_SO = 0x80, + OBJECT_CLIENT_OLE = 0x82, + OBJECT_CLIENT_OLE_CACHE = 0x83, +*/ + }; + +enum LinkCreateType +{ + CREATE_NONE, // nichts weiter tun + CREATE_CONNECT, // Link gleich connecten + CREATE_UPDATE // Link connecten und updaten +}; + + +class SwSection : public SwClient +{ + // damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird! + friend class SwSectionNode; + // the "read CTOR" of SwSectionFrm have to change the Hiddenflag + friend class SwSectionFrm; + + String sSectionNm; + String sCondition; // erstmal, vielleicht auch mal ein Feld ?? + String sLinkFileName, + sLinkFilePassWd; // JP 27.02.2001: must later changed to Sequence + ::com::sun::star::uno::Sequence <sal_Int8> aPasswd; + + SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt + ::binfilter::SvBaseLinkRef refLink; + + SectionType eType; + + BOOL bProtectFlag : 1; // Flags fuer schnelle Abfragen, wird ueber + // Attribut im Format gesetzt + BOOL bHiddenFlag : 1; // Flag: Absaetze versteckt ? + BOOL bHidden : 1; // alle Absaetze nicht sichtbar ? + BOOL bCondHiddenFlag : 1; // Hiddenflag fuer die Bedingung ? + BOOL bConnectFlag : 1; // Flag: "Verbindung zum Server" vorhanden? + + + void _SetHiddenFlag( int bHidden, int bCondition ); + void _SetProtectFlag( int bFlag ) { bProtectFlag = bFlag; } + + int _IsProtect() const; + +public: + TYPEINFO(); // rtti + + SwSection( SectionType eType, const String& rName, + SwSectionFmt* pFmt = 0 ); + ~SwSection(); + + // kopiere nur die Daten der Section! + // Ableitung bleibt (beim Left) erhalten. + SwSection& operator=( const SwSection& ); + int operator==( const SwSection& rCmp ) const; + + const String& GetName() const { return sSectionNm; } + void SetName( const String& rName ) { sSectionNm = rName; } + SectionType GetType() const { return eType; } + void SetType( SectionType eNew ) { eType = eNew; } + + SwSectionFmt* GetFmt() { return (SwSectionFmt*)pRegisteredIn; } + SwSectionFmt* GetFmt() const { return (SwSectionFmt*)pRegisteredIn; } + + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + // setze die Hidden/Protected -> gesamten Baum updaten ! + // (Attribute/Flags werden gesetzt/erfragt) + int IsHidden() const { return bHidden; } + int IsProtect() const { return GetFmt() ? _IsProtect() + : IsProtectFlag(); } + + void SetHidden( int bFlag = TRUE ); + void SetProtect( int bFlag = TRUE ); + + // erfrage die internen Flags (Zustand inklusive Parents nicht, was + // aktuell an der Section gesetzt ist!!) + int IsHiddenFlag() const { return bHiddenFlag; } + int IsProtectFlag() const { return bProtectFlag; } + + void SetCondHidden( int bFlag = TRUE ); + int IsCondHidden() const { return bCondHiddenFlag; } + // erfrage (auch ueber die Parents), ob diese Section versteckt sein soll. + int CalcHiddenFlag() const; + + + inline SwSection* GetParent() const; + + // setze/erfrage die Bedingung + const String& GetCondition() const { return sCondition; } + void SetCondition( const String& rNew ) { sCondition = rNew; } + + // setze/erfrage den gelinkten FileNamen + const String& GetLinkFileName() const; + void SetLinkFileName( const String& rNew, const String* pPassWd = 0 ); + // Passwort des gelinkten Files (nur waehrend der Laufzeit gueltig!) + const String& GetLinkFilePassWd() const { return sLinkFilePassWd; } + void SetLinkFilePassWd( const String& rS ) { sLinkFilePassWd = rS; } + + // get / set password of this section + const ::com::sun::star::uno::Sequence <sal_Int8>& + GetPasswd() const { return aPasswd; } + void SetPasswd( const ::com::sun::star::uno::Sequence <sal_Int8>& rNew ) + { aPasswd = rNew; } + + // Daten Server-Methoden + void SetRefObject( SwServerObject* pObj ); + const SwServerObject* GetObject() const { return &refObj; } + SwServerObject* GetObject() { return &refObj; } + + // Methoden fuer gelinkte Bereiche + USHORT GetUpdateType() const { return refLink->GetUpdateMode(); } + void SetUpdateType( USHORT nType ) { refLink->SetUpdateMode( nType ); } + + BOOL IsConnected() const { return refLink.Is(); } + void UpdateNow() { refLink->Update(); } + void Disconnect() { refLink->Disconnect(); } + + const ::binfilter::SvBaseLink& GetBaseLink() const { return *refLink; } + ::binfilter::SvBaseLink& GetBaseLink() { return *refLink; } + + void CreateLink( LinkCreateType eType ); + + + BOOL IsLinkType() const + { return DDE_LINK_SECTION == eType || FILE_LINK_SECTION == eType; } + + // Flags fuer UI - Verbindung geklappt? + BOOL IsConnectFlag() const { return bConnectFlag; } + void SetConnectFlag( BOOL bFlag = TRUE ) { bConnectFlag = bFlag; } + + // return the TOX base class if the section is a TOX section + +private: + // privater Constructor, weil nie kopiert werden darf !! + SwSection( const SwSection& ); +}; + + +enum SectionSort { SORTSECT_NOT, SORTSECT_NAME, SORTSECT_POS }; + +class SwSectionFmt : public SwFrmFmt +{ + friend class SwDoc; + SwSection* _GetSection() const; + +protected: + SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc ); + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + ~SwSectionFmt(); + + //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt). + virtual void DelFrms(); + + //Erzeugt die Ansichten + virtual void MakeFrms(); + + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + // erfrage vom Format Informationen + + SwSection* GetSection() const { return (SwSection*)_GetSection(); } + inline SwSectionFmt* GetParent() const; + inline SwSection* GetParentSection() const; + + // alle Sections, die von dieser abgeleitet sind + // - sortiert nach : Name oder Position oder unsortiert + // - alle oder nur die, die sich im normalten Nodes-Array befinden + USHORT GetChildSections( SwSections& rArr, + SectionSort eSort = SORTSECT_NOT, + int bAllSections = TRUE ) const; + + // erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array + // befindet. + int IsInNodesArr() const; + + SwSectionNode* GetSectionNode( BOOL bAlways = FALSE ); + const SwSectionNode* GetSectionNode( BOOL bAlways = FALSE ) const + { return ((SwSectionFmt*)this)->GetSectionNode( bAlways ); } + + // ist die Section eine gueltige fuers GlobalDocument? + const SwSection* GetGlobalDocSection() const; +}; + +// -------------- inlines --------------------------------- + +inline SwSection* SwSection::GetParent() const +{ + register SwSectionFmt* pFmt = GetFmt(); + register SwSection* pRet = 0; + if( pFmt ) + pRet = pFmt->GetParentSection(); + return pRet; +} + +inline SwSectionFmt* SwSectionFmt::GetParent() const +{ + register SwSectionFmt* pRet = 0; + if( GetRegisteredIn() ) + pRet = PTR_CAST( SwSectionFmt, GetRegisteredIn() ); + return pRet; +} + +inline SwSection* SwSectionFmt::GetParentSection() const +{ + register SwSectionFmt* pParent = GetParent(); + register SwSection* pRet = 0; + if( pParent ) + pRet = pParent->_GetSection(); + return pRet; +} + + +} //namespace binfilter +#endif + //_SECTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/shellid.hxx b/inc/bf_sw/shellid.hxx new file mode 100644 index 000000000..b020125c2 --- /dev/null +++ b/inc/bf_sw/shellid.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SHELLID_HXX +#define _SHELLID_HXX + +namespace binfilter { + +/*-------------------------------------------------------------------- + Beschreibung: Mapping fuer UI-Parameter + --------------------------------------------------------------------*/ + +#define SW_BASESHELL (SFX_INTERFACE_SW_START + 1) +#define SW_TEXTSHELL (SFX_INTERFACE_SW_START + 2) +#define SW_LISTSHELL (SFX_INTERFACE_SW_START + 3) +#define SW_TABSHELL (SFX_INTERFACE_SW_START + 4) +#define SW_FRAMESHELL (SFX_INTERFACE_SW_START + 5) +#define SW_GRFSHELL (SFX_INTERFACE_SW_START + 6) +#define SW_OLESHELL (SFX_INTERFACE_SW_START + 7) +#define SW_DRAWSHELL (SFX_INTERFACE_SW_START + 8) +#define SW_DRWTXTSHELL (SFX_INTERFACE_SW_START + 9) + +#define SW_INTERFACE_MODULE (SFX_INTERFACE_SW_START + 10) +#define SW_DOCSHELL (SFX_INTERFACE_SW_START + 11) +#define SW_VIEWSHELL (SFX_INTERFACE_SW_START + 12) +#define SW_PAGEPREVIEW (SFX_INTERFACE_SW_START + 13) +#define SW_GLOSDOCSHELL (SFX_INTERFACE_SW_START + 14) +#define SW_SRC_VIEWSHELL (SFX_INTERFACE_SW_START + 15) + +#define SW_BEZIERSHELL (SFX_INTERFACE_SW_START + 16) +#define SW_DRAWBASESHELL (SFX_INTERFACE_SW_START + 17) +#define SW_DRAWFORMSHELL (SFX_INTERFACE_SW_START + 18) + +#define SW_WEBDOCSHELL (SFX_INTERFACE_SW_START + 19) +#define SW_WEBVIEWSHELL (SFX_INTERFACE_SW_START + 20) +#define SW_WEBBASESHELL (SFX_INTERFACE_SW_START + 21) +#define SW_WEBTEXTSHELL (SFX_INTERFACE_SW_START + 22) +#define SW_WEBFRAMESHELL (SFX_INTERFACE_SW_START + 23) +#define SW_WEBGLOSDOCSHELL (SFX_INTERFACE_SW_START + 24) +#define SW_WEBLISTSHELL (SFX_INTERFACE_SW_START + 25) +#define SW_WEBTABSHELL (SFX_INTERFACE_SW_START + 26) +#define SW_WEBGRFSHELL (SFX_INTERFACE_SW_START + 27) +#define SW_WEBOLESHELL (SFX_INTERFACE_SW_START + 28) +#define SW_WEBDRAWBASESHELL (SFX_INTERFACE_SW_START + 29) +#define SW_WEBDRAWFORMSHELL (SFX_INTERFACE_SW_START + 30) + +} //namespace binfilter +#endif // _UIPARAM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/shellio.hxx b/inc/bf_sw/shellio.hxx new file mode 100644 index 000000000..e0c75e2f3 --- /dev/null +++ b/inc/bf_sw/shellio.hxx @@ -0,0 +1,468 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _SHELLIO_HXX +#define _SHELLIO_HXX + +#include <bf_svtools/bf_solar.h> +#include <bf_tools/string.hxx> + +#include <tools/datetime.hxx> +#include <tools/ref.hxx> +#include <sot/formats.hxx> + +#include <docfac.hxx> // SwDocFac +#include <tools/debug.hxx> +class SvStream; +namespace binfilter { +class SvStorage; +class SvStorageStreamRef; +class SvPtrarr; +class SfxItemPool; +class SfxItemSet; +class SvStrings; +class SvStringsSortDtor; +class SvxMacroTableDtor; + +// einige Forward - Deklarationen +class SfxFactoryFilterContainer; +class SfxFilter; +class SfxMedium; +class SvxFontItem; + +class Sw3Io; +class SwCntntNode; +class SwCrsrShell; +class SwDoc; +class SwPaM; +struct SwPosition; + +// ab so vielen chars wird ein mit einem ASCII/W4W-Reader eingelesener +// Absatz zwangsweise umgebrochen. Muss immer groesser als 200 sein !!! +#define MAX_ASCII_PARA 10000 + + +class SwAsciiOptions +{ + String sFont; + rtl_TextEncoding eCharSet; + USHORT nLanguage; + LineEnd eCRLF_Flag; + +public: + + const String& GetFontName() const { return sFont; } + void SetFontName( const String& rFont ) { sFont = rFont; } + + rtl_TextEncoding GetCharSet() const { return eCharSet; } + void SetCharSet( rtl_TextEncoding nVal ) { eCharSet = nVal; } + + USHORT GetLanguage() const { return nLanguage; } + void SetLanguage( USHORT nVal ) { nLanguage = nVal; } + + LineEnd GetParaFlags() const { return eCRLF_Flag; } + void SetParaFlags( LineEnd eVal ) { eCRLF_Flag = eVal; } + + void Reset() + { + sFont.Erase(); + eCRLF_Flag = GetSystemLineEnd(); + eCharSet = ::osl_getThreadTextEncoding(); + nLanguage = 0; + } + // for the automatic conversion (mail/news/...) + void ReadUserData( const String& ); + + SwAsciiOptions() { Reset(); } +}; + + +/* Basis-Klasse aller Writer */ + +struct Writer_Impl; + +class Writer : public SvRefBase +{ + SwAsciiOptions aAscOpts; + +protected: + Writer_Impl* pImpl; + + SvStream* pStrm; + SwPaM* pOrigPam; // der letze zu bearbeitende Pam + + void ResetWriter(); + BOOL CopyNextPam( SwPaM ** ); + + virtual ULONG WriteStream() = 0; + +public: + SwDoc* pDoc; + SwPaM* pCurPam; + BOOL bWriteAll : 1; + BOOL bShowProgress : 1; + BOOL bWriteClipboardDoc : 1; + BOOL bWriteOnlyFirstTable : 1; + BOOL bASCII_ParaAsCR : 1; + BOOL bASCII_ParaAsBlanc : 1; + BOOL bASCII_NoLastLineEnd : 1; + BOOL bUCS2_WithStartChar : 1; + + BOOL bBlock : 1; + BOOL bOrganizerMode : 1; + + Writer(); + virtual ~Writer(); + + ULONG Write( SwPaM&, SvStream& ); + + BOOL ShowProgress() const { return bShowProgress; } + void SetShowProgress( BOOL bFlag = FALSE ) { bShowProgress = bFlag; } + + const SwAsciiOptions& GetAsciiOptions() const { return aAscOpts; } + void SetAsciiOptions( const SwAsciiOptions& rOpt ) { aAscOpts = rOpt; } + + void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; } +#ifndef DBG_UTIL + SvStream& Strm() { return *pStrm; } +#else + SvStream& Strm(); +#endif + + BOOL IsOrganizerMode() const { return bOrganizerMode; } + void SetOrganizerMode( BOOL bSet ) { bOrganizerMode = bSet; } +}; + +#ifndef SW_DECL_WRITER_DEFINED +#define SW_DECL_WRITER_DEFINED +SV_DECL_REF(Writer) +#endif +SV_IMPL_REF(Writer) + +/**************** SwReader/Reader ************************/ +// Basisklasse der moeglichen Optionen fuer einen speziellen Reader +class Reader; +// Ruft den Reader mit seinen Optionen, Dokument, Cursor etc. +class SwReader; +// SwRead ist der Pointer auf die Read-Optionen-Basisklasse +typedef Reader *SwRead; + +class SwgReaderOption +{ + SwAsciiOptions aASCIIOpts; + union + { + BOOL bFmtsOnly; + struct + { + BOOL bFrmFmts: 1; + BOOL bPageDescs: 1; + BOOL bTxtFmts: 1; + BOOL bNumRules: 1; + BOOL bMerge:1; + } Fmts; + } What; + +public: + void ResetAllFmtsOnly() { What.bFmtsOnly = 0; } + void SetAllFmtsOnly() { What.bFmtsOnly = (BOOL)0xff; } + BOOL IsFmtsOnly() const { return What.bFmtsOnly; } + + BOOL IsFrmFmts() const { return What.Fmts.bFrmFmts; } + void SetFrmFmts( const BOOL bNew) { What.Fmts.bFrmFmts = bNew; } + + BOOL IsPageDescs() const { return What.Fmts.bPageDescs; } + void SetPageDescs( const BOOL bNew) { What.Fmts.bPageDescs = bNew; } + + BOOL IsTxtFmts() const { return What.Fmts.bTxtFmts; } + void SetTxtFmts( const BOOL bNew) { What.Fmts.bTxtFmts = bNew; } + + BOOL IsNumRules() const { return What.Fmts.bNumRules; } + void SetNumRules( const BOOL bNew) { What.Fmts.bNumRules = bNew; } + + BOOL IsMerge() const { return What.Fmts.bMerge; } + void SetMerge( const BOOL bNew ) { What.Fmts.bMerge = bNew; } + + const SwAsciiOptions& GetASCIIOpts() const { return aASCIIOpts; } + void SetASCIIOpts( const SwAsciiOptions& rOpts ) { aASCIIOpts = rOpts; } + void ResetASCIIOpts() { aASCIIOpts.Reset(); } + + SwgReaderOption() + { ResetAllFmtsOnly(); aASCIIOpts.Reset(); } +}; + +class SwReader: public SwDocFac +{ + SvStream* pStrm; + SvStorage* pStg; + SfxMedium* pMedium; // wer ein Medium haben will (W4W) + + SwPaM* pCrsr; + String aFileName; + +public: + /* + * Initiales Einlesen. Dokument wird erst beim Read(..) angelegt. + * JP 25.04.95: oder falls es mitgegeben wird, in dieses. + * Sonderfall fuer Load mit Sw3Reader + */ + SwReader( SvStorage&, const String& rFilename, SwDoc *pDoc = 0 ); + SwReader( SfxMedium&, const String& rFilename, SwDoc *pDoc = 0 ); + /* + * In ein existierendes Dokument einlesen, Dokument und + * Position im Dokument werden aus dem SwPaM uebernommen. + */ + SwReader( SfxMedium&, const String& rFilename, SwPaM& ); + + /* + * Nur SwReader::Read(...) ist die Export-Schnittstelle!!! + */ + BOOL NeedsPasswd( const Reader& ); + BOOL CheckPasswd( const String&, const Reader& ); + ULONG Read( const Reader& ); + + // ask for glossaries +}; + + +/**************** SPEZIELLE Reader ************************/ + +// spezielle - Reader koennen beides sein !! (Excel, W4W, .. ) +#define SW_STREAM_READER 1 +#define SW_STORAGE_READER 2 + +class Reader +{ + friend class SwReader; + SwDoc* pTemplate; + String aTemplateNm; + Date aDStamp; + Time aTStamp; + DateTime aChkDateTime; + +protected: + SvStream* pStrm; + SvStorage* pStg; + SfxMedium* pMedium; // wer ein Medium haben will (W4W) + + SwgReaderOption aOpt; + BOOL bInsertMode : 1; + BOOL bTmplBrowseMode : 1; + BOOL bReadUTF8: 1; // Stream als UTF-8 interpretieren + BOOL bBlockMode: 1; + BOOL bOrganizerMode : 1; + BOOL bHasAskTemplateName : 1; + BOOL bIgnoreHTMLComments : 1; + + virtual String GetTemplateName() const; + +public: + Reader(); + virtual ~Reader(); + + virtual int GetReaderType(); + SwgReaderOption& GetReaderOpt() { return aOpt; } + + virtual void SetFltName( const String& rFltNm ); + + // Die Filter-Vorlage laden, setzen und wieder freigeben + SwDoc* GetTemplateDoc(); + BOOL SetTemplate( SwDoc& rDoc ); + void ClearTemplate(); + void SetTemplateName( const String& rDir ); + + BOOL IsReadUTF8() const { return bReadUTF8; } + void SetReadUTF8( BOOL bSet ) { bReadUTF8 = bSet; } + + BOOL IsBlockMode() const { return bBlockMode; } + void SetBlockMode( BOOL bSet ) { bBlockMode = bSet; } + + BOOL IsOrganizerMode() const { return bOrganizerMode; } + void SetOrganizerMode( BOOL bSet ) { bOrganizerMode = bSet; } + + BOOL IsIgnoreHTMLComments() const { return bIgnoreHTMLComments; } + void SetIgnoreHTMLComments( BOOL bSet ) { bIgnoreHTMLComments = bSet; } + + + // read the sections of the document, which is equal to the medium. + // returns the count of it +private: + virtual ULONG Read(SwDoc &,SwPaM &,const String &)=0; + + // alle die die Streams / Storages nicht geoeffnet brauchen, + // muessen die Methode ueberladen (W4W!!) + virtual int SetStrmStgPtr(); +}; + + + +class AsciiReader: public Reader +{ + friend class SwReader; + virtual ULONG Read( SwDoc &,SwPaM &,const String &){DBG_BF_ASSERT(0, "STRIP"); return 0;} +public: + AsciiReader(): Reader() {} +}; + +class SwgReader: public Reader +{ + virtual ULONG Read( SwDoc &,SwPaM &,const String &); +}; + +class StgReader : public Reader +{ + String aFltName; + +protected: + ULONG OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize ); + +public: + const String& GetFltName() { return aFltName; } +}; + + +class Sw3Reader : public StgReader +{ + Sw3Io* pIO; + virtual ULONG Read( SwDoc &,SwPaM &,const String &); +public: + Sw3Reader() : pIO( 0 ) {} + + Sw3Io* GetSw3Io() { return pIO; } + const Sw3Io* GetSw3Io() const { return pIO; } + void SetSw3Io( Sw3Io* pIo ) { pIO = pIo; } + + // read the sections of the document, which is equal to the medium. + // returns the count of it +}; + +// Der uebergebene Stream muss dynamisch angelegt werden und +// vor dem Loeschen der Instanz per Stream() angefordert +// und geloescht werden! + +class SwImpBlocks; + +extern void _InitFilter(); +extern void _FinitFilter(); +extern SwRead ReadRtf, ReadAscii, ReadSwg, ReadSw3, ReadHTML; + + +/* + * Schreiben, Writer + */ + + +// Die folgende Klasse ist ein Wrappe fuer die Basic-I/O-Funktionen +// des Writer 3.0. Alles ist statisch. Alle u.a. Filternamen sind die +// Writer-internen Namen, d.h. die namen, die in INSTALL.INI vor dem +// Gleichheitszeichen stehen, z.b. SWG oder ASCII. + +class SwIoSystem +{ +public: + // suche ueber den Filtertext den Filtereintrag + static const SfxFilter* GetFilterOfFilterTxt( const String& rFilterNm, + const SfxFactoryFilterContainer* pCnt = 0 ); + // suche ueber den internen FormatNamen den Filtereintrag + static const SfxFilter* GetFilterOfFormat( const String& rFormat, + const SfxFactoryFilterContainer* pCnt = 0 ); + + // Feststellen des zu verwendenden Filters fuer die uebergebene + // Datei. Der Filtername wird zurueckgeliefert. Konnte kein Filter + // zurueckgeliefert werden, wird der Name des ASCII-Filters geliefert! + static const SfxFilter* GetFileFilter( const String& rFileName, + SfxMedium* pMedium = 0 ); + + // Feststellen ob das File in dem vorgegebenen Format vorliegt. + // Z.z werden nur unsere eigene Filter unterstuetzt!! + static bool IsFileFilter( SfxMedium& rMedium, const String& rFmtName, + const SfxFilter** ppFlt = 0 ); + + static bool IsValidStgFilter( SvStorage& , const SfxFilter& ); + + static bool IsDetectableText(const sal_Char* pBuf, ULONG &rLen, + CharSet *pCharSet=0, bool *pSwap=0, LineEnd *pLineEnd=0); + static bool IsDetectableW4W(const String& rFileName); + + static const SfxFilter* GetTextFilter(const sal_Char* pBuf, ULONG nLen); + // gebe einen bestimmten Reader zurueck + static Reader* GetReader( const String& rFltName ); + + static const String GetSubStorageName( const SfxFilter& rFltr ); +}; + + +// Schnittstellenklasse fuer den allgemeinen Zugriff auf die +// speziellen Writer + +class SwWriter +{ + SvStream* pStrm; + + SwPaM* pOutPam; + SwCrsrShell *pShell; + SwDoc &rDoc; + BOOL bWriteAll; + +public: + ULONG Write( WriterRef& rxWriter ); + SwWriter( SvStream&, SwPaM &, BOOL bWriteAll = FALSE ); +}; + +WriterRef GetASCWriter( const String& rFltNm ); + + +// diese Filter sind immer vorhanden und koennen ueber die +// Formatnamen gesucht werden. Alle anderen Filter sind nur intern +// bekannt. Die UI-Seite benutzt die GetReader()/GetWriter() -Funktionen, +// um die speziellen zu erhalten. + +extern sal_Char FILTER_SWG[]; // SWG-Filter +extern sal_Char FILTER_RTF[]; // RTF-Filter +extern sal_Char FILTER_TEXT[]; // Text-Filter mit Default-CodeSet +extern sal_Char FILTER_BAS[]; // StarBasic (identisch mit ANSI) +extern sal_Char FILTER_WW8[]; // WinWord 97-Filter +extern sal_Char FILTER_SW3[]; // SW3-Storage Filter +extern sal_Char FILTER_SW4[]; // SW4-Storage Filter +extern sal_Char FILTER_SW4[]; // SW4-Storage Filter +extern sal_Char FILTER_SW5[]; // SW5-Storage Filter +extern sal_Char FILTER_SWGV[]; // SWG-Vorlagen Filter +extern sal_Char FILTER_SW3V[]; // SW3-Storage Vorlagen Filter +extern sal_Char FILTER_SW4V[]; // SW4-Storage Vorlagen Filter +extern sal_Char FILTER_SW5V[]; // SW5-Storage Vorlagen Filter +extern sal_Char FILTER_SWW4V[]; // SW/Web Storage Vorlagen Filter +extern sal_Char FILTER_SWW5V[]; // SW/Web Storage Vorlagen Filter +extern sal_Char FILTER_TEXT_DLG[]; // text filter with encoding dialog +extern sal_Char FILTER_XML[]; // XML filter +extern sal_Char FILTER_XMLV[]; // XML filter +extern sal_Char FILTER_XMLVW[]; // XML filter + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/shellres.hxx b/inc/bf_sw/shellres.hxx new file mode 100644 index 000000000..19adbe7eb --- /dev/null +++ b/inc/bf_sw/shellres.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SHELLRES_HXX +#define _SHELLRES_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <tools/rc.hxx> +#include <vcl/bitmap.hxx> + +#ifndef _SVSTDARR_HXX +#define _SVSTDARR_STRINGSDTOR +#include <bf_svtools/svstdarr.hxx> +#endif +namespace binfilter { + +struct ShellResource : public Resource +{ + String aPostItAuthor; + String aPostItPage; + String aPostItLine; + + // Calc Fehlerstrings + String aCalc_Syntax; + String aCalc_ZeroDiv; + String aCalc_Brack; + String aCalc_Pow; + String aCalc_VarNFnd; + String aCalc_Overflow; + String aCalc_WrongTime; + String aCalc_Default; + String aCalc_Error; + + // fuers GetRefFeld - oben/unten + String aGetRefFld_Up, aGetRefFld_Down; + // fuer dynamisches Menu - String "alle" + String aStrAllPageHeadFoot; + // fuer einige Listboxen - String "keine" + String aStrNone; + // fuer Felder, die Fixiert sind + String aFixedStr; + + //names of TOXs + String aTOXIndexName; + String aTOXUserName; + String aTOXContentName; + String aTOXIllustrationsName; + String aTOXObjectsName; + String aTOXTablesName; + String aTOXAuthoritiesName; + + SvStringsDtor aDocInfoLst; + + // Fly-Anker Bmps +// Bitmap aAnchorBmp; +// Bitmap aDragAnchorBmp; + + // die AutoFormat-Redline-Kommentare + inline const SvStringsDtor& GetAutoFmtNameLst() const; + + ShellResource(); + ~ShellResource(); + +private: + void _GetAutoFmtNameLst() const; + SvStringsDtor *pAutoFmtNameLst; + String sPageDescFirstName, sPageDescFollowName, sPageDescName; +}; + +inline const SvStringsDtor& ShellResource::GetAutoFmtNameLst() const +{ + if( !pAutoFmtNameLst ) + _GetAutoFmtNameLst(); + return *pAutoFmtNameLst; +} + + +} //namespace binfilter +#endif //_SHELLRES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/sortopt.hxx b/inc/bf_sw/sortopt.hxx new file mode 100644 index 000000000..95f6c0db8 --- /dev/null +++ b/inc/bf_sw/sortopt.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SORTOPT_HXX +#define _SORTOPT_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_svtools/svarray.hxx> +#include <bf_tools/string.hxx> +namespace binfilter { + +enum SwSortOrder { SRT_ASCENDING, SRT_DESCENDING }; +enum SwSortDirection { SRT_COLUMNS, SRT_ROWS }; + +/*-------------------------------------------------------------------- + Beschreibung: SortierSchluessel + --------------------------------------------------------------------*/ +struct SwSortKey +{ + SwSortKey(); + SwSortKey( const SwSortKey& rOld ); + + String sSortType; + SwSortOrder eSortOrder; + USHORT nColumnId; + BOOL bIsNumeric; +}; + +SV_DECL_PTRARR(SwSortKeys, SwSortKey*, 3, 1) + + struct SwSortOptions + { + SwSortOptions(); + ~SwSortOptions(); + SwSortOptions(const SwSortOptions& rOpt); + + SwSortKeys aKeys; + SwSortDirection eDirection; + sal_Unicode cDeli; + USHORT nLanguage; + BOOL bTable; + BOOL bIgnoreCase; + }; + +} //namespace binfilter +#endif // _SORTOPT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/statstr.hrc b/inc/bf_sw/statstr.hrc new file mode 100644 index 000000000..3d8261f19 --- /dev/null +++ b/inc/bf_sw/statstr.hrc @@ -0,0 +1,31 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _STATSTR_HRC +#define _STATSTR_HRC + +#include "rcid.hrc" + +#define STR_STATSTR_W4WWRITE (RC_STATLIN_STR + 1) +#define STR_STATSTR_SWGREAD (RC_STATLIN_STR + 2) +#define STR_STATSTR_SWGWRITE (RC_STATLIN_STR + 3) +#define STR_STATSTR_REFORMAT (RC_STATLIN_STR + 4) +#define STR_STATSTR_SEARCH (RC_STATLIN_STR + 7) +#define STR_STATSTR_LAYOUTINIT (RC_STATLIN_STR + 10) +#define STR_STATSTR_SWGPRTOLENOTIFY (RC_STATLIN_STR + 17) + +#endif diff --git a/inc/bf_sw/sw.mk b/inc/bf_sw/sw.mk new file mode 100644 index 000000000..a2da417a3 --- /dev/null +++ b/inc/bf_sw/sw.mk @@ -0,0 +1,24 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +CDEFS+=-DNUM_RELSPACE +CDEFS+=-DVERTICAL_LAYOUT +CDEFS+=-DACCESSIBLE_LAYOUT +CDEFS+=-DBIDI + +# ------------------------------------------------------------------------ diff --git a/inc/bf_sw/sw3io.hxx b/inc/bf_sw/sw3io.hxx new file mode 100644 index 000000000..a15da3790 --- /dev/null +++ b/inc/bf_sw/sw3io.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SW3IO_HXX +#define _SW3IO_HXX + +#include <bf_svtools/bf_solar.h> + +class UniString; + +namespace binfilter { +class SvStorage; +class SvStrings; +class SvxMacroTableDtor; + +class Sw3IoImp; +class SwPaM; +class SwDoc; + +class SwgReaderOption; + +#define DRAWING_STREAM_NAME "DrawingLayer" + +class Sw3Io +{ + friend class Sw3IoImp; + Sw3IoImp* pImp; // Implementationsdaten + + // nur ueber diese beiden Klassen darf ein Load/Save erfolgen!! + friend class Sw3Reader; + friend class Sw3Writer; + + ULONG Load( SvStorage*, SwPaM* = NULL ); + +public: + Sw3Io( SwDoc& ); + ~Sw3Io(); + Sw3IoImp* GetImp() { return pImp; } + void SetReadOptions( const SwgReaderOption& rOpt, BOOL bOverwrite=TRUE ); + + void HandsOff(); + + // Erzeugen eines eindeutigen Streamnamens im gegebenen Storage + static UniString UniqueName( SvStorage*, const sal_Char* pPrefix ); + + // Ermitteln aller Sections eines Dokuments +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swatrset.hxx b/inc/bf_sw/swatrset.hxx new file mode 100644 index 000000000..3e6759e40 --- /dev/null +++ b/inc/bf_sw/swatrset.hxx @@ -0,0 +1,328 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWATRSET_HXX +#define _SWATRSET_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/mempool.hxx> +#include <bf_svtools/itemset.hxx> +#include <bf_svtools/itempool.hxx> +class OutputDevice; +namespace binfilter { +class SfxBoolItem; +class SvxMacroItem; +class SwModify; +class SwDoc; + + + +class SvxPostureItem; +class SvxWeightItem; +class SvxShadowedItem; +class SvxAutoKernItem; +class SvxWordLineModeItem; +class SvxContourItem; +class SvxKerningItem; +class SvxUnderlineItem; +class SvxCrossedOutItem; +class SvxFontHeightItem; +class SvxPropSizeItem; +class SvxFontItem; +class SvxColorItem; +class SvxCharSetColorItem; +class SvxLanguageItem; +class SvxEscapementItem; +class SvxCaseMapItem; +class SvxNoHyphenItem; +class SvxBlinkItem; +class SvxEmphasisMarkItem; +class SvxTwoLinesItem; +class SvxCharScaleWidthItem; +class SvxCharRotateItem; +class SvxCharReliefItem; + +// Frame-Attribute +class SwFmtFillOrder; +class SwFmtFrmSize; +class SvxPaperBinItem; +class SvxLRSpaceItem; +class SvxULSpaceItem; +class SwFmtCntnt; +class SwFmtHeader; +class SwFmtFooter; +class SvxPrintItem; +class SvxOpaqueItem; +class SvxProtectItem; +class SwFmtSurround; +class SwFmtVertOrient; +class SwFmtHoriOrient; +class SwFmtAnchor; +class SvxBoxItem; +class SvxBrushItem; +class SvxShadowItem; +class SwFmtPageDesc; +class SvxFmtBreakItem; +class SwFmtCol; + +class SvxFmtKeepItem; +class SwFmtURL; +class SwFmtLineNumber; +class SwFmtEditInReadonly; +class SwFmtLayoutSplit; +class SwFmtChain; +class SwFmtFtnAtTxtEnd; +class SwFmtEndAtTxtEnd; +class SwFmtNoBalancedColumns; +class SvxFrameDirectionItem; +class SwTextGridItem; +class SwHeaderAndFooterEatSpacingItem; + +// Grafik-Attribute +class SwMirrorGrf; +class SwCropGrf; +class SwRotationGrf; +class SwLuminanceGrf; +class SwContrastGrf; +class SwChannelRGrf; +class SwChannelGGrf; +class SwChannelBGrf; +class SwGammaGrf; +class SwInvertGrf; +class SwTransparencyGrf; +class SwDrawModeGrf; + +// Paragraph-Attribute +class SvxLineSpacingItem; +class SvxAdjustItem; +class SvxFmtSplitItem; +class SwRegisterItem; +class SwNumRuleItem; +class SvxWidowsItem; +class SvxOrphansItem; +class SvxTabStopItem; +class SvxHyphenZoneItem; +class SwFmtDrop; +class SvxScriptSpaceItem; +class SvxHangingPunctuationItem; +class SvxForbiddenRuleItem; +class SvxParaVertAlignItem; +class SvxParaGridItem; +class SwParaConnectBorderItem; + +// TabellenBox-Attribute +class SwTblBoxNumFormat; +class SwTblBoxFormula; +class SwTblBoxValue; + +#ifndef INLINE +#define INLINE inline +#endif + +class SwAttrPool : public SfxItemPool +{ + friend void _InitCore(); // fuers anlegen/zerstoeren der + friend void _FinitCore(); // Versionsmaps + static USHORT* pVersionMap1; + static USHORT* pVersionMap2; + static USHORT* pVersionMap3; + static USHORT* pVersionMap4; + + SwDoc* pDoc; + +public: + SwAttrPool( SwDoc* pDoc ); + + SwDoc* GetDoc() { return pDoc; } + const SwDoc* GetDoc() const { return pDoc; } + + static USHORT* GetVersionMap1() { return pVersionMap1; } + static USHORT* GetVersionMap2() { return pVersionMap2; } + static USHORT* GetVersionMap3() { return pVersionMap3; } + static USHORT* GetVersionMap6() { return pVersionMap4; } +}; + + +class SwAttrSet : public SfxItemSet +{ + // Pointer fuers Modify-System + SwAttrSet *pOldSet, *pNewSet; + + // Notification-Callback + virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew ); + + void PutChgd( const SfxPoolItem& rI ) { SfxItemSet::PutDirect( rI ); } +public: + SwAttrSet( SwAttrPool&, USHORT nWhich1, USHORT nWhich2 ); + SwAttrSet( SwAttrPool&, const USHORT* nWhichPairTable ); + SwAttrSet( const SwAttrSet& ); + + int Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ); + int Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ); + + // ein Item oder einen Bereich loeschen + USHORT ClearItem_BC( USHORT nWhich, SwAttrSet* pOld, SwAttrSet* pNew ); + USHORT ClearItem_BC( USHORT nWhich1, USHORT nWhich2, + SwAttrSet* pOld = 0, SwAttrSet* pNew = 0 ); + + int Intersect_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ); + + SwAttrPool* GetPool() const { return (SwAttrPool*)SfxItemSet::GetPool(); } + + // kopiere die Attribute ggfs. ueber Dokumentgrenzen + void CopyToModify( SwModify& rMod ) const; + + // ---------------------------------------------------------------- + // Sonderbehandlung fuer einige Attribute + // Setze den Modify-Pointer (alten pDefinedIn) bei folgenden Attributen: + // - SwFmtDropCaps + // - SwFmtPageDesc + // (Wird beim Einfuegen in Formate/Nodes gerufen) + void SetModifyAtAttr( const SwModify* pModify ); + + // Das Doc wird jetzt am SwAttrPool gesetzt. Dadurch hat man es immer + // im Zugriff. + const SwDoc *GetDoc() const { return GetPool()->GetDoc(); } + SwDoc *GetDoc() { return GetPool()->GetDoc(); } + + // GetMethoden: das Bool gibt an, ob nur im Set (FALSE) oder auch in + // den Parents gesucht werden soll. Wird nichts gefunden, + // wird das deflt. Attribut returnt. + // Charakter-Attribute - impl. steht im charatr.hxx + // AMA 12.10.94: Umstellung von SwFmt... auf Svx... + inline const SvxPostureItem &GetPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetWeight( BOOL = TRUE ) const; + inline const SvxShadowedItem &GetShadowed( BOOL = TRUE ) const; + inline const SvxAutoKernItem &GetAutoKern( BOOL = TRUE ) const; + inline const SvxWordLineModeItem &GetWordLineMode( BOOL = TRUE ) const; + inline const SvxContourItem &GetContour( BOOL = TRUE ) const; + inline const SvxKerningItem &GetKerning( BOOL = TRUE ) const; + inline const SvxUnderlineItem &GetUnderline( BOOL = TRUE ) const; + inline const SvxCrossedOutItem &GetCrossedOut( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetSize( BOOL = TRUE ) const; + inline const SvxPropSizeItem &GetPropSize( BOOL = TRUE ) const; + INLINE const SvxFontItem &GetFont( BOOL = TRUE ) const; + inline const SvxColorItem &GetColor( BOOL = TRUE ) const; + inline const SvxCharSetColorItem &GetCharSetColor( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetLanguage( BOOL = TRUE ) const; + inline const SvxEscapementItem &GetEscapement( BOOL = TRUE ) const; + inline const SvxCaseMapItem &GetCaseMap( BOOL = TRUE ) const; + inline const SvxNoHyphenItem &GetNoHyphenHere( BOOL = TRUE ) const; + inline const SvxBlinkItem &GetBlink( BOOL = TRUE ) const; + inline const SvxBrushItem &GetChrBackground( BOOL = TRUE ) const; + inline const SvxFontItem &GetCJKFont( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetCJKSize( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetCJKLanguage( BOOL = TRUE ) const; + inline const SvxPostureItem &GetCJKPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetCJKWeight( BOOL = TRUE ) const; + inline const SvxFontItem &GetCTLFont( BOOL = TRUE ) const; + inline const SvxFontHeightItem &GetCTLSize( BOOL = TRUE ) const; + inline const SvxLanguageItem &GetCTLLanguage( BOOL = TRUE ) const; + inline const SvxPostureItem &GetCTLPosture( BOOL = TRUE ) const; + inline const SvxWeightItem &GetCTLWeight( BOOL = TRUE ) const; + inline const SfxBoolItem &GetWritingDirection( BOOL = TRUE ) const; + inline const SvxEmphasisMarkItem &GetEmphasisMark( BOOL = TRUE ) const; + inline const SvxTwoLinesItem &Get2Lines( BOOL = TRUE ) const; + inline const SvxCharScaleWidthItem &GetCharScaleW( BOOL = TRUE ) const; + inline const SvxCharRotateItem &GetCharRotate( BOOL = TRUE ) const; + inline const SvxCharReliefItem &GetCharRelief( BOOL = TRUE ) const; + + // Frame-Attribute - impl. steht im frmatr.hxx + INLINE const SwFmtFillOrder &GetFillOrder( BOOL = TRUE ) const; + INLINE const SwFmtFrmSize &GetFrmSize( BOOL = TRUE ) const; + INLINE const SvxPaperBinItem &GetPaperBin( BOOL = TRUE ) const; + INLINE const SvxLRSpaceItem &GetLRSpace( BOOL = TRUE ) const; + INLINE const SvxULSpaceItem &GetULSpace( BOOL = TRUE ) const; + INLINE const SwFmtCntnt &GetCntnt( BOOL = TRUE ) const; + INLINE const SwFmtHeader &GetHeader( BOOL = TRUE ) const; + INLINE const SwFmtFooter &GetFooter( BOOL = TRUE ) const; + INLINE const SvxPrintItem &GetPrint( BOOL = TRUE ) const; + INLINE const SvxOpaqueItem &GetOpaque( BOOL = TRUE ) const; + INLINE const SvxProtectItem &GetProtect( BOOL = TRUE ) const; + INLINE const SwFmtSurround &GetSurround( BOOL = TRUE ) const; + INLINE const SwFmtVertOrient &GetVertOrient( BOOL = TRUE ) const; + INLINE const SwFmtHoriOrient &GetHoriOrient( BOOL = TRUE ) const; + INLINE const SwFmtAnchor &GetAnchor( BOOL = TRUE ) const; + INLINE const SvxBoxItem &GetBox( BOOL = TRUE ) const; + INLINE const SvxFmtKeepItem &GetKeep( BOOL = TRUE ) const; + INLINE const SvxBrushItem &GetBackground( BOOL = TRUE ) const; + INLINE const SvxShadowItem &GetShadow( BOOL = TRUE ) const; + INLINE const SwFmtPageDesc &GetPageDesc( BOOL = TRUE ) const; + INLINE const SvxFmtBreakItem &GetBreak( BOOL = TRUE ) const; + INLINE const SwFmtCol &GetCol( BOOL = TRUE ) const; + INLINE const SvxMacroItem &GetMacro( BOOL = TRUE ) const; + INLINE const SwFmtURL &GetURL( BOOL = TRUE ) const; + INLINE const SwFmtEditInReadonly &GetEditInReadonly( BOOL = TRUE ) const; + INLINE const SwFmtLayoutSplit &GetLayoutSplit( BOOL = TRUE ) const; + INLINE const SwFmtChain &GetChain( BOOL = TRUE ) const; + INLINE const SwFmtLineNumber &GetLineNumber( BOOL = TRUE ) const; + INLINE const SwFmtFtnAtTxtEnd &GetFtnAtTxtEnd( BOOL = TRUE ) const; + INLINE const SwFmtEndAtTxtEnd &GetEndAtTxtEnd( BOOL = TRUE ) const; + INLINE const SwFmtNoBalancedColumns &GetBalancedColumns( BOOL = TRUE ) const; + INLINE const SvxFrameDirectionItem &GetFrmDir( BOOL = TRUE ) const; + INLINE const SwTextGridItem &GetTextGrid( BOOL = TRUE ) const; + inline const SwHeaderAndFooterEatSpacingItem &GetHeaderAndFooterEatSpacing( BOOL = TRUE ) const; + + // Grafik-Attribute - impl. steht im grfatr.hxx + INLINE const SwMirrorGrf &GetMirrorGrf( BOOL = TRUE ) const; + inline const SwCropGrf &GetCropGrf( BOOL = TRUE ) const; + inline const SwRotationGrf &GetRotationGrf(BOOL = TRUE ) const; + inline const SwLuminanceGrf &GetLuminanceGrf(BOOL = TRUE ) const; + inline const SwContrastGrf &GetContrastGrf(BOOL = TRUE ) const; + inline const SwChannelRGrf &GetChannelRGrf(BOOL = TRUE ) const; + inline const SwChannelGGrf &GetChannelGGrf(BOOL = TRUE ) const; + inline const SwChannelBGrf &GetChannelBGrf(BOOL = TRUE ) const; + inline const SwGammaGrf &GetGammaGrf(BOOL = TRUE ) const; + inline const SwInvertGrf &GetInvertGrf(BOOL = TRUE ) const; + inline const SwTransparencyGrf &GetTransparencyGrf(BOOL = TRUE ) const; + inline const SwDrawModeGrf &GetDrawModeGrf(BOOL = TRUE ) const; + + // Paragraph-Attribute - impl. steht im paratr.hxx + inline const SvxLineSpacingItem &GetLineSpacing( BOOL = TRUE ) const; + inline const SvxAdjustItem &GetAdjust( BOOL = TRUE ) const; + inline const SvxFmtSplitItem &GetSplit( BOOL = TRUE ) const; + inline const SwRegisterItem &GetRegister( BOOL = TRUE ) const; + inline const SwNumRuleItem &GetNumRule( BOOL = TRUE ) const; + inline const SvxWidowsItem &GetWidows( BOOL = TRUE ) const; + inline const SvxOrphansItem &GetOrphans( BOOL = TRUE ) const; + inline const SvxTabStopItem &GetTabStops( BOOL = TRUE ) const; + inline const SvxHyphenZoneItem &GetHyphenZone( BOOL = TRUE ) const; + inline const SwFmtDrop &GetDrop( BOOL = TRUE ) const; + inline const SvxScriptSpaceItem &GetScriptSpace(BOOL = TRUE) const; + inline const SvxHangingPunctuationItem &GetHangingPunctuation(BOOL = TRUE) const; + inline const SvxForbiddenRuleItem &GetForbiddenRule(BOOL = TRUE) const; + inline const SvxParaVertAlignItem &GetParaVertAlign(BOOL = TRUE) const; + inline const SvxParaGridItem &GetParaGrid(BOOL = TRUE) const; + inline const SwParaConnectBorderItem &GetParaConnectBorder(BOOL = TRUE ) const; + + // TabellenBox-Attribute - impl. steht im cellatr.hxx + INLINE const SwTblBoxNumFormat &GetTblBoxNumFmt( BOOL = TRUE ) const; + INLINE const SwTblBoxFormula &GetTblBoxFormula( BOOL = TRUE ) const; + INLINE const SwTblBoxValue &GetTblBoxValue( BOOL = TRUE ) const; + + DECL_FIXEDMEMPOOL_NEWDEL(SwAttrSet) +}; + +//Helper for filters to find true lineheight of a font +long AttrSetToLineHeight(const SwDoc &rDoc, const SwAttrSet &rSet, + const OutputDevice &rOut, sal_Int16 nScript); +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swbaslnk.hxx b/inc/bf_sw/swbaslnk.hxx new file mode 100644 index 000000000..3cb6cd33a --- /dev/null +++ b/inc/bf_sw/swbaslnk.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWBASLNK_HXX +#define _SWBASLNK_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <bf_so3/lnkbase.hxx> +namespace binfilter { + +class SwNode; +class SwCntntNode; +class SwNodeIndex; + +class SwBaseLink : public ::binfilter::SvBaseLink +{ + SwCntntNode* pCntntNode; + BOOL bSwapIn : 1; + BOOL bNoDataFlag : 1; + BOOL bIgnoreDataChanged : 1; + +public: + TYPEINFO(); + + SwBaseLink( USHORT nMode, USHORT nFormat, SwCntntNode* pNode = 0 ) + : ::binfilter::SvBaseLink( nMode, nFormat ), pCntntNode( pNode ), + bSwapIn( FALSE ), bNoDataFlag( FALSE ), bIgnoreDataChanged( FALSE ) + {} + virtual ~SwBaseLink(); + + virtual void DataChanged( const String& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + + + + SwCntntNode *GetCntntNode() { return pCntntNode; } + + // nur fuer Grafiken + bool SwapIn( BOOL bWaitForData = FALSE, BOOL bNativFormat = FALSE ); + + bool IsShowQuickDrawBmp() const; // nur fuer Grafiken + + bool Connect() { return 0 != SvBaseLink::GetRealObject(); } + + // nur fuer Grafik-Links ( zum Umschalten zwischen DDE / Grf-Link) + void SetObjType( USHORT nType ) { SvBaseLink::SetObjType( nType ); } + + BOOL IsRecursion( const SwBaseLink* pChkLnk ) const; + virtual BOOL IsInRange( ULONG nSttNd, ULONG nEndNd, xub_StrLen nStt = 0, + xub_StrLen nEnd = STRING_NOTFOUND ) const; + + void SetNoDataFlag() { bNoDataFlag = TRUE; } + BOOL ChkNoDataFlag() { return bNoDataFlag ? !(bNoDataFlag = FALSE) : FALSE; } + BOOL IsNoDataFlag() const { return bNoDataFlag; } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swcalwrp.hxx b/inc/bf_sw/swcalwrp.hxx new file mode 100644 index 000000000..8cc4c16be --- /dev/null +++ b/inc/bf_sw/swcalwrp.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWCALWRP_HXX +#define _SWCALWRP_HXX + +#include <i18npool/lang.h> +#include <bf_tools/string.hxx> +#include <unotools/calendarwrapper.hxx> +namespace binfilter { + +class SwCalendarWrapper : public CalendarWrapper +{ + String sUniqueId; + USHORT nLang; + +public: + SwCalendarWrapper( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory > & xMSF ) + : CalendarWrapper( xMSF ), nLang( LANGUAGE_SYSTEM ) + {} + +}; + + +extern SwCalendarWrapper* pCalendarWrapper; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swcrsr.hxx b/inc/bf_sw/swcrsr.hxx new file mode 100644 index 000000000..fc239accd --- /dev/null +++ b/inc/bf_sw/swcrsr.hxx @@ -0,0 +1,214 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWCRSR_HXX +#define _SWCRSR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <pam.hxx> +#include <tblsel.hxx> +#include <cshtyp.hxx> +namespace com { namespace sun { namespace star { namespace util { + struct SearchOptions; +} } } } + +namespace binfilter { + + +class SwShellCrsr; +class SwShellTableCrsr; +class SwTableCursor; +class SwUnoCrsr; +class SwUnoTableCrsr; +struct _SwCursor_SavePos; + + + +// ein Basis-Struktur fuer die Parameter der Find-Methoden +// return - Werte vom Found-Aufruf. +const int FIND_NOT_FOUND = 0; +const int FIND_FOUND = 1; +const int FIND_NO_RING = 2; + +struct SwFindParas +{ + virtual int Find( SwPaM*, SwMoveFn, const SwPaM*, bool ) = 0; + virtual int IsReplaceMode() const = 0; + +protected: + ~SwFindParas() {} +}; + +enum SwCursorSelOverFlags +{ + SELOVER_NONE = 0x00, + SELOVER_CHECKNODESSECTION = 0x01, + SELOVER_TOGGLE = 0x02, + SELOVER_ENABLEREVDIREKTION = 0x04, + SELOVER_CHANGEPOS = 0x08 +}; + +class SwCursor : public SwPaM +{ + friend class SwCrsrSaveState; + + _SwCursor_SavePos* pSavePos; + BYTE nCursorBidiLevel; // bidi level of the cursor + +protected: + virtual _SwCursor_SavePos* CreateNewSavePos() const; + void SaveState(); + void RestoreState(); + + const _SwCursor_SavePos* GetSavePos() const { return pSavePos; } + +public: + SwCursor( const SwPosition &rPos, SwPaM* pRing = 0 ); + virtual ~SwCursor(); + + + virtual operator SwShellCrsr* () { return NULL; } // DBG_BF_ASSERT + virtual operator SwShellTableCrsr* () { return NULL; } // DBG_BF_ASSERT + virtual operator SwTableCursor* () { return NULL; } // DBG_BF_ASSERT + virtual operator SwUnoCrsr* () { return NULL; } // DBG_BF_ASSERT + virtual operator SwUnoTableCrsr* () { return NULL; } // DBG_BF_ASSERT + + inline operator const SwShellCrsr* () const; + inline operator const SwShellTableCrsr* () const; + inline operator const SwTableCursor* () const; + inline operator const SwUnoCrsr* () const; + inline operator const SwUnoTableCrsr* () const; + + virtual void SaveTblBoxCntnt( const SwPosition* = NULL ) {} // DBG_BF_ASSERT + + bool LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, BOOL bAllowVisual, + BOOL bInsertCrsr ); + + bool Left( USHORT nCnt, USHORT nMode, BOOL bAllowVisual = FALSE ) + { return LeftRight( TRUE, nCnt, nMode, bAllowVisual, FALSE ); } + bool Right( USHORT nCnt, USHORT nMode, BOOL bAllowVisual = FALSE ) + { return LeftRight( FALSE, nCnt, nMode, bAllowVisual, FALSE ); } + + bool MovePara( SwWhichPara, SwPosPara ); + bool MoveSection( SwWhichSection, SwPosSection ); + bool MoveTable( SwWhichTable, SwPosTable ); + + + // gibt es eine Selection vom Content in die Tabelle + // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt + virtual bool IsSelOvr( int eFlags = + ( SELOVER_CHECKNODESSECTION | + SELOVER_TOGGLE | SELOVER_CHANGEPOS )); + virtual bool IsInProtectTable( bool bMove = FALSE, + bool bChgCrsr = TRUE ); + + + // TRUE: an die Position kann der Cursor gesetzt werden + virtual bool IsAtValidPos( BOOL = TRUE ) const { return false; } // DBG_BF_ASSERT + + // darf der Cursor in ReadOnlyBereiche? + bool IsReadOnlyAvailable() const; + + BYTE GetCrsrBidiLevel() const { return nCursorBidiLevel; } + void SetCrsrBidiLevel( BYTE nNewLevel ) { nCursorBidiLevel = nNewLevel; } + + DECL_FIXEDMEMPOOL_NEWDEL( SwCursor ) +}; + + +class SwCrsrSaveState +{ + SwCursor& rCrsr; +public: + SwCrsrSaveState( SwCursor& rC ) : rCrsr( rC ) { rC.SaveState(); } + ~SwCrsrSaveState() { rCrsr.RestoreState(); } +}; + +struct _SwCursor_SavePos +{ + ULONG nNode; + xub_StrLen nCntnt; + _SwCursor_SavePos* pNext; + + _SwCursor_SavePos( const SwCursor& rCrsr ) + : nNode( rCrsr.GetPoint()->nNode.GetIndex() ), + nCntnt( rCrsr.GetPoint()->nContent.GetIndex() ), + pNext( 0 ) + {} + virtual ~_SwCursor_SavePos() {} + + DECL_FIXEDMEMPOOL_NEWDEL( _SwCursor_SavePos ) +}; + + + +class SwTableCursor : public virtual SwCursor +{ + +protected: + ULONG nTblPtNd, nTblMkNd; + xub_StrLen nTblPtCnt, nTblMkCnt; + SwSelBoxes aSelBoxes; + BOOL bChg : 1; + BOOL bParked : 1; // Tabellen-Cursor wurde geparkt + +public: + SwTableCursor( SwTableCursor& ); + virtual ~SwTableCursor(); + + virtual operator SwTableCursor* (); + + void DeleteBox( USHORT nPos ) { aSelBoxes.Remove( nPos ); bChg = TRUE; } + USHORT GetBoxesCount() const { return aSelBoxes.Count(); } + const SwSelBoxes& GetBoxes() const { return aSelBoxes; } +}; + + +// --------------------------- inline Methoden ---------------------- + +inline SwCursor::operator const SwShellCrsr* () const +{ + return (SwShellCrsr*)*((SwCursor*)this); +} + +inline SwCursor::operator const SwShellTableCrsr* () const +{ + return (SwShellTableCrsr*)*((SwCursor*)this); +} + +inline SwCursor::operator const SwTableCursor* () const +{ + return (SwTableCursor*)*((SwCursor*)this); +} + +inline SwCursor::operator const SwUnoCrsr* () const +{ + return (SwUnoCrsr*)*((SwCursor*)this); +} + +inline SwCursor::operator const SwUnoTableCrsr* () const +{ + return (SwUnoTableCrsr*)*((SwCursor*)this); +} + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swdbdata.hxx b/inc/bf_sw/swdbdata.hxx new file mode 100644 index 000000000..a76fc0f96 --- /dev/null +++ b/inc/bf_sw/swdbdata.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWDBDATA_HXX +#define _SWDBDATA_HXX + +#include <bf_svtools/bf_solar.h> + +#include "rtl/ustring.hxx" +namespace binfilter { + +// contains the description of a data source +struct SwDBData +{ + ::rtl::OUString sDataSource; + ::rtl::OUString sCommand; //table, query or statement + sal_Int32 nCommandType; //com::sun::star::sdb::CommandType + SwDBData() : + nCommandType(0){} + + BOOL operator !=(const SwDBData& rCmp) const + {return rCmp.sDataSource != sDataSource || rCmp.sCommand != sCommand || rCmp.nCommandType != nCommandType;} + BOOL operator ==(const SwDBData& rCmp) const + {return rCmp.sDataSource == sDataSource && rCmp.sCommand == sCommand && rCmp.nCommandType == nCommandType;} +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swddetbl.hxx b/inc/bf_sw/swddetbl.hxx new file mode 100644 index 000000000..079bfccb4 --- /dev/null +++ b/inc/bf_sw/swddetbl.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWDDETBL_HXX +#define _SWDDETBL_HXX + +#include <bf_svtools/bf_solar.h> + +#include "swtable.hxx" +namespace binfilter { + +class SwDDEFieldType; + +class SwDDETable : public SwTable +{ +public: + TYPEINFO(); + // Constructor movet alle Lines/Boxen aus der SwTable zu sich. + // Die SwTable ist danach Leer und muss geloescht werden. + SwDDETable( SwTable& rTable, SwDDEFieldType*, BOOL = TRUE ) + : SwTable( rTable ) + {} + SwDDEFieldType* GetDDEFldType() { DBG_BF_ASSERT(0, "STRIP"); return NULL; } + inline const SwDDEFieldType* GetDDEFldType() const; +}; + + +// ----------- Inlines ----------------------------- + +inline const SwDDEFieldType* SwDDETable::GetDDEFldType() const +{ + return ((SwDDETable*)this)->GetDDEFldType(); +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swdll.hxx b/inc/bf_sw/swdll.hxx new file mode 100644 index 000000000..ad178911c --- /dev/null +++ b/inc/bf_sw/swdll.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef SW_SWDLL_HXX +#define SW_SWDLL_HXX + +#include <bf_svtools/bf_solar.h> + +class ResMgr; +class SvFactory; +class SotFactory; +class StatusBar; + +class SfxMedium; +class SfxFilter; + +#include <bf_sfx2/sfxdefs.hxx> +#include <bf_sfx2/module.hxx> + +#include <bf_so3/pseudo.hxx> + +namespace binfilter { + +class SwDLL + +/* [Description] + + This class is a wrapper for a Load-On-Demand-DLL. One instance + per SfxApplication will be created for the runtime of + SfxApplication-subclass::Main(). + + Remember: Do export this class! It is used by the application. +*/ + +{ + + static void RegisterFactories(); + +public: + // Ctor/Dtor must be linked to the application + SwDLL(); + ~SwDLL(); + + // static-init/exit-code must be linked to the application + static void LibInit(); // called from SfxApplication-subclass::Init() + static void LibExit(); // called from SfxApplication-subclass::Exit() + + // DLL-init/exit-code must be linked to the DLL only + static void Init(); // called directly after loading the DLL + static void Exit(); // called directly befor unloading the DLL + + static ULONG DetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter, + SfxFilterFlags nMust, SfxFilterFlags nDont ); + static ULONG GlobDetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter, + SfxFilterFlags nMust, SfxFilterFlags nDont ); + + static sal_Bool RegisterFrameLoaders( void* pServiceManager, void* pRegistryKey ); + static void* CreateFrameLoader( const sal_Char* pImplementationName, void* pServiceManager, void *pRegistryKey ); +}; + +//------------------------------------------------------------------------- + +class SwModuleDummy : public SfxModule + +/* [Description] + + This tricky class keeps pointers to the SvFactories while + the DLL isn`t loaded. A pointer to the one instance is available + through SXX_MOD() (shared-lib-app-data). +*/ + +{ +public: + virtual ~SwModuleDummy(); + TYPEINFO(); + // SvFactory name convention: + // 'p' + SfxObjectShell-subclass + 'Factory' + SotFactory* pSwDocShellFactory; + SotFactory* pSwWebDocShellFactory; + SotFactory* pSwGlobalDocShellFactory; + + SwModuleDummy( ResMgr *pResMgrIn, BOOL bDummyIn, + SotFactory* pWebFact, + SotFactory* pFact, + SotFactory* pGlobalFact ) + : SfxModule(pResMgrIn, bDummyIn, + (SfxObjectFactory*)pFact, + (SfxObjectFactory*)pWebFact, + (SfxObjectFactory*)pGlobalFact, 0L), + pSwDocShellFactory( pFact ), + pSwWebDocShellFactory( pWebFact ), + pSwGlobalDocShellFactory( pGlobalFact ) + {} + + virtual SfxModule* Load(); +}; + +//------------------------------------------------------------------------- + +#define SW_DLL() ( *(SwModuleDummy**) GetAppData(BF_SHL_WRITER) ) + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swerror.h b/inc/bf_sw/swerror.h new file mode 100644 index 000000000..0d4af41ee --- /dev/null +++ b/inc/bf_sw/swerror.h @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWSWERROR_H +#define _SWSWERROR_H + +#ifndef _ERRCODE_HXX +#include <tools/errcode.hxx> +#endif + +#define ERROR_SW_BASE (ERRCODE_AREA_SW) +#define ERROR_SW_READ_BASE (ERROR_SW_BASE | ERRCODE_CLASS_READ) +#define ERROR_SW_WRITE_BASE (ERROR_SW_BASE | ERRCODE_CLASS_WRITE) + +#define WARN_SW_BASE (ERRCODE_AREA_SW | ERRCODE_WARNING_MASK) +#define WARN_SW_READ_BASE (WARN_SW_BASE | ERRCODE_CLASS_READ ) +#define WARN_SW_WRITE_BASE (WARN_SW_BASE | ERRCODE_CLASS_WRITE ) + + +// Import Fehler +#define ERR_SWG_FILE_FORMAT_ERROR (ERROR_SW_READ_BASE | 1 ) +#define ERR_SWG_READ_ERROR (ERROR_SW_READ_BASE | 2 ) + +#define ERR_SW6_INPUT_FILE (ERROR_SW_READ_BASE | 4 ) +#define ERR_SW6_NOWRITER_FILE (ERROR_SW_READ_BASE | 5 ) +#define ERR_SW6_UNEXPECTED_EOF (ERROR_SW_READ_BASE | 6 ) +#define ERR_SW6_PASSWD (ERROR_SW_READ_BASE | 7 ) + +#define ERR_WW6_NO_WW6_FILE_ERR (ERROR_SW_READ_BASE | 8 ) +#define ERR_WW6_FASTSAVE_ERR (ERROR_SW_READ_BASE | 9 ) + +#define ERR_W4W_WRITE_TMP_ERROR (ERROR_SW_READ_BASE | 10 ) +#define ERR_EXCLOT_WRONG_RANGE (ERROR_SW_READ_BASE | 11 ) + +#define ERR_FORMAT_ROWCOL (ERROR_SW_READ_BASE | 12) + +#define ERR_SWG_NEW_VERSION (ERROR_SW_READ_BASE | 13) +#define ERR_WW8_NO_WW8_FILE_ERR (ERROR_SW_READ_BASE | 14) + +#define ERR_FORMAT_FILE_ROWCOL (ERROR_SW_READ_BASE | 15) + +// Export Fehler +#define ERR_SWG_WRITE_ERROR (ERROR_SW_WRITE_BASE | 30 ) +#define ERR_SWG_OLD_GLOSSARY (ERROR_SW_WRITE_BASE | 31 ) +#define ERR_SWG_CANNOT_WRITE (ERROR_SW_WRITE_BASE | 32 ) +#define ERR_W4W_READ_TMP_ERROR (ERROR_SW_WRITE_BASE | 33 ) +#define ERR_SWG_LARGE_DOC_ERROR (ERROR_SW_WRITE_BASE | 34 ) +#define ERR_WRITE_ERROR_FILE (ERROR_SW_WRITE_BASE | 35 ) + +// Import/Export Fehler +#define ERR_SWG_INTERNAL_ERROR (ERROR_SW_BASE | 50 ) + +#define ERR_W4W_MEM (ERROR_SW_BASE | 51 ) +#define ERR_W4W_WRITE_FULL (ERROR_SW_BASE | 52 ) +#define ERR_W4W_INTERNAL_ERROR (ERROR_SW_BASE | 53 ) +#define ERR_W4W_DLL_ERROR (ERROR_SW_BASE | 54 ) + +#define ERR_TXTBLOCK_NEWFILE_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_LOCKING | 55 ) + +// weitere Fehler und Fehlerklassen +#define ERR_AUTOPATH_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_PATH | 55 ) +#define ERR_TBLSPLIT_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 56 ) +#define ERR_TBLINSCOL_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 57 ) +#define ERR_TBLDDECHG_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 58 ) + +// ----- Warnings --------------------------- + +// Import - Warnings +#define WARN_SWG_NO_DRAWINGS (WARN_SW_READ_BASE | 70 ) +#define WARN_WW6_FASTSAVE_ERR (WARN_SW_READ_BASE | 71 ) +// continued below + +// Import & Export - Warnings +#define WARN_SWG_FEATURES_LOST (WARN_SW_BASE | 72 ) +#define WARN_SWG_OLE (WARN_SW_BASE | 73 ) +#define WARN_SWG_POOR_LOAD (WARN_SW_BASE | 74 ) + +// Export warnings +#define WARN_SWG_HTML_NO_MACROS (WARN_SW_WRITE_BASE |75) +#define WARN_WRITE_ERROR_FILE (WARN_SW_WRITE_BASE |76) + +// More Import & Export - Warnings +#define WARN_FORMAT_FILE_ROWCOL (WARN_SW_READ_BASE | 77) +#define WARN_UNCONVERTABLE_CHARS (WARN_SW_WRITE_BASE | 78) + +#ifndef __RSC + +inline bool IsWarning( ULONG nErr ) +{ + return 0 != ( nErr & ERRCODE_WARNING_MASK & nErr ); +} + +inline bool IsError( ULONG nErr ) +{ + return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr ); +} + +#endif + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swevent.hxx b/inc/bf_sw/swevent.hxx new file mode 100644 index 000000000..f8e683e45 --- /dev/null +++ b/inc/bf_sw/swevent.hxx @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWEVENT_HXX +#define _SWEVENT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_sfx2/sfx.hrc> + +namespace binfilter { + +#define SW_EVENT_OBJECT_SELECT ( EVENT_APP_START + 0 ) +#define SW_EVENT_START_INS_GLOSSARY ( EVENT_APP_START + 1 ) +#define SW_EVENT_END_INS_GLOSSARY ( EVENT_APP_START + 2 ) +#define SW_EVENT_MAIL_MERGE ( EVENT_APP_START + 3 ) +#define SW_EVENT_FRM_KEYINPUT_ALPHA ( EVENT_APP_START + 4 ) +#define SW_EVENT_FRM_KEYINPUT_NOALPHA ( EVENT_APP_START + 5 ) +#define SW_EVENT_FRM_RESIZE ( EVENT_APP_START + 6 ) +#define SW_EVENT_FRM_MOVE ( EVENT_APP_START + 7 ) +#define SW_EVENT_PAGE_COUNT ( EVENT_APP_START + 8 ) +#define SW_EVENT_MAIL_MERGE_END ( EVENT_APP_START + 9 ) + + +class SwFrmFmt; +class SwFmtINetFmt; +class IMapObject; + +// enum fuer Objecte die Events ins Basic oder in JavaScript Callen +enum SwCallEventObjectType +{ + EVENT_OBJECT_NONE = 0, // Null ist garnichts + EVENT_OBJECT_IMAGE, + EVENT_OBJECT_INETATTR, + EVENT_OBJECT_URLITEM, + EVENT_OBJECT_IMAGEMAP +}; + +// structur fuer den Austausch zwischen UI/CORE + +struct SwCallMouseEvent +{ + SwCallEventObjectType eType; + union + { + // EVENT_OBJECT_IMAGE/EVENT_OBJECT_URLITEM + const SwFrmFmt* pFmt; + + // EVENT_OBJECT_INETATTR + const SwFmtINetFmt* pINetAttr; + + // EVENT_OBJECT_IMAGEMAP + struct + { + const SwFrmFmt* pFmt; + const IMapObject* pIMapObj; + } IMAP; + } PTR; + + SwCallMouseEvent() + : eType( EVENT_OBJECT_NONE ) + { PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; } + + void Set( SwCallEventObjectType eTyp, const SwFrmFmt* pFmt ) + { eType = eTyp; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = 0; } + + void Set( const SwFrmFmt* pFmt, const IMapObject* pIMapObj ) + { eType = EVENT_OBJECT_IMAGEMAP; PTR.pFmt = pFmt; PTR.IMAP.pIMapObj = pIMapObj; } + + void Set( const SwFmtINetFmt* pINetAttr ) + { eType = EVENT_OBJECT_INETATTR; PTR.pINetAttr = pINetAttr; PTR.IMAP.pIMapObj = 0; } + + int operator==( const SwCallMouseEvent& rEvent ) const + { + return eType == rEvent.eType && + PTR.pFmt == rEvent.PTR.pFmt && + PTR.IMAP.pIMapObj == rEvent.PTR.IMAP.pIMapObj; + } + int operator!=( const SwCallMouseEvent& rEvent ) const + { return !( *this == rEvent ); } + + void Clear() + { eType = EVENT_OBJECT_NONE; PTR.pFmt = 0; PTR.IMAP.pIMapObj = 0; } + + BOOL HasEvent() const { return EVENT_OBJECT_NONE != eType; } +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swfltopt.hxx b/inc/bf_sw/swfltopt.hxx new file mode 100644 index 000000000..f6007e08c --- /dev/null +++ b/inc/bf_sw/swfltopt.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWFTLOPT_HXX +#define _SWFTLOPT_HXX + +#include <unotools/configitem.hxx> +namespace binfilter { + +class SwFilterOptions : public ::utl::ConfigItem +{ +public: + SwFilterOptions( sal_uInt16 nCnt, const sal_Char** ppNames, + sal_uInt32* pValues ); + + void GetValues( sal_uInt16 nCnt, const sal_Char** ppNames, + sal_uInt32* pValues ); + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swgpar.hxx b/inc/bf_sw/swgpar.hxx new file mode 100644 index 000000000..970d6f839 --- /dev/null +++ b/inc/bf_sw/swgpar.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWGPAR_HXX +#define _SWGPAR_HXX + +#include <bf_svtools/bf_solar.h> + +class UniString; +class SvStream; +namespace binfilter { + + +class SwDoc; +class SwPaM; +class SwSwgReader; + + +class SfxDocumentInfo; + +enum SwgReadOptions { + SWGRD_CHARFMTS = 0x0001, // Zeichenvorlagen + SWGRD_FRAMEFMTS = 0x0002, // Rahmenvorlagen + SWGRD_PARAFMTS = 0x0004, // Absatzvorlagen + SWGRD_PAGEFMTS = 0x0008, // Seitenvorlagen + SWGRD_MACROS = 0x0010, // globale Makros + SWGRD_NUMRULES = 0x0020, // globale Numerierungsregeln + + SWGRD_FORCE = 0x1000, // Vorlagen immer einlesen + + SWGRD_NORMAL = 0x00FF // alles (Normalfall) +}; + +class SwSwgParser +{ +private: + SwSwgReader* pRdr; +public: + ULONG CallParser( USHORT = SWGRD_NORMAL ); + BOOL NeedsPasswd(); + BOOL CheckPasswd( const UniString& ); + + SwSwgParser( SwDoc *pSwDoc, const SwPaM* pSwPaM, + SvStream *pIstream, const UniString& rFileName, //$ istream + BOOL bNewDoc=TRUE ); + SwSwgParser( SvStream *pIstream ); //$ istream + ~SwSwgParser(); +}; + +} //namespace binfilter +#endif // _SWGPAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swgstr.hxx b/inc/bf_sw/swgstr.hxx new file mode 100644 index 000000000..c531249bd --- /dev/null +++ b/inc/bf_sw/swgstr.hxx @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWGSTR_HXX +#define _SWGSTR_HXX + +#include <bf_svtools/bf_solar.h> +#include <bf_tools/string.hxx> +#include <tools/stream.hxx> +namespace binfilter { + +typedef long long3; // Zur Dokumentation: 3-byte-Longs + +#define MAX_BEGIN 64 // Maximale Blockschachtelung +#define PASSWDLEN 16 // Maximale Passwortlaenge + +// Neue Version mit SvStreams + +// Passwort- und Codierungs-Funktionalitaet + +class swcrypter { +protected: + sal_Char cPasswd[ PASSWDLEN ]; // Passwort-Puffer + BOOL bPasswd; // TRUE wenn mit Passwort + void encode( sal_Char*, USHORT ); // Puffer codieren/decodieren +public: + swcrypter(); + BOOL setpasswd( const String& ); // Passwort setzen + void copypasswd( const sal_Char* ); // Passwort direkt setzen + const sal_Char* getpasswd() { return cPasswd; } +}; + +// Reader/Writer-Stream-Basisklasse mit Pufferverwaltung fuer Texte +// und Spezial-I/O fuer 3-Byte-Longs + +class swstreambase : public swcrypter { +protected: + SvStream* pStrm; // eigentlicher Stream + sal_Char* pBuf; // Zwischenpuffer + USHORT nBuflen; // Laenge des Zwischenpuffers + short nLong; // Long-Laenge (3 oder 4) + BOOL bTempStrm; // TRUE: Stream loeschen + void checkbuf( USHORT ); // Testen der Pufferlaenge + + swstreambase( SvStream& ); + + swstreambase( const swstreambase& ); + int operator=( const swstreambase& ); +public: + ~swstreambase(); + SvStream& Strm() { return *pStrm; } + sal_Char* GetBuf() { return pBuf; } + + // Zusatzfunktionen zur I/O von LONGs als 3-Byte-Zahlen + + void long3() { nLong = 3; } + void long4() { nLong = 4; } + + void sync( swstreambase& r ) { pStrm->Seek( r.tell() ); } + + // Alias- und Hilfsfunktionen + + void seek( long nPos ) { pStrm->Seek( nPos ); } + long tell() { return pStrm->Tell(); } + long filesize(); // Dateigroesse + void flush() { pStrm->Flush(); } + + void setbad(); + int good() { return ( pStrm->GetError() == SVSTREAM_OK ); } + int bad() { return ( pStrm->GetError() != SVSTREAM_OK ); } + int operator!() { return ( pStrm->GetError() != SVSTREAM_OK ); } + int eof() { return pStrm->IsEof(); } + + BYTE get(); + void get( void* p, USHORT n ) { pStrm->Read( (sal_Char*) p, n ); } + + inline swstreambase& operator>>( sal_Char& ); + inline swstreambase& operator>>( BYTE& ); + inline swstreambase& operator>>( short& ); + inline swstreambase& operator>>( USHORT& ); + swstreambase& operator>>( long& ); + inline swstreambase& operator>>( ULONG& ); +}; + +inline swstreambase& swstreambase::operator>>( sal_Char& c ) +{ + *pStrm >> c; return *this; +} + +inline swstreambase& swstreambase::operator>>( BYTE& c ) +{ + *pStrm >> c; return *this; +} + +inline swstreambase& swstreambase::operator>>( short& c ) +{ + *pStrm >> c; return *this; +} + +inline swstreambase& swstreambase::operator>>( USHORT& c ) +{ + *pStrm >> c; return *this; +} + +inline swstreambase& swstreambase::operator>>( ULONG& c ) +{ + return *this >> (long&) c; +} + +class swistream : public swstreambase { + BYTE cType; // Record-Typ + ULONG nOffset; // Record-Offset-Portion +public: + swistream( SvStream& ); + + BYTE peek(); // 1 Byte testen + BYTE next(); // Blockstart + BYTE cur() { return cType; } // aktueller Block + BYTE skipnext(); // Record ueberspringen + void undonext(); // next() rueckgaengig machen + long getskip() { return nOffset; } + void skip( long = -1L ); // Block ueberspringen + sal_Char* text(); // Textstring lesen (nach BEGIN) + long size(); // aktuelle Record-Laenge + +private: + swistream( const swistream& ); + int operator=( const swistream& ); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swhints.hxx b/inc/bf_sw/swhints.hxx new file mode 100644 index 000000000..c261bccfb --- /dev/null +++ b/inc/bf_sw/swhints.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SW_HINTS_HXX +#define SW_HINTS_HXX + +namespace binfilter { + +#define SW_BROADCASTID_START SFX_HINT_USER00 +#define SW_BROADCAST_DRAWVIEWS_CREATED SW_BROADCASTID_START + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swmodule.hxx b/inc/bf_sw/swmodule.hxx new file mode 100644 index 000000000..b25e85a1c --- /dev/null +++ b/inc/bf_sw/swmodule.hxx @@ -0,0 +1,196 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWMODULE_HXX +#define _SWMODULE_HXX + + +#include <tools/link.hxx> +#include <bf_sfx2/module.hxx> + +#include <bf_svtools/lstner.hxx> +#include <swdll.hxx> +#include "shellid.hxx" +#include <bf_tools/string.hxx> +#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp> +#include <tools/fldunit.hxx> +namespace com{ namespace sun{ namespace star{ namespace scanner{ + class XScannerManager; +}}}} + +class Color; + +namespace binfilter { +class SvStringsDtor; +class SvtAccessibilityOptions; +class SvtCTLOptions; +class SfxItemSet; +class SfxErrorHandler; +class ColorConfig; +class AuthorCharAttr; + +class SfxRequest; + +class SwDBConfig; +class SwModuleOptions; +class SwMasterUsrPref; +class SwViewOption; +class SwView; +class SwPrintOptions; +class SwAutoFmtOpt; +class SwChapterNumRules; +class SwStdFontConfig; +class SwAttrPool; + +struct SwDBData; +#define VIEWOPT_DEST_VIEW 0 +#define VIEWOPT_DEST_TEXT 1 +#define VIEWOPT_DEST_WEB 2 +#define VIEWOPT_DEST_VIEW_ONLY 3 //ViewOptions werden nur an der ::com::sun::star::sdbcx::View, nicht an der Appl. gesetzt + +class SwModule: public SwModuleDummy , public SfxListener +{ + String sActAuthor; + + // ConfigItems + SwModuleOptions* pModuleConfig; + SwMasterUsrPref* pUsrPref; + SwMasterUsrPref* pWebUsrPref; + SwPrintOptions* pPrtOpt; + SwPrintOptions* pWebPrtOpt; + SwStdFontConfig* pStdFontConfig; + SwDBConfig* pDBConfig; + ColorConfig* pColorConfig; + SvtCTLOptions* pCTLOptions; + + SfxErrorHandler* pErrorHdl; + + SwAttrPool *pAttrPool; + + // Die aktuelle View wird hier gehalten um nicht ueber + // GetActiveView arbeiten zu muessen + // Die View ist solange gueltig bis Sie im Activate + // zerstoert oder ausgetauscht wird + SwView* pView; + + // Liste aller Redline-Autoren + SvStringsDtor* pAuthorNames; + + // DictionaryList listener to trigger spellchecking or hyphenation + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener > xLngSvcEvtListener; + ::com::sun::star::uno::Reference< + ::com::sun::star::scanner::XScannerManager > m_xScannerManager; + + sal_Bool bAuthorInitialised : 1; + sal_Bool bEmbeddedLoadSave : 1; + + // Hint abfangen fuer DocInfo + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + +public: + TYPEINFO(); + + // dieser Ctor nur fuer SW-Dll + SwModule( SvFactory* pFact, + SvFactory* pWebFact, + SvFactory* pGlobalFact ); + // dieser Ctor nur fuer Web-Dll + SwModule( SvFactory* pWebFact ); + + ~SwModule(); + + virtual SfxModule* Load(); + + // View setzen nur fuer internen Gebrauch, + // aus techn. Gruenden public + // + inline void SetView(SwView* pVw) { pView = pVw; } + inline SwView* GetView() { return pView; } + + // Benutzereinstellungen modifizieren + const SwMasterUsrPref *GetUsrPref(sal_Bool bWeb) const; + const SwViewOption* GetViewOption(sal_Bool bWeb); + + // ConfigItems erzeugen + SwModuleOptions* GetModuleConfig() { return pModuleConfig;} + SwPrintOptions* GetPrtOptions(sal_Bool bWeb); + SwStdFontConfig* GetStdFontConfig() { return pStdFontConfig; } + SwDBConfig* GetDBConfig(); + ColorConfig& GetColorConfig(); + SvtCTLOptions& GetCTLOptions(); + + sal_Bool IsEmbeddedLoadSave() const { return bEmbeddedLoadSave; } + void SetEmbeddedLoadSave( sal_Bool bFlag ) { bEmbeddedLoadSave = bFlag; } + + // Redlining + const String& GetRedlineAuthor(sal_uInt16 nPos); + sal_uInt16 InsertRedlineAuthor(const String& rAuthor); //SW50.SDW + + // returne den definierten DocStat - WordDelimiter + const String& GetDocStatWordDelim() const; + + // Durchreichen der Metric von der ModuleConfig (fuer HTML-Export) + sal_uInt16 GetMetric( sal_Bool bWeb ) const; + + // Update-Stati durchreichen + sal_uInt16 GetLinkUpdMode( sal_Bool bWeb ) const; + sal_uInt16 GetFldUpdateFlags( sal_Bool bWeb ) const; + + //hier wird der Pool angelegt und an der SfxShell gesetzt + void InitAttrPool(); + //Pool loeschen bevor es zu spaet ist + void RemoveAttrPool(); + + inline ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener > + GetLngSvcEvtListener(); + inline void SetLngSvcEvtListener( ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener > & xLstnr); + void CreateLngSvcEvtListener(); + + ::com::sun::star::uno::Reference< + ::com::sun::star::scanner::XScannerManager > + GetScannerManager() const {return m_xScannerManager;} +}; + + +inline ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener > + SwModule::GetLngSvcEvtListener() +{ + return xLngSvcEvtListener; +} + +inline void SwModule::SetLngSvcEvtListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener > & xLstnr) +{ + xLngSvcEvtListener = xLstnr; +} + + +#define SW_MOD() ( *(SwModule**) GetAppData(BF_SHL_WRITER)) +SwView* GetActiveView(); + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swpre.mk b/inc/bf_sw/swpre.mk new file mode 100644 index 000000000..0b661c06b --- /dev/null +++ b/inc/bf_sw/swpre.mk @@ -0,0 +1,37 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + + +#====================================================================== +# standardmaessig mit Optimierung, muss explizit mit nopt=t ausgeschaltet +# werden, wenn nicht gewuenscht +#---------------------------------------------------------------------- + +.IF "$(nopt)"!="" || "$(NOPT)"!="" +nopt=true +NOPT=TRUE +optimize= +OPTIMIZE= +.ELSE +.IF "$(debug)$(DEBUG)"=="" +optimize=true +OPTIMIZE=TRUE +.ENDIF +.ENDIF + + diff --git a/inc/bf_sw/swprtopt.hxx b/inc/bf_sw/swprtopt.hxx new file mode 100644 index 000000000..231644ffa --- /dev/null +++ b/inc/bf_sw/swprtopt.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWPRTOPT_HXX +#define _SWPRTOPT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/multisel.hxx> +#include <printdata.hxx> +namespace binfilter { + +#define POSTITS_NONE 0 +#define POSTITS_ONLY 1 +#define POSTITS_ENDDOC 2 +#define POSTITS_ENDPAGE 3 + +class SwPrtOptions : public SwPrintData +{ + USHORT nJobNo; + String sJobName; + +public: + SwPrtOptions( const String& rJobName ) + : nJobNo( 1 ) + , sJobName( rJobName ) + , aOffset( Point(0,0) ) + , nMergeCnt( 0 ) + , nMergeAct( 0 ) + , bCollate(FALSE) + , bPrintSelection (FALSE) + , bJobStartet(FALSE) + {} + + const String& GetJobName() const { return sJobName; } + + MultiSelection aMulti; + Point aOffset; + ULONG nMergeCnt; // Anzahl der Serienbriefe + ULONG nMergeAct; // Aktueller Serienbriefnr. + USHORT nCopyCount; + + BOOL bCollate, + bPrintSelection, // Markierung drucken + bJobStartet; + + SwPrtOptions& operator=(const SwPrintData& rData) + { + SwPrintData::operator=(rData); + return *this; + } +}; + + +} //namespace binfilter +#endif //_SWPRTOPT_HXX + + + + + + + + + + + + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swrect.hxx b/inc/bf_sw/swrect.hxx new file mode 100644 index 000000000..d7fefaa3a --- /dev/null +++ b/inc/bf_sw/swrect.hxx @@ -0,0 +1,383 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWRECT_HXX +#define _SWRECT_HXX + +#include <bf_svtools/bf_solar.h> +#include <osl/diagnose.h> + + +#include <tools/gen.hxx> +class SvStream; +namespace binfilter { + + +class SwRect +{ + long nX; + long nY; + long nWidth; + long nHeight; + + +public: + inline SwRect(); + inline SwRect( const SwRect &rRect ); + inline SwRect( const Point& rLT, const Size& rSize ); + inline SwRect( const Point& rLT, const Point& rRB ); + inline SwRect( long X, long Y, long Width, long Height ); + + //SV-SS z.B. SwRect( pWin->GetClipRect() ); + SwRect( const Rectangle &rRect ); + + //Set-Methoden + inline void Chg( const Point& rNP, const Size &rNS ); + inline void Pos( const Point& rNew ); + inline void Pos( const long nNewX, const long nNewY ); + inline void SSize( const Size& rNew ); + inline void SSize( const long nHeight, const long nWidth ); + inline void Width( long nNew ); + inline void Height( long nNew ); + inline void Left( const long nLeft ); + inline void Right( const long nRight ); + inline void Top( const long nTop ); + inline void Bottom( const long nBottom ); + + //Get-Methoden + inline const Point &Pos() const; + inline const Size &SSize() const; + inline long Width() const; + inline long Height() const; + inline long Left() const; + inline long Right() const; + inline long Top() const; + inline long Bottom() const; + + //Damit Layoutseitig per Memberpointer auf die Member von Pos und SSize + //zugegriffen werden kann. + inline Point &Pos(); + inline Size &SSize(); + + void Justify(); + + SwRect &Union( const SwRect& rRect ); + SwRect &Intersection( const SwRect& rRect ); + //Wie Intersection nur wird davon ausgegangen, dass die Rects ueberlappen! + SwRect &_Intersection( const SwRect &rRect ); + inline SwRect GetUnion( const SwRect& rRect ) const; + inline SwRect GetIntersection( const SwRect& rRect ) const; + + BOOL IsInside( const Point& rPOINT ) const; + BOOL IsInside( const SwRect& rRect ) const; + BOOL IsOver( const SwRect& rRect ) const; + inline BOOL HasArea() const; + inline BOOL IsEmpty() const; + inline void Clear(); + + inline SwRect &operator = ( const SwRect &rRect ); + + inline BOOL operator == ( const SwRect& rRect ) const; + inline BOOL operator != ( const SwRect& rRect ) const; + + inline SwRect &operator+=( const Point &rPt ); + inline SwRect &operator-=( const Point &rPt ); + + inline SwRect &operator+=( const Size &rSz ); + inline SwRect &operator-=( const Size &rSz ); + + //SV-SS z.B. pWin->DrawRect( aSwRect.SVRect() ); + inline Rectangle SVRect() const; + + //Zortech wuerde hier fehlerhaften Code erzeugen. +// inline operator SRectangle() const; +// inline operator Rectangle() const { return Rectangle( aPos, aSize ); } + + // Ausgabeoperator fuer die Debugging-Gemeinde + + +#ifdef VERTICAL_LAYOUT + void _Top( const long nTop ); + void _Bottom( const long nBottom ); + void _Left( const long nLeft ); + void _Right( const long nRight ); + void _Width( const long nNew ); + void _Height( const long nNew ); + long _Top() const; + long _Bottom() const; + long _Left() const; + long _Right() const; + long _Width() const; + long _Height() const; + void SubTop( const long nSub ); + void AddBottom( const long nAdd ); + void SubLeft( const long nSub ); + void AddRight( const long nAdd ); + void AddWidth( const long nAdd ); + void AddHeight( const long nAdd ); + void SetPosX( const long nNew ); + void SetPosY( const long nNew ); + void SetLeftAndWidth( long nLeft, long nNew ); + void SetTopAndHeight( long nTop, long nNew ); + void SetRightAndWidth( long nRight, long nNew ); + void SetBottomAndHeight( long nBottom, long nNew ); + void SetUpperLeftCorner( const Point& rNew ); + void SetUpperRightCorner( const Point& rNew ); + void SetLowerLeftCorner( const Point& rNew ); + const Size _Size() const; + const Point TopLeft() const; + const Point TopRight() const; + const Point BottomLeft() const; + const Point BottomRight() const; + const Size SwappedSize() const; + long GetLeftDistance( long ) const; + long GetBottomDistance( long ) const; + long GetRightDistance( long ) const; + long GetTopDistance( long ) const; + BOOL OverStepLeft( long ) const; + BOOL OverStepBottom( long ) const; + BOOL OverStepTop( long ) const; + BOOL OverStepRight( long ) const; +#endif +}; + +// Implementation in in swrect.cxx +extern SvStream &operator<<( SvStream &rStream, const SwRect &rRect ); + +#ifdef VERTICAL_LAYOUT +typedef void (SwRect:: *SwRectSet)( const long nNew ); +typedef long (SwRect:: *SwRectGet)() const; +typedef const Point (SwRect:: *SwRectPoint)() const; +typedef const Size (SwRect:: *SwRectSize)() const; +typedef BOOL (SwRect:: *SwRectMax)( long ) const; +typedef long (SwRect:: *SwRectDist)( long ) const; +typedef void (SwRect:: *SwRectSetTwice)( long, long ); +typedef void (SwRect:: *SwRectSetPos)( const Point& ); +#endif + +//---------------------------------- Set-Methoden +inline void SwRect::Chg( const Point& rNP, const Size &rNS ) +{ + nX = rNP.X(); nY = rNP.Y(); + nWidth = rNS.Width(); nHeight = rNS.Height(); +} +inline void SwRect::Pos( const Point& rNew ) +{ + nX = rNew.X(); nY = rNew.Y(); +} +inline void SwRect::Pos( const long nNewX, const long nNewY ) +{ + nX = nNewX; nY = nNewY; +} +inline void SwRect::SSize( const Size& rNew ) +{ + nWidth = rNew.Width(); nHeight = rNew.Height(); +} +inline void SwRect::SSize( const long nNewHeight, const long nNewWidth ) +{ + nWidth = nNewWidth; nHeight = nNewHeight; +} +inline void SwRect::Width( long nNew ) +{ + nWidth = nNew; +} +inline void SwRect::Height( long nNew ) +{ + nHeight = nNew; +} +inline void SwRect::Left( const long nLeft ) +{ + nWidth += nX - nLeft; + nX = nLeft; +} +inline void SwRect::Right( const long nRight ) +{ + nWidth = nRight - nX + 1; +} +inline void SwRect::Top( const long nTop ) +{ + nHeight += nY - nTop; + nY = nTop; +} +inline void SwRect::Bottom( const long nBottom ) +{ + nHeight = nBottom - nY + 1; +} + +//----------------------------------- Get-Methoden +inline const Point &SwRect::Pos() const +{ + return *(Point*)(&nX); +} +inline Point &SwRect::Pos() +{ + return *(Point*)(&nX); +} +inline const Size &SwRect::SSize() const +{ + return *(Size*)(&nWidth); +} +inline Size &SwRect::SSize() +{ + return *(Size*)(&nWidth); +} +inline long SwRect::Width() const +{ + return nWidth; +} +inline long SwRect::Height() const +{ + return nHeight; +} +inline long SwRect::Left() const +{ + return nX; +} +inline long SwRect::Right() const +{ + return nWidth ? nX + nWidth - 1 : nX; +} +inline long SwRect::Top() const +{ + return nY; +} +inline long SwRect::Bottom() const +{ + return nHeight ? nY + nHeight - 1 : nY; +} + +//----------------------------------- operatoren +inline SwRect &SwRect::operator = ( const SwRect &rRect ) +{ + nX = rRect.Left(); + nY = rRect.Top(); + nWidth = rRect.Width(); + nHeight = rRect.Height(); + return *this; +} +inline BOOL SwRect::operator == ( const SwRect& rRect ) const +{ + return (nX == rRect.Left() && + nY == rRect.Top() && + nWidth == rRect.Width() && + nHeight == rRect.Height()); +} +inline BOOL SwRect::operator != ( const SwRect& rRect ) const +{ + return (nX != rRect.Left() || + nY != rRect.Top() || + nWidth != rRect.Width() || + nHeight != rRect.Height()); +} + +inline SwRect &SwRect::operator+=( const Point &rPt ) +{ + nX += rPt.X(); nY += rPt.Y(); + return *this; +} +inline SwRect &SwRect::operator-=( const Point &rPt ) +{ + nX -= rPt.X(); nY -= rPt.Y(); + return *this; +} + +inline SwRect &SwRect::operator+=( const Size &rSz ) +{ + nWidth += rSz.Width(); nHeight += rSz.Height(); + return *this; +} +inline SwRect &SwRect::operator-=( const Size &rSz ) +{ + nWidth -= rSz.Width(); nHeight -= rSz.Height(); + return *this; +} + + +//--------------------------- Sonstiges +inline Rectangle SwRect::SVRect() const +{ + OSL_ENSURE( nWidth && nHeight, "SVRect() ohne Widht oder Height" ); + return Rectangle( nX, nY, + nX + nWidth - 1, //Right() + nY + nHeight - 1 ); //Bottom() +} + +inline SwRect SwRect::GetUnion( const SwRect& rRect ) const +{ + return SwRect( *this ).Union( rRect ); +} +inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const +{ + return SwRect( *this ).Intersection( rRect ); +} + +inline BOOL SwRect::HasArea() const +{ + return nHeight && nWidth; +} +inline BOOL SwRect::IsEmpty() const +{ + return !(nHeight && nWidth); +} +inline void SwRect::Clear() +{ + nX = nY = nWidth = nHeight = 0; +} + +//-------------------------- CToren +inline SwRect::SwRect() : + nX( 0 ), + nY( 0 ), + nWidth ( 0 ), + nHeight( 0 ) +{ +} +inline SwRect::SwRect( const SwRect &rRect ) : + nX( rRect.Left() ), + nY( rRect.Top() ), + nWidth ( rRect.Width() ), + nHeight( rRect.Height() ) +{ +} +inline SwRect::SwRect( const Point& rLT, const Size& rSize ) : + nX( rLT.X() ), + nY( rLT.Y() ), + nWidth ( rSize.Width() ), + nHeight( rSize.Height()) +{ +} +inline SwRect::SwRect( const Point& rLT, const Point& rRB ) : + nX( rLT.X() ), + nY( rLT.Y() ), + nWidth ( rRB.X() - rLT.X() + 1 ), + nHeight( rRB.Y() - rLT.Y() + 1 ) +{ +} +inline SwRect::SwRect( long X, long Y, long WidthIn, long HeightIn ) : + nX( X ), + nY( Y ), + nWidth ( WidthIn ), + nHeight( HeightIn ) +{ +} + + +} //namespace binfilter +#endif //_SWRECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swregion.hxx b/inc/bf_sw/swregion.hxx new file mode 100644 index 000000000..0bab281ab --- /dev/null +++ b/inc/bf_sw/swregion.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWREGION_HXX +#define _SWREGION_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/svarray.hxx> + +#include "swrect.hxx" +namespace binfilter { + +SV_DECL_VARARR( SwRects, SwRect, 20, 8 ) + +} //namespace binfilter +#endif //_SWREGION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swserv.hxx b/inc/bf_sw/swserv.hxx new file mode 100644 index 000000000..ba6646a47 --- /dev/null +++ b/inc/bf_sw/swserv.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _SWSERV_HXX +#define _SWSERV_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_so3/linksrc.hxx> +namespace binfilter { + +class SwBookmark; +class SwSectionNode; +class SwBaseLink; +class SwTableNode; +struct SwPosition; +class SwPaM; + +class SwServerObject : public ::binfilter::SvLinkSource +{ +protected: + enum ServerModes { BOOKMARK_SERVER, TABLE_SERVER, SECTION_SERVER, NONE_SERVER } eType; + union { + SwBookmark* pBkmk; + SwTableNode* pTblNd; + SwSectionNode* pSectNd; + } CNTNT_TYPE; + + SwServerObject(); + +public: + SwServerObject( SwBookmark& rBookmark ) + : eType( BOOKMARK_SERVER ) + { + CNTNT_TYPE.pBkmk = &rBookmark; + } + SwServerObject( SwTableNode& rTableNd ) + : eType( TABLE_SERVER ) + { + CNTNT_TYPE.pTblNd = &rTableNd; + } + SwServerObject( SwSectionNode& rSectNd ) + : eType( SECTION_SERVER ) + { + CNTNT_TYPE.pSectNd = &rSectNd; + } + virtual ~SwServerObject(); + + + + + BOOL IsLinkInServer( const SwBaseLink* ) const; + + void SetNoServer() + { CNTNT_TYPE.pBkmk = 0, eType = NONE_SERVER; } +}; + +#ifndef SW_DECL_SWSERVEROBJECT_DEFINED +#define SW_DECL_SWSERVEROBJECT_DEFINED +SV_DECL_REF( SwServerObject ) +#endif + +} //namespace binfilter +#endif // _SWSERV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swstyle.h b/inc/bf_sw/swstyle.h new file mode 100644 index 000000000..8d515bb65 --- /dev/null +++ b/inc/bf_sw/swstyle.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWSTYLE_H +#define _SWSTYLE_H + + +#define SWSTYLEBIT_TEXT 0x0001 +#define SWSTYLEBIT_CHAPTER 0x0002 +#define SWSTYLEBIT_LIST 0x0004 +#define SWSTYLEBIT_IDX 0x0008 +#define SWSTYLEBIT_EXTRA 0x0010 +#define SWSTYLEBIT_HTML 0x0020 +#define SWSTYLEBIT_CONDCOLL 0x0040 + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swtable.hxx b/inc/bf_sw/swtable.hxx new file mode 100644 index 000000000..1fa2174df --- /dev/null +++ b/inc/bf_sw/swtable.hxx @@ -0,0 +1,276 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWTABLE_HXX +#define _SWTABLE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/mempool.hxx> +#include <tools/ref.hxx> +#include <bf_svtools/svarray.hxx> +#include <tblenum.hxx> +#include <calbck.hxx> + +#ifndef DBG_UTIL +#include <node.hxx> // fuer StartNode->GetMyIndex +#else +namespace binfilter { +class SwStartNode; +} //namespace binfilter +#endif +class Color; +namespace binfilter { + +class SfxPoolItem; +class SwFrmFmt; +class SwTableFmt; +class SwTableLineFmt; +class SwTableBoxFmt; +class SwTableLine; +class SwTableBox; +class SwTableNode; +class SwTabCols; +class SwDoc; +class SwSelBoxes; +class SwTblCalcPara; +class SwChartLines; +struct SwPosition; +class SwNodeIndex; + +class SchMemChart; +class SwTableBox_Impl; + +#ifndef SW_DECL_SWSERVEROBJECT_DEFINED +#define SW_DECL_SWSERVEROBJECT_DEFINED +SV_DECL_REF( SwServerObject ) +#endif + +SV_DECL_PTRARR_DEL(SwTableLines, SwTableLine*, 10, 20) +SV_DECL_PTRARR_DEL(SwTableBoxes, SwTableBox*, 25, 50) + +// speicher die Inhaltstragenden Box-Pointer zusaetzlich in einem +// sortierten Array (fuers rechnen in der Tabelle) +typedef SwTableBox* SwTableBoxPtr; +SV_DECL_PTRARR_SORT( SwTableSortBoxes, SwTableBoxPtr, 25, 50 ) + +class SwTable: public SwClient //Client vom FrmFmt +{ +protected: + SwTableLines aLines; + SwTableSortBoxes aSortCntBoxes; + SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt + +//SOLL das fuer jede Tabelle einstellbar sein? + TblChgMode eTblChgMode; + + USHORT nGrfsThatResize; // Anzahl der Grfs, die beim HTML-Import + // noch ein Resize der Tbl. anstossen + + BOOL bModifyLocked :1; + BOOL bHeadlineRepeat:1; + + BOOL IsModifyLocked(){ return bModifyLocked;} + +public: + TYPEINFO(); + + SwTable( SwTableFmt* ); + SwTable( const SwTable& rTable ); // kein Copy der Lines !! + ~SwTable(); + + USHORT IncGrfsThatResize() { return ++nGrfsThatResize; } + USHORT DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; } + + void LockModify() { bModifyLocked = TRUE; } //Muessen _immer_ paarig + void UnlockModify() { bModifyLocked = FALSE;} //benutzt werden! + + BOOL IsHeadlineRepeat() const { return bHeadlineRepeat; } + void SetHeadlineRepeat( BOOL bSet ) { bHeadlineRepeat = bSet; } + + SwTableLines &GetTabLines() { return aLines; } + const SwTableLines &GetTabLines() const { return aLines; } + + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } + + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + SwTableSortBoxes& GetTabSortBoxes() { return aSortCntBoxes; } + const SwTableSortBoxes& GetTabSortBoxes() const { return aSortCntBoxes; } + + // gebe den Zellnamen zu der angebenen Row/Col zurueck. Das ist + // nur fuer ausgeglichene Tabellen interessant, weil diese keine + // "Sub"Boxen kennen. Es wird z.B. aus (0,0) ein "A1". + // lese die 1. Nummer und loesche sie aus dem String + // (wird von GetTblBox und SwTblFld benutzt) + static USHORT _GetBoxNum( String& rStr, BOOL bFirst = FALSE ); + // suche die Inhaltstragende Box mit dem Namen + const SwTableBox* GetTblBox( const String& rName ) const; + // kopiere die selektierten Boxen in ein anderes Dokument. + // kopiere die Tabelle in diese. (die Logik steht im TBLRWCL.CXX) + // kopiere die Headline (mit Inhalt!) der Tabelle in eine andere + + // erfrage die Box, dessen Start-Index auf nBoxStt steht + SwTableBox* GetTblBox( ULONG nSttIdx ); + const SwTableBox* GetTblBox( ULONG nSttIdx ) const + { return ((SwTable*)this)->GetTblBox( nSttIdx ); } + + // returnt TRUE wenn sich in der Tabelle Verschachtelungen befinden + BOOL IsTblComplex() const; + + // suche alle Inhaltstragenden-Boxen der Grundline in der diese Box + // steht. rBoxes auch als Return-Wert, um es gleich weiter zu benutzen + //JP 31.01.97: bToTop = TRUE -> hoch bis zur Grundline, + // FALSE-> sonst nur die Line der Box + // erfrage vom Client Informationen + virtual BOOL GetInfo( SfxPoolItem& ) const; + + // suche im Format nach der angemeldeten Tabelle + static SwTable* FindTable( SwFrmFmt* pFmt ); + + // Struktur ein wenig aufraeumen + void GCLines(); + // BorderLine ein wenig aufraeumen + void GCBorderLines(); + + SwTableNode* GetTableNode() const; + + // Daten Server-Methoden + const SwServerObject* GetObject() const { return &refObj; } + SwServerObject* GetObject() { return &refObj; } + + TblChgMode GetTblChgMode() const { return eTblChgMode; } + void SetTblChgMode( TblChgMode eMode ) { eTblChgMode = eMode; } + +}; + +class SwTableLine: public SwClient // Client vom FrmFmt +{ + SwTableBoxes aBoxes; + SwTableBox *pUpper; + +public: + TYPEINFO(); + + SwTableLine( SwTableLineFmt*, USHORT nBoxes, SwTableBox *pUp ); + ~SwTableLine(); + + SwTableBoxes &GetTabBoxes() { return aBoxes; } + const SwTableBoxes &GetTabBoxes() const { return aBoxes; } + + SwTableBox *GetUpper() { return pUpper; } + const SwTableBox *GetUpper() const { return pUpper; } + void SetUpper( SwTableBox *pNew ) { pUpper = pNew; } + + + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } + + //Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen. + SwFrmFmt* ClaimFrmFmt(); + void ChgFrmFmt( SwTableLineFmt* pNewFmt ); + + // suche nach der naechsten/vorherigen Box mit Inhalt + SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0, + BOOL bOvrTblLns=TRUE ) const; + SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0, + BOOL bOvrTblLns=TRUE ) const; + +}; + +class SwTableBox: public SwClient //Client vom FrmFmt +{ + friend class SwNodes; // um den Index umzusetzen ! + friend void DelBoxNode(SwTableSortBoxes&); // um den StartNode* zu loeschen ! + friend class SwXMLTableContext; + + //nicht (mehr) implementiert. + SwTableBox( const SwTableBox & ); + + SwTableLines aLines; + const SwStartNode * pSttNd; + SwTableLine *pUpper; + SwTableBox_Impl* pImpl; + + SwTableBox &operator=( const SwTableBox &); //gibts nicht. + // falls das Format schon Formeln/Values enthaelt, muss ein neues + // fuer die neue Box erzeugt werden. + SwTableBoxFmt* CheckBoxFmt( SwTableBoxFmt* ); + +public: + TYPEINFO(); + + SwTableBox( SwTableBoxFmt*, USHORT nLines, SwTableLine *pUp = 0 ); + SwTableBox( SwTableBoxFmt*, const SwStartNode&, SwTableLine *pUp = 0 ); + SwTableBox( SwTableBoxFmt*, const SwNodeIndex&, SwTableLine *pUp = 0 ); + ~SwTableBox(); + + SwTableLines &GetTabLines() { return aLines; } + const SwTableLines &GetTabLines() const { return aLines; } + + SwTableLine *GetUpper() { return pUpper; } + const SwTableLine *GetUpper() const { return pUpper; } + void SetUpper( SwTableLine *pNew ) { pUpper = pNew; } + + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } + + //Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen. + SwFrmFmt* ClaimFrmFmt(); + void ChgFrmFmt( SwTableBoxFmt *pNewFmt ); + + const SwStartNode *GetSttNd() const { return pSttNd; } + ULONG GetSttIdx() const +#ifndef DBG_UTIL + { return pSttNd ? pSttNd->GetIndex() : 0; } +#else + ; +#endif + + // suche nach der naechsten/vorherigen Box mit Inhalt + // gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt + // und ergibt sich aus der Position in den Lines/Boxen/Tabelle + String GetName() const; + // gebe den "Wert" der Box zurueck (fuers rechnen in der Tabelle) + double GetValue( SwTblCalcPara& rPara ) const; + + BOOL IsInHeadline( const SwTable* pTbl = 0 ) const; + + // enthaelt die Box Inhalt, der als Nummer formatiert werden kann? + ULONG IsValidNumTxtNd( BOOL bCheckAttr = TRUE ) const; + // teste ob der BoxInhalt mit der Nummer uebereinstimmt, wenn eine + // Tabellenformel gesetzt ist. (fuers Redo des Change vom NumFormat!) + + // ist das eine FormelBox oder eine Box mit numerischen Inhalt (AutoSum) + // Was es ist, besagt der ReturnWert - die WhichId des Attributes + // Leere Boxen haben den ReturnWert USHRT_MAX !! + + // fuers Laden - tauscht bei Value Zellen den Inhalt aus, falls sie + // fuer die Sprache System formatiert sind. + void ChgByLanguageSystem(); + + DECL_FIXEDMEMPOOL_NEWDEL(SwTableBox) + + // zugriff auf interne Daten - z.Z. benutzt fuer den NumFormatter +}; + +} //namespace binfilter +#endif //_SWTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swtblfmt.hxx b/inc/bf_sw/swtblfmt.hxx new file mode 100644 index 000000000..2b10eb151 --- /dev/null +++ b/inc/bf_sw/swtblfmt.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWTBLFMT_HXX +#define _SWTBLFMT_HXX + +#include <frmfmt.hxx> +namespace binfilter { + +class SwDoc; + +class SwTableFmt : public SwFrmFmt +{ + friend class SwDoc; + +protected: + SwTableFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange ) + {} + SwTableFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange ) + {} + + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt) +}; + +class SwTableLineFmt : public SwFrmFmt +{ + friend class SwDoc; + +protected: + SwTableLineFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange ) + {} + SwTableLineFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange ) + {} + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt) +}; + +class SwTableBoxFmt : public SwFrmFmt +{ + friend class SwDoc; + +protected: + SwTableBoxFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange ) + {} + SwTableBoxFmt( SwAttrPool& rPool, const String &rFmtNm, + SwFrmFmt *pDrvdFrm ) + : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange ) + {} + +public: + TYPEINFO(); //Bereits in Basisklasse Client drin. + + // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute) + virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); + + DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt) +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swtypes.hxx b/inc/bf_sw/swtypes.hxx new file mode 100644 index 000000000..f5592184e --- /dev/null +++ b/inc/bf_sw/swtypes.hxx @@ -0,0 +1,261 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * 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. + * + * 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). + * + * 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. + * + ************************************************************************/ +#ifndef _SWTYPES_HXX +#define _SWTYPES_HXX + +#include <bf_svtools/bf_solar.h> +#include <i18npool/lang.h> +#include <limits.h> //fuer LONG_MAX + +#ifdef PM20 +#include <stdlib.h> +#endif +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/lang/Locale.hpp> + +// wenn das hier geaendert wird, dann auch im globals.hrc aendern!!! +//#define SW_FILEFORMAT_40 SOFFICE_FILEFORMAT_40 + +namespace com{namespace sun{namespace star{ + namespace linguistic2{ + class XDictionaryList; + class XSpellChecker1; + class XHyphenator; + class XThesaurus; + } + namespace beans{ + class XPropertySet; + } +}}} +namespace utl{ + class TransliterationWrapper; +} +class Size; +class MapMode; +class ResMgr; +class Graphic; +class OutputDevice; +class CharClass; +class LocaleDataWrapper; +class CollatorWrapper; +namespace binfilter { + +class UniString; +class ByteString; + +class SwPathFinder; + + +typedef long SwTwips; +#define INVALID_TWIPS LONG_MAX +#define TWIPS_MAX (LONG_MAX - 1) + +#define MM50 283 // 1/2 cm in TWIPS + +#define MINFLY 23 //Minimalgroesse fuer FlyFrms +#define MINLAY 23 //Minimalgroesse anderer Frms + +// Default-Spaltenabstand zweier Textspalten entspricht 0.3 cm +#define DEF_GUTTER_WIDTH (MM50 / 5 * 3) + +//Minimale Distance (Abstand zum Text) fuer das BorderAttribut, damit +//die aligned'en Linien nicht geplaettet werden. +//28 Twips == 0,4mm +#define MIN_BORDER_DIST 28 + + /* minimaler Dokmentrand */ +const SwTwips lMinBorder = 1134; + +//Die Wiesenbreite links neben und ueber dem Dokument. +//Die halbe Wiesenbreite ist der Abstand zwischen den Seiten. +#define DOCUMENTBORDER 568L + +// Konstante Strings +extern UniString aEmptyStr; // "" +extern ByteString aEmptyByteStr; // "" +extern UniString aDotStr; // '.' + +//Zum Einfuegen von Beschriftungen (wie bzw. wo soll eingefuegt werden). +//Hier weil ein eigenes hxx nicht lohnt und es sonst nirgendwo so recht +//hinpasst. +enum SwLabelType +{ + LTYPE_TABLE, //Beschriftung einer Tabelle + LTYPE_OBJECT, //Beschriftung von Grafik oder OLE + LTYPE_FLY, //Beschriftung eines (Text-)Rahmens + LTYPE_DRAW //Beschriftung eines Zeichen-Objektes +}; + + +const BYTE OLD_MAXLEVEL = 5; +const BYTE MAXLEVEL = 10; //Ehemals numrule.hxx +const BYTE NO_NUM = 200; //Ehemals numrule.hxx +const BYTE NO_NUMBERING = 201; //Ehemals numrule.hxx +const BYTE NO_INIT = 202; //Ehemals numrule.hxx + +// fuer Absaetze mit NO_NUM aber auf unterschiedlichen Leveln +// DAMIT entfaellt das NO_NUM !!!! +const BYTE NO_NUMLEVEL = 0x20; // wird mit den Levels verodert + + +/* + * Nette Funktionen als MACRO oder inline + */ + +/* ein KiloByte sind 1024 Byte */ +#define KB 1024 + +#define SET_CURR_SHELL( shell ) CurrShell aCurr( shell ) + +// pPathFinder wird von der UI initialisiert. Die Klasse liefert alle +// benoetigten Pfade. +extern SwPathFinder *pPathFinder; + +// Werte fuer die Einzuege an der Nummerierung und BulletListe +// (fuer die weiteren Ebenen sind die Werte mit den Ebenen+1 zu +// multiplizieren; Ebenen 0..4 !!!) +const USHORT lBullIndent = 567 / 2; +const short lBullFirstLineOffset = -567 / 2; +const USHORT lNumIndent = 567 / 2; +const short lNumFirstLineOffset = -567 / 2; + +// Anzahl der SystemField-Types vom SwDoc +#define INIT_FLDTYPES 32 +// Anzahl der vordefinierten Seq-Feldtypen. Es handelt sich dabei +// immer um die letzen Felder vor INIT_FLDTYPES +#define INIT_SEQ_FLDTYPES 4 + +//Die ehemaligen Rendevouz-Ids leben weiter: +//Es gibt Ids fuer die Anker (SwFmtAnchor) und ein paar weitere die nur fuer +//Schnittstellen Bedeutung haben (SwDoc). +enum RndStdIds +{ + FLY_AT_CNTNT, //Absatzgebundener Rahmen + FLY_IN_CNTNT, //Zeichengebundener Rahmen + FLY_PAGE, //Seitengebundener Rahmen + FLY_AT_FLY, //Rahmengebundener Rahmen ( LAYER_IMPL ) + FLY_AUTO_CNTNT, //Automatisch positionierter, absatzgebundener Rahmen + //Der Rest wird nur fuer SS benutzt. + RND_STD_HEADER, + RND_STD_FOOTER, + RND_STD_HEADERL, + RND_STD_HEADERR, + RND_STD_FOOTERL, + RND_STD_FOOTERR, + + RND_DRAW_OBJECT // ein Draw-Object !! nur fuer die SwDoc-Schnittstelle! +}; + + +extern ResMgr* pSwResMgr; // steht in swapp0.cxx +#define SW_RES(i) ResId(i,*pSwResMgr) +#define SW_RESSTR(i) SW_RES(i).toString() + +com::sun::star::lang::Locale CreateLocale( LanguageType eLanguage ); + +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XHyphenator > GetHyphenator(); +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList(); +::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > GetLinguPropertySet(); + +// reutns the twip size of this graphic +Size GetGraphicSizeTwip( const Graphic&, OutputDevice* pOutDev ); + + +// Seperator fuer Sprunge im Dokument auf verschiedene Inhalttype +const sal_Unicode cMarkSeperator = '|'; +extern const sal_Char* pMarkToTable; // Strings stehen +extern const sal_Char* pMarkToFrame; // im Init.cxx +extern const sal_Char* pMarkToRegion; +extern const sal_Char* pMarkToOutline; +extern const sal_Char* pMarkToText; +extern const sal_Char* pMarkToGraphic; +extern const sal_Char* pMarkToOLE; + +#ifndef DB_DELIM // Ist in OFA definiert!!! +#define DB_DELIM ((sal_Unicode)0xff) // Datenbank <-> Tabellen-Trenner +#endif + + +enum SetAttrMode +{ + SETATTR_DEFAULT = 0x0000, // default + SETATTR_DONTEXPAND = 0x0001, // TextAttribute nicht weiter expand. + SETATTR_DONTREPLACE = 0x0002, // kein anderes TextAttrib verdraengen + + SETATTR_NOTXTATRCHR = 0x0004, // bei Attr ohne Ende kein 0xFF einfuegen + SETATTR_NOHINTADJUST = 0x0008, // keine Zusammenfassung von Bereichen. + SETATTR_NOFORMATATTR = 0x0010, // nicht zum FormatAttribut umwandeln + SETATTR_DONTCHGNUMRULE = 0x0020, // nicht die NumRule veraendern + SETATTR_APICALL = 0x0040 // called from API (all UI related + // functionality will be disabled) +}; + +//Umrechnung Twip<-> 1/100 mm fuer UNO + +#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) +#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) +#define TWIP_TO_MM100_UNSIGNED(TWIP) ((((TWIP)*127L+36L)/72L)) +#define MM100_TO_TWIP_UNSIGNED(MM100) ((((MM100)*72L+63L)/127L)) + +#define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c ) + +#ifndef SW_CONSTASCII_DECL +#define SW_CONSTASCII_DECL( n, s ) n[sizeof(s)] +#endif +#ifndef SW_CONSTASCII_DEF +#define SW_CONSTASCII_DEF( n, s ) n[sizeof(s)] = s +#endif + + +#define CHAR_HARDBLANK ((sal_Unicode)0x00A0) +#define CHAR_HARDHYPHEN ((sal_Unicode)0x2011) +#define CHAR_SOFTHYPHEN ((sal_Unicode)0x00AD) + +// returns the APP - CharClass instance - used for all ToUpper/ToLower/... +CharClass& GetAppCharClass(); +LocaleDataWrapper& GetAppLocaleData(); + +ULONG GetAppLanguage(); + + +#define SW_COLLATOR_IGNORES ( \ + ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ) + +CollatorWrapper& GetAppCollator(); +CollatorWrapper& GetAppCaseCollator(); + +const ::utl::TransliterationWrapper& GetAppCmpStrIgnore(); + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swunohelper.hxx b/inc/bf_sw/swunohelper.hxx new file mode 100644 index 000000000..770665813 --- /dev/null +++ b/inc/bf_sw/swunohelper.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWUNOHELPER_HXX +#define _SWUNOHELPER_HXX + +#include <bf_svtools/bf_solar.h> + +#include <sal/types.h> + + +namespace com { namespace sun { namespace star { + namespace uno { + class Any; + } +}}} +class String; +class SvStrings; + +namespace binfilter { + +namespace SWUnoHelper { + +// calls over the compherl the getEnumAsInt32 function and handle the +// exceptions. +sal_Int32 GetEnumAsInt32( const ::com::sun::star::uno::Any& rVal ); + +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/swwait.hxx b/inc/bf_sw/swwait.hxx new file mode 100644 index 000000000..ec29e691a --- /dev/null +++ b/inc/bf_sw/swwait.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWWAIT_HXX +#define _SWWAIT_HXX + +#include <bf_svtools/bf_solar.h> + +namespace binfilter { + +class SwDocShell; + +class SwWait +{ + SwDocShell &rDoc; + BOOL bLock; +public: + SwWait( SwDocShell &rDocShell, BOOL bLockDispatcher ); + ~SwWait(); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tabcol.hxx b/inc/bf_sw/tabcol.hxx new file mode 100644 index 000000000..26a8fcfd1 --- /dev/null +++ b/inc/bf_sw/tabcol.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TABCOL_HXX +#define _TABCOL_HXX + +#include <bf_svtools/bf_solar.h> + +#ifndef _SVSTDARR_HXX +#define _SVSTDARR_LONGS +#define _SVSTDARR_BOOLS +#include <bf_svtools/svstdarr.hxx> +#endif +namespace binfilter { + +class SwTabCols : public SvLongs +{ + long nLeftMin, //Linker aeusserer Rand (Bezugspunkt) in + //Dokumentkordinaten. + //Alle anderen Werte relativ zu diesem Punkt! + nLeft, //Linker Rand der Tabelle. + nRight, //Rechter Rand der Tabelle. + nRightMax; //Maximaler rechter Rand der Tabelle. + + + + SvBools aHidden; //Fuer jeden Eintrag ein Flag, Hidden oder nicht. + //Wenn das Flag Hidden TRUE ist liegt der Spalten- + //trenner nicht in der aktuellen Zeile; er muss + //mit gepflegt werden, darf aber nicht angezeigt + //werden. +public: + SwTabCols( USHORT /*nSize*/ = 0 ){DBG_BF_ASSERT(0, "STRIP");} ; + SwTabCols( const SwTabCols& ) : SvLongs() {DBG_BF_ASSERT(0, "STRIP");} ; + BOOL IsHidden( USHORT nPos ) const { return aHidden[nPos]; } + void SetHidden( USHORT nPos, BOOL bValue ) { aHidden[nPos] = bValue; } + inline void InsertHidden( USHORT nPos, BOOL bValue ); + inline void DeleteHidden( USHORT nPos, USHORT nAnz = 1 ); + + //fuer den CopyCTor + const SvBools& GetHidden() const { return aHidden; } + + long GetLeftMin() const { return nLeftMin; } + long GetLeft() const { return nLeft; } + long GetRight() const { return nRight; } + long GetRightMax()const { return nRightMax;} + + void SetLeftMin ( long nNew ) { nLeftMin = nNew; } + void SetLeft ( long nNew ) { nLeft = nNew; } + void SetRight ( long nNew ) { nRight = nNew; } + void SetRightMax( long nNew ) { nRightMax = nNew;} +}; + +inline void SwTabCols::InsertHidden( USHORT nPos, BOOL bValue ) +{ + aHidden.Insert( bValue, nPos ); +} +inline void SwTabCols::DeleteHidden( USHORT nPos, USHORT nAnz ) +{ + aHidden.Remove( nPos, nAnz ); +} + +} //namespace binfilter +#endif //_TABCOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tblafmt.hxx b/inc/bf_sw/tblafmt.hxx new file mode 100644 index 000000000..5f60f336a --- /dev/null +++ b/inc/bf_sw/tblafmt.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TBLAFMT_HXX +#define _TBLAFMT_HXX + +/************************************************************************* +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +JP 20.07.95: + + Die akt. Struktur der Autoformatierung darf nicht mehr veraendert werden. + Diese wird durch unterschiedlichen Code vom StartWriter und vom StarCalc + eingelesen/geschrieben. + Sollte sich doch mal eine Aenderung nicht vermeiden lassen, dann auf + jedenfall in beiden Applikationen aendern. + + The structure of table auto formatting should not changed. It is used + by different code of Writer and Calc. If a change is necessary, the + source code of both applications must be changed! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +**************************************************************************/ + +#include <bf_svtools/svarray.hxx> + +#include "hintids.hxx" //_immmer_ vor den solar-items! + +#define ITEMID_HORJUSTIFY 0 +#define ITEMID_VERJUSTIFY 0 +#define ITEMID_ORIENTATION 0 +#define ITEMID_MARGIN 0 + +#include <bf_svx/algitem.hxx> +#include <bf_svx/fontitem.hxx> +#include <bf_svx/fhgtitem.hxx> +#include <bf_svx/wghtitem.hxx> +#include <bf_svx/postitem.hxx> +#include <bf_svx/udlnitem.hxx> +#include <bf_svx/crsditem.hxx> +#include <bf_svx/cntritem.hxx> +#include <bf_svx/shdditem.hxx> +#include <bf_svx/colritem.hxx> +#include <bf_svx/boxitem.hxx> +#include <bf_svx/brshitem.hxx> +#include <bf_svx/adjitem.hxx> +#include <bf_svx/rotmodit.hxx> +#include <bf_svtools/intitem.hxx> +namespace binfilter { +class SvNumberFormatter; + +struct SwAfVersions; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tblenum.hxx b/inc/bf_sw/tblenum.hxx new file mode 100644 index 000000000..45c97ee65 --- /dev/null +++ b/inc/bf_sw/tblenum.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TBLENUM_HXX +#define _TBLENUM_HXX +namespace binfilter { + +//fuers aendern der Tabellen/Spalten/Zeilen Breiten/Hoehen +enum TblChgWidthHeightType +{ + WH_COL_LEFT, + WH_COL_RIGHT, + WH_ROW_TOP, + WH_ROW_BOTTOM, + WH_CELL_LEFT, + WH_CELL_RIGHT, + WH_CELL_TOP, + WH_CELL_BOTTOM, + + + // folgende koennen hinein verodert werden + WH_FLAG_INSDEL = 0x4000, // Insert/Del-Modus: das Bigger-Flag + // besagt was passiert: + // bBigger -> Box wird entfernt + // !bBigger-> Box wird eingefuegt + WH_FLAG_BIGGER = 0x8000 // Box wird groesser -> sonst kleiner +}; + +enum TblChgMode +{ + TBLFIX_CHGABS, // Tabelle feste Breite, den Nachbar andern + TBLFIX_CHGPROP, // Tabelle feste Breite, alle Nachbarn aendern + TBLVAR_CHGABS // Tabelle variable, alle Nachbarn aendern +}; + + +enum SplitTbl_HeadlineOption +{ + HEADLINE_NONE = 0, // lasse alles wie es ist + HEADLINE_BORDERCOPY, // von der davor obere Line der vorhergehen Line + HEADLINE_CNTNTCOPY, // kopiere die 1. Line komplett mit Inhalt + HEADLINE_BOXATTRCOPY, // kopiere von der 1. Line die Box Attribute + HEADLINE_BOXATRCOLLCOPY // kopiere von der 1. Line die Box Attribute + // und die Absatzvorlagen +}; + +enum TableMergeErr +{ + TBLMERGE_OK, + TBLMERGE_NOSELECTION, + TBLMERGE_TOOCOMPLEX +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tblsel.hxx b/inc/bf_sw/tblsel.hxx new file mode 100644 index 000000000..2e2d76c5d --- /dev/null +++ b/inc/bf_sw/tblsel.hxx @@ -0,0 +1,197 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TBLSEL_HXX +#define _TBLSEL_HXX + +#include <bf_svtools/bf_solar.h> + + +#include <swtable.hxx> +#include <swrect.hxx> +namespace binfilter { + +class SwCrsrShell; +class SwCursor; +class SwTableCursor; +class SwFrm; +class SwTabFrm; +class SwTableBox; +class SwTableLine; +class SwLayoutFrm; +class SwPaM; +class SwNode; +class SwTable; +class SwCellFrm; + +SV_DECL_PTRARR( SwCellFrms, SwCellFrm*, 16, 16 ) +SV_DECL_PTRARR_SORT( SwSelBoxes, SwTableBoxPtr, 10, 20 ) + + +//Sucht alle Boxen zusammen, die in der Tabelle selektiert sind. +//Je nach enum-Parameter wird die Selektion in der angegebenen Richtung +//erweitert. +//Die Boxen werden ueber das Layout zusammengsucht, es wird auch bei +//aufgespaltenen Tabellen korrekt gearbeitet (siehe: MakeSelUnions()). +enum SwTblSearchType +{ + TBLSEARCH_NONE = 0x1, // keine Erweiterung + TBLSEARCH_ROW = 0x2, // erweiter auf Zeilen + TBLSEARCH_COL = 0x3, // erweiter auf Spalten + + // als Flag zu den anderen Werten!! + TBLSEARCH_PROTECT = 0x8, // auch geschuetzte Boxen einsammeln + TBLSEARCH_NO_UNION_CORRECT = 0x10 // die zusammenges. Union nicht korrigieren +}; + +//wie vor, jedoch wird nicht von der Selektion sondern von den +//Start- EndFrms ausgegangen. +void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd, + SwSelBoxes& rBoxes, const SwTblSearchType = TBLSEARCH_NONE ); + +// suche fuer eine AutoSumme die beteiligten Boxen zusammen +BOOL GetAutoSumSel( const SwCrsrShell&, SwCellFrms& ); + +// teste, ob die Selektion ausgeglichen ist +SV_DECL_PTRARR( SwChartBoxes, SwTableBoxPtr, 16, 16) +SV_DECL_PTRARR_DEL( SwChartLines, SwChartBoxes*, 25, 50) + +// teste ob die Celle in die SSelection gehoert +// (wurde eine Funktion, damit GetTblSel() und MakeTblCrsr() immer +// das "gleiche Verstaendnis" fuer die Selektion haben) +BOOL IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell ); + +// bestimme die Boxen, die zusammen gefasst werden sollen. +// Dabei wird auf Layout Basis das Rechteck "angepasst". D.H. es +// werden Boxen zugefuegt wenn welche an den Seiten ueberlappen +// Zusaetzlich wird die neue Box erzeugt und mit dem entsprechenden +// Inhalt gefuellt. +void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, + SwTableBox** ppMergeBox ); + +BOOL IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam ); + +// teste ob ein Split oder InsertCol dazu fuehrt, das eine Box +// kleiner als MINLAY wird. +BOOL CheckSplitCells( const SwCrsrShell& rShell, USHORT nDiv, + const SwTblSearchType = TBLSEARCH_NONE ); +BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv, + const SwTblSearchType = TBLSEARCH_NONE ); + +//Fuer das Arbeiten auf TabSelektion auch fuer aufgespaltene Tabellen. +class SwSelUnion +{ + SwRect aUnion; //Das die Sel umschliessende Rechteck. + SwTabFrm *pTable; //Die (Follow-)Table zu der Union. + +public: + SwSelUnion( const SwRect &rRect, SwTabFrm *pTab ) : + aUnion( rRect ), pTable( pTab ) {} + + const SwRect& GetUnion() const { return aUnion; } + SwRect& GetUnion() { return aUnion; } + const SwTabFrm *GetTable() const { return pTable; } + SwTabFrm *GetTable() { return pTable; } +}; + +SV_DECL_PTRARR_DEL( SwSelUnions, SwSelUnion*, 10, 20 ) + +//Ermittelt die von einer Tabellenselektion betroffenen Tabellen und die +//Union-Rechteckte der Selektionen - auch fuer aufgespaltene Tabellen. +//Wenn ein Parameter != TBLSEARCH_NONE uebergeben wird, so wird die +//Selektion in der angegebenen Richtung erweitert. +void MakeSelUnions( SwSelUnions&, const SwLayoutFrm *pStart, + const SwLayoutFrm *pEnd, + const SwTblSearchType = TBLSEARCH_NONE ); + + +// ------------------------------------------------------------------- +// Diese Klassen kopieren die aktuelle Tabellen-Selektion (rBoxes) +// unter Beibehaltung der Tabellen-Strubktur in eine eigene Struktur + +class _FndBox; +class _FndLine; + +SV_DECL_PTRARR_DEL( _FndBoxes, _FndBox*, 10, 20 ) +SV_DECL_PTRARR_DEL( _FndLines, _FndLine*,10, 20 ) + +class _FndBox +{ + SwTableBox* pBox; + _FndLines aLines; + _FndLine* pUpper; + + SwTableLine *pLineBefore; //Zum Loeschen/Restaurieren des Layouts. + SwTableLine *pLineBehind; + +public: + _FndBox( SwTableBox* pB, _FndLine* pFL ) : + pBox(pB), pUpper(pFL), pLineBefore( 0 ), pLineBehind( 0 ) {} + + const _FndLines& GetLines() const { return aLines; } + _FndLines& GetLines() { return aLines; } + const SwTableBox* GetBox() const { return pBox; } + SwTableBox* GetBox() { return pBox; } + const _FndLine* GetUpper() const { return pUpper; } + _FndLine* GetUpper() { return pUpper; } + + void MakeNewFrms( SwTable &rTable, const USHORT nNumber, + const BOOL bBehind ); +}; + + +class _FndLine +{ + SwTableLine* pLine; + _FndBoxes aBoxes; + _FndBox* pUpper; +public: + _FndLine(SwTableLine* pL, _FndBox* pFB=0) : pLine(pL), pUpper(pFB) {} + const _FndBoxes& GetBoxes() const { return aBoxes; } + _FndBoxes& GetBoxes() { return aBoxes; } + const SwTableLine* GetLine() const { return pLine; } + SwTableLine* GetLine() { return pLine; } + const _FndBox* GetUpper() const { return pUpper; } + _FndBox* GetUpper() { return pUpper; } + + void SetUpper( _FndBox* pUp ) { pUpper = pUp; } +}; + + +struct _FndPara +{ + _FndBox* pFndBox; + _FndLine* pFndLine; + const SwSelBoxes& rBoxes; + + _FndPara( const SwSelBoxes& rBxs, _FndBox* pFB ) + : pFndBox( pFB ), rBoxes( rBxs ) {} + _FndPara( const _FndPara& rPara, _FndBox* pFB ) + : pFndBox(pFB), pFndLine(rPara.pFndLine), rBoxes(rPara.rBoxes) {} + _FndPara( const _FndPara& rPara, _FndLine* pFL ) + : pFndBox(rPara.pFndBox), pFndLine(pFL), rBoxes(rPara.rBoxes) {} +}; + +BOOL _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara ); +BOOL _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara ); + + +} //namespace binfilter +#endif // _TBLSEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tgrditem.hxx b/inc/bf_sw/tgrditem.hxx new file mode 100644 index 000000000..6dd8c1289 --- /dev/null +++ b/inc/bf_sw/tgrditem.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SW_TGRDITEM_HXX +#define SW_TGRDITEM_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/poolitem.hxx> +#include <hintids.hxx> +#include <format.hxx> + +class IntlWrapper; + +namespace binfilter { + +enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS }; + +class SwTextGridItem : public SfxPoolItem +{ + Color aColor; + sal_uInt16 nLines; + sal_uInt16 nBaseHeight, nRubyHeight; + SwTextGrid eGridType; + BOOL bRubyTextBelow; + BOOL bPrintGrid; + BOOL bDisplayGrid; + +public: + SwTextGridItem(); + virtual ~SwTextGridItem(); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + virtual bool QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + SwTextGridItem& operator=( const SwTextGridItem& ); + + const Color& GetColor() const { return aColor; } + void SetColor( const Color& rCol ) { aColor = rCol; } + + sal_uInt16 GetLines() const { return nLines; } + void SetLines( sal_uInt16 nNew ) { nLines = nNew; } + + sal_uInt16 GetBaseHeight() const { return nBaseHeight; } + void SetBaseHeight( sal_uInt16 nNew ) { nBaseHeight = nNew; } + + sal_uInt16 GetRubyHeight() const { return nRubyHeight; } + void SetRubyHeight( sal_uInt16 nNew ) { nRubyHeight = nNew; } + + SwTextGrid GetGridType() const { return eGridType; } + void SetGridType( SwTextGrid eNew ) { eGridType = eNew; } + + BOOL IsRubyTextBelow() const { return bRubyTextBelow; } + BOOL GetRubyTextBelow() const { return bRubyTextBelow; } + void SetRubyTextBelow( BOOL bNew ) { bRubyTextBelow = bNew; } + + BOOL IsPrintGrid() const { return bPrintGrid; } + BOOL GetPrintGrid() const { return bPrintGrid; } + void SetPrintGrid( BOOL bNew ) { bPrintGrid = bNew; } + + BOOL IsDisplayGrid() const { return bDisplayGrid; } + BOOL GetDisplayGrid() const { return bDisplayGrid; } + void SetDisplayGrid( BOOL bNew ) { bDisplayGrid = bNew; } +}; + +inline const SwTextGridItem &SwAttrSet::GetTextGrid(BOOL bInP) const + { return (const SwTextGridItem&)Get( RES_TEXTGRID, bInP ); } +inline const SwTextGridItem &SwFmt::GetTextGrid(BOOL bInP) const + { return (const SwTextGridItem&)aSet.Get( RES_TEXTGRID, bInP ); } + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/tox.hxx b/inc/bf_sw/tox.hxx new file mode 100644 index 000000000..167256954 --- /dev/null +++ b/inc/bf_sw/tox.hxx @@ -0,0 +1,674 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TOX_HXX +#define _TOX_HXX + +#include <bf_svtools/bf_solar.h> + + + +#include <bf_svtools/poolitem.hxx> + +#include <swtypes.hxx> +#include <toxe.hxx> +#include <calbck.hxx> +#include <osl/diagnose.h> +namespace binfilter { + +class SwTOXType; +class SwTOXMark; +class SwTxtTOXMark; +class SwDoc; + +SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10) + +/*-------------------------------------------------------------------- + Description: Entry of content index, alphabetical index or user defined index + --------------------------------------------------------------------*/ + +#define IVER_TOXMARK_STRPOOL ((USHORT)1) +#define IVER_TOXMARK_NEWTOX ((USHORT)2) + +class SwTOXMark : public SfxPoolItem, public SwClient +{ + friend void _InitCore(); + friend class SwTxtTOXMark; + + String aAltText; // Der Text des Eintrages ist unterschiedlich + String aPrimaryKey, aSecondaryKey; + + // three more strings for phonetic sorting + String aTextReading; + String aPrimaryKeyReading; + String aSecondaryKeyReading; + + SwTxtTOXMark* pTxtAttr; + + USHORT nLevel; + BOOL bAutoGenerated : 1; // generated using a concordance file + BOOL bMainEntry : 1; // main entry emphasized by character style + + + SwTOXMark(); // to create the dflt. atr. in _InitCore + +public: + TYPEINFO(); // rtti + + SwTOXMark( const SwTOXType* pTyp ); + SwTOXMark( const SwTOXMark& rCopy ); + virtual ~SwTOXMark(); + + // "pure virtual methods" of SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; + virtual SvStream& Store(SvStream &rStream, USHORT) const { return rStream; } + virtual USHORT GetVersion( USHORT nFFVer ) const; + + SwTOXMark& operator=( const SwTOXMark& rCopy ); + + inline BOOL IsAlternativeText() const; + inline const String& GetAlternativeText() const; + + inline void SetAlternativeText( const String& rAlt ); + + // content or user defined index + inline void SetLevel(USHORT nLevel); + inline USHORT GetLevel() const; + + // for alphabetical index only + inline void SetPrimaryKey(const String& rStr ); + inline void SetSecondaryKey(const String& rStr); + inline void SetTextReading(const String& rStr); + inline void SetPrimaryKeyReading(const String& rStr ); + inline void SetSecondaryKeyReading(const String& rStr); + + inline const String& GetPrimaryKey() const; + inline const String& GetSecondaryKey() const; + inline const String& GetTextReading() const; + inline const String& GetPrimaryKeyReading() const; + inline const String& GetSecondaryKeyReading() const; + + BOOL IsAutoGenerated() const {return bAutoGenerated;} + void SetAutoGenerated(BOOL bSet) {bAutoGenerated = bSet;} + + BOOL IsMainEntry() const {return bMainEntry;} + void SetMainEntry(BOOL bSet) { bMainEntry = bSet;} + + inline const SwTOXType* GetTOXType() const; + + const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; } + SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; } +}; + +/*-------------------------------------------------------------------- + Description: index types + --------------------------------------------------------------------*/ + +class SwTOXType : public SwModify +{ +public: + SwTOXType(TOXTypes eTyp, const String& aName); + SwTOXType(const SwTOXType& rCopy); + + inline const String& GetTypeName() const; + void SetTypeName(const String& rName); + inline TOXTypes GetType() const; + +private: + String aName; + TOXTypes eType; +}; + +/*-------------------------------------------------------------------- + Description: Structure of the index lines + --------------------------------------------------------------------*/ + +#define FORM_TITLE 0 +#define FORM_ALPHA_DELIMITTER 1 +#define FORM_PRIMARY_KEY 2 +#define FORM_SECONDARY_KEY 3 +#define FORM_ENTRY 4 + +/* + Pattern structure + + <E#> - entry number <E# CharStyleName,PoolId> + <ET> - entry text <ET CharStyleName,PoolId> + <E> - entry text and number <E CharStyleName,PoolId> + <T> - tab stop <T,,Position,Adjust> + <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId> + <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER> + <#> - Page number <# CharStyleName,PoolId> + <LS> - Link start <LS> + <LE> - Link end <LE> + <A00> - Authority entry field <A02 CharStyleName, PoolId> + */ + +// These enum values are stored and must not be changed! +enum FormTokenType +{ + TOKEN_ENTRY_NO, + TOKEN_ENTRY_TEXT, + TOKEN_ENTRY, + TOKEN_TAB_STOP, + TOKEN_TEXT, + TOKEN_PAGE_NUMS, + TOKEN_CHAPTER_INFO, + TOKEN_LINK_START, + TOKEN_LINK_END, + TOKEN_AUTHORITY, + TOKEN_END +}; + +struct SwFormToken +{ + String sText; + String sCharStyleName; + SwTwips nTabStopPosition; + FormTokenType eTokenType; + USHORT nPoolId; + USHORT eTabAlign; + USHORT nChapterFormat; //SwChapterFormat; + USHORT nAuthorityField; //enum ToxAuthorityField + sal_Unicode cTabFillChar; + + SwFormToken(FormTokenType eType ) : + nTabStopPosition(0), + eTokenType(eType), + nPoolId(USHRT_MAX), + eTabAlign(0 /*SVX_TAB_ADJUST_LEFT*/), + nChapterFormat(0 /*CF_NUMBER*/), + nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/), + cTabFillChar(' ') {} + + String GetString() const; +}; + +class SwFormTokenEnumerator +{ + String sPattern; + xub_StrLen nCurPatternPos; + xub_StrLen nCurPatternLen; + + FormTokenType _SearchNextToken( xub_StrLen nStt, xub_StrLen& rEnd, + xub_StrLen* pTokenLen = 0 ) const; + SwFormToken BuildToken( FormTokenType, xub_StrLen ) const; + +public: + SwFormTokenEnumerator( const String& rPattern ); + BOOL HasNextToken() const + { return nCurPatternPos + nCurPatternLen < sPattern.Len(); } + + SwFormToken GetNextToken(); + + const String& GetPattern() const { return sPattern; } +}; + +class SwForm +{ + String aPattern[ AUTH_TYPE_END + 1 ]; + String aTemplate[ AUTH_TYPE_END + 1 ]; + USHORT nType, nFormMaxLevel; + BOOL bGenerateTabPos : 1; + BOOL bIsRelTabPos : 1; + BOOL bCommaSeparated : 1; + +public: + SwForm( USHORT nType = TOX_CONTENT ); + SwForm( const SwForm& rForm ); + + SwForm& operator=( const SwForm& rForm ); + + inline void SetTemplate(USHORT nLevel, const String& rName); + inline const String& GetTemplate(USHORT nLevel) const; + + inline void SetPattern(USHORT nLevel, const String& rName); + inline const String& GetPattern(USHORT nLevel) const; + + static String ConvertPatternFrom51(const String& rSource, TOXTypes eType); + + // fill tab stop positions from template to pattern + void AdjustTabStops(SwDoc& rDoc); + + SwFormTokenEnumerator CreateTokenEnumerator(USHORT nLevel) const + {return SwFormTokenEnumerator(GetPattern(nLevel));} + + inline USHORT GetTOXType() const; + inline USHORT GetFormMax() const; + + void SetFirstTabPos( USHORT n ); //{ nFirstTabPos = n; } + + BOOL IsGenerateTabPos() const { return bGenerateTabPos; } + void SetGenerateTabPos( BOOL b ) { bGenerateTabPos = b; } + + BOOL IsRelTabPos() const { return bIsRelTabPos; } + void SetRelTabPos( BOOL b ) { bIsRelTabPos = b; } + + BOOL IsCommaSeparated() const { return bCommaSeparated;} + void SetCommaSeparated( BOOL b) { bCommaSeparated = b;} + + static USHORT GetFormMaxLevel( USHORT nType ); + + static const sal_Char* aFormEntry; // <E> + static BYTE nFormEntryLen; // 3 characters + static const sal_Char* aFormTab; // <T> + static BYTE nFormTabLen; // 3 characters + static const sal_Char* aFormPageNums; // <P> + static BYTE nFormPageNumsLen; // 3 characters + static const sal_Char* aFormLinkStt; // <LS> + static BYTE nFormLinkSttLen; // 4 characters + static const sal_Char* aFormLinkEnd; // <LE> + static BYTE nFormLinkEndLen; // 4 characters + static const sal_Char* aFormEntryNum; // <E#> + static BYTE nFormEntryNumLen; // 4 characters + static const sal_Char* aFormEntryTxt; // <ET> + static BYTE nFormEntryTxtLen; // 4 characters + static const sal_Char* aFormChapterMark; // <C> + static BYTE nFormChapterMarkLen; // 3 characters + static const sal_Char* aFormText; // <TX> + static BYTE nFormTextLen; // 4 characters + static const sal_Char* aFormAuth; // <Axx> xx - decimal enum value + static BYTE nFormAuthLen; // 3 characters +}; + +/*-------------------------------------------------------------------- + Description: Content to create indexes of + --------------------------------------------------------------------*/ + +enum SwTOXElement +{ + TOX_MARK = 1, + TOX_OUTLINELEVEL = 2, + TOX_TEMPLATE = 4, + TOX_OLE = 8, + TOX_TABLE = 16, + TOX_GRAPHIC = 32, + TOX_FRAME = 64, + TOX_SEQUENCE = 128 +}; + +enum SwTOIOptions +{ + TOI_SAME_ENTRY = 1, + TOI_FF = 2, + TOI_CASE_SENSITIVE = 4, + TOI_KEY_AS_ENTRY = 8, + TOI_ALPHA_DELIMITTER = 16, + TOI_DASH = 32, + TOI_INITIAL_CAPS = 64 +}; + +//which part of the caption is to be displayed +enum SwCaptionDisplay +{ + CAPTION_COMPLETE, + CAPTION_NUMBER, + CAPTION_TEXT +}; + +enum SwTOOElements +{ + TOO_MATH = 0x01, + TOO_CHART = 0x02, + TOO_CALC = 0x08, + TOO_DRAW_IMPRESS= 0x10, + TOO_OTHER = 0x80 +}; + +#define TOX_STYLE_DELIMITER ((sal_Unicode)0x01) //JP 19.07.00: use a control char + +/*-------------------------------------------------------------------- + Description: Class for all indexes + --------------------------------------------------------------------*/ + +class SwTOXBase : public SwClient +{ + // not implemented + SwTOXBase& operator=(const SwTOXBase& rSource); + + SwForm aForm; // description of the lines + String aName; // unique name + String aTitle; // title + + String sMainEntryCharStyle; // name of the character style applied to main index entries + + String aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER + String sSequenceName; // FieldTypeName of a caption sequence + + LanguageType eLanguage; + String sSortAlgorithm; + + union { + USHORT nLevel; // consider outline levels + USHORT nOptions; // options of alphabetical index + } aData; + + USHORT nCreateType; // sources to create the index from + USHORT nOLEOptions; // OLE sources + SwCaptionDisplay eCaptionDisplay; // + BOOL bProtected : 1; // index protected ? + BOOL bFromChapter : 1; // create from chapter or document + BOOL bFromObjectNames : 1; // create a table or object index + // from the names rather than the caption + BOOL bLevelFromChapter : 1; // User index: get the level from the source chapter +public: + SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm, + USHORT nCreaType, const String& rTitle ); + SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 ); + virtual ~SwTOXBase(); + + + // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc. + // If not, so create it an copy all other used things. The return is this + SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& ); + + const SwTOXType* GetTOXType() const; // + + USHORT GetCreateType() const; // creation types + + const String& GetTOXName() const {return aName;} + void SetTOXName(const String& rSet) {aName = rSet;} + + const String& GetTitle() const; // Title + const String& GetTypeName() const; // Name + const SwForm& GetTOXForm() const; // description of the lines + + void SetCreate(USHORT); + void SetTitle(const String& rTitle); + void SetTOXForm(const SwForm& rForm); + + TOXTypes GetType() const; + + const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;} + void SetMainEntryCharStyle(const String& rSet) {sMainEntryCharStyle = rSet;} + + // content index only + inline void SetLevel(USHORT); // consider outline level + inline USHORT GetLevel() const; + + // alphabetical index only + inline USHORT GetOptions() const; // alphabetical index options + inline void SetOptions(USHORT nOpt); + + // index of objects + USHORT GetOLEOptions() const {return nOLEOptions;} + void SetOLEOptions(USHORT nOpt) {nOLEOptions = nOpt;} + + // index of objects + + // user defined index only + inline void SetTemplateName(const String& rName); // Absatzlayout beachten + inline String GetTemplateName() const; + + const String& GetStyleNames(USHORT nLevel) const + { + DBG_ASSERT( nLevel < MAXLEVEL, "Which level?"); + return aStyleNames[nLevel]; + } + void SetStyleNames(const String& rSet, USHORT nLevel) + { + DBG_ASSERT( nLevel < MAXLEVEL, "Which level?"); + aStyleNames[nLevel] = rSet; + } + + BOOL IsFromChapter() const { return bFromChapter;} + void SetFromChapter(BOOL bSet) { bFromChapter = bSet;} + + BOOL IsFromObjectNames() const {return bFromObjectNames;} + void SetFromObjectNames(BOOL bSet) {bFromObjectNames = bSet;} + + BOOL IsLevelFromChapter() const {return bLevelFromChapter;} + void SetLevelFromChapter(BOOL bSet) {bLevelFromChapter = bSet;} + + BOOL IsProtected() const { return bProtected; } + void SetProtected(BOOL bSet) { bProtected = bSet; } + + const String& GetSequenceName() const {return sSequenceName;} + void SetSequenceName(const String& rSet) {sSequenceName = rSet;} + + SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;} + void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;} + + static const String& GetTOXName(TOXTypes eType); // toxmgr.cxx + + LanguageType GetLanguage() const {return eLanguage;} + void SetLanguage(LanguageType nLang) {eLanguage = nLang;} + + const String& GetSortAlgorithm()const {return sSortAlgorithm;} + void SetSortAlgorithm(const String& rSet) {sSortAlgorithm = rSet;} + +}; + + +/*-------------------------------------------------------------------- + Description: Inlines + --------------------------------------------------------------------*/ + +// +//SwTOXMark +// +inline const String& SwTOXMark::GetAlternativeText() const + { return aAltText; } + +inline const SwTOXType* SwTOXMark::GetTOXType() const + { return (SwTOXType*)GetRegisteredIn(); } + +inline BOOL SwTOXMark::IsAlternativeText() const + { return aAltText.Len() > 0; } + +inline void SwTOXMark::SetAlternativeText(const String& rAlt) +{ + aAltText = rAlt; +} + +inline void SwTOXMark::SetLevel( USHORT nLvl ) +{ + OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); + nLevel = nLvl; +} + +inline void SwTOXMark::SetPrimaryKey( const String& rKey ) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aPrimaryKey = rKey; +} + +inline void SwTOXMark::SetSecondaryKey( const String& rKey ) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aSecondaryKey = rKey; +} + +inline void SwTOXMark::SetTextReading( const String& rTxt ) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aTextReading = rTxt; +} + +inline void SwTOXMark::SetPrimaryKeyReading( const String& rKey ) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aPrimaryKeyReading = rKey; +} + +inline void SwTOXMark::SetSecondaryKeyReading( const String& rKey ) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aSecondaryKeyReading = rKey; +} + +inline USHORT SwTOXMark::GetLevel() const +{ + OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); + return nLevel; +} + +inline const String& SwTOXMark::GetPrimaryKey() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aPrimaryKey; +} + +inline const String& SwTOXMark::GetSecondaryKey() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aSecondaryKey; +} + +inline const String& SwTOXMark::GetTextReading() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aTextReading; +} + +inline const String& SwTOXMark::GetPrimaryKeyReading() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aPrimaryKeyReading; +} + +inline const String& SwTOXMark::GetSecondaryKeyReading() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aSecondaryKeyReading; +} + +// +//SwForm +// +inline void SwForm::SetTemplate(USHORT nLevel, const String& rName) +{ + OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX"); + aTemplate[nLevel] = rName; +} + +inline void SwForm::SetPattern(USHORT nLevel, const String& rName) +{ + OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX"); + aPattern[nLevel] = rName; +} + +inline const String& SwForm::GetPattern(USHORT nLevel) const +{ + OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX"); + return aPattern[nLevel]; +} + +inline const String& SwForm::GetTemplate(USHORT nLevel) const +{ + OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX"); + return aTemplate[nLevel]; +} + +inline USHORT SwForm::GetTOXType() const +{ + return nType; +} + +inline USHORT SwForm::GetFormMax() const +{ + return nFormMaxLevel; +} + + +// +//SwTOXType +// +inline const String& SwTOXType::GetTypeName() const + { return aName; } + +inline void SwTOXType::SetTypeName(const String& rName) + { aName = rName; } + +inline TOXTypes SwTOXType::GetType() const + { return eType; } + +// +// SwTOXBase +// +inline const SwTOXType* SwTOXBase::GetTOXType() const + { return (SwTOXType*)GetRegisteredIn(); } + +inline USHORT SwTOXBase::GetCreateType() const + { return nCreateType; } + +inline const String& SwTOXBase::GetTitle() const + { return aTitle; } + +inline const String& SwTOXBase::GetTypeName() const + { return GetTOXType()->GetTypeName(); } + +inline const SwForm& SwTOXBase::GetTOXForm() const + { return aForm; } + +inline void SwTOXBase::SetCreate(USHORT nCreate) + { nCreateType = nCreate; } + +inline void SwTOXBase::SetTitle(const String& rTitle) + { aTitle = rTitle; } + +inline void SwTOXBase::SetTOXForm(const SwForm& rForm) + { aForm = rForm; } + +inline TOXTypes SwTOXBase::GetType() const + { return GetTOXType()->GetType(); } + +inline void SwTOXBase::SetLevel(USHORT nLev) +{ + OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); + aData.nLevel = nLev; +} + +inline USHORT SwTOXBase::GetLevel() const +{ + OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); + return aData.nLevel; +} + +inline void SwTOXBase::SetTemplateName(const String& rName) +{ + DBG_WARNING("SwTOXBase::SetTemplateName obsolete"); + aStyleNames[0] = rName; + +} + +inline String SwTOXBase::GetTemplateName() const +{ + DBG_WARNING("SwTOXBase::GetTemplateName obsolete"); + return aStyleNames[0].GetToken(0, TOX_STYLE_DELIMITER); +} + +inline USHORT SwTOXBase::GetOptions() const +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + return aData.nOptions; +} + +inline void SwTOXBase::SetOptions(USHORT nOpt) +{ + OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); + aData.nOptions = nOpt; +} + + +} //namespace binfilter +#endif // _TOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/toxe.hxx b/inc/bf_sw/toxe.hxx new file mode 100644 index 000000000..b8c46c989 --- /dev/null +++ b/inc/bf_sw/toxe.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TOXE_HXX +#define _TOXE_HXX + +namespace binfilter { +enum SwTOXSearch +{ + TOX_NXT, + TOX_PRV, + TOX_SAME_NXT, + TOX_SAME_PRV +}; + +enum SwTOIKeyType +{ + TOI_PRIMARY, + TOI_SECONDARY +}; + +enum TOXTypes +{ + TOX_INDEX, + TOX_USER, + TOX_CONTENT, + TOX_ILLUSTRATIONS, + TOX_OBJECTS, + TOX_TABLES, + TOX_AUTHORITIES +}; +// this enum contains all types of sources +enum ToxAuthorityType +{ + //BiBTeX - fields + AUTH_TYPE_ARTICLE, + AUTH_TYPE_BOOK, + AUTH_TYPE_BOOKLET, + AUTH_TYPE_CONFERENCE, + AUTH_TYPE_INBOOK, + AUTH_TYPE_INCOLLECTION, + AUTH_TYPE_INPROCEEDINGS, + AUTH_TYPE_JOURNAL, + AUTH_TYPE_MANUAL, + AUTH_TYPE_MASTERSTHESIS, + AUTH_TYPE_MISC, + AUTH_TYPE_PHDTHESIS, + AUTH_TYPE_PROCEEDINGS, + AUTH_TYPE_TECHREPORT, + AUTH_TYPE_UNPUBLISHED, + //additional types + AUTH_TYPE_EMAIL, + AUTH_TYPE_WWW, + AUTH_TYPE_CUSTOM1, + AUTH_TYPE_CUSTOM2, + AUTH_TYPE_CUSTOM3, + AUTH_TYPE_CUSTOM4, + AUTH_TYPE_CUSTOM5, + AUTH_TYPE_END +}; + +//this enum contains the fields of an authority entry +enum ToxAuthorityField +{ + AUTH_FIELD_IDENTIFIER, + AUTH_FIELD_AUTHORITY_TYPE, //ToxAuthorityType + //BibTex types + AUTH_FIELD_ADDRESS, + AUTH_FIELD_ANNOTE, + AUTH_FIELD_AUTHOR, + AUTH_FIELD_BOOKTITLE, + AUTH_FIELD_CHAPTER, + AUTH_FIELD_EDITION, + AUTH_FIELD_EDITOR, + AUTH_FIELD_HOWPUBLISHED, + AUTH_FIELD_INSTITUTION, + AUTH_FIELD_JOURNAL, +// AUTH_FIELD_KEY, // BiBTeX - Field + AUTH_FIELD_MONTH, + AUTH_FIELD_NOTE, + AUTH_FIELD_NUMBER, + AUTH_FIELD_ORGANIZATIONS, + AUTH_FIELD_PAGES, + AUTH_FIELD_PUBLISHER, + AUTH_FIELD_SCHOOL, + AUTH_FIELD_SERIES, + AUTH_FIELD_TITLE, + AUTH_FIELD_REPORT_TYPE, + AUTH_FIELD_VOLUME, + AUTH_FIELD_YEAR, + //additional types + AUTH_FIELD_URL, + AUTH_FIELD_CUSTOM1, + AUTH_FIELD_CUSTOM2, + AUTH_FIELD_CUSTOM3, + AUTH_FIELD_CUSTOM4, + AUTH_FIELD_CUSTOM5, + AUTH_FIELD_ISBN, + AUTH_FIELD_END +}; +} //namespace binfilter + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/toxwrap.hxx b/inc/bf_sw/toxwrap.hxx new file mode 100644 index 000000000..4240d7224 --- /dev/null +++ b/inc/bf_sw/toxwrap.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOXWRAP_HXX +#define _TOXWRAP_HXX + +#include <bf_svtools/bf_solar.h> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/uno/Reference.hxx> + +namespace com { namespace sun { namespace star { +namespace i18n { + class XExtendedIndexEntrySupplier; +} +namespace lang { + class XMultiServiceFactory; +} +}}} +class String; +namespace binfilter { + + +class IndexEntrySupplierWrapper +{ + ::com::sun::star::lang::Locale aLcl; + ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedIndexEntrySupplier > xIES; + +public: + IndexEntrySupplierWrapper(); + ~IndexEntrySupplierWrapper(); + + void SetLocale( const ::com::sun::star::lang::Locale& rLocale ) { aLcl = rLocale; } + + ::com::sun::star::uno::Sequence< ::rtl::OUString > + GetAlgorithmList( const ::com::sun::star::lang::Locale& rLcl ) const; + + sal_Bool LoadAlgorithm( const ::com::sun::star::lang::Locale& rLcl, + const String& sSortAlgorithm, long nOptions ) const; + + sal_Int16 CompareIndexEntry( const String& rTxt1, const String& rTxtReading1, + const ::com::sun::star::lang::Locale& rLcl1, + const String& rTxt2, const String& rTxtReading2, + const ::com::sun::star::lang::Locale& rLcl2 ) const; +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txatbase.hxx b/inc/bf_sw/txatbase.hxx new file mode 100644 index 000000000..fb7cf257c --- /dev/null +++ b/inc/bf_sw/txatbase.hxx @@ -0,0 +1,424 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXATBASE_HXX +#define _TXATBASE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/poolitem.hxx> +#include <hintids.hxx> +#include <osl/diagnose.h> +namespace binfilter { + +class SfxItemPool; +class SwFont; + +class SvxBrushItem; +class SvxFontItem; +class SvxPostureItem; +class SvxWeightItem; +class SvxUnderlineItem; +class SvxFontHeightItem; +class SvxPropSizeItem; +class SvxShadowedItem; +class SvxAutoKernItem; +class SvxWordLineModeItem; +class SvxContourItem; +class SvxCrossedOutItem; +class SvxColorItem; +class SvxCharSetColorItem; +class SvXMLAttrContainerItem; +class SwFmtRuby; +class SvxTwoLinesItem; +class SvxEmphasisMarkItem; +class SvxCharScaleWidthItem; +class SvxCharRotateItem; +class SvxCharReliefItem; + +class SwFmtCharFmt; +class SwFmtINetFmt; +class SvxKerningItem; +class SvxCaseMapItem; +class SvxLanguageItem; +class SvxEscapementItem; +class SvxBlinkItem; +class SvxNoHyphenItem; +class SwFmtSoftHyph; +class SwFmtHardBlank; +class SwFmtFld; +class SwFmtFtn; +class SwFmtFlyCnt; +class SwTOXMark; +class SwFmtRefMark; + +class SwTxtAttr +{ + const SfxPoolItem* pAttr; + xub_StrLen nStart; + BOOL bDontExpand : 1; + BOOL bLockExpandFlag : 1; + + BOOL bDontMergeAttr : 1; // refmarks, toxmarks, ruby + BOOL bDontMoveAttr : 1; // refmarks, toxmarks + BOOL bCharFmtAttr : 1; // charfmt, inet + BOOL bOverlapAllowedAttr : 1; // refmarks, toxmarks + BOOL bPriorityAttr : 1; // attribute has priority (redlining) + BOOL bDontExpandStart : 1; // don't expand start at paragraph start (ruby) +protected: + SwTxtAttr( const SfxPoolItem& rAttr, xub_StrLen nStart ); + + void SetLockExpandFlag( BOOL bFlag ) { bLockExpandFlag = bFlag; } + void SetDontMergeAttr( BOOL bFlag ) { bDontMergeAttr = bFlag; } + void SetDontMoveAttr( BOOL bFlag ) { bDontMoveAttr = bFlag; } + void SetCharFmtAttr( BOOL bFlag ) { bCharFmtAttr = bFlag; } + void SetOverlapAllowedAttr( BOOL bFlag ){ bOverlapAllowedAttr = bFlag; } + void SetDontExpandStartAttr(BOOL bFlag) { bDontExpandStart = bFlag; } + +public: + virtual ~SwTxtAttr(); + + // RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!! + void RemoveFromPool( SfxItemPool& rPool ); + + // Start Position erfragen + xub_StrLen* GetStart() { return &nStart; } + const xub_StrLen* GetStart() const { return &nStart; } + + // End Position erfragen + virtual xub_StrLen* GetEnd(); + inline const xub_StrLen* GetEnd() const; + inline const xub_StrLen* GetAnyEnd() const; + + inline void SetDontExpand( BOOL bNew ); + BOOL DontExpand() const { return bDontExpand; } + BOOL IsLockExpandFlag() const { return bLockExpandFlag; } + BOOL IsDontMergeAttr() const { return bDontMergeAttr; } + BOOL IsDontMoveAttr() const { return bDontMoveAttr; } + BOOL IsCharFmtAttr() const { return bCharFmtAttr; } + BOOL IsOverlapAllowedAttr() const { return bOverlapAllowedAttr; } + BOOL IsPriorityAttr() const { return bPriorityAttr; } + void SetPriorityAttr( BOOL bFlag ) { bPriorityAttr = bFlag; } + BOOL IsDontExpandStartAttr() const { return bDontExpandStart; } + + inline const SfxPoolItem& GetAttr() const; + inline USHORT Which() const { return GetAttr().Which(); } + + + inline const SvxFontItem &GetFont() const; + inline const SvxPostureItem &GetPosture() const; + inline const SvxWeightItem &GetWeight() const; + inline const SvxUnderlineItem &GetUnderline() const; + inline const SvxFontHeightItem &GetFontSize() const; + inline const SvxPropSizeItem &GetPropSize() const; + inline const SvxShadowedItem &GetShadowed() const; + inline const SvxAutoKernItem &GetAutoKern() const; + inline const SvxWordLineModeItem &GetWordLineMode() const; + inline const SvxContourItem &GetContour() const; + inline const SvxCrossedOutItem &GetCrossedOut() const; + inline const SvxColorItem &GetColor() const; + inline const SvxCharSetColorItem &GetCharSetColor() const; + inline const SwFmtCharFmt &GetCharFmt() const; + inline const SvxKerningItem &GetKerning() const; + inline const SvxCaseMapItem &GetCaseMap() const; + inline const SvxLanguageItem &GetLanguage() const; + inline const SvxEscapementItem &GetEscapement() const; + inline const SvxBlinkItem &GetBlink() const; + inline const SvxBrushItem &GetChrBackground() const; + inline const SvxNoHyphenItem &GetNoHyphenHere() const; + inline const SwFmtSoftHyph &GetSoftHyph() const; + inline const SwFmtHardBlank &GetHardBlank() const; + inline const SwFmtFld &GetFld() const; + inline const SwFmtFtn &GetFtn() const; + inline const SwFmtFlyCnt &GetFlyCnt() const; + inline const SwTOXMark &GetTOXMark() const; + inline const SwFmtRefMark &GetRefMark() const; + inline const SwFmtINetFmt &GetINetFmt() const; + inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const; + inline const SwFmtRuby &GetRuby() const; + inline const SvxTwoLinesItem &Get2Lines() const; + inline const SvxEmphasisMarkItem &GetEmphasisMark() const; + inline const SvxCharScaleWidthItem &GetCharScaleW() const; + inline const SvxCharRotateItem &GetCharRotate() const; + inline const SvxCharReliefItem &GetCharRelief() const; + +private: + SwTxtAttr( const SwTxtAttr& ); + SwTxtAttr& operator=( const SwTxtAttr& ); +}; + +class SwTxtAttrEnd : public SwTxtAttr +{ +protected: + xub_StrLen nEnd; + +public: + SwTxtAttrEnd( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); + virtual xub_StrLen* GetEnd(); +}; + + +// --------------- Inline Implementierungen ------------------------ + +inline const xub_StrLen* SwTxtAttr::GetEnd() const +{ + return ((SwTxtAttr*)this)->GetEnd(); +} + +inline const xub_StrLen* SwTxtAttr::GetAnyEnd() const +{ + const xub_StrLen* pEnd = GetEnd(); + return pEnd ? pEnd : &nStart; +} + +inline const SfxPoolItem& SwTxtAttr::GetAttr() const +{ + OSL_ENSURE( pAttr, "wo ist mein Attribut?" ); + return *pAttr; +} + +inline void SwTxtAttr::SetDontExpand( BOOL bNew ) +{ + if( !bLockExpandFlag ) + bDontExpand = bNew; +} + +inline const SvxFontItem& SwTxtAttr::GetFont() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_FONT, "Falsche Abfrage" ); + return (const SvxFontItem&)*pAttr; +} + +inline const SvxPostureItem& SwTxtAttr::GetPosture() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_POSTURE, "Falsche Abfrage" ); + return (const SvxPostureItem&)*pAttr; +} + +inline const SvxWeightItem& SwTxtAttr::GetWeight() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_WEIGHT, "Falsche Abfrage" ); + return (const SvxWeightItem&)*pAttr; +} + +inline const SvxUnderlineItem& SwTxtAttr::GetUnderline() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_UNDERLINE, "Falsche Abfrage" ); + return (const SvxUnderlineItem&)*pAttr; +} + +inline const SvxFontHeightItem& SwTxtAttr::GetFontSize() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_FONTSIZE, "Falsche Abfrage" ); + return (const SvxFontHeightItem&)*pAttr; +} + +inline const SvxPropSizeItem& SwTxtAttr::GetPropSize() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_PROPORTIONALFONTSIZE, "Falsche Abfrage" ); + return (const SvxPropSizeItem&)*pAttr; +} + +inline const SvxShadowedItem& SwTxtAttr::GetShadowed() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_SHADOWED, "Falsche Abfrage" ); + return (const SvxShadowedItem&)*pAttr; +} + +inline const SvxAutoKernItem& SwTxtAttr::GetAutoKern() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_AUTOKERN, "Falsche Abfrage" ); + return (const SvxAutoKernItem&)*pAttr; +} + +inline const SvxWordLineModeItem& SwTxtAttr::GetWordLineMode() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_WORDLINEMODE, "Falsche Abfrage" ); + return (const SvxWordLineModeItem&)*pAttr; +} + +inline const SvxContourItem& SwTxtAttr::GetContour() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_CONTOUR, "Falsche Abfrage" ); + return (const SvxContourItem&)*pAttr; +} + +inline const SvxCrossedOutItem& SwTxtAttr::GetCrossedOut() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_CROSSEDOUT, "Falsche Abfrage" ); + return (const SvxCrossedOutItem&)*pAttr; +} + +inline const SvxColorItem& SwTxtAttr::GetColor() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_COLOR, "Falsche Abfrage" ); + return (const SvxColorItem&)*pAttr; +} + +inline const SvxCharSetColorItem& SwTxtAttr::GetCharSetColor() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_CHARSETCOLOR, "Falsche Abfrage" ); + return (const SvxCharSetColorItem&)*pAttr; +} + +inline const SwFmtCharFmt& SwTxtAttr::GetCharFmt() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_CHARFMT, "Falsche Abfrage" ); + return (const SwFmtCharFmt&)*pAttr; +} + +inline const SvxKerningItem& SwTxtAttr::GetKerning() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_KERNING, "Falsche Abfrage" ); + return (const SvxKerningItem&)*pAttr; +} + +inline const SvxCaseMapItem& SwTxtAttr::GetCaseMap() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_CASEMAP, "Falsche Abfrage" ); + return (const SvxCaseMapItem&)*pAttr; +} + +inline const SvxLanguageItem& SwTxtAttr::GetLanguage() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_LANGUAGE, "Falsche Abfrage" ); + return (const SvxLanguageItem&)*pAttr; +} + +inline const SvxEscapementItem& SwTxtAttr::GetEscapement() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_ESCAPEMENT, "Falsche Abfrage" ); + return (const SvxEscapementItem&)*pAttr; +} + +inline const SvxBlinkItem& SwTxtAttr::GetBlink() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_BLINK, "Falsche Abfrage" ); + return (const SvxBlinkItem&)*pAttr; +} + +inline const SvxBrushItem& SwTxtAttr::GetChrBackground() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_BACKGROUND, "Falsche Abfrage" ); + return (const SvxBrushItem&)*pAttr; +} + +inline const SvxNoHyphenItem& SwTxtAttr::GetNoHyphenHere() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_NOHYPHEN, "Falsche Abfrage" ); + return (const SvxNoHyphenItem&)*pAttr; +} + +inline const SwFmtSoftHyph& SwTxtAttr::GetSoftHyph() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_SOFTHYPH, "Falsche Abfrage" ); + return (const SwFmtSoftHyph&)*pAttr; +} + +inline const SwFmtHardBlank& SwTxtAttr::GetHardBlank() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_HARDBLANK, "Falsche Abfrage" ); + return (const SwFmtHardBlank&)*pAttr; +} + +inline const SwFmtFld& SwTxtAttr::GetFld() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_FIELD, "Falsche Abfrage" ); + return (const SwFmtFld&)*pAttr; +} + +inline const SwFmtFtn& SwTxtAttr::GetFtn() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_FTN, "Falsche Abfrage" ); + return (const SwFmtFtn&)*pAttr; +} + +inline const SwFmtFlyCnt& SwTxtAttr::GetFlyCnt() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_FLYCNT, "Falsche Abfrage" ); + return (const SwFmtFlyCnt&)*pAttr; +} + +inline const SwTOXMark& SwTxtAttr::GetTOXMark() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_TOXMARK, "Falsche Abfrage" ); + return (const SwTOXMark&)*pAttr; +} + +inline const SwFmtRefMark& SwTxtAttr::GetRefMark() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_REFMARK, "Falsche Abfrage" ); + return (const SwFmtRefMark&)*pAttr; +} + +inline const SwFmtINetFmt& SwTxtAttr::GetINetFmt() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_INETFMT, "Falsche Abfrage" ); + return (const SwFmtINetFmt&)*pAttr; +} + +inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_UNKNOWNATR_CONTAINER, + "Falsche Abfrage" ); + return (const SvXMLAttrContainerItem&)*pAttr; +} + +inline const SwFmtRuby& SwTxtAttr::GetRuby() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_TXTATR_CJK_RUBY, + "Falsche Abfrage" ); + return (const SwFmtRuby&)*pAttr; +} +inline const SvxTwoLinesItem& SwTxtAttr::Get2Lines() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_TWO_LINES, + "Falsche Abfrage" ); + return (const SvxTwoLinesItem&)*pAttr; +} + +inline const SvxEmphasisMarkItem& SwTxtAttr::GetEmphasisMark() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_EMPHASIS_MARK, "Falsche Abfrage" ); + return (const SvxEmphasisMarkItem&)*pAttr; +} + +inline const SvxCharScaleWidthItem& SwTxtAttr::GetCharScaleW() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_SCALEW, "Falsche Abfrage" ); + return (const SvxCharScaleWidthItem&)*pAttr; +} + +inline const SvxCharRotateItem& SwTxtAttr::GetCharRotate() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_ROTATE, "Falsche Abfrage" ); + return (const SvxCharRotateItem&)*pAttr; +} + +inline const SvxCharReliefItem& SwTxtAttr::GetCharRelief() const +{ + OSL_ENSURE( pAttr && pAttr->Which() == RES_CHRATR_RELIEF, "Falsche Abfrage" ); + return (const SvxCharReliefItem&)*pAttr; +} + + + // #ifndef _TXATBASE_HXX +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtatr.hxx b/inc/bf_sw/txtatr.hxx new file mode 100644 index 000000000..aa198e8d5 --- /dev/null +++ b/inc/bf_sw/txtatr.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTATR_HXX +#define _TXTATR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd +#include <calbck.hxx> +namespace binfilter { + +class SwTxtNode; // fuer SwTxtFld +class SvxFont; +class SwCharSetCol; +class SwCharFmt; +class SvxTwoLinesItem; + +// ATT_CHARFMT ********************************************* + +class SwTxtCharFmt : public SwTxtAttrEnd +{ + SwTxtNode* pMyTxtNd; + BOOL bPrevNoHyph : 1; + BOOL bPrevBlink : 1; + BOOL bPrevURL : 1; + BOOL bColor : 1; + +public: + SwTxtCharFmt( const SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + ~SwTxtCharFmt( ); + + // werden vom SwFmtCharFmt hierher weitergeleitet + virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + // erfrage und setze den TxtNode Pointer + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + +}; + +// ATT_HARDBLANK ****************************** + +// ATT_XNLCONTAINERITEM ****************************** + +// ****************************** + +class SwTxtRuby : public SwTxtAttrEnd, public SwClient +{ + +public: + SwTxtRuby( const SwFmtRuby& rAttr, xub_StrLen nStartIn, xub_StrLen nEndIn ): + SwTxtAttrEnd( (SfxPoolItem &)rAttr, nStartIn, nEndIn ) + { DBG_BF_ASSERT(0, "STRIP"); }; + +}; + +// ****************************** + +// --------------- Inline Implementierungen ------------------------ + +inline const SwTxtNode& SwTxtCharFmt::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtCharFmt:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtflcnt.hxx b/inc/bf_sw/txtflcnt.hxx new file mode 100644 index 000000000..31d6098e9 --- /dev/null +++ b/inc/bf_sw/txtflcnt.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTFLCNT_HXX +#define _TXTFLCNT_HXX + +#include <txatbase.hxx> +namespace binfilter { + +class SwFlyInCntFrm; +class SwFrm; +class SwTxtNode; +class SwDoc; + +// SWTXT_FLYCNT ******************************** +// Attribut fuer zeilengebundene Frames (ohne Endindex) + +class SwTxtFlyCnt : public SwTxtAttr +{ + SwFlyInCntFrm *_GetFlyFrm( const SwFrm *pCurrFrm ); + +public: + SwTxtFlyCnt( const SwFmtFlyCnt& rAttr, xub_StrLen nStart ); + + // Setzt den Anker im pFmt und + void SetAnchor( const SwTxtNode *pNode ); + + inline SwFlyInCntFrm *GetFlyFrm( const SwFrm *pCurrFrm ); + inline const SwFlyInCntFrm *GetFlyFrm( const SwFrm *pCurrFrm ) const; + + // erzeugt sich ein neues FlyFrameFormat + void CopyFlyFmt( SwDoc* pDoc ); +}; + +inline SwFlyInCntFrm *SwTxtFlyCnt::GetFlyFrm( const SwFrm *pCurrFrm ) +{ + return _GetFlyFrm( pCurrFrm ); +} + +inline const SwFlyInCntFrm *SwTxtFlyCnt::GetFlyFrm( const SwFrm *pCurrFrm ) const +{ + return ((SwTxtFlyCnt*)this)->_GetFlyFrm( pCurrFrm ); +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtfld.hxx b/inc/bf_sw/txtfld.hxx new file mode 100644 index 000000000..60c5900c6 --- /dev/null +++ b/inc/bf_sw/txtfld.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTFLD_HXX +#define _TXTFLD_HXX + +#include <txatbase.hxx> +namespace binfilter { + +class SwTxtNode; + +// ATT_FLD *********************************** + +class SwTxtFld : public SwTxtAttr +{ + String aExpand; + SwTxtNode *pMyTxtNd; +public: + SwTxtFld( const SwFmtFld& rAttr, xub_StrLen nStart ); + ~SwTxtFld(); + + void Expand(); + inline void ExpandAlways(); + + // erfrage und setze den TxtNode Pointer + const SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + // enable notification that field content has changed and needs reformatting + void NotifyContentChange(SwFmtFld& rFmtFld); +}; + +inline const SwTxtNode& SwTxtFld::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtFld:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +inline void SwTxtFld::ExpandAlways() +{ + aExpand += ' '; + Expand(); +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtftn.hxx b/inc/bf_sw/txtftn.hxx new file mode 100644 index 000000000..40f8db5ce --- /dev/null +++ b/inc/bf_sw/txtftn.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTFTN_HXX +#define _TXTFTN_HXX + +#include <bf_svtools/bf_solar.h> + +#include <txatbase.hxx> +namespace binfilter { + +class SwNodeIndex; +class SwTxtNode; +class SwNodes; +class SwDoc; + +// ATT_FTN ********************************************************** + +class SwTxtFtn : public SwTxtAttr +{ + SwNodeIndex *pStartNode; + SwTxtNode* pMyTxtNd; + USHORT nSeqNo; + + // Zuweisung und Copy-Ctor sind nicht erlaubt. + SwTxtFtn& operator=( const SwTxtFtn &rTxtFtn ); + SwTxtFtn( const SwTxtFtn &rTxtFtn ); + +public: + SwTxtFtn( const SwFmtFtn& rAttr, xub_StrLen nStart ); + ~SwTxtFtn(); + + inline SwNodeIndex *GetStartNode() const { return pStartNode; } + void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE ); + void SetNumber( const USHORT nNumber, const String* = 0 ); + + // erfrage und setze den TxtNode Pointer + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + + // lege eine neue leere TextSection fuer diese Fussnote an + void MakeNewTextSection( SwNodes& rNodes ); + + // loesche die FtnFrame aus der Seite + void DelFrms(); + // bedingten Absatzvorlagen checken + + // fuer die Querverweise auf Fussnoten + USHORT SetSeqRefNo(); + void SetSeqNo( USHORT n ) { nSeqNo = n; } // fuer die Reader + USHORT GetSeqRefNo() const { return nSeqNo; } + + static void SetUniqueSeqRefNo( SwDoc& rDoc ); +}; + +inline const SwTxtNode& SwTxtFtn::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtFtn:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtinet.hxx b/inc/bf_sw/txtinet.hxx new file mode 100644 index 000000000..8e5c03480 --- /dev/null +++ b/inc/bf_sw/txtinet.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTINET_HXX +#define _TXTINET_HXX + +#include <bf_svtools/bf_solar.h> + +#include <txatbase.hxx> +#include <calbck.hxx> +class Color; +namespace binfilter { + +class SvxFont; +class SwTxtNode; +class SwCharFmt; + + +// ATT_INETFMT ********************************************* + +class SwTxtINetFmt : public SwTxtAttrEnd, public SwClient +{ + SwTxtNode* pMyTxtNd; + BOOL bVisited : 1; // Besuchter Link? + BOOL bValidVis : 1; // Ist das bVisited-Flag gueltig? + BOOL bColor : 1; + +public: + SwTxtINetFmt( const SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + virtual ~SwTxtINetFmt(); + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + // erfrage und setze den TxtNode Pointer + const SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + + SwCharFmt* GetCharFmt(); + const SwCharFmt* GetCharFmt() const + { return ((SwTxtINetFmt*)this)->GetCharFmt(); } + + BOOL IsVisited() const { return bVisited; } + void SetVisited( BOOL bNew ) { bVisited = bNew; } + + BOOL IsValidVis() const { return bValidVis; } + void SetValidVis( BOOL bNew ) { bValidVis = bNew; } + +}; +inline const SwTxtNode& SwTxtINetFmt::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtINetFmt:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txtrfmrk.hxx b/inc/bf_sw/txtrfmrk.hxx new file mode 100644 index 000000000..f2023ab41 --- /dev/null +++ b/inc/bf_sw/txtrfmrk.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTRFMRK_HXX +#define _TXTRFMRK_HXX + +#include <txatbase.hxx> +namespace binfilter { + +class SwTxtNode; + +// SWTXT_REFMARK ************************************* +// Attribut fuer Inhalts-/Positions-Referenzen im Text + +class SwTxtRefMark : public SwTxtAttrEnd +{ + SwTxtNode* pMyTxtNd; + USHORT* pEnd; // fuer InhaltsReferenz / PositionRef. ohne Ende +public: + SwTxtRefMark( const SwFmtRefMark& rAttr, + xub_StrLen nStart, xub_StrLen * pEnd = 0 ); + + virtual xub_StrLen *GetEnd(); // SwTxtAttr + inline const xub_StrLen* GetEnd() const { return pEnd; } + + // erfrage und setze den TxtNode Pointer + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } +}; +inline const SwTxtNode& SwTxtRefMark::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtRefMark:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/txttxmrk.hxx b/inc/bf_sw/txttxmrk.hxx new file mode 100644 index 000000000..0fe1e3552 --- /dev/null +++ b/inc/bf_sw/txttxmrk.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _TXTTXMRK_HXX +#define _TXTTXMRK_HXX + +#include <txatbase.hxx> +namespace binfilter { + +class SwTxtNode; +class SwDoc; + +// SWTXT_TOXMARK ******************************* +// Attribut fuer die Verzeichnisse + +class SwTxtTOXMark : public SwTxtAttrEnd +{ + xub_StrLen* pEnd; // wenn AlternativText vom SwTOXMark dann 0 !! + SwTxtNode* pMyTxtNd; +public: + SwTxtTOXMark( const SwTOXMark& rAttr, + xub_StrLen nStart, xub_StrLen * pEnd = 0 ); + virtual ~SwTxtTOXMark(); + + virtual xub_StrLen *GetEnd(); // SwTxtAttr + inline const xub_StrLen* GetEnd() const { return pEnd; } + + void CopyTOXMark( SwDoc* pDestDoc ); + + // erfrage und setze den TxtNode Pointer + inline const SwTxtNode* GetpTxtNd() const { return pMyTxtNd; } + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } +}; + +inline const SwTxtNode& SwTxtTOXMark::GetTxtNode() const +{ + OSL_ENSURE( pMyTxtNd, "SwTxtTOXMark:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unobaseclass.hxx b/inc/bf_sw/unobaseclass.hxx new file mode 100644 index 000000000..5c78edeb3 --- /dev/null +++ b/inc/bf_sw/unobaseclass.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOBASECLASS_HXX +#define _UNOBASECLASS_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XEnumeration.hpp> +#include <cppuhelper/implbase2.hxx> +namespace binfilter { + +typedef +cppu::WeakImplHelper2 +< + ::com::sun::star::container::XEnumeration, + ::com::sun::star::lang::XServiceInfo +> +SwSimpleEnumerationBaseClass; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unocoll.hxx b/inc/bf_sw/unocoll.hxx new file mode 100644 index 000000000..8c47157b8 --- /dev/null +++ b/inc/bf_sw/unocoll.hxx @@ -0,0 +1,462 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOCOLL_HXX +#define _UNOCOLL_HXX + +#include <bf_svtools/bf_solar.h> + +#include <flyenum.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> + +#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <cppuhelper/implbase3.hxx> // helper for implementations +namespace com{namespace sun {namespace star {namespace text +{ + class XTextTable; + class XTextSection; + class XFootnote; +}}}} +namespace binfilter { + +class SwDoc; +class SwFrmFmt; +class SwXFrame; +class SwFrmFmt; +class SwFmtFtn; +class XBookmark; +class SwXReferenceMark; +class SwSectionFmt; +class SwBookmark; +class SwFmtRefMark; +class SwXReferenceMark; +class SwXBookmark; + + +class SwUnoCollection +{ + sal_Bool bObjectValid; + SwDoc* pDoc; + + public: + SwUnoCollection(SwDoc* p) + : bObjectValid(sal_True) + , pDoc(p) + {} + + virtual ~SwUnoCollection() {} + + virtual void Invalidate(); + sal_Bool IsValid() const {return bObjectValid;} + + + SwDoc* GetDoc() const {return pDoc;} +}; + +#define SW_SERVICE_TYPE_TEXTTABLE 0 // +#define SW_SERVICE_TYPE_TEXTFRAME 1 // +#define SW_SERVICE_TYPE_GRAPHIC 2 +#define SW_SERVICE_TYPE_OLE 3 +#define SW_SERVICE_TYPE_BOOKMARK 4 +#define SW_SERVICE_TYPE_FOOTNOTE 5 +#define SW_SERVICE_TYPE_ENDNOTE 6 +#define SW_SERVICE_TYPE_INDEXMARK 7 // Stichwortverzeichniseintrag +#define SW_SERVICE_TYPE_INDEX 8 // Stichwortverzeichnis +#define SW_SERVICE_REFERENCE_MARK 9 +#define SW_SERVICE_STYLE_CHARACTER_STYLE 10 +#define SW_SERVICE_STYLE_PARAGRAPH_STYLE 11 +#define SW_SERVICE_STYLE_FRAME_STYLE 12 +#define SW_SERVICE_STYLE_PAGE_STYLE 13 +#define SW_SERVICE_STYLE_NUMBERING_STYLE 14 +#define SW_SERVICE_CONTENT_INDEX_MARK 15 +#define SW_SERVICE_CONTENT_INDEX 16 +#define SW_SERVICE_USER_INDEX_MARK 17 +#define SW_SERVICE_USER_INDEX 18 +#define SW_SERVICE_TEXT_SECTION 19 +#define SW_SERVICE_FIELDTYPE_DATETIME 20 +#define SW_SERVICE_FIELDTYPE_USER 21 +#define SW_SERVICE_FIELDTYPE_SET_EXP 22 +#define SW_SERVICE_FIELDTYPE_GET_EXP 23 +#define SW_SERVICE_FIELDTYPE_FILE_NAME 24 +#define SW_SERVICE_FIELDTYPE_PAGE_NUM 25 +#define SW_SERVICE_FIELDTYPE_AUTHOR 26 +#define SW_SERVICE_FIELDTYPE_CHAPTER 27 +#define SW_SERVICE_FIELDTYPE_DUMMY_0 28 +#define SW_SERVICE_FIELDTYPE_GET_REFERENCE 29 +#define SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT 30 +#define SW_SERVICE_FIELDTYPE_ANNOTATION 31 +#define SW_SERVICE_FIELDTYPE_INPUT 32 +#define SW_SERVICE_FIELDTYPE_MACRO 33 +#define SW_SERVICE_FIELDTYPE_DDE 34 +#define SW_SERVICE_FIELDTYPE_HIDDEN_PARA 35 +#define SW_SERVICE_FIELDTYPE_DOC_INFO 36 +#define SW_SERVICE_FIELDTYPE_TEMPLATE_NAME 37 +#define SW_SERVICE_FIELDTYPE_USER_EXT 38 +#define SW_SERVICE_FIELDTYPE_REF_PAGE_SET 39 +#define SW_SERVICE_FIELDTYPE_REF_PAGE_GET 40 +#define SW_SERVICE_FIELDTYPE_JUMP_EDIT 41 +#define SW_SERVICE_FIELDTYPE_SCRIPT 42 +#define SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET 43 +#define SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET 44 +#define SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM 45 +#define SW_SERVICE_FIELDTYPE_DATABASE 46 +#define SW_SERVICE_FIELDTYPE_DATABASE_NAME 47 +#define SW_SERVICE_FIELDTYPE_TABLE_FORMULA 48 +#define SW_SERVICE_FIELDTYPE_PAGE_COUNT 49 +#define SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT 50 +#define SW_SERVICE_FIELDTYPE_WORD_COUNT 51 +#define SW_SERVICE_FIELDTYPE_CHARACTER_COUNT 52 +#define SW_SERVICE_FIELDTYPE_TABLE_COUNT 53 +#define SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT 54 +#define SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT 55 +#define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR 56 +#define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME 57 +#define SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME 58 +#define SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION 59 +#define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR 60 +#define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME 61 +#define SW_SERVICE_FIELDTYPE_DOCINFO_INFO_0 62 +#define SW_SERVICE_FIELDTYPE_DOCINFO_INFO_1 63 +#define SW_SERVICE_FIELDTYPE_DOCINFO_INFO_2 64 +#define SW_SERVICE_FIELDTYPE_DOCINFO_INFO_3 65 +#define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR 66 +#define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME 67 +#define SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS 68 +#define SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT 69 +#define SW_SERVICE_FIELDTYPE_DOCINFO_TITLE 70 +#define SW_SERVICE_FIELDTYPE_DOCINFO_REVISION 71 +#define SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY 72 +#define SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS 73 +#define SW_SERVICE_FIELDTYPE_DROPDOWN 74 +#define SW_SERVICE_FIELDTYPE_DUMMY_4 75 +#define SW_SERVICE_FIELDTYPE_DUMMY_5 76 +#define SW_SERVICE_FIELDTYPE_DUMMY_6 77 +#define SW_SERVICE_FIELDTYPE_DUMMY_7 78 +#define SW_SERVICE_FIELDTYPE_DUMMY_8 79 +#define SW_SERVICE_FIELDMASTER_USER 80 +#define SW_SERVICE_FIELDMASTER_DDE 81 +#define SW_SERVICE_FIELDMASTER_SET_EXP 82 +#define SW_SERVICE_FIELDMASTER_DATABASE 83 +#define SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY 84 +#define SW_SERVICE_FIELDMASTER_DUMMY2 85 +#define SW_SERVICE_FIELDMASTER_DUMMY3 86 +#define SW_SERVICE_FIELDMASTER_DUMMY4 87 +#define SW_SERVICE_FIELDMASTER_DUMMY5 88 +#define SW_SERVICE_INDEX_ILLUSTRATIONS 89 +#define SW_SERVICE_INDEX_OBJECTS 90 +#define SW_SERVICE_INDEX_TABLES 91 +#define SW_SERVICE_INDEX_BIBLIOGRAPHY 92 +#define SW_SERVICE_PARAGRAPH 93 +#define SW_SERVICE_FIELDTYPE_INPUT_USER 94 +#define SW_SERVICE_FIELDTYPE_HIDDEN_TEXT 95 +#define SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE 96 +#define SW_SERVICE_NUMBERING_RULES 97 +#define SW_SERVICE_TEXT_COLUMNS 98 +#define SW_SERVICE_INDEX_HEADER_SECTION 99 +#define SW_SERVICE_DEFAULTS 100 +#define SW_SERVICE_IMAP_RECTANGLE 101 +#define SW_SERVICE_IMAP_CIRCLE 102 +#define SW_SERVICE_IMAP_POLYGON 103 + +#define SW_SERVICE_LAST SW_SERVICE_IMAP_POLYGON + + +#define SW_SERVICE_INVALID USHRT_MAX + +class SwXServiceProvider +{ +public: + static ::rtl::OUString GetProviderName(sal_uInt16 nObjectType); + static sal_uInt16 GetProviderType(const ::rtl::OUString& rServiceName); + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc); + static ::com::sun::star::uno::Sequence<rtl::OUString> GetAllServiceNames(); + +}; + + +typedef +cppu::WeakImplHelper3 +< + ::com::sun::star::container::XNameAccess, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XServiceInfo +> +SwCollectionBaseClass; +class SwXTextTables : public SwCollectionBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXTextTables(); +public: + SwXTextTables(SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static ::com::sun::star::text::XTextTable* GetObject( SwFrmFmt& rFmt ); +}; + + + +class SwXFrames : public SwCollectionBaseClass, + public SwUnoCollection +{ + const FlyCntType eType; +protected: + virtual ~SwXFrames(); +public: + SwXFrames(SwDoc* pDoc, FlyCntType eSet); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + FlyCntType GetType()const{return eType;} + static SwXFrame* GetObject( SwFrmFmt& rFmt, FlyCntType eType ); + +}; + + + +class SwXTextFrames : public SwXFrames +{ +protected: + virtual ~SwXTextFrames(); +public: + SwXTextFrames(SwDoc* pDoc); + + +// SMART_UNO_DECLARATION( SwXTextFrames, UsrObject ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + + +class SwXTextGraphicObjects : public SwXFrames +{ +protected: + virtual ~SwXTextGraphicObjects(); +public: + SwXTextGraphicObjects(SwDoc* pDoc); + + +// SMART_UNO_DECLARATION( SwXTextGraphicObjects, UsrObject ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + + +class SwXTextEmbeddedObjects : public SwXFrames +{ +protected: + virtual ~SwXTextEmbeddedObjects(); +public: + SwXTextEmbeddedObjects(SwDoc* pDoc); + + +// SMART_UNO_DECLARATION( SwXTextEmbeddedObjects, UsrObject ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + + +class SwXTextSections : public SwCollectionBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXTextSections(); +public: + SwXTextSections(SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static ::com::sun::star::text::XTextSection* GetObject( SwSectionFmt& rFmt ); +}; + + +class SwXBookmarks : public SwCollectionBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXBookmarks(); +public: + SwXBookmarks(SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static SwXBookmark* GetObject( SwBookmark& rBkm, SwDoc* pDoc ); +}; + + + +typedef +cppu::WeakImplHelper2 +< + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XServiceInfo +> +SwSimpleIndexAccessBaseClass; +class SwXFootnotes : public SwSimpleIndexAccessBaseClass, + public SwUnoCollection +{ + sal_Bool bEndnote; +protected: + virtual ~SwXFootnotes(); +public: + SwXFootnotes(sal_Bool bEnd, SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote> GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt ); +}; + + + +class SwXReferenceMarks : public SwCollectionBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXReferenceMarks(); +public: + SwXReferenceMarks(SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static SwXReferenceMark* GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark ); +}; + +} //namespace binfilter +#endif + + + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unocrsr.hxx b/inc/bf_sw/unocrsr.hxx new file mode 100644 index 000000000..5522a42cc --- /dev/null +++ b/inc/bf_sw/unocrsr.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOCRSR_HXX +#define _UNOCRSR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <swcrsr.hxx> +#include <calbck.hxx> +namespace binfilter { + + +class SwUnoCrsr : public virtual SwCursor, public SwModify +{ + BOOL bRemainInSection : 1; + BOOL bSkipOverHiddenSections : 1; + BOOL bSkipOverProtectSections : 1; + +public: + SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 ); + virtual ~SwUnoCrsr(); + + virtual operator SwUnoCrsr* (); + + // gibt es eine Selection vom Content in die Tabelle + // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt + virtual bool IsSelOvr( int eFlags = + ( SELOVER_CHECKNODESSECTION | + SELOVER_TOGGLE | SELOVER_CHANGEPOS )); + + BOOL IsRemainInSection() const { return bRemainInSection; } + void SetRemainInSection( BOOL bFlag ) { bRemainInSection = bFlag; } + + BOOL IsSkipOverProtectSections() const + { return bSkipOverProtectSections; } + void SetSkipOverProtectSections( BOOL bFlag ) + { bSkipOverProtectSections = bFlag; } + + BOOL IsSkipOverHiddenSections() const + { return bSkipOverHiddenSections; } + void SetSkipOverHiddenSections( BOOL bFlag ) + { bSkipOverHiddenSections = bFlag; } + + DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr ) +}; + + + +class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor +{ + // die Selection hat die gleiche Reihenfolge wie die + // TabellenBoxen. D.h., wird aus dem einen Array an einer Position + // etwas geloescht, dann muss es auch im anderen erfolgen!! + SwCursor aTblSel; + +public: + SwUnoTableCrsr( const SwPosition& rPos ); + virtual ~SwUnoTableCrsr() {} + + virtual operator SwUnoCrsr* () { return this; } + virtual operator SwUnoTableCrsr* () { return this; } + virtual operator SwTableCursor* () { return this; } + + // gibt es eine Selection vom Content in die Tabelle + // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt + virtual bool IsSelOvr( int ) { return false; } + + SwCursor& GetSelRing() { return aTblSel; } + const SwCursor& GetSelRing() const { return aTblSel; } +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unocrsrhelper.hxx b/inc/bf_sw/unocrsrhelper.hxx new file mode 100644 index 000000000..cc2c6c799 --- /dev/null +++ b/inc/bf_sw/unocrsrhelper.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOCRSRHELPER_HXX +#define _UNOCRSRHELPER_HXX + + +#include <com/sun/star/beans/XPropertyState.hpp> +#include <unocrsr.hxx> +namespace binfilter { + +class SfxItemSet; +struct SfxItemPropertyMap; + +class SwPaM; + + +namespace com{ namespace sun{ namespace star{ + namespace uno{ + class Any; + } +}}} + + +namespace SwUnoCursorHelper +{ + sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap + , SwPaM& rPam + , ::com::sun::star::uno::Any *pAny + , ::com::sun::star::beans::PropertyState& eState + , const SwTxtNode* pNode = 0 ); + + void GetCurPageStyle(SwPaM& rPaM, String &rString); + + inline sal_Bool IsStartOfPara(SwPaM& rUnoCrsr) + { return rUnoCrsr.GetPoint()->nContent == 0;} + inline sal_Bool IsEndOfPara(SwPaM& rUnoCrsr) + { return rUnoCrsr.GetCntntNode() && + rUnoCrsr.GetPoint()->nContent == rUnoCrsr.GetCntntNode()->Len();} + + void resetCrsrPropertyValue(const SfxItemPropertyMap* pMap, SwPaM& rPam); + void InsertFile(SwUnoCrsr* pUnoCrsr, + const String& rFileName, + const String& rFilterName, + const String& rFilterOption, + const String& rPassword); + + void getNumberingProperty( + SwPaM& rPam, + ::com::sun::star::beans::PropertyState& eState, + ::com::sun::star::uno::Any *pAny ); + + void setNumberingProperty( + const ::com::sun::star::uno::Any& rValue, + SwPaM& rPam); + + sal_Int16 IsNodeNumStart( + SwPaM& rPam, + ::com::sun::star::beans::PropertyState& eState); + +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unodraw.hxx b/inc/bf_sw/unodraw.hxx new file mode 100644 index 000000000..d850a385e --- /dev/null +++ b/inc/bf_sw/unodraw.hxx @@ -0,0 +1,231 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNODRAW_HXX +#define _UNODRAW_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svx/fmdpage.hxx> +#include <calbck.hxx> +#include <frmfmt.hxx> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/drawing/XShapes.hpp> +#include <cppuhelper/implbase3.hxx> // helper for implementations +#include <cppuhelper/implbase5.hxx> // helper for implementations +#include <bf_svtools/itemprop.hxx> +namespace binfilter { + +class SdrMarkList; +class SdrView; +class SwDoc; + +class SwFmDrawPage : public SvxFmDrawPage +{ + SdrPageView* pPageView; +protected: + + // Erzeugen eines SdrObjects anhand einer Description. Kann von + // abgeleiteten Klassen dazu benutzt werden, eigene ::com::sun::star::drawing::Shapes zu + // unterstuetzen (z.B. Controls) + virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape ) throw (); + +public: + SwFmDrawPage( SdrPage* pPage ); + virtual ~SwFmDrawPage() throw (); + + const SdrMarkList& PreGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes); + void PreUnGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > xShapeGroup); +// void PostGroup(); ?? wird es noch gebraucht ?? + + SdrView* GetDrawView() {return pView;} + SdrPageView* GetPageView(); + void RemovePageView(); + + // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt + // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder + // ein ein SvxShape aggregierendes Objekt anlegen. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw (); +}; + + + +typedef cppu::WeakAggImplHelper3 +< + ::com::sun::star::drawing::XDrawPage, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::drawing::XShapeGrouper +> +SwXDrawPageBaseClass; +class SwXDrawPage : public SwXDrawPageBaseClass +{ + SwDoc* pDoc; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xPageAgg; + SwFmDrawPage* pDrawPage; +public: + SwXDrawPage(SwDoc* pDoc); + ~SwXDrawPage(); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XShapes + virtual void SAL_CALL add(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL remove(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape) throw( ::com::sun::star::uno::RuntimeException ); + + //XShapeGrouper + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > SAL_CALL group(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL ungroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > & aGroup) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + SwFmDrawPage* GetSvxPage(); + void Invalidate() {pDoc = 0;} +}; + + +class SwShapeDescriptor_Impl; +class SwXGroupShape; +typedef +cppu::WeakAggImplHelper5 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::text::XTextContent, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel +> +SwXShapeBaseClass; +class SwXShape : public SwXShapeBaseClass, + public SwClient +{ + friend class SwHTMLImageWatcher; + friend class SwHTMLParser; + friend class SwXGroupShape; + friend class SwXDrawPage; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xShapeAgg; + SfxItemPropertySet aPropSet; + const SfxItemPropertyMap* _pMap; + ::com::sun::star::uno::Sequence< sal_Int8 >* pImplementationId; + + SwShapeDescriptor_Impl* pImpl; + + sal_Bool m_bDescriptor; + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + + SvxShape* GetSvxShape(); +protected: + virtual ~SwXShape(); +public: + SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape); + + + TYPEINFO(); + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;} + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > GetAggregationInterface() {return xShapeAgg;} +}; + + +class SwXGroupShape : + public SwXShape, + public ::com::sun::star::drawing::XShapes +{ +protected: + virtual ~SwXGroupShape(); +public: + SwXGroupShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape); + + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XShapes + virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); +}; +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoevent.hxx b/inc/bf_sw/unoevent.hxx new file mode 100644 index 000000000..25610ee2c --- /dev/null +++ b/inc/bf_sw/unoevent.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOEVENT_HXX +#define _UNOEVENT_HXX + +#include <bf_svtools/unoevent.hxx> + +namespace binfilter { + +class SvxMacroItem; +class SvxMacro; + +class SwXFrame; +class SwXTextFrame; +class SwXTextGraphicObject; +class SwXTextEmbeddedObject; +class SwXFrameStyle; +class SwFmtINetFmt; + + + +class SwHyperlinkEventDescriptor : public SvDetachedEventDescriptor +{ + const ::rtl::OUString sImplName; + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ); +protected: + virtual ~SwHyperlinkEventDescriptor(); +public: + + SwHyperlinkEventDescriptor(); + + + + void copyMacrosFromINetFmt(const SwFmtINetFmt& aFmt); + void copyMacrosIntoINetFmt(SwFmtINetFmt& aFmt); + + void copyMacrosFromNameReplace( + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameReplace> & xReplace); +}; + + + +// SwEventDescriptor for +// 1) SwXTextFrame +// 2) SwXGraphicObject +// 3) SwXEmbeddedObject +// All these objects are an SwXFrame, so they can use a common implementation +class SwFrameEventDescriptor : public SvEventDescriptor +{ + ::rtl::OUString sSwFrameEventDescriptor; + + SwXFrame& rFrame; + +public: + SwFrameEventDescriptor( SwXTextFrame& rFrameRef ); + SwFrameEventDescriptor( SwXTextGraphicObject& rGraphicRef ); + SwFrameEventDescriptor( SwXTextEmbeddedObject& rObjectRef ); + + ~SwFrameEventDescriptor(); + + virtual ::rtl::OUString SAL_CALL getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ); + +protected: + virtual void setMacroItem(const SvxMacroItem& rItem); + virtual const SvxMacroItem& getMacroItem(); + virtual sal_uInt16 getMacroItemWhich() const; +}; + +class SwFrameStyleEventDescriptor : public SvEventDescriptor +{ + ::rtl::OUString sSwFrameStyleEventDescriptor; + + SwXFrameStyle& rStyle; + +public: + SwFrameStyleEventDescriptor( SwXFrameStyle& rStyleRef ); + + ~SwFrameStyleEventDescriptor(); + + virtual ::rtl::OUString SAL_CALL getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ); + +protected: + virtual void setMacroItem(const SvxMacroItem& rItem); + virtual const SvxMacroItem& getMacroItem(); + virtual sal_uInt16 getMacroItemWhich() const; +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoevtlstnr.hxx b/inc/bf_sw/unoevtlstnr.hxx new file mode 100644 index 000000000..fe0be9f4b --- /dev/null +++ b/inc/bf_sw/unoevtlstnr.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOEVTLSTNR_HXX +#define _UNOEVTLSTNR_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/svarray.hxx> + +#include <com/sun/star/uno/Reference.h> +namespace com{namespace sun{namespace star{ + namespace lang + { + class XEventListener; + } +}}} +namespace binfilter { + +/* -------------------------------------------------- + * Verwaltung der EventListener + * --------------------------------------------------*/ +typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > * XEventListenerPtr; +SV_DECL_PTRARR(SwEvtLstnrArray, XEventListenerPtr, 4, 4) +class SwEventListenerContainer +{ + protected: + SwEvtLstnrArray* pListenerArr; + ::com::sun::star::uno::XInterface* pxParent; + public: + SwEventListenerContainer( ::com::sun::star::uno::XInterface* pxParent); + ~SwEventListenerContainer(); + + void AddListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & rxListener); + BOOL RemoveListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & rxListener); + void Disposing(); +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unofield.hxx b/inc/bf_sw/unofield.hxx new file mode 100644 index 000000000..0dae193cd --- /dev/null +++ b/inc/bf_sw/unofield.hxx @@ -0,0 +1,307 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOFIELD_HXX +#define _UNOFIELD_HXX + +#include <bf_svtools/bf_solar.h> + +#include <com/sun/star/text/XDependentTextField.hpp> +#include <com/sun/star/util/XRefreshable.hpp> +#include <com/sun/star/util/XUpdatable.hpp> +#include <calbck.hxx> +#include <unoobj.hxx> +#include <unocoll.hxx> +#include <RefreshListenerContainer.hxx> +class String; +namespace binfilter { + +class SwFieldType; +class SwDoc; +class SwFmtFld; +class SwField; +class SwSetExpField; + + + +class SwXFieldMaster : public cppu::WeakImplHelper4 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::lang::XComponent +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + sal_uInt16 nResTypeId; + SwDoc* m_pDoc; + + sal_Bool m_bIsDescriptor; + + String sParam1; //Content / Database / NumberingSeparator + String sParam2; // - /DataTablename + String sParam3; // - /DataFieldName + double fParam1; // Value / - + sal_Int8 nParam1; // ChapterNumberingLevel + sal_Bool bParam1; // IsExpression + sal_Int32 nParam2; + +protected: + virtual ~SwXFieldMaster(); +public: + + SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId); + SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + static ::rtl::OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc); + static ::rtl::OUString LocalizeFormula(const SwSetExpField& rFld, const ::rtl::OUString& rFormula, sal_Bool bQuery); + + SwFieldType* GetFldType(sal_Bool bDontCreate = sal_False) const; + SwDoc* GetDoc() {return m_pDoc;} + + sal_Bool IsDescriptor()const {return m_bIsDescriptor;} + sal_uInt16 GetResId() const {return nResTypeId;} +}; + + + +struct SwFieldProperties_Impl; +class SwXTextField : public cppu::WeakImplHelper5 +< + ::com::sun::star::text::XDependentTextField, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::util::XUpdatable +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + const SwFmtFld* pFmtFld; + SwDoc* m_pDoc; + + sal_Bool m_bIsDescriptor; + sal_Bool m_bCallUpdate; + sal_uInt16 m_nServiceId; + SwFieldProperties_Impl* m_pProps; + String m_sTypeName; + + + //SwFieldType* GetFldType() const { return (SwFieldType*)GetRegisteredIn(); } + SwDoc* GetDoc() {return m_pDoc;} +protected: + virtual ~SwXTextField(); +public: + SwXTextField(sal_uInt16 nServiceId); + SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XDependentTextField + virtual void SAL_CALL attachTextFieldMaster(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xFieldMaster) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getTextFieldMaster(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextField + virtual ::rtl::OUString SAL_CALL getPresentation(sal_Bool bShowCommand) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XUpdatable + virtual void SAL_CALL update( ) throw (::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + const SwField* GetField() const; + const SwFmtFld* GetFldFmt(){return GetField() ? pFmtFld : 0; }; + void Invalidate(); +}; + + +typedef +cppu::WeakImplHelper2 +< + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo +> +SwXTextFieldMastersBaseClass; +class SwXTextFieldMasters : public SwXTextFieldMastersBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXTextFieldMasters(); +public: + SwXTextFieldMasters(SwDoc* pDoc); + + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + + static sal_Bool getInstanceName(const SwFieldType& rFldType, String& rName); +}; + + + +typedef +cppu::WeakImplHelper3 +< + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::util::XRefreshable +> +SwXTextFieldTypesBaseClass; +class SwXTextFieldTypes : public SwXTextFieldTypesBaseClass, + public SwUnoCollection +{ + SwRefreshListenerContainer aRefreshCont; +protected: + virtual ~SwXTextFieldTypes(); +public: + SwXTextFieldTypes(SwDoc* pDoc); + + + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::util::XRefreshable + virtual void SAL_CALL refresh( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // SwUnoCollection + virtual void Invalidate(); +}; + + + +class SwXFieldEnumeration : public cppu::WeakImplHelper2 +< + ::com::sun::star::container::XEnumeration, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient +{ + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > > aItems; + sal_Int32 nNextIndex; // index of next element to be returned + + SwDoc* pDoc; + +protected: + virtual ~SwXFieldEnumeration(); +public: + SwXFieldEnumeration(SwDoc* pDoc); + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; +} //namespace binfilter +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoframe.hxx b/inc/bf_sw/unoframe.hxx new file mode 100644 index 000000000..cd5ad7528 --- /dev/null +++ b/inc/bf_sw/unoframe.hxx @@ -0,0 +1,343 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOFRAME_HXX +#define _UNOFRAME_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unoobj.hxx> +#include <bf_sfx2/objsh.hxx> +#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp> +#include <com/sun/star/text/XTextFrame.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> + +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase6.hxx> + +namespace binfilter { + +class SwDoc; + + +class BaseFrameProperties_Impl; +class SwXFrame : public cppu::WeakImplHelper6 +< + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::drawing::XShape, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XUnoTunnel +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SfxItemPropertySet aPropSet; + const SfxItemPropertyMap* _pMap; + SwDoc* mpDoc; + + const FlyCntType eType; + + // Descriptor-interface + BaseFrameProperties_Impl* pProps; + sal_Bool bIsDescriptor; + String sName; + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxStyleFamily; + + virtual ~SwXFrame(); +public: + SwXFrame(FlyCntType eSet, + const SfxItemPropertyMap* pMap, + SwDoc *pDoc ); //Descriptor-If + SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, + const SfxItemPropertyMap* pMap); + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + TYPEINFO(); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XShape + virtual ::com::sun::star::awt::Point SAL_CALL getPosition( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException); + + //XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType(void) throw( ::com::sun::star::uno::RuntimeException ); + + //Basisimplementierung + //XComponent + virtual void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + SwFrmFmt* GetFrmFmt() const + { + return PTR_CAST ( SwFrmFmt, GetRegisteredIn() ); + } + FlyCntType GetFlyCntType()const {return eType;} + + sal_Bool IsDescriptor() const {return bIsDescriptor;} + void ResetDescriptor(); + static SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt ); +}; + + +typedef cppu::WeakImplHelper3 +< + ::com::sun::star::text::XTextFrame, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::document::XEventsSupplier +> +SwXTextFrameBaseClass; + +class SwXTextFrame : public SwXTextFrameBaseClass, + public SwXText, + public SwXFrame +{ + const SfxItemPropertyMap* _pMap; + +protected: + virtual const SwStartNode *GetStartNode() const; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + virtual ~SwXTextFrame(); +public: + SwXTextFrame(SwDoc *pDoc); + SwXTextFrame(SwFrmFmt& rFmt); + + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XTextFrame + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // XEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + void * SAL_CALL operator new( size_t ) throw(); + void SAL_CALL operator delete( void * ) throw(); +}; + + +typedef cppu::WeakImplHelper2 +< + ::com::sun::star::text::XTextContent, + ::com::sun::star::document::XEventsSupplier +> +SwXTextGraphicObjectBaseClass; +class SwXTextGraphicObject : public SwXTextGraphicObjectBaseClass, + public SwXFrame +{ +protected: + virtual ~SwXTextGraphicObject(); +public: + SwXTextGraphicObject( SwDoc *pDoc ); + SwXTextGraphicObject(SwFrmFmt& rFmt); + + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // XEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); + void * SAL_CALL operator new( size_t ) throw(); + void SAL_CALL operator delete( void * ) throw(); +}; + + +typedef cppu::WeakImplHelper3 +< + ::com::sun::star::text::XTextContent, + ::com::sun::star::document::XEmbeddedObjectSupplier, + ::com::sun::star::document::XEventsSupplier +>SwXTextEmbeddedObjectBaseClass; + +class SwXTextEmbeddedObject : public SwXTextEmbeddedObjectBaseClass, + public SwXFrame +{ +protected: + virtual ~SwXTextEmbeddedObject(); +public: + SwXTextEmbeddedObject( SwDoc *pDoc ); + SwXTextEmbeddedObject(SwFrmFmt& rFmt); + + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XEmbeddedObjectSupplier, + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL getEmbeddedObject(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // XEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); + void * SAL_CALL operator new( size_t ) throw(); + void SAL_CALL operator delete( void * ) throw(); +}; + + + +class SwXOLEListener : public cppu::WeakImplHelper1 +< + ::com::sun::star::util::XModifyListener +>, + public SwClient +{ + SvPtrarr aFmts; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModel( const SwFmt& rFmt, SwOLENode** ppNd = 0 ) const; + SfxObjectShell* GetObjShell( const SwFmt& rFmt, + SwOLENode** ppNd = 0 ) const; + sal_uInt16 FindEntry( const ::com::sun::star::lang::EventObject& Source, SwOLENode** ppNd = 0 ); +public: + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::util::XModifyListener + virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); + + sal_Bool AddOLEFmt( SwFrmFmt& rFmt ); + void Modify( SfxPoolItem*, SfxPoolItem* ); +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoidx.hxx b/inc/bf_sw/unoidx.hxx new file mode 100644 index 000000000..2cf707e81 --- /dev/null +++ b/inc/bf_sw/unoidx.hxx @@ -0,0 +1,331 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOIDX_HXX +#define _UNOIDX_HXX + +#include <bf_svtools/bf_solar.h> + +#include <com/sun/star/text/XDocumentIndexMark.hpp> +#include <com/sun/star/text/XDocumentIndex.hpp> +#include <com/sun/star/container/XIndexReplace.hpp> +#include <unoobj.hxx> +#include <unocoll.hxx> +#include <toxe.hxx> +namespace binfilter { +class SwTOXBaseSection; +class SwTOXMark; +class SwTOXType; + + +class SwDocIdxProperties_Impl; +class SwXIndexStyleAccess_Impl; +class SwXIndexTokenAccess_Impl; + +class SwXDocumentIndex : public cppu::WeakImplHelper5 +< + ::com::sun::star::text::XDocumentIndex, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XUnoTunnel +>, + public SwClient +{ + friend class SwXIndexStyleAccess_Impl; + friend class SwXIndexTokenAccess_Impl; + + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertyMap* _pMap; + SwDoc* m_pDoc; + const SwTOXBaseSection* pBase; + TOXTypes eTOXType; + + //Descriptor-Interface + sal_Bool bIsDescriptor; + SwDocIdxProperties_Impl* pProps; + + SwXIndexStyleAccess_Impl* pStyleAccess; + SwXIndexTokenAccess_Impl* pTokenAccess; + + SwSectionFmt* GetFmt()const {return (SwSectionFmt*)GetRegisteredIn();} + + sal_Bool IsDescriptor() const {return bIsDescriptor;} + const SwDocIdxProperties_Impl* GetProperties_Impl() const { return pProps;} + SwDocIdxProperties_Impl* GetProperties_Impl() { return pProps;} + TOXTypes GetTOXType() const {return eTOXType;} + + SwXIndexStyleAccess_Impl* GetStyleAccess() const {return pStyleAccess;} + void SetStyleAccess(SwXIndexStyleAccess_Impl* pSet) + {pStyleAccess = pSet;} + + SwXIndexTokenAccess_Impl* GetTokenAccess() const {return pTokenAccess;} + void SetTokenAccess(SwXIndexTokenAccess_Impl* pSet) + {pTokenAccess = pSet;} +protected: + virtual ~SwXDocumentIndex(); +public: + SwXDocumentIndex(const SwTOXBaseSection* = 0, SwDoc* = 0); + //Descriptor-Ctor + SwXDocumentIndex(TOXTypes eToxType, SwDoc& rDoc); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XDocumentIndex + virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL update( ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); +}; + + +class SwXDocumentIndexMark : public cppu::WeakImplHelper4 +< + ::com::sun::star::text::XDocumentIndexMark, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XUnoTunnel +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SwDepend aTypeDepend; + SwDoc* m_pDoc; + const SwTOXMark* m_pTOXMark; + const SfxItemPropertyMap* _pMap; + + sal_Bool bIsDescriptor; + sal_Bool bMainEntry; + TOXTypes eType; + sal_uInt16 nLevel; + String sAltText; + String sPrimaryKey; + String sSecondaryKey; + String sTextReading; + String sPrimaryKeyReading; + String sSecondaryKeyReading; + String sUserIndexName; + + void InitMap(TOXTypes eToxType); +protected: + virtual ~SwXDocumentIndexMark(); +public: + SwXDocumentIndexMark(TOXTypes eToxType); + SwXDocumentIndexMark(const SwTOXType* pType, + const SwTOXMark* pMark, + SwDoc* pDc); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getMarkEntry(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setMarkEntry(const ::rtl::OUString& aIndexEntry) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + SwTOXType* GetTOXType() const {return (SwTOXType*)aTypeDepend.GetRegisteredIn();} + const SwTOXMark* GetTOXMark() const {return m_pTOXMark;} + + static SwXDocumentIndexMark* GetObject(SwTOXType* pType, const SwTOXMark* pMark, + SwDoc* pDoc); + void Invalidate(); +}; + + + +class SwXDocumentIndexes : public SwCollectionBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXDocumentIndexes(); +public: + SwXDocumentIndexes(SwDoc* pDoc); + + +// SMART_UNO_DECLARATION( SwXDocumentIndexes, UsrObject ); + +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) + +// throw( ::com::sun::star::uno::RuntimeException ); +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut ); + + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static SwXDocumentIndex* GetObject(const SwTOXBaseSection* pTOX); +}; + + +class SwXIndexStyleAccess_Impl : public cppu::WeakImplHelper2 +< + ::com::sun::star::container::XIndexReplace, + ::com::sun::star::lang::XServiceInfo +> +{ + SwXDocumentIndex& rParent; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; +protected: + virtual ~SwXIndexStyleAccess_Impl(); +public: + SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx); + + + //XIndexReplace + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + + +class SwXIndexTokenAccess_Impl : public cppu::WeakImplHelper2 +< + ::com::sun::star::container::XIndexReplace, + ::com::sun::star::lang::XServiceInfo +> +{ + SwXDocumentIndex& rParent; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; + sal_Int32 nCount; +protected: + virtual ~SwXIndexTokenAccess_Impl(); +public: + SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx); + + + + //XIndexReplace + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unomailmerge.hxx b/inc/bf_sw/unomailmerge.hxx new file mode 100644 index 000000000..205fcd953 --- /dev/null +++ b/inc/bf_sw/unomailmerge.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _UNOMAILMERGE_HXX_ +#define _UNOMAILMERGE_HXX_ + +#include <cppuhelper/implbase5.hxx> // WeakImplHelper4 +#include <cppuhelper/interfacecontainer.hxx> // OMultiTypeInterfaceContainerHelperVar +#include <unotools/configitem.hxx> // !! needed for OMultiTypeInterfaceContainerHelperVar !! + + +#include <com/sun/star/task/XJob.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/beans/PropertyChangeEvent.hpp> +#include <com/sun/star/text/XMailMergeBroadcaster.hpp> + +#include <bf_svtools/itemprop.hxx> +#include <bf_sfx2/objsh.hxx> // SfxObjectShellRef +namespace com { namespace sun { namespace star { namespace sdbc { + class XResultSet; + class XConnection; +}}}} + +namespace com { namespace sun { namespace star { namespace frame { + class XModel; +}}}} + +namespace com { namespace sun { namespace star { namespace lang { + class XMultiServiceFactory; +}}}} + +namespace com { namespace sun { namespace star { namespace text { + class XMailMergeListener; + struct MailMergeEvent; +}}}} + +namespace rtl { + class OUString; +} +namespace binfilter { + + +/////////////////////////////////////////////////////////////////////////// + +// uses templates from <cppuhelper/interfacecontainer.h> +// and <unotools/configitem.hxx> + +// helper function call class +struct PropHashType_Impl +{ + size_t operator()(const INT32 &s) const { return s; } +}; + +typedef cppu::OMultiTypeInterfaceContainerHelperVar + < + INT32, + PropHashType_Impl, + std::equal_to< INT32 > + > OPropertyListenerContainerHelper; + +//////////////////////////////////////////////////////////// + +class SwXMailMerge : + public cppu::WeakImplHelper5 + < + ::com::sun::star::task::XJob, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::text::XMailMergeBroadcaster, + ::com::sun::star::lang::XComponent, + ::com::sun::star::lang::XServiceInfo + > +{ + cppu::OInterfaceContainerHelper aEvtListeners; + cppu::OInterfaceContainerHelper aMergeListeners; + OPropertyListenerContainerHelper aPropListeners; + + //SfxItemPropertySet aPropSet; + const SfxItemPropertyMap* pMap; + + SfxObjectShellRef xDocSh; // the document + + String aTmpFileName; + + // properties of mail merge service + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSelection; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > xConnection; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel; + ::rtl::OUString aDataSourceName; + ::rtl::OUString aDataCommand; + ::rtl::OUString aFilter; + ::rtl::OUString aDocumentURL; + ::rtl::OUString aOutputURL; + ::rtl::OUString aFileNamePrefix; + sal_Int32 nDataCommandType; + sal_Int16 nOutputType; + sal_Bool bEscapeProcessing; + sal_Bool bSinglePrintJobs; + sal_Bool bFileNameFromColumn; + + sal_Bool bDisposing; + + + void launchEvent( const ::com::sun::star::beans::PropertyChangeEvent &rEvt ) const; + + // disallow use of copy-constructor and assignment-operator for now + SwXMailMerge( const SwXMailMerge & ); + SwXMailMerge & operator = ( const SwXMailMerge & ); +protected: + virtual ~SwXMailMerge(); +public: + SwXMailMerge(); + + + void LaunchMailMergeEvent( const ::com::sun::star::text::MailMergeEvent &rData ) const; + + // XJob + virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // XMailMergeBroadcaster + virtual void SAL_CALL addMailMergeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XMailMergeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeMailMergeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XMailMergeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); +}; + + +extern ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw(); +extern ::rtl::OUString SAL_CALL SwXMailMerge_getImplementationName() throw(); +extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); + +//////////////////////////////////////////////////////////// + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unomap.hxx b/inc/bf_sw/unomap.hxx new file mode 100644 index 000000000..3f6655b35 --- /dev/null +++ b/inc/bf_sw/unomap.hxx @@ -0,0 +1,308 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOMAP_HXX +#define _UNOMAP_HXX + +#include <bf_svtools/itemprop.hxx> +namespace binfilter { + +#define PROPERTY_NONE 0 + +#define PROPERTY_MAP_TEXT_CURSOR 0 +#define PROPERTY_MAP_CHAR_STYLE 1 +#define PROPERTY_MAP_PARA_STYLE 2 +#define PROPERTY_MAP_FRAME_STYLE 3 +#define PROPERTY_MAP_PAGE_STYLE 4 +#define PROPERTY_MAP_NUM_STYLE 5 +#define PROPERTY_MAP_SECTION 6 +#define PROPERTY_MAP_TEXT_TABLE 7 +#define PROPERTY_MAP_TABLE_CELL 8 +#define PROPERTY_MAP_TABLE_RANGE 9 +#define PROPERTY_MAP_TEXT_SEARCH 10 +#define PROPERTY_MAP_TEXT_FRAME 11 +#define PROPERTY_MAP_TEXT_GRAPHIC 12 +#define PROPERTY_MAP_TEXT_SHAPE 13 +#define PROPERTY_MAP_INDEX_USER 14 +#define PROPERTY_MAP_INDEX_CNTNT 15 +#define PROPERTY_MAP_INDEX_IDX 16 +#define PROPERTY_MAP_USER_MARK 17 +#define PROPERTY_MAP_CNTIDX_MARK 18 +#define PROPERTY_MAP_INDEX_MARK 19 +#define PROPERTY_MAP_TEXT_TABLE_ROW 20 +#define PROPERTY_MAP_TEXT_SHAPE_DESCRIPTOR 21 +#define PROPERTY_MAP_TEXT_TABLE_CURSOR 22 +#define PROPERTY_MAP_BOOKMARK 23 +#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS 24 +#define PROPERTY_MAP_INDEX_ILLUSTRATIONS 25 +#define PROPERTY_MAP_INDEX_OBJECTS 26 +#define PROPERTY_MAP_INDEX_TABLES 27 +#define PROPERTY_MAP_BIBLIOGRAPHY 28 +#define PROPERTY_MAP_TEXT_DOCUMENT 29 +#define PROPERTY_MAP_LINK_TARGET 30 +#define PROPERTY_MAP_AUTO_TEXT_GROUP 31 +#define PROPERTY_MAP_TEXTPORTION_EXTENSIONS 34 +#define PROPERTY_MAP_FOOTNOTE 35 +#define PROPERTY_MAP_TEXT_COLUMS 36 +#define PROPERTY_MAP_PARAGRAPH 37 +#define PROPERTY_MAP_EMBEDDED_OBJECT 38 +#define PROPERTY_MAP_REDLINE 39 +#define PROPERTY_MAP_TEXT_DEFAULT 40 + +#define PROPERTY_MAP_FLDTYP_DATETIME 41 +#define PROPERTY_MAP_FLDTYP_USER 42 +#define PROPERTY_MAP_FLDTYP_SET_EXP 43 +#define PROPERTY_MAP_FLDTYP_GET_EXP 44 +#define PROPERTY_MAP_FLDTYP_FILE_NAME 45 +#define PROPERTY_MAP_FLDTYP_PAGE_NUM 46 +#define PROPERTY_MAP_FLDTYP_AUTHOR 47 +#define PROPERTY_MAP_FLDTYP_CHAPTER 48 +#define PROPERTY_MAP_FLDTYP_GET_REFERENCE 49 +#define PROPERTY_MAP_FLDTYP_CONDITIONED_TEXT 50 +#define PROPERTY_MAP_FLDTYP_HIDDEN_TEXT 51 +#define PROPERTY_MAP_FLDTYP_ANNOTATION 52 +#define PROPERTY_MAP_FLDTYP_INPUT 53 +#define PROPERTY_MAP_FLDTYP_MACRO 54 +#define PROPERTY_MAP_FLDTYP_DDE 55 +#define PROPERTY_MAP_FLDTYP_HIDDEN_PARA 56 +#define PROPERTY_MAP_FLDTYP_DOC_INFO 57 +#define PROPERTY_MAP_FLDTYP_TEMPLATE_NAME 58 +#define PROPERTY_MAP_FLDTYP_USER_EXT 59 +#define PROPERTY_MAP_FLDTYP_REF_PAGE_SET 60 +#define PROPERTY_MAP_FLDTYP_REF_PAGE_GET 61 +#define PROPERTY_MAP_FLDTYP_JUMP_EDIT 62 +#define PROPERTY_MAP_FLDTYP_SCRIPT 63 +#define PROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET 64 +#define PROPERTY_MAP_FLDTYP_DATABASE_NUM_SET 65 +#define PROPERTY_MAP_FLDTYP_DATABASE_SET_NUM 66 +#define PROPERTY_MAP_FLDTYP_DATABASE 67 +#define PROPERTY_MAP_FLDTYP_DATABASE_NAME 68 +#define PROPERTY_MAP_FLDTYP_DOCSTAT 69 +#define PROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR 70 +#define PROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME 71 +#define PROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_DATE_TIME 72 +#define PROPERTY_MAP_FLDTYP_DOCINFO_CREATE_DATE_TIME 73 +#define PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME 74 +#define PROPERTY_MAP_FLDTYP_DOCINFO_MISC 75 +#define PROPERTY_MAP_FLDTYP_DOCINFO_REVISION 76 +#define PROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS 77 +#define PROPERTY_MAP_FLDTYP_DUMMY_0 78 +#define PROPERTY_MAP_FLDTYP_TABLE_FORMULA 79 +#define PROPERTY_MAP_FLDMSTR_USER 80 +#define PROPERTY_MAP_FLDMSTR_DDE 81 +#define PROPERTY_MAP_FLDMSTR_SET_EXP 82 +#define PROPERTY_MAP_FLDMSTR_DATABASE 83 +#define PROPERTY_MAP_FLDMSTR_DUMMY0 84 +#define PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY 85 +#define PROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY 86 +#define PROPERTY_MAP_TEXT 87 +#define PROPERTY_MAP_REDLINE_PORTION 88 +#define PROPERTY_MAP_MAILMERGE 89 +#define PROPERTY_MAP_FLDTYP_DROPDOWN 90 +#define PROPERTY_MAP_END 91 + +#define PROPERTY_SET_CHAR_STYLE 1 +#define PROPERTY_SET_PARA_STYLE 2 +#define PROPERTY_SET_FRAME_STYLE 3 +#define PROPERTY_SET_PAGE_STYLE 4 +#define PROPERTY_SET_NUM_STYLE 5 + +//S&E +#define WID_WORDS 0 +#define WID_BACKWARDS 1 +#define WID_REGULAR_EXPRESSION 2 +#define WID_CASE_SENSITIVE 3 +#define WID_IN_SELECTION 4 +#define WID_STYLES 5 +#define WID_SIMILARITY 6 +#define WID_SIMILARITY_RELAX 7 +#define WID_SIMILARITY_EXCHANGE 8 +#define WID_SIMILARITY_ADD 9 +#define WID_SIMILARITY_REMOVE 10 +#define WID_SEARCH_ALL 11 + +//Sections +#define WID_SECT_CONDITION 8000 +#define WID_SECT_DDE_TYPE 8001 +#define WID_SECT_DDE_FILE 8002 +#define WID_SECT_DDE_ELEMENT 8003 +#define WID_SECT_LINK 8004 +#define WID_SECT_VISIBLE 8005 +#define WID_SECT_PROTECTED 8006 +#define WID_SECT_REGION 8007 +#define WID_SECT_DDE_AUTOUPDATE 8008 +#define WID_SECT_DOCUMENT_INDEX 8009 +#define WID_SECT_IS_GLOBAL_DOC_SECTION 8010 +#define WID_SECT_PASSWORD 8011 +#define WID_SECT_CURRENTLY_VISIBLE 8012 + +//Verzeichnisse +#define WID_PRIMARY_KEY 1000 +#define WID_SECONDARY_KEY 1001 +#define WID_ALT_TEXT 1002 +#define WID_IDX_TITLE 1003 +#define WID_LEVEL 1004 +#define WID_CREATE_FROM_MARKS 1005 +#define WID_CREATE_FROM_OUTLINE 1006 +#define WID_MAIN_ENTRY 1007 +#define WID_CREATE_FROM_CHAPTER 1008 +#define WID_CREATE_FROM_LABELS 1009 +#define WID_USE_ALPHABETICAL_SEPARATORS 1010 +#define WID_USE_KEY_AS_ENTRY 1011 +#define WID_USE_COMBINED_ENTRIES 1012 +#define WID_IS_CASE_SENSITIVE 1013 +#define WID_USE_P_P 1014 +#define WID_USE_DASH 1015 +#define WID_USE_UPPER_CASE 1016 +#define WID_INDEX_AUTO_MARK_FILE_U_R_L 1017 +#define WID_LABEL_CATEGORY 1018 +#define WID_LABEL_DISPLAY_TYPE 1019 +#define WID_USE_LEVEL_FROM_SOURCE 1020 +#define WID_LEVEL_FORMAT 1021 +#define WID_LEVEL_PARAGRAPH_STYLES 1022 +#define WID_RECALC_TAB_STOPS 1023 +//#define WID_??? 1024 +#define WID_MAIN_ENTRY_CHARACTER_STYLE_NAME 1025 +#define WID_CREATE_FROM_TABLES 1026 +#define WID_CREATE_FROM_TEXT_FRAMES 1027 +#define WID_CREATE_FROM_GRAPHIC_OBJECTS 1028 +#define WID_CREATE_FROM_EMBEDDED_OBJECTS 1029 +#define WID_CREATE_FROM_STAR_MATH 1030 +#define WID_PROTECTED 1031 + +#define WID_CREATE_FROM_STAR_CHART 1032 +#define WID_CREATE_FROM_STAR_CALC 1033 +#define WID_CREATE_FROM_STAR_DRAW 1034 +#define WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS 1035 +#define WID_USER_IDX_NAME 1036 +#define WID_PARA_HEAD 1037 +#define WID_PARA_SEP 1038 +#define WID_PARA_LEV1 1039 +#define WID_PARA_LEV2 1040 +#define WID_PARA_LEV3 1041 +#define WID_PARA_LEV4 1042 +#define WID_PARA_LEV5 1043 +#define WID_PARA_LEV6 1044 +#define WID_PARA_LEV7 1045 +#define WID_PARA_LEV8 1046 +#define WID_PARA_LEV9 1047 +#define WID_PARA_LEV10 1048 +#define WID_IS_COMMA_SEPARATED 1049 +#define WID_INDEX_MARKS 1050 +#define WID_IS_RELATIVE_TABSTOPS 1051 +#define WID_CREATE_FROM_PARAGRAPH_STYLES 1052 +#define WID_IDX_CONTENT_SECTION 1053 +#define WID_IDX_HEADER_SECTION 1054 +#define WID_IDX_LOCALE 1055 +#define WID_IDX_SORT_ALGORITHM 1056 +#define WID_IDX_NAME 1057 + +#define WID_TEXT_READING 1058 +#define WID_PRIMARY_KEY_READING 1059 +#define WID_SECONDARY_KEY_READING 1060 + +//text document +#define WID_DOC_CHAR_COUNT 1000 +#define WID_DOC_PARA_COUNT 1001 +#define WID_DOC_WORD_COUNT 1002 +#define WID_DOC_WORD_SEPARATOR 1003 +#define WID_DOC_CHANGES_SHOW 1004 +#define WID_DOC_CHANGES_RECORD 1005 +#define WID_DOC_AUTO_MARK_URL 1006 +#define WID_DOC_HIDE_TIPS 1007 +#define WID_DOC_REDLINE_DISPLAY 1008 +#define WID_DOC_FORBIDDEN_CHARS 1009 +#define WID_DOC_CHANGES_PASSWORD 1010 +#define WID_DOC_TWO_DIGIT_YEAR 1011 +#define WID_DOC_AUTOMATIC_CONTROL_FOCUS 1012 +#define WID_DOC_APPLY_FORM_DESIGN_MODE 1013 +#define WID_DOC_BASIC_LIBRARIES 1014 + +//MailMerge +#define WID_SELECTION 1071 +#define WID_RESULT_SET 1072 +#define WID_CONNECTION 1073 +#define WID_MODEL 1074 +#define WID_DATA_SOURCE_NAME 1075 +#define WID_DATA_COMMAND 1076 +#define WID_FILTER 1077 +#define WID_DOCUMENT_URL 1078 +#define WID_OUTPUT_URL 1079 +#define WID_DATA_COMMAND_TYPE 1080 +#define WID_OUTPUT_TYPE 1081 +#define WID_ESCAPE_PROCESSING 1082 +#define WID_SINGLE_PRINT_JOBS 1083 +#define WID_FILE_NAME_FROM_COLUMN 1084 +#define WID_FILE_NAME_PREFIX 1085 + +//AutoText +#define WID_GROUP_PATH 0 +#define WID_GROUP_TITLE 1 + +//NumberingRules +#define WID_IS_AUTOMATIC 0 +#define WID_CONTINUOUS 1 +#define WID_RULE_NAME 2 +#define WID_IS_ABS_MARGINS 3 + +//TextColumns +#define WID_TXTCOL_LINE_WIDTH 0 +#define WID_TXTCOL_LINE_COLOR 1 +#define WID_TXTCOL_LINE_REL_HGT 2 +#define WID_TXTCOL_LINE_ALIGN 3 +#define WID_TXTCOL_LINE_IS_ON 4 +#define WID_TXTCOL_IS_AUTOMATIC 5 +#define WID_TXTCOL_AUTO_DISTANCE 6 + + + +class SwItemPropertySet : public SfxItemPropertySet +{ +protected: + virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const; +public: + SwItemPropertySet( const SfxItemPropertyMap *pMap ) : + SfxItemPropertySet( pMap ){} +}; + + +class SwUnoPropertyMapProvider +{ + SfxItemPropertyMap* aMapArr[PROPERTY_MAP_END]; + + SfxItemPropertySet* pCharStyleMap; + SfxItemPropertySet* pParaStyleMap; + SfxItemPropertySet* pFrameStyleMap; + SfxItemPropertySet* pPageStyleMap; + SfxItemPropertySet* pNumStyleMap; + + void Sort(sal_uInt16 nId); +public: + SwUnoPropertyMapProvider(); + ~SwUnoPropertyMapProvider(); + + const SfxItemPropertyMap* GetPropertyMap(sal_uInt16 PropertyId); + + SfxItemPropertySet& GetPropertySet(sal_Int8 nPropSetId); +}; + +extern SwUnoPropertyMapProvider aSwMapProvider; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unomid.h b/inc/bf_sw/unomid.h new file mode 100644 index 000000000..5a864d711 --- /dev/null +++ b/inc/bf_sw/unomid.h @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SW_UNOMID_HXX +#define SW_UNOMID_HXX + + +#define MID_MIRROR_VERT 0 +#define MID_MIRROR_HORZ_EVEN_PAGES 1 +#define MID_MIRROR_HORZ_ODD_PAGES 2 + +#define MID_PAGEDESC_PAGEDESCNAME 0 +#define MID_PAGEDESC_PAGENUMOFFSET 1 + +#define MID_SURROUND_SURROUNDTYPE 0 +#define MID_SURROUND_ANCHORONLY 1 +#define MID_SURROUND_CONTOUR 2 +#define MID_SURROUND_CONTOUROUTSIDE 3 + +#define MID_VERTORIENT_ORIENT 0 +#define MID_VERTORIENT_RELATION 1 +#define MID_VERTORIENT_POSITION 2 + +#define MID_HORIORIENT_ORIENT 0 +#define MID_HORIORIENT_RELATION 1 +#define MID_HORIORIENT_POSITION 2 +#define MID_HORIORIENT_PAGETOGGLE 3 + +#define MID_ANCHOR_ANCHORTYPE 0 +#define MID_ANCHOR_PAGENUM 1 +#define MID_ANCHOR_ANCHORFRAME 2 + +#define MID_URL_HYPERLINKFORMAT 0 +#define MID_URL_HYPERLINKNAME 1 +#define MID_URL_CLIENTMAP 2 +#define MID_URL_SERVERMAP 3 +#define MID_URL_URL 4 +#define MID_URL_TARGET 5 +#define MID_URL_VISITED_FMT 6 +#define MID_URL_UNVISITED_FMT 7 +#define MID_URL_HYPERLINKEVENTS 8 + +#define MID_CHAIN_PREVNAME 0 +#define MID_CHAIN_NEXTNAME 1 + +#define MID_LINENUMBER_COUNT 0 +#define MID_LINENUMBER_STARTVALUE 1 + +#define MID_DROPCAP_FORMAT 0 +#define MID_DROPCAP_WHOLE_WORD 1 +#define MID_DROPCAP_CHAR_STYLE_NAME 2 +#define MID_DROPCAP_LINES 3 +#define MID_DROPCAP_COUNT 4 +#define MID_DROPCAP_DISTANCE 5 + +#define MID_FRMSIZE_SIZE 0 +#define MID_FRMSIZE_REL_HEIGHT 1 +#define MID_FRMSIZE_REL_WIDTH 2 + +#define MID_FRMSIZE_WIDTH 4 +#define MID_FRMSIZE_HEIGHT 5 +#define MID_FRMSIZE_SIZE_TYPE 6 +#define MID_FRMSIZE_IS_AUTO_HEIGHT 7 +/* XML only */ +#define MID_FRMSIZE_MIN_HEIGHT 8 +#define MID_FRMSIZE_FIX_HEIGHT 9 +#define MID_FRMSIZE_COL_WIDTH 10 +#define MID_FRMSIZE_REL_COL_WIDTH 11 +/* UNO */ +#define MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT 12 +#define MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH 13 + +#define MID_COLUMNS 0 +#define MID_COLUMN_SEPARATOR_LINE 1 + +//SwFmtFtnAtTxtEnd +#define MID_COLLECT 0 +#define MID_RESTART_NUM 1 +#define MID_NUM_START_AT 2 +#define MID_OWN_NUM 3 +#define MID_NUM_TYPE 4 +#define MID_PREFIX 5 +#define MID_SUFFIX 6 + +//page style footnote +#define MID_FTN_HEIGHT 0 +#define MID_LINE_WEIGHT 1 +#define MID_LINE_COLOR 2 +#define MID_LINE_RELWIDTH 3 +#define MID_LINE_ADJUST 4 +#define MID_LINE_TEXT_DIST 5 +#define MID_LINE_FOOTNOTE_DIST 6 + +//SwFmtRuby +#define MID_RUBY_TEXT 0 +#define MID_RUBY_ADJUST 1 +#define MID_RUBY_CHARSTYLE 2 +#define MID_RUBY_ABOVE 3 + +//SwTextGridItem +#define MID_GRID_COLOR 0 +#define MID_GRID_LINES 1 +#define MID_GRID_BASEHEIGHT 2 +#define MID_GRID_RUBYHEIGHT 3 +#define MID_GRID_TYPE 4 +#define MID_GRID_RUBY_BELOW 5 +#define MID_GRID_PRINT 6 +#define MID_GRID_DISPLAY 7 + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unomod.hxx b/inc/bf_sw/unomod.hxx new file mode 100644 index 000000000..19bc37bc7 --- /dev/null +++ b/inc/bf_sw/unomod.hxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOMOD_HXX +#define _UNOMOD_HXX + +#include <com/sun/star/text/XModule.hpp> +#include <com/sun/star/view/XPrintSettingsSupplier.hpp> +#include <com/sun/star/view/XViewSettingsSupplier.hpp> +#include <cppuhelper/implbase4.hxx> // helper for implementations +#include <comphelper/ChainablePropertySet.hxx> +#include <comphelper/SettingsHelper.hxx> +namespace binfilter { + +class SwView; +class SwViewOption; +struct SwPrintData; +class SwDoc; + +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SwXModule_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); + +class SwXModule : public cppu::WeakImplHelper4 +< + ::com::sun::star::text::XModule, + ::com::sun::star::view::XViewSettingsSupplier, + ::com::sun::star::view::XPrintSettingsSupplier, + ::com::sun::star::lang::XServiceInfo +> +{ + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxViewSettings; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxPrintSettings; + +protected: + virtual ~SwXModule(); +public: + SwXModule(); + + + //XViewSettings + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getViewSettings(void) + throw( ::com::sun::star::uno::RuntimeException ); + + //XPrintSettings + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getPrintSettings(void) + throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) + throw( ::com::sun::star::uno::RuntimeException ); +}; + +enum SwXPrintSettingsType +{ + PRINT_SETTINGS_MODULE, + PRINT_SETTINGS_WEB, + PRINT_SETTINGS_DOCUMENT +}; + +class SwXPrintSettings : public comphelper::ChainableHelperNoState +{ + friend class SwXDocumentSettings; +protected: + SwXPrintSettingsType meType; + SwPrintData * mpPrtOpt; + SwDoc *mpDoc; + + virtual void _preSetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _postSetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + + virtual void _preGetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _postGetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + + virtual ~SwXPrintSettings() + throw(); +public: + SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = NULL ); + + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) + throw( ::com::sun::star::uno::RuntimeException ); +}; + + +class SwXViewSettings : public comphelper::ChainableHelperNoState +{ + + friend class SwXDocumentSettings; +protected: + SwView* pView; + SwViewOption* mpViewOption; + const SwViewOption* mpConstViewOption; + sal_Bool bObjectValid:1, bWeb:1, mbApplyZoom; + virtual void _preSetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _postSetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + + virtual void _preGetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _postGetValues () + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + + virtual ~SwXViewSettings() + throw(); +public: + SwXViewSettings(sal_Bool bWeb, SwView* pView); + + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + sal_Bool IsValid() const {return bObjectValid;} + void Invalidate() {bObjectValid = sal_False;} +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoobj.hxx b/inc/bf_sw/unoobj.hxx new file mode 100644 index 000000000..e8820204f --- /dev/null +++ b/inc/bf_sw/unoobj.hxx @@ -0,0 +1,1223 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOOBJ_HXX +#define _UNOOBJ_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unoevtlstnr.hxx> +#include <unobaseclass.hxx> +#include <bf_svtools/itemprop.hxx> +#include <bf_svtools/svarray.hxx> +#include <frmfmt.hxx> +#include <flyenum.hxx> +#include <fldbas.hxx> +#include <fmtcntnt.hxx> +#include <pam.hxx> +#include <toxe.hxx> +#include <sortopt.hxx> +#include <com/sun/star/document/XDocumentInsertable.hpp> +#include <com/sun/star/text/XTextCursor.hpp> +#include <com/sun/star/text/XWordCursor.hpp> +#include <com/sun/star/text/XParagraphCursor.hpp> +#include <com/sun/star/text/XSentenceCursor.hpp> +#include <com/sun/star/text/XFootnote.hpp> +#include <com/sun/star/text/XTextSection.hpp> +#include <com/sun/star/text/XTextField.hpp> +#include <com/sun/star/text/XTextRange.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/util/XSortable.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XContentEnumerationAccess.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/text/XTextRangeCompare.hpp> +#include <com/sun/star/text/XRelativeTextContentInsert.hpp> +#include <com/sun/star/text/XRelativeTextContentRemove.hpp> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/implbase3.hxx> // helper for implementations +#include <cppuhelper/implbase4.hxx> // helper for implementations +#include <cppuhelper/implbase5.hxx> // helper for implementations +#include <cppuhelper/implbase6.hxx> // helper for implementations +#include <cppuhelper/implbase7.hxx> // helper for implementations +#include <cppuhelper/implbase9.hxx> +#include <cppuhelper/implbase11.hxx> // helper for implementations +#include "TextCursorHelper.hxx" +#include <comphelper/uno3.hxx> + + +#include <tools/link.hxx> +namespace binfilter { + +#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar) +#define C2S(cChar) UniString::CreateFromAscii(cChar) + +class SwUnoCrsr; +class SwCursor; +class SwBookmark; +class SwFmtFtn; +class SwFmtFld; +class SwFmtRefMark; +class SwEvtLstnrArray; +class GetCurTxtFmtColl; + + +class SwParaSelection +{ + SwUnoCrsr* pUnoCrsr; +public: + SwParaSelection(SwUnoCrsr* pCrsr); + ~SwParaSelection(); +}; + + + +enum CursorType +{ + CURSOR_INVALID, + CURSOR_BODY, + CURSOR_FRAME, + CURSOR_TBLTEXT, + CURSOR_FOOTNOTE, + CURSOR_HEADER, + CURSOR_FOOTER, + CURSOR_REDLINE, + CURSOR_ALL, // fuer Search&Replace + CURSOR_SELECTION, // create a paragraph enumeration from a text range or cursor + CURSOR_SELECTION_IN_TABLE +}; + + + +#define PUNOPAM (_pStartCrsr) + +#define FOREACHUNOPAM_START(pCrsr) \ + {\ + SwPaM *_pStartCrsr = pCrsr, *__pStartCrsr = _pStartCrsr; \ + do { + +#define FOREACHUNOPAM_END() \ + } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); \ + } + + + + + +SV_DECL_PTRARR(SwDependArr, SwDepend*, 2, 2) + +SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); +::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); + +void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, + SwDependArr& rFrameArr, BOOL bSort ); + + + +class SwUnoInternalPaM : public SwPaM +{ + SwUnoInternalPaM( const SwUnoInternalPaM& ); +public: + SwUnoInternalPaM(SwDoc& rDoc); + ~SwUnoInternalPaM(); + + SwUnoInternalPaM& operator=(const SwPaM& rPaM); +}; + +/*-------------------------------------------------- + Start/EndAction oder Start/EndAllAction +--------------------------------------------------*/ +class UnoActionContext +{ + SwDoc* pDoc; + public: + UnoActionContext(SwDoc* pDoc); + ~UnoActionContext(); + + void InvalidateDocument() {pDoc = 0;} +}; +/* -------------------------------------------------- + * Actions kurzfristig unterbrechen + * --------------------------------------------------*/ +class UnoActionRemoveContext +{ + SwDoc* pDoc; + public: + UnoActionRemoveContext(SwDoc* pDoc); + ~UnoActionRemoveContext(); +}; + +typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > * XTextRangeRefPtr; +SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) + +void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); + + + +class SwXTextRange; +class SwXTextCursor; +class SwXText : public ::com::sun::star::text::XText, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::text::XTextRangeCompare, + public ::com::sun::star::text::XRelativeTextContentInsert, + public ::com::sun::star::text::XRelativeTextContentRemove, + public ::com::sun::star::beans::XPropertySet, + public ::com::sun::star::lang::XUnoTunnel +{ + SwDoc* pDoc; + BOOL bObjectValid; + CursorType eCrsrType; + const SfxItemPropertyMap* _pMap; +protected: + virtual const SwStartNode *GetStartNode() const; +public: + SwXText(SwDoc* pDc, CursorType eType); + virtual ~SwXText(); + + const SwDoc* GetDoc()const {return pDoc;} + SwDoc* GetDoc() {return pDoc;} + + // wenn ein SwXText attached wird, wird das Doc gesetzt + void SetDoc(SwDoc* pDc) + {DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); + pDoc = pDc; + bObjectValid = 0 != pDc; + } + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual void SAL_CALL insertString(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const ::rtl::OUString& aString, BOOL bAbsorb) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL insertControlCharacter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, sal_Int16 nControlCharacter, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL insertTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + //XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextRangeCompare + sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + //XRelativeTextContentInsert + virtual void SAL_CALL insertTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + //XRelativeTextContentRemove + virtual void SAL_CALL removeTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + INT16 ComparePositions(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos2) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + BOOL CheckForOwnMember(const SwXTextRange* pRange1, const OTextCursorHelper* pCursor1)throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // + void Invalidate() {bObjectValid = sal_False;} + BOOL IsValid()const {return bObjectValid;} + + CursorType GetTextType() {return eCrsrType;} +}; + + + +enum SwGetPropertyStatesCaller +{ + SW_PROPERTY_STATE_CALLER_DEFAULT, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY +}; +#define CRSR_ATTR_MODE_TABLE 1 //attributes should be applied to a table selection +#define CRSR_ATTR_MODE_DONTREPLACE 2 //attributes should be added, not replaced + +typedef cppu::WeakImplHelper11< + ::com::sun::star::text::XSentenceCursor, + ::com::sun::star::text::XWordCursor, + ::com::sun::star::text::XParagraphCursor, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::document::XDocumentInsertable, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::util::XSortable, + ::com::sun::star::container::XContentEnumerationAccess, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::beans::XMultiPropertyStates + > SwXTextCursor_Base; +class SwXTextCursor : public SwXTextCursor_Base, + public SwClient, + public OTextCursorHelper +{ + SwEventListenerContainer aLstnrCntnr; + SfxItemPropertySet aPropSet; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwSortOptions* pLastSortOptions; + + CursorType eType; + + void DeleteAndInsert(const String& rText); + + DECL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface>* ); + +protected: + virtual ~SwXTextCursor(); +public: + SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, const SwPosition& rPos, + CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + DECLARE_XINTERFACE(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextCursor - neu + virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL goLeft( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL goRight( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoStart( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoEnd( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + + //XWordCursor - neu + virtual BOOL SAL_CALL isStartOfWord( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL isEndOfWord( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoNextWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoPreviousWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoEndOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoStartOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); + + //XSentenceCursor - neu + virtual BOOL SAL_CALL isStartOfSentence( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL isEndOfSentence( ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoNextSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoPreviousSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoStartOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); + virtual BOOL SAL_CALL gotoEndOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); + + //ParagraphCursor - neu + virtual BOOL SAL_CALL isStartOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL isEndOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL gotoStartOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL gotoEndOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL gotoNextParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL gotoPreviousParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + static void SetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& aValue, + const SfxItemPropertyMap* pMap = 0, + USHORT nAttrMode = 0) + throw(::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Any GetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > GetPropertyStates( SwPaM& rPaM, SfxItemPropertySet& rPropSet, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller = SW_PROPERTY_STATE_CALLER_DEFAULT) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::beans::PropertyState GetPropertyState( SwPaM& rPaM, SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + static void SetPropertyToDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Any GetPropertyDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XDocumentInsertable - neu + virtual void SAL_CALL insertDocumentFromURL(const ::rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + + //XSortable - neu + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException ); + + //XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const ::rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XMultiPropertyStates + virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + virtual const SwPaM* GetPaM() const; + virtual SwPaM* GetPaM(); + virtual const SwDoc* GetDoc() const; + virtual SwDoc* GetDoc(); + SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} + const SwUnoCrsr* GetCrsr()const{return (SwUnoCrsr*)GetRegisteredIn();} + + static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAttrMode ); + static void GetCrsrAttr(SwPaM& rPam, SfxItemSet& rSet, BOOL bCurrentAttrOnly = FALSE); + static void getTextFromPam(SwPaM& aCrsr, ::rtl::OUString& rBuffer); + static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); + + static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); + static void SetString(SwCursor& rCrsr, const ::rtl::OUString& rString); + + static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + createSortDescriptor(sal_Bool bFromTable); + static sal_Bool convertSortProperties( + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor, + SwSortOptions& rSortOpt); +}; + +typedef +cppu::WeakImplHelper5 +< + ::com::sun::star::text::XTextContent, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XUnoTunnel +> +SwRefBookmarkBaseClass; +class SwXBookmark : public SwRefBookmarkBaseClass, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SwDoc* pDoc; + String m_aName; + BOOL bIsDescriptor; +protected: + virtual ~SwXBookmark(); +public: + SwXBookmark(SwBookmark* pBkm = 0, SwDoc* pDoc = 0); + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwBookmark* GetBookmark() const { return (SwBookmark*)GetRegisteredIn(); } + SwDoc* GetDoc(){return pDoc;} +}; + + + + +typedef cppu::WeakAggImplHelper2 +< + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::lang::XServiceInfo +> SwXBodyTextBaseClass; +class SwXBodyText : public SwXBodyTextBaseClass, + public SwXText +{ +protected: + virtual ~SwXBodyText(); +public: + SwXBodyText(SwDoc* pDoc); + + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();} + virtual void SAL_CALL release( ) throw(){OWeakObject::release();} + + //XAggregation + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); +}; + + +class SwXTextRange : public cppu::WeakImplHelper7 +< + ::com::sun::star::text::XTextRange, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XContentEnumerationAccess, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::container::XEnumerationAccess +>, public SwClient +{ + friend class SwXText; + enum RangePosition + { + RANGE_IN_TEXT, // 'normaler' ::com::sun::star::text::TextRange + RANGE_IN_FRAME,// TextPosition wurde mit einem Rahmen angelegt, der kein Uno-Objekt besitzt + RANGE_IN_CELL, // TextPosition wurde mit einer Zelle angelegt, die kein Uno-Objekt besitzt + RANGE_IS_TABLE, // Anker einer Tabelle + RANGE_INVALID // von NewInstance erzeugt + } eRangePosition; + + SwDoc* pDoc; + SwTableBox* pBox; + const SwStartNode* pBoxStartNode; + SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden + SfxItemPropertySet aPropSet; + //SwDepend aFrameDepend; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + + + void _CreateNewBookmark(SwPaM& rPam); + //TODO: new exception type for protected content + void DeleteAndInsert(const String& rText) throw( ::com::sun::star::uno::RuntimeException ); +protected: + virtual ~SwXTextRange(); +public: + SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rxParent); + SwXTextRange(SwFrmFmt& rFmt, SwPaM& rPam); + SwXTextRange(SwFrmFmt& rTblFmt, SwTableBox& rTblBox, SwPaM& rPam); + SwXTextRange(SwFrmFmt& rTblFmt, const SwStartNode& rStartNode, SwPaM& rPam); + SwXTextRange(SwFrmFmt& rTblFmt); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const ::rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + BOOL GetPositions(SwPaM& rToFill) const; + const SwDoc* GetDoc()const {return pDoc;} + SwDoc* GetDoc(){return pDoc;} + + SwBookmark* GetBookmark() const { return (SwBookmark*)GetRegisteredIn(); } + + static BOOL XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, + const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition(SwDoc* pDoc, + const SwPosition& rPos, const SwPosition* pMark); +}; + + + +typedef cppu::WeakImplHelper3 +< + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::lang::XServiceInfo +> +SwXTextRangesBaseClass; +class SwXTextRanges : public SwXTextRangesBaseClass, + public SwClient +{ + XTextRangeArr* pRangeArr; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + XTextRangeArr* GetRangesArray(); + SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } +protected: + virtual ~SwXTextRanges(); +public: + SwXTextRanges(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + const SwUnoCrsr* GetCursor() const { return (const SwUnoCrsr*)GetRegisteredIn(); } +}; + + + +struct SwTextSectionProperties_Impl; +class SwXTextSection : public cppu::WeakImplHelper7 +< + ::com::sun::star::text::XTextSection, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XUnoTunnel +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SfxItemPropertySet aPropSet; + + BOOL m_bIsDescriptor; + BOOL m_bIndexHeader; + String m_sName; + SwTextSectionProperties_Impl* pProps; +protected: + virtual ~SwXTextSection(); +public: + SwXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE); + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + TYPEINFO(); + + //XTextSection + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > SAL_CALL getParentSection(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > > SAL_CALL getChildSections(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XMultiPropertySet + virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + SwSectionFmt* GetFmt()const {return (SwSectionFmt*)GetRegisteredIn();} + static SwXTextSection* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); +}; + + +typedef +cppu::WeakImplHelper5 +< + ::com::sun::star::text::XFootnote, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XUnoTunnel +> +SwXFootnoteBaseClass; +class SwXFootnote : public SwXFootnoteBaseClass, + public SwXText, + public SwClient +{ + friend class SwXFootnotes; + + SwEventListenerContainer aLstnrCntnr; + const SwFmtFtn* pFmtFtn; + BOOL m_bIsDescriptor; + String m_sLabel; + BOOL m_bIsEndnote; + +protected: + virtual const SwStartNode *GetStartNode() const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + virtual ~SwXFootnote(); +public: + SwXFootnote(BOOL bEndnote); + SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(){SwXFootnoteBaseClass::acquire();} + virtual void SAL_CALL release( ) throw(){SwXFootnoteBaseClass::release();} + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XFootnote + virtual ::rtl::OUString SAL_CALL getLabel(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setLabel(const ::rtl::OUString& aLabel) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + const SwFmtFtn* FindFmt() const {return GetDoc() ? pFmtFtn : 0;} + void Invalidate(); +}; + + + +class SwXParagraphEnumeration : public SwSimpleEnumerationBaseClass, + public SwClient +{ + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + + BOOL bFirstParagraph; + SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} + CursorType eCursorType; + ULONG nEndIndex; + sal_Int32 nFirstParaStart; + sal_Int32 nLastParaEnd; +protected: + virtual ~SwXParagraphEnumeration(); +public: + SwXParagraphEnumeration(SwXText* pParent, SwPosition& rPos, CursorType eType); + SwXParagraphEnumeration(SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); + + + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + +class SwXParagraph : public cppu::WeakImplHelper9 +< + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::text::XTextRange, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::text::XTextContent, + ::com::sun::star::container::XContentEnumerationAccess +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SfxItemPropertySet aPropSet; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + ::rtl::OUString m_sText; + BOOL m_bIsDescriptor; + + sal_Int32 nSelectionStartPos; + sal_Int32 nSelectionEndPos; + + SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} +protected: + virtual ~SwXParagraph(); +public: + SwXParagraph(); + SwXParagraph(SwXText* pParent, SwUnoCrsr* pCrsr, sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XMultiPropertySet +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - war XTextPortionEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const ::rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + BOOL IsDescriptor() const {return m_bIsDescriptor;} + + static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); + static SwXParagraph* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); + //falls es mal als Service erzeugt werden kann + //void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + void attachToText(SwXText* pParent, SwUnoCrsr* pCrsr); +}; + + +#define PARAFRAME_PORTION_PARAGRAPH 0 +#define PARAFRAME_PORTION_CHAR 1 +#define PARAFRAME_PORTION_TEXTRANGE 2 + +class SwXParaFrameEnumeration : public cppu::WeakImplHelper2 +< + ::com::sun::star::container::XEnumeration, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient +{ + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xNextObject; //hasMoreElements legt das Objekt schon an + SwDependArr aFrameArr; //wird im Ctor gefuellt + + SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} + BOOL CreateNextObject(); + void FillFrame(SwUnoCrsr& rUnoCrsr); +public: + SwXParaFrameEnumeration(const SwUnoCrsr& rUnoCrsr, sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); + ~SwXParaFrameEnumeration(); + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + + +class SwXTextPortionEnumeration : public cppu::WeakImplHelper3 +< + ::com::sun::star::container::XEnumeration, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel +>, + public SwClient +{ + XTextRangeArr aPortionArr; //all portions are created in the ctor + SwDependArr aFrameArr; //wird im Ctor gefuellt - mit am Zeichen gebundenen Rahmen + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent; + BOOL bAtEnd; + BOOL bFirstPortion; + + const sal_Int32 nStartPos; + const sal_Int32 nEndPos; + + SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } + SwXTextPortionEnumeration(); + void CreatePortions(); +protected: + virtual ~SwXTextPortionEnumeration(); +public: + SwXTextPortionEnumeration(SwPaM& rParaCrsr, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, + sal_Int32 nStart, sal_Int32 nEnd ); + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + +typedef +cppu::WeakImplHelper2 +< + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XEnumerationAccess +> +SwXHeadFootTextBaseClass; +class SwXHeadFootText : public SwXHeadFootTextBaseClass, + public SwXText, + public SwClient +{ + SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + BOOL bIsHeader; +protected: + virtual const SwStartNode *GetStartNode() const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); +public: + SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); + ~SwXHeadFootText(); + + TYPEINFO(); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(){SwXHeadFootTextBaseClass::acquire();} + virtual void SAL_CALL release( ) throw(){SwXHeadFootTextBaseClass::release();} + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + +class SwXReferenceMark : public SwRefBookmarkBaseClass, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SwDoc* pDoc; + const SwFmtRefMark* pMark; + String sMarkName; + BOOL m_bIsDescriptor; + + BOOL IsValid() const {return 0 != GetRegisteredIn();} + void InsertRefMark(SwPaM& rPam, SwDoc* pDoc); +public: + SwXReferenceMark(SwDoc* pDoc, const SwFmtRefMark* pMark); + ~SwXReferenceMark(); + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + const SwFmtRefMark* GetMark()const {return pMark;} + const String& GetMarkName() const {return sMarkName;} + SwDoc* GetDoc() const{return pDoc;} + void Invalidate(); +}; +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoport.hxx b/inc/bf_sw/unoport.hxx new file mode 100644 index 000000000..5ef56a21d --- /dev/null +++ b/inc/bf_sw/unoport.hxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOPORT_HXX +#define _UNOPORT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unoevtlstnr.hxx> +#include <calbck.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/container/XContentEnumerationAccess.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/text/XTextField.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase8.hxx> +#include <bf_svtools/itemprop.hxx> +namespace binfilter { + +class SwFmtFld; +class SwFrmFmt; +class SwUnoCrsr; +class SwRedline; +class SwTxtRuby; + + +enum SwTextPortionType +{ + PORTION_TEXT, + PORTION_FIELD, + PORTION_FRAME, + PORTION_FOOTNOTE, + PORTION_CONTROL_CHAR, + PORTION_REFMARK_START, + PORTION_REFMARK_END, + PORTION_TOXMARK_START, + PORTION_TOXMARK_END, + PORTION_BOOKMARK_START, + PORTION_BOOKMARK_END, + PORTION_REDLINE_START, + PORTION_REDLINE_END, + PORTION_RUBY_START, + PORTION_RUBY_END +}; +class SwXRubyPortion; +class SwXTextPortion : public cppu::WeakImplHelper8 +< + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::text::XTextRange, + ::com::sun::star::text::XTextField, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::container::XContentEnumerationAccess, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient +{ + friend class SwXRubyPortion; + SwEventListenerContainer aLstnrCntnr; + SfxItemPropertySet aPropSet; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xRefMark; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xTOXMark; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xBookmark; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xFootnote; + ::com::sun::star::uno::Any* pRubyText; + ::com::sun::star::uno::Any* pRubyStyle; + ::com::sun::star::uno::Any* pRubyAdjust; + ::com::sun::star::uno::Any* pRubyIsAbove; + + const SwFmtFld* pFmtFld; + SwDepend aFrameDepend; + SwFrmFmt* pFrameFmt; + SwTextPortionType ePortionType; + sal_Int16 nControlChar; + + BOOL bIsCollapsed; + + SwFmtFld* GetFldFmt(BOOL bInit = sal_False); +protected: + SfxItemPropertySet& GetPropSet() { return aPropSet; } + + void GetPropertyValues( const ::rtl::OUString *pPropertyNames, + ::com::sun::star::uno::Any *pValues, + sal_Int32 nLength ); + virtual ~SwXTextPortion(); +public: + SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, SwTextPortionType eType ); + SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, SwFrmFmt& rFmt ); + + + //XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XMultiPropertySet +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XTextField + virtual ::rtl::OUString SAL_CALL getPresentation(BOOL bShowCommand) throw( ::com::sun::star::uno::RuntimeException ); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const ::rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + void SetRefMark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark) + {xRefMark = xMark;} + + void SetTOXMark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark) + {xTOXMark = xMark;} + + void SetBookmark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark) + {xBookmark = xMark;} + + void SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark) + {xFootnote = xMark;} + + void SetControlChar(sal_Int16 nSet) {nControlChar = nSet;} + + BOOL IsCollapsed() const { return bIsCollapsed;} + void SetCollapsed(BOOL bSet) { bIsCollapsed = bSet;} + + SwTextPortionType GetTextPortionType() const {return ePortionType;} + + SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } +}; + + +class SwXRubyPortion : public SwXTextPortion +{ +public: + SwXRubyPortion(const SwUnoCrsr* pPortionCrsr, + SwTxtRuby& rAttr, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, + sal_Bool bEnd ); + ~SwXRubyPortion(); +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoprnms.hxx b/inc/bf_sw/unoprnms.hxx new file mode 100644 index 000000000..dc77ed05f --- /dev/null +++ b/inc/bf_sw/unoprnms.hxx @@ -0,0 +1,735 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOPRNMS_HXX +#define _UNOPRNMS_HXX + + +#include <sal/types.h> +#include <bf_svtools/bf_solar.h> +namespace binfilter { + + +enum SwPropNameIds +{ +/* 0001 */ SW_PROPNAME_BEGIN = 1, + +/* 0001 */ UNO_NAME_FOLLOW_STYLE = SW_PROPNAME_BEGIN, +/* 0002 */ UNO_NAME_IS_PHYSICAL, +/* 0003 */ UNO_NAME_IS_AUTO_UPDATE, +/* 0004 */ UNO_NAME_DISPLAY_NAME, +/* 0005 */ UNO_NAME_PARA_GRAPHIC_URL, +/* 0006 */ UNO_NAME_PARA_GRAPHIC_FILTER, +/* 0007 */ UNO_NAME_HEADER_GRAPHIC_URL, +/* 0008 */ UNO_NAME_HEADER_GRAPHIC_FILTER, +/* 0009 */ UNO_NAME_FOOTER_GRAPHIC_URL, +/* 0010 */ UNO_NAME_FOOTER_GRAPHIC_FILTER, +/* 0011 */ UNO_NAME_BACK_GRAPHIC_URL, +/* 0012 */ UNO_NAME_BACK_GRAPHIC_FILTER, +/* 0013 */ UNO_NAME_BACK_GRAPHIC_LOCATION, +/* 0014 */ UNO_NAME_BACK_GRAPHIC_BITMAP, +/* 0015 */ UNO_NAME_GRAPHIC_URL, +/* 0016 */ UNO_NAME_GRAPHIC_FILTER, +/* 0017 */ UNO_NAME_GRAPHIC_LOCATION, +/* 0018 */ UNO_NAME_GRAPHIC_SIZE, +/* 0019 */ UNO_NAME_GRAPHIC_BITMAP, +/* 0020 */ UNO_NAME_BULLET_FONT, +/* 0021 */ UNO_NAME_PARA_GRAPHIC_LOCATION, +/* 0022 */ UNO_NAME_HEADER_GRAPHIC_LOCATION, +/* 0023 */ UNO_NAME_FOOTER_GRAPHIC_LOCATION, +/* 0024 */ UNO_NAME_PARA_LEFT_PARA_MARGIN, +/* 0025 */ UNO_NAME_PARA_RIGHT_PARA_MARGIN, +/* 0026 */ UNO_NAME_PARA_LEFT_MARGIN, +/* 0027 */ UNO_NAME_PARA_RIGHT_MARGIN, +/* 0028 */ UNO_NAME_PARA_LEFT_MARGIN_RELATIVE, +/* 0029 */ UNO_NAME_PARA_RIGHT_MARGIN_RELATIVE, +/* 0030 */ UNO_NAME_PARA_IS_AUTO_FIRST_LINE_INDENT, +/* 0031 */ UNO_NAME_PARA_FIRST_LINE_INDENT, +/* 0032 */ UNO_NAME_PARA_FIRST_LINE_INDENT_RELATIVE, +/* 0033 */ UNO_NAME_PARA_IS_HYPHENATION, +/* 0034 */ UNO_NAME_PARA_HYPHENATION_MAX_LEADING_CHARS, +/* 0035 */ UNO_NAME_PARA_HYPHENATION_MAX_TRAILING_CHARS, +/* 0036 */ UNO_NAME_PARA_HYPHENATION_MAX_HYPHENS, +/* 0037 */ UNO_NAME_LEFT_MARGIN, +/* 0038 */ UNO_NAME_RIGHT_MARGIN, +/* 0039 */ UNO_NAME_HEADER_LEFT_MARGIN, +/* 0040 */ UNO_NAME_HEADER_RIGHT_MARGIN, +/* 0041 */ UNO_NAME_FOOTER_LEFT_MARGIN, +/* 0042 */ UNO_NAME_FOOTER_RIGHT_MARGIN, +/* 0043 */ UNO_NAME_TEXT_RANGE, +/* 0044 */ UNO_NAME_NAME, +/* 0045 */ UNO_NAME_NUMBERING_ALIGNMENT, +/* 0046 */ UNO_NAME_BULLET_FONT_NAME, +/* 0047 */ UNO_NAME_BULLET_ID, +/* 0048 */ UNO_NAME_CHAR_STYLE_NAME, +/* 0049 */ UNO_NAME_ANCHOR_CHAR_STYLE_NAME, +/* 0050 */ UNO_NAME_SUFFIX, +/* 0051 */ UNO_NAME_PREFIX, +/* 0052 */ UNO_NAME_PARENT_NUMBERING, +/* 0053 */ UNO_NAME_START_WITH, +/* 0054 */ UNO_NAME_CHAR_FONT_NAME, +/* 0055 */ UNO_NAME_CHAR_FONT_STYLE_NAME, +/* 0056 */ UNO_NAME_CHAR_FONT_FAMILY, +/* 0057 */ UNO_NAME_CHAR_FONT_CHAR_SET, +/* 0058 */ UNO_NAME_CHAR_FONT_PITCH, +/* 0059 */ UNO_NAME_CHAR_POSTURE, +/* 0060 */ UNO_NAME_CHAR_WEIGHT, +/* 0061 */ UNO_NAME_CHAR_HEIGHT, +/* 0062 */ UNO_NAME_CHAR_LOCALE, +/* 0063 */ UNO_NAME_CHAR_FONT_NAME_ASIAN, +/* 0064 */ UNO_NAME_CHAR_FONT_STYLE_NAME_ASIAN, +/* 0065 */ UNO_NAME_CHAR_FONT_FAMILY_ASIAN, +/* 0066 */ UNO_NAME_CHAR_FONT_CHAR_SET_ASIAN, +/* 0067 */ UNO_NAME_CHAR_FONT_PITCH_ASIAN, +/* 0068 */ UNO_NAME_CHAR_POSTURE_ASIAN, +/* 0069 */ UNO_NAME_CHAR_WEIGHT_ASIAN, +/* 0070 */ UNO_NAME_CHAR_HEIGHT_ASIAN, +/* 0071 */ UNO_NAME_CHAR_LOCALE_ASIAN, +/* 0072 */ UNO_NAME_CHAR_FONT_NAME_COMPLEX, +/* 0073 */ UNO_NAME_CHAR_FONT_STYLE_NAME_COMPLEX, +/* 0074 */ UNO_NAME_CHAR_FONT_FAMILY_COMPLEX, +/* 0075 */ UNO_NAME_CHAR_FONT_CHAR_SET_COMPLEX, +/* 0076 */ UNO_NAME_CHAR_FONT_PITCH_COMPLEX, +/* 0077 */ UNO_NAME_CHAR_POSTURE_COMPLEX, +/* 0078 */ UNO_NAME_CHAR_WEIGHT_COMPLEX, +/* 0079 */ UNO_NAME_CHAR_HEIGHT_COMPLEX, +/* 0080 */ UNO_NAME_CHAR_LOCALE_COMPLEX, +/* 0081 */ UNO_NAME_CHAR_AUTO_KERNING, +/* 0082 */ UNO_NAME_CHAR_UNDERLINE, +/* 0083 */ UNO_NAME_CHAR_UNDERLINE_COLOR, +/* 0084 */ UNO_NAME_CHAR_UNDERLINE_HAS_COLOR, +/* 0085 */ UNO_NAME_CHAR_ESCAPEMENT, +/* 0086 */ UNO_NAME_CHAR_CASE_MAP, +/* 0087 */ UNO_NAME_CHAR_SHADOWED, +/* 0088 */ UNO_NAME_CHAR_STRIKEOUT, +/* 0089 */ UNO_NAME_CHAR_CROSSED_OUT, +/* 0090 */ UNO_NAME_CHAR_NO_HYPHENATION, +/* 0091 */ UNO_NAME_CHAR_AUTO_ESCAPEMENT, +/* 0092 */ UNO_NAME_CHAR_PROP_HEIGHT, +/* 0093 */ UNO_NAME_CHAR_DIFF_HEIGHT, +/* 0094 */ UNO_NAME_CHAR_PROP_HEIGHT_ASIAN, +/* 0095 */ UNO_NAME_CHAR_DIFF_HEIGHT_ASIAN, +/* 0096 */ UNO_NAME_CHAR_PROP_HEIGHT_COMPLEX, +/* 0097 */ UNO_NAME_CHAR_DIFF_HEIGHT_COMPLEX, +/* 0098 */ UNO_NAME_CHAR_ESCAPEMENT_HEIGHT, +/* 0099 */ UNO_NAME_CHAR_COLOR, + +/* 0100 */ UNO_NAME_CHAR_FLASH, +/* 0101 */ UNO_NAME_CHAR_KERNING, +/* 0102 */ UNO_NAME_CHAR_BACK_COLOR, +/* 0103 */ UNO_NAME_CHAR_BACK_TRANSPARENT, +/* 0104 */ UNO_NAME_CHAR_COMBINE_IS_ON, +/* 0105 */ UNO_NAME_CHAR_COMBINE_PREFIX, +/* 0106 */ UNO_NAME_CHAR_COMBINE_SUFFIX, +/* 0107 */ UNO_NAME_CHAR_EMPHASIS, +/* 0108 */ UNO_NAME_PARA_LINE_SPACING, +/* 0109 */ UNO_NAME_PARA_TOP_MARGIN, +/* 0110 */ UNO_NAME_PARA_BOTTOM_MARGIN, +/* 0111 */ UNO_NAME_PARA_TOP_MARGIN_RELATIVE, +/* 0112 */ UNO_NAME_PARA_BOTTOM_MARGIN_RELATIVE, +/* 0113 */ UNO_NAME_PARA_EXPAND_SINGLE_WORD, +/* 0114 */ UNO_NAME_END_NOTICE, +/* 0115 */ UNO_NAME_EMBEDDED_OBJECTS, +/* 0116 */ UNO_NAME_ALPHABETICAL_SEPARATORS, +/* 0117 */ UNO_NAME_BACKGROUND_COLOR, +/* 0118 */ UNO_NAME_BEGIN_NOTICE, +/* 0119 */ UNO_NAME_CASE_SENSITIVE, +/* 0120 */ UNO_NAME_FRAME_STYLE_NAME, +/* 0121 */ UNO_NAME_NUMBERING_STYLE_NAME, +/* 0122 */ UNO_NAME_NUMBERING_LEVEL, +/* 0123 */ UNO_NAME_NUMBERING_START_VALUE, +/* 0124 */ UNO_NAME_NUMBERING_IS_NUMBER, +/* 0125 */ UNO_NAME_COMBINE_ENTRIES, +/* 0126 */ UNO_NAME_COUNT_LINES_IN_FRAMES, +/* 0127 */ UNO_NAME_DDE_COMMAND_TYPE, +/* 0128 */ UNO_NAME_DDE_COMMAND_FILE, +/* 0129 */ UNO_NAME_DDE_COMMAND_ELEMENT, +/* 0130 */ UNO_NAME_IS_AUTOMATIC_UPDATE, +/* 0131 */ UNO_NAME_DEFAULT_TABSTOP_DISTANCE, +/* 0132 */ UNO_NAME_DISTANCE, +/* 0133 */ UNO_NAME_DROP_CAP_FORMAT, +/* 0134 */ UNO_NAME_DROP_CAP_WHOLE_WORD, +/* 0135 */ UNO_NAME_DROP_CAP_CHAR_STYLE_NAME, +/* 0136 */ UNO_NAME_FILE_LINK, +/* 0137 */ UNO_NAME_GRAPHIC, +/* 0138 */ UNO_NAME_GRAPHICS, +/* 0139 */ UNO_NAME_IS_PROTECTED, +/* 0140 */ UNO_NAME_KEY_AS_ENTRY, +/* 0141 */ UNO_NAME_PARA_KEEP_TOGETHER, +/* 0142 */ UNO_NAME_KEEP_TOGETHER, +/* 0143 */ UNO_NAME_IS_LANDSCAPE, +/* 0144 */ UNO_NAME_SEPARATOR_TEXT, +/* 0145 */ UNO_NAME_MARKS, +/* 0146 */ UNO_NAME_NUMBER_POSITION, +/* 0147 */ UNO_NAME_OUTLINES, +/* 0148 */ UNO_NAME_PAGE_STYLE_NAME, +/* 0149 */ UNO_NAME_PAGE_STYLE_LAYOUT, +/* 0150 */ UNO_NAME_PARA_STYLES, +/* 0151 */ UNO_NAME_PARA_ADJUST, +/* 0152 */ UNO_NAME_PARA_REGISTER_MODE_ACTIVE, +/* 0153 */ UNO_NAME_PARA_STYLE_NAME, +/* 0154 */ UNO_NAME_PARA_LAST_LINE_ADJUST, +/* 0155 */ UNO_NAME_PARA_LINE_NUMBER_COUNT, +/* 0156 */ UNO_NAME_PARA_LINE_NUMBER_START_VALUE, +/* 0157 */ UNO_NAME_BACK_COLOR, +/* 0158 */ UNO_NAME_PARA_BACK_COLOR, +/* 0159 */ UNO_NAME_PARA_WIDOWS, +/* 0160 */ UNO_NAME_PARA_ORPHANS, +/* 0161 */ UNO_NAME_PARA_BACK_TRANSPARENT, +/* 0162 */ UNO_NAME_POSITION_END_OF_DOC, +/* 0163 */ UNO_NAME_POSITION_PROTECTED, +/* 0164 */ UNO_NAME_ALTERNATIVE_TEXT, +/* 0165 */ UNO_NAME_PRIMARY_KEY, +/* 0166 */ UNO_NAME_PRINT_TABLES, +/* 0167 */ UNO_NAME_PRINT_GRAPHICS, +/* 0168 */ UNO_NAME_PRINT_REVERSED, +/* 0169 */ UNO_NAME_PRINT_PROSPECT, +/* 0170 */ UNO_NAME_PRINT_CONTROLS, +/* 0171 */ UNO_NAME_PRINT_DRAWINGS, +/* 0172 */ UNO_NAME_PRINT_RIGHT_PAGES, +/* 0173 */ UNO_NAME_PRINT_LEFT_PAGES, +/* 0174 */ UNO_NAME_PRINT_BLACK_FONTS, +/* 0175 */ UNO_NAME_PRINTER_PAPER_TRAY, +/* 0176 */ UNO_NAME_PRINT_PAGE_BACKGROUND, +/* 0177 */ UNO_NAME_PRINT_ANNOTATION_MODE, +/* 0178 */ UNO_NAME_PRINT_FAX_NAME, +/* 0179 */ UNO_NAME_PRINT_PAPER_FROM_SETUP, +/* 0180 */ UNO_NAME_REGISTER_MODE_ACTIVE, +/* 0181 */ UNO_NAME_RELATIVE_WIDTH, +/* 0182 */ UNO_NAME_RELATIVE_HEIGHT, +/* 0183 */ UNO_NAME_REPEAT_HEADLINE, +/* 0184 */ UNO_NAME_SEARCH_STYLES, +/* 0185 */ UNO_NAME_SEARCH_BACKWARDS, +/* 0186 */ UNO_NAME_SEARCH_SIMILARITY, +/* 0187 */ UNO_NAME_SEARCH_IN_SELECTION, +/* 0188 */ UNO_NAME_SEARCH_CASE_SENSITIVE, +/* 0189 */ UNO_NAME_SEARCH_SIMILARITY_ADD, +/* 0190 */ UNO_NAME_SEARCH_SIMILARITY_RELAX, +/* 0191 */ UNO_NAME_SEARCH_SIMILARITY_REMOVE, +/* 0192 */ UNO_NAME_SEARCH_REGULAR_EXPRESSION, +/* 0193 */ UNO_NAME_SEARCH_SIMILARITY_EXCHANGE, +/* 0194 */ UNO_NAME_SECONDARY_KEY, +/* 0195 */ UNO_NAME_SEPARATOR_INTERVAL, +/* 0196 */ UNO_NAME_SHOW_BREAKS, +/* 0197 */ UNO_NAME_SHOW_SPACES, +/* 0198 */ UNO_NAME_SHOW_TABLES, +/* 0199 */ UNO_NAME_SHOW_GRAPHICS, + +/* 0200 */ UNO_NAME_SHOW_DRAWINGS, +/* 0201 */ UNO_NAME_SHOW_TABSTOPS, +/* 0202 */ UNO_NAME_SHOW_VERT_RULER, +/* 0203 */ UNO_NAME_SHOW_PARA_BREAKS, +/* 0204 */ UNO_NAME_SHOW_HIDDEN_TEXT, +/* 0205 */ UNO_NAME_SHOW_ANNOTATIONS, +/* 0206 */ UNO_NAME_SHOW_SOFT_HYPHENS, +/* 0207 */ UNO_NAME_SHOW_VERT_SCROLL_BAR, +/* 0208 */ UNO_NAME_SHOW_HORI_SCROLL_BAR, +/* 0209 */ UNO_NAME_SHOW_FIELD_COMMANDS, +/* 0210 */ UNO_NAME_SHOW_TEXT_BOUNDARIES, +/* 0211 */ UNO_NAME_SHOW_PROTECTED_SPACES, +/* 0212 */ UNO_NAME_SHOW_TABLE_BOUNDARIES, +/* 0213 */ UNO_NAME_SHOW_HIDDEN_PARAGRAPHS, +/* 0214 */ UNO_NAME_SHOW_INDEX_MARK_BACKGROUND, +/* 0215 */ UNO_NAME_SHOW_FOOTNOTE_BACKGROUND, +/* 0216 */ UNO_NAME_SHOW_TEXT_FIELD_BACKGROUND, +/* 0217 */ UNO_NAME_IS_SYNC_WIDTH_TO_HEIGHT, +/* 0218 */ UNO_NAME_IS_SYNC_HEIGHT_TO_WIDTH, +/* 0219 */ UNO_NAME_SIZE_PROTECTED, +/* 0220 */ UNO_NAME_SMOOTH_SCROLLING, +/* 0222 */ UNO_NAME_TABLES, +/* 0223 */ UNO_NAME_TEXT_FRAMES, +/* 0224 */ UNO_NAME_TEXT_COLUMNS, +/* 0225 */ UNO_NAME_BACK_TRANSPARENT, +/* 0226 */ UNO_NAME_USE_PP, +/* 0227 */ UNO_NAME_USER_METRIC, +/* 0228 */ UNO_NAME_ANCHOR_TYPE, +/* 0229 */ UNO_NAME_ANCHOR_TYPES, +/* 0230 */ UNO_NAME_ANCHOR_PAGE_NO, +/* 0231 */ UNO_NAME_ANCHOR_FRAME, +/* 0232 */ UNO_NAME_AUTHOR, +/* 0233 */ UNO_NAME_BREAK_TYPE, +/* 0234 */ UNO_NAME_CHAIN_NEXT_NAME, +/* 0235 */ UNO_NAME_CHAIN_PREV_NAME, +/* 0236 */ UNO_NAME_CHAPTER_FORMAT, +/* 0237 */ UNO_NAME_CLIENT_MAP, +/* 0238 */ UNO_NAME_CONDITION, +/* 0239 */ UNO_NAME_CONTENT, +/* 0240 */ UNO_NAME_CHAR_CONTOURED, +/* 0241 */ UNO_NAME_CONTOUR_OUTSIDE, +/* 0242 */ UNO_NAME_CONTENT_PROTECTED, +/* 0243 */ UNO_NAME_COUNT_EMPTY_LINES, +/* 0244 */ UNO_NAME_RESTART_AT_EACH_PAGE, +/* 0245 */ UNO_NAME_DATA_BASE_NAME, +/* 0246 */ UNO_NAME_DATA_TABLE_NAME, +/* 0247 */ UNO_NAME_DATA_COMMAND_TYPE, +/* 0248 */ UNO_NAME_DATA_COLUMN_NAME, +/* 0249 */ UNO_NAME_IS_DATA_BASE_FORMAT, +/* 0250 */ UNO_NAME_DATE, +/* 0251 */ UNO_NAME_IS_DATE, +/* 0252 */ UNO_NAME_EDIT_IN_READONLY, +/* 0253 */ UNO_NAME_FALSE_CONTENT, +/* 0254 */ UNO_NAME_FILE_FORMAT, +/* 0255 */ UNO_NAME_IS_FIXED, +/* 0256 */ UNO_NAME_FOOTNOTE_COUNTING, +/* 0257 */ UNO_NAME_FORMULA, +/* 0258 */ UNO_NAME_FRAME_NAME, +/* 0259 */ UNO_NAME_GRAPHIC_NAME, +/* 0260 */ UNO_NAME_FULL_NAME, +/* 0261 */ UNO_NAME_HEIGHT, +/* 0262 */ UNO_NAME_IS_AUTO_HEIGHT, +/* 0263 */ UNO_NAME_SIZE_TYPE, +/* 0264 */ UNO_NAME_HINT, +/* 0265 */ UNO_NAME_HORI_ORIENT, +/* 0266 */ UNO_NAME_HORI_MIRRORED_ON_EVEN_PAGES, +/* 0267 */ UNO_NAME_HORI_MIRRORED_ON_ODD_PAGES, +/* 0268 */ UNO_NAME_HORI_ORIENT_RELATION, +/* 0269 */ UNO_NAME_HORI_ORIENT_POSITION, +/* 0270 */ UNO_NAME_HYPER_LINK_U_R_L, +/* 0271 */ UNO_NAME_HYPER_LINK_TARGET, +/* 0272 */ UNO_NAME_HYPER_LINK_NAME, +/* 0273 */ UNO_NAME_HYPER_LINK_EVENTS, +/* 0274 */ UNO_NAME_INFO_TYPE, +/* 0275 */ UNO_NAME_INFO_FORMAT, +/* 0276 */ UNO_NAME_IS_INPUT, +/* 0277 */ UNO_NAME_LEVEL, +/* 0278 */ UNO_NAME_INTERVAL, +/* 0279 */ UNO_NAME_LINK_REGION, +/* 0280 */ UNO_NAME_MACRO_NAME, +/* 0281 */ UNO_NAME_SPLIT, +/* 0282 */ UNO_NAME_PARA_SPLIT, +/* 0283 */ UNO_NAME_NUMBER_FORMAT, +/* 0284 */ UNO_NAME_NUMBERING_TYPE, +/* 0285 */ UNO_NAME_NUMBERING_RULES, +/* 0286 */ UNO_NAME_OFFSET, +/* 0287 */ UNO_NAME_ON, +/* 0288 */ UNO_NAME_OPAQUE, +/* 0289 */ UNO_NAME_PAGE_TOGGLE, +/* 0290 */ UNO_NAME_PAGE_DESC_NAME, +/* 0291 */ UNO_NAME_PAGE_NUMBER_OFFSET, +/* 0292 */ UNO_NAME_PLACEHOLDER, +/* 0293 */ UNO_NAME_PLACEHOLDER_TYPE, +/* 0294 */ UNO_NAME_PRINT, +/* 0295 */ UNO_NAME_REFERENCE_FIELD_PART, +/* 0296 */ UNO_NAME_REFERENCE_FIELD_SOURCE, +/* 0297 */ UNO_NAME_REGISTER_PARAGRAPH_STYLE, +/* 0298 */ UNO_NAME_SCRIPT_TYPE, +/* 0299 */ UNO_NAME_SEARCH_ALL, + +/* 0300 */ UNO_NAME_SEARCH_WORDS, +/* 0301 */ UNO_NAME_SEQUENCE_VALUE, +/* 0302 */ UNO_NAME_SERVER_MAP, +/* 0303 */ UNO_NAME_IMAGE_MAP, +/* 0304 */ UNO_NAME_SET_NUMBER, +/* 0305 */ UNO_NAME_SHADOW_FORMAT, +/* 0306 */ UNO_NAME_SHOW_HORI_RULER, +/* 0307 */ UNO_NAME_SIZE, +/* 0308 */ UNO_NAME_ACTUAL_SIZE, +/* 0309 */ UNO_NAME_SOURCE_NAME, +/* 0310 */ UNO_NAME_START_AT, +/* 0311 */ UNO_NAME_STATISTIC_TYPE_ID, +/* 0312 */ UNO_NAME_SUB_TYPE, +/* 0313 */ UNO_NAME_SURROUND, +/* 0314 */ UNO_NAME_IS_EXPRESSION, +/* 0315 */ UNO_NAME_IS_SHOW_FORMULA, +/* 0316 */ UNO_NAME_TEXT_WRAP, +/* 0317 */ UNO_NAME_SURROUND_CONTOUR, +/* 0318 */ UNO_NAME_SURROUND_ANCHORONLY, +/* 0319 */ UNO_NAME_TABLE_NAME, +/* 0320 */ UNO_NAME_TABSTOPS, +/* 0321 */ UNO_NAME_TITLE, +/* 0322 */ UNO_NAME_TOP_MARGIN, +/* 0323 */ UNO_NAME_BOTTOM_MARGIN, +/* 0324 */ UNO_NAME_TRUE_CONTENT, +/* 0325 */ UNO_NAME_URL_CONTENT, +/* 0326 */ UNO_NAME_USERTEXT, +/* 0327 */ UNO_NAME_USER_DATA_TYPE, +/* 0328 */ UNO_NAME_VALUE, +/* 0329 */ UNO_NAME_VARIABLE_NAME, +/* 0330 */ UNO_NAME_VARIABLE_SUBTYPE, +/* 0331 */ UNO_NAME_VERT_ORIENT, +/* 0332 */ UNO_NAME_VERT_MIRRORED, +/* 0333 */ UNO_NAME_VERT_ORIENT_POSITION, +/* 0334 */ UNO_NAME_VERT_ORIENT_RELATION, +/* 0335 */ UNO_NAME_IS_VISIBLE, +/* 0336 */ UNO_NAME_WIDTH, +/* 0337 */ UNO_NAME_CHAR_WORD_MODE, +/* 0338 */ UNO_NAME_GRAPHIC_CROP, +/* 0339 */ UNO_NAME_CHARACTER_FORMAT_NONE, +/* 0340 */ UNO_NAME_TEXT_POSITION, +/* 0341 */ UNO_NAME_DOCUMENT_INDEX_MARK, +/* 0342 */ UNO_NAME_DOCUMENT_INDEX, +/* 0343 */ UNO_NAME_IS_GLOBAL_DOCUMENT_SECTION, +/* 0344 */ UNO_NAME_TEXT_FIELD, +/* 0345 */ UNO_NAME_BOOKMARK, +/* 0346 */ UNO_NAME_TEXT_TABLE, +/* 0347 */ UNO_NAME_CELL, +/* 0348 */ UNO_NAME_TEXT_FRAME, +/* 0349 */ UNO_NAME_REFERENCE_MARK, +/* 0350 */ UNO_NAME_TEXT_SECTION, +/* 0351 */ UNO_NAME_FOOTNOTE, +/* 0352 */ UNO_NAME_ENDNOTE, +/* 0353 */ UNO_NAME_CHART_ROW_AS_LABEL, +/* 0354 */ UNO_NAME_CHART_COLUMN_AS_LABEL, +/* 0355 */ UNO_NAME_TABLE_COLUMS, +/* 0356 */ UNO_NAME_LEFT_BORDER, +/* 0357 */ UNO_NAME_RIGHT_BORDER, +/* 0358 */ UNO_NAME_TOP_BORDER, +/* 0359 */ UNO_NAME_BOTTOM_BORDER, +/* 0360 */ UNO_NAME_BORDER_DISTANCE, +/* 0361 */ UNO_NAME_LEFT_BORDER_DISTANCE, +/* 0362 */ UNO_NAME_RIGHT_BORDER_DISTANCE, +/* 0363 */ UNO_NAME_TOP_BORDER_DISTANCE, +/* 0364 */ UNO_NAME_BOTTOM_BORDER_DISTANCE, +/* 0365 */ UNO_NAME_TABLE_BORDER, +/* 0366 */ UNO_NAME_TABLE_COLUMN_SEPARATORS, +/* 0367 */ UNO_NAME_TABLE_COLUMN_RELATIVE_SUM, +/* 0368 */ UNO_NAME_HEADER_TEXT, +/* 0369 */ UNO_NAME_HEADER_TEXT_LEFT, +/* 0370 */ UNO_NAME_HEADER_TEXT_RIGHT, +/* 0371 */ UNO_NAME_FOOTER_TEXT, +/* 0372 */ UNO_NAME_FOOTER_TEXT_LEFT, +/* 0373 */ UNO_NAME_FOOTER_TEXT_RIGHT, +/* 0374 */ UNO_NAME_HEADER_BACK_COLOR, +/* 0375 */ UNO_NAME_HEADER_GRAPHIC, +/* 0376 */ UNO_NAME_HEADER_BACK_TRANSPARENT, +/* 0377 */ UNO_NAME_HEADER_LEFT_BORDER, +/* 0378 */ UNO_NAME_HEADER_RIGHT_BORDER, +/* 0379 */ UNO_NAME_HEADER_TOP_BORDER, +/* 0380 */ UNO_NAME_HEADER_BOTTOM_BORDER, +/* 0381 */ UNO_NAME_HEADER_BORDER_DISTANCE, +/* 0382 */ UNO_NAME_HEADER_SHADOW_FORMAT, +/* 0383 */ UNO_NAME_HEADER_BODY_DISTANCE, +/* 0384 */ UNO_NAME_HEADER_IS_DYNAMIC_HEIGHT, +/* 0385 */ UNO_NAME_HEADER_IS_SHARED, +/* 0386 */ UNO_NAME_HEADER_HEIGHT, +/* 0387 */ UNO_NAME_HEADER_IS_ON, +/* 0388 */ UNO_NAME_FOOTER_BACK_COLOR, +/* 0389 */ UNO_NAME_FOOTER_GRAPHIC, +/* 0390 */ UNO_NAME_FOOTER_BACK_TRANSPARENT, +/* 0391 */ UNO_NAME_FOOTER_LEFT_BORDER, +/* 0392 */ UNO_NAME_FOOTER_RIGHT_BORDER, +/* 0393 */ UNO_NAME_FOOTER_TOP_BORDER, +/* 0394 */ UNO_NAME_FOOTER_BOTTOM_BORDER, +/* 0395 */ UNO_NAME_FOOTER_BORDER_DISTANCE, +/* 0396 */ UNO_NAME_FOOTER_SHADOW_FORMAT, +/* 0397 */ UNO_NAME_FOOTER_BODY_DISTANCE, +/* 0398 */ UNO_NAME_FOOTER_IS_DYNAMIC_HEIGHT, +/* 0399 */ UNO_NAME_FOOTER_IS_SHARED, + +/* 0400 */ UNO_NAME_FOOTER_HEIGHT, +/* 0401 */ UNO_NAME_FOOTER_IS_ON, +/* 0402 */ UNO_NAME_OVERWRITE_STYLES, +/* 0403 */ UNO_NAME_LOAD_NUMBERING_STYLES, +/* 0404 */ UNO_NAME_LOAD_PAGE_STYLES, +/* 0405 */ UNO_NAME_LOAD_FRAME_STYLES, +/* 0406 */ UNO_NAME_LOAD_TEXT_STYLES, +/* 0407 */ UNO_NAME_FILE_NAME, +/* 0408 */ UNO_NAME_FILTER_NAME, +/* 0409 */ UNO_NAME_FILTER_OPTION, +/* 0410 */ UNO_NAME_PASSWORD, +/* 0411 */ UNO_NAME_COPY_COUNT, +/* 0412 */ UNO_NAME_COLLATE, +/* 0413 */ UNO_NAME_SORT, +/* 0414 */ UNO_NAME_PAGES, +/* 0415 */ UNO_NAME_FIRST_LINE_OFFSET, +/* 0416 */ UNO_NAME_SYMBOL_TEXT_DISTANCE, +/* 0417 */ UNO_NAME_USER_INDEX_NAME, +/* 0418 */ UNO_NAME_REVISION, +/* 0419 */ UNO_NAME_UNVISITED_CHAR_STYLE_NAME, +/* 0420 */ UNO_NAME_VISITED_CHAR_STYLE_NAME, +/* 0421 */ UNO_NAME_PARAGRAPH_COUNT, +/* 0422 */ UNO_NAME_WORD_COUNT, +/* 0423 */ UNO_NAME_WORD_SEPARATOR, +/* 0424 */ UNO_NAME_CHARACTER_COUNT, +/* 0425 */ UNO_NAME_ZOOM_VALUE, +/* 0426 */ UNO_NAME_ZOOM_TYPE, +/* 0427 */ UNO_NAME_CREATE_FROM_MARKS, +/* 0428 */ UNO_NAME_CREATE_FROM_OUTLINE, +/* 0429 */ UNO_NAME_PARAGRAPH_STYLE_NAMES, +/* 0430 */ UNO_NAME_CREATE_FROM_CHAPTER, +/* 0431 */ UNO_NAME_CREATE_FROM_LABELS, +/* 0432 */ UNO_NAME_USE_ALPHABETICAL_SEPARATORS, +/* 0433 */ UNO_NAME_USE_KEY_AS_ENTRY, +/* 0434 */ UNO_NAME_USE_COMBINED_ENTRIES, +/* 0435 */ UNO_NAME_IS_CASE_SENSITIVE, +/* 0436 */ UNO_NAME_USE_P_P, +/* 0437 */ UNO_NAME_USE_DASH, +/* 0438 */ UNO_NAME_USE_UPPER_CASE, +/* 0439 */ UNO_NAME_LABEL_CATEGORY, +/* 0440 */ UNO_NAME_LABEL_DISPLAY_TYPE, +/* 0441 */ UNO_NAME_USE_LEVEL_FROM_SOURCE, +/* 0442 */ UNO_NAME_LEVEL_FORMAT, +/* 0443 */ UNO_NAME_LEVEL_PARAGRAPH_STYLES, +/* 0444 */ UNO_NAME_RECALC_TAB_STOPS, +/* 0445 */ UNO_NAME_MAIN_ENTRY_CHARACTER_STYLE_NAME, +/* 0446 */ UNO_NAME_CREATE_FROM_TABLES, +/* 0447 */ UNO_NAME_CREATE_FROM_TEXT_FRAMES, +/* 0448 */ UNO_NAME_CREATE_FROM_GRAPHIC_OBJECTS, +/* 0449 */ UNO_NAME_CREATE_FROM_EMBEDDED_OBJECTS, +/* 0450 */ UNO_NAME_CREATE_FROM_STAR_MATH, +/* 0451 */ UNO_NAME_CREATE_FROM_STAR_CHART, +/* 0452 */ UNO_NAME_CREATE_FROM_STAR_CALC, +/* 0453 */ UNO_NAME_CREATE_FROM_STAR_DRAW, +/* 0454 */ UNO_NAME_CREATE_FROM_OTHER_EMBEDDED_OBJECTS, +/* 0455 */ UNO_NAME_INDEX_AUTO_MARK_FILE_U_R_L, +/* 0456 */ UNO_NAME_IS_COMMA_SEPARATED, +/* 0457 */ UNO_NAME_IS_RELATIVE_TABSTOPS, +/* 0458 */ UNO_NAME_CREATE_FROM_LEVEL_PARAGRAPH_STYLES, +/* 0459 */ UNO_NAME_SHOW_CHANGES, +/* 0460 */ UNO_NAME_RECORD_CHANGES, +/* 0461 */ UNO_LINK_DISPLAY_NAME, +/* 0462 */ UNO_LINK_DISPLAY_BITMAP, +/* 0463 */ UNO_NAME_HEADING_STYLE_NAME, +/* 0464 */ UNO_NAME_SHOW_ONLINE_LAYOUT, +/* 0465 */ UNO_NAME_USER_DEFINED_ATTRIBUTES, +/* 0466 */ UNO_NAME_TEXT_USER_DEFINED_ATTRIBUTES, +/* 0467 */ UNO_NAME_FILE_PATH, +/* 0468 */ UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL, +/* 0469 */ UNO_NAME_PARA_CONDITIONAL_STYLE_NAME, +/* 0470 */ UNO_NAME_CHAPTER_NUMBERING_LEVEL, +/* 0471 */ UNO_NAME_NUMBERING_SEPARATOR, +/* 0472 */ UNO_NAME_IS_CONTINUOUS_NUMBERING, +/* 0473 */ UNO_NAME_IS_AUTOMATIC, +/* 0474 */ UNO_NAME_IS_ABSOLUTE_MARGINS, +/* 0475 */ UNO_NAME_CATEGORY, +/* 0476 */ UNO_NAME_DEPENDENT_TEXT_FIELDS, +/* 0477 */ UNO_NAME_CURRENT_PRESENTATION, +/* 0478 */ UNO_NAME_ADJUST, +/* 0479 */ UNO_NAME_INSTANCE_NAME, +/* 0480 */ UNO_NAME_TEXT_PORTION_TYPE, +/* 0481 */ UNO_NAME_CONTROL_CHARACTER, +/* 0482 */ UNO_NAME_IS_COLLAPSED, +/* 0483 */ UNO_NAME_IS_START, +/* 0484 */ UNO_NAME_SEQUENCE_NUMBER, +/* 0485 */ UNO_NAME_REFERENCE_ID, +/* 0486 */ UNO_NAME_HEADER_LEFT_BORDER_DISTANCE, +/* 0487 */ UNO_NAME_HEADER_RIGHT_BORDER_DISTANCE, +/* 0488 */ UNO_NAME_HEADER_TOP_BORDER_DISTANCE, +/* 0489 */ UNO_NAME_HEADER_BOTTOM_BORDER_DISTANCE, +/* 0490 */ UNO_NAME_FOOTER_LEFT_BORDER_DISTANCE, +/* 0491 */ UNO_NAME_FOOTER_RIGHT_BORDER_DISTANCE, +/* 0492 */ UNO_NAME_FOOTER_TOP_BORDER_DISTANCE, +/* 0493 */ UNO_NAME_FOOTER_BOTTOM_BORDER_DISTANCE, +/* 0494 */ UNO_NAME_PARA_IS_NUMBERING_RESTART, +/* 0495 */ UNO_NAME_HIDE_FIELD_TIPS, +/* 0496 */ UNO_NAME_HEADER_USER_DEFINED_ATTRIBUTES, +/* 0497 */ UNO_NAME_FOOTER_USER_DEFINED_ATTRIBUTES, +/* 0498 */ UNO_NAME_PARA_SHADOW_FORMAT, +/* 0499 */ UNO_NAME_CONTOUR_POLY_POLYGON, + +/* 0500 */ UNO_NAME_IS_PIXEL_CONTOUR, +/* 0501 */ UNO_NAME_IS_AUTOMATIC_CONTOUR, +/* 0502 */ UNO_NAME_SEPARATOR_LINE_WIDTH, +/* 0503 */ UNO_NAME_SEPARATOR_LINE_COLOR, +/* 0504 */ UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT, +/* 0505 */ UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT, +/* 0506 */ UNO_NAME_SEPARATOR_LINE_IS_ON, +/* 0507 */ UNO_NAME_IS_SKIP_HIDDEN_TEXT, +/* 0508 */ UNO_NAME_IS_SKIP_PROTECTED_TEXT, +/* 0509 */ UNO_NAME_DOCUMENT_INDEX_MARKS, +/* 0510 */ UNO_NAME_FOOTNOTE_IS_COLLECT_AT_TEXT_END, +/* 0511 */ UNO_NAME_FOOTNOTE_IS_RESTART_NUMBERING, +/* 0512 */ UNO_NAME_FOOTNOTE_RESTART_NUMBERING_AT, +/* 0513 */ UNO_NAME_FOOTNOTE_IS_OWN_NUMBERING, +/* 0514 */ UNO_NAME_FOOTNOTE_NUMBERING_TYPE, +/* 0515 */ UNO_NAME_FOOTNOTE_NUMBERING_PREFIX, +/* 0516 */ UNO_NAME_FOOTNOTE_NUMBERING_SUFFIX, +/* 0517 */ UNO_NAME_ENDNOTE_IS_COLLECT_AT_TEXT_END, +/* 0518 */ UNO_NAME_ENDNOTE_IS_RESTART_NUMBERING, +/* 0519 */ UNO_NAME_ENDNOTE_RESTART_NUMBERING_AT, +/* 0520 */ UNO_NAME_ENDNOTE_IS_OWN_NUMBERING, +/* 0521 */ UNO_NAME_ENDNOTE_NUMBERING_TYPE, +/* 0522 */ UNO_NAME_ENDNOTE_NUMBERING_PREFIX, +/* 0523 */ UNO_NAME_ENDNOTE_NUMBERING_SUFFIX, +/* 0524 */ UNO_NAME_BRACKET_BEFORE, +/* 0525 */ UNO_NAME_BRACKET_AFTER, +/* 0526 */ UNO_NAME_IS_NUMBER_ENTRIES, +/* 0527 */ UNO_NAME_IS_SORT_BY_POSITION, +/* 0528 */ UNO_NAME_SORT_KEYS, +/* 0529 */ UNO_NAME_IS_SORT_ASCENDING, +/* 0530 */ UNO_NAME_SORT_KEY, +/* 0531 */ UNO_NAME_FIELDS, +/* 0532 */ UNO_NAME_DATE_TIME_VALUE, +/* 0533 */ UNO_NAME_IS_ON, +/* 0534 */ UNO_NAME_Z_ORDER, +/* 0535 */ UNO_NAME_CONTENT_SECTION, +/* 0536 */ UNO_NAME_HEADER_SECTION, +/* 0537 */ UNO_NAME_PARA_IS_HANGING_PUNCTUATION, +/* 0538 */ UNO_NAME_PARA_IS_CHARACTER_DISTANCE, +/* 0539 */ UNO_NAME_PARA_IS_FORBIDDEN_RULES, +/* 0540 */ UNO_NAME_PARA_VERT_ALIGNMENT, +/* 0541 */ UNO_NAME_IS_MAIN_ENTRY, +/* 0542 */ UNO_NAME_GRAPHIC_ROTATION, +/* 0543 */ UNO_NAME_ADJUST_LUMINANCE, +/* 0544 */ UNO_NAME_ADJUST_CONTRAST, +/* 0545 */ UNO_NAME_ADJUST_RED, +/* 0546 */ UNO_NAME_ADJUST_GREEN, +/* 0547 */ UNO_NAME_ADJUST_BLUE, +/* 0548 */ UNO_NAME_GAMMA, +/* 0549 */ UNO_NAME_GRAPHIC_IS_INVERTED, +/* 0550 */ UNO_NAME_TRANSPARENCY, +/* 0551 */ UNO_NAME_GRAPHIC_COLOR_MODE, +/* 0552 */ UNO_NAME_REDLINE_AUTHOR, +/* 0553 */ UNO_NAME_REDLINE_DATE_TIME, +/* 0554 */ UNO_NAME_REDLINE_COMMENT, +/* 0555 */ UNO_NAME_REDLINE_TYPE, +/* 0556 */ UNO_NAME_REDLINE_SUCCESSOR_DATA, +/* 0557 */ UNO_NAME_REDLINE_IDENTIFIER, +/* 0558 */ UNO_NAME_IS_IN_HEADER_FOOTER, +/* 0559 */ UNO_NAME_START_REDLINE, +/* 0560 */ UNO_NAME_END_REDLINE, +/* 0561 */ UNO_NAME_REDLINE_START, +/* 0562 */ UNO_NAME_REDLINE_END, +/* 0563 */ UNO_NAME_REDLINE_TEXT, +/* 0564 */ UNO_NAME_REDLINE_DISPLAY_TYPE, +/* 0565 */ UNO_NAME_FORBIDDEN_CHARACTERS, +/* 0566 */ UNO_NAME_RUBY_BASE_TEXT, +/* 0567 */ UNO_NAME_RUBY_TEXT, +/* 0568 */ UNO_NAME_RUBY_ADJUST, +/* 0569 */ UNO_NAME_RUBY_CHAR_STYLE_NAME, +/* 0570 */ UNO_NAME_RUBY_IS_ABOVE, +/* 0571 */ UNO_NAME_FOOTNOTE_HEIGHT, +/* 0572 */ UNO_NAME_FOOTNOTE_LINE_WEIGHT, +/* 0573 */ UNO_NAME_FOOTNOTE_LINE_COLOR, +/* 0574 */ UNO_NAME_FOOTNOTE_LINE_RELATIVE_WIDTH, +/* 0575 */ UNO_NAME_FOOTNOTE_LINE_ADJUST, +/* 0576 */ UNO_NAME_FOOTNOTE_LINE_TEXT_DISTANCE, +/* 0577 */ UNO_NAME_FOOTNOTE_LINE_DISTANCE, +/* 0578 */ UNO_NAME_CHAR_ROTATION, +/* 0579 */ UNO_NAME_CHAR_ROTATION_IS_FIT_TO_LINE, +/* 0580 */ UNO_NAME_CHAR_SCALE_WIDTH, +/* 0581 */ UNO_NAME_TAB_STOP_DISTANCE, +/* 0582 */ UNO_NAME_IS_WIDTH_RELATIVE, +/* 0583 */ UNO_NAME_CHAR_RELIEF, +/* 0584 */ UNO_NAME_IS_HIDDEN, +/* 0585 */ UNO_NAME_IS_CONDITION_TRUE, +/* 0586 */ UNO_NAME_TWO_DIGIT_YEAR, +/* 0587 */ UNO_NAME_PROTECTION_KEY, +/* 0588 */ UNO_NAME_REDLINE_PROTECTION_KEY, +/* 0589 */ UNO_NAME_AUTOMATIC_DISTANCE, +/* 0590 */ UNO_NAME_AUTOMATIC_CONTROL_FOCUS, +/* 0591 */ UNO_NAME_APPLY_FORM_DESIGN_MODE, +/* 0592 */ UNO_NAME_LOCALE, +/* 0593 */ UNO_NAME_SORT_ALGORITHM, +/* 0594 */ UNO_NAME_FRAME_HEIGHT_ABSOLUTE, +/* 0596 */ UNO_NAME_FRAME_HEIGHT_PERCENT, +/* 0597 */ UNO_NAME_FRAME_ISAUTOMATIC_HEIGHT, +/* 0598 */ UNO_NAME_FRAME_WIDTH_ABSOLUTE, +/* 0599 */ UNO_NAME_FRAME_WIDTH_PERCENT, +/* 0600 */ UNO_NAME_PARA_STYLEHEADING, +/* 0601 */ UNO_NAME_PARA_STYLELEVEL1, +/* 0602 */ UNO_NAME_PARA_STYLELEVEL10, +/* 0603 */ UNO_NAME_PARA_STYLELEVEL2, +/* 0604 */ UNO_NAME_PARA_STYLELEVEL3, +/* 0605 */ UNO_NAME_PARA_STYLELEVEL4, +/* 0606 */ UNO_NAME_PARA_STYLELEVEL5, +/* 0607 */ UNO_NAME_PARA_STYLELEVEL6, +/* 0608 */ UNO_NAME_PARA_STYLELEVEL7, +/* 0609 */ UNO_NAME_PARA_STYLELEVEL8, +/* 0610 */ UNO_NAME_PARA_STYLELEVEL9, +/* 0611 */ UNO_NAME_PARA_STYLESEPARATOR, +/* 0612 */ UNO_NAME_MACRO_LIBRARY, +/* 0613 */ UNO_NAME_CELL_NAME, +/* 0614 */ UNO_NAME_PARA_USER_DEFINED_ATTRIBUTES, +/* 0615 */ UNO_NAME_MERGE_LAST_PARA, +/* 0616 */ UNO_NAME_WRITING_MODE, +/* 0617 */ UNO_NAME_GRID_COLOR, +/* 0618 */ UNO_NAME_GRID_LINES, +/* 0619 */ UNO_NAME_GRID_BASE_HEIGHT, +/* 0620 */ UNO_NAME_GRID_RUBY_HEIGHT, +/* 0621 */ UNO_NAME_GRID_MODE, +/* 0622 */ UNO_NAME_GRID_RUBY_BELOW, +/* 0623 */ UNO_NAME_GRID_PRINT, +/* 0624 */ UNO_NAME_GRID_DISPLAY, +/* 0625 */ UNO_NAME_SNAP_TO_GRID, +/* 0626 */ UNO_NAME_DONT_BALANCE_TEXT_COLUMNS, +/* 0627 */ UNO_NAME_IS_CURRENTLY_VISIBLE, +/* 0628 */ UNO_NAME_ANCHOR_POSITION, +/* 0629 */ UNO_NAME_TEXT_READING, +/* 0630 */ UNO_NAME_PRIMARY_KEY_READING, +/* 0631 */ UNO_NAME_SECONDARY_KEY_READING, +/* 0632 */ UNO_NAME_BACK_GRAPHIC_TRANSPARENCY, +/* 0633 */ UNO_NAME_BACK_COLOR_R_G_B, +/* 0634 */ UNO_NAME_BACK_COLOR_TRANSPARENCY, +/* 0635 */ UNO_NAME_HEADER_DYNAMIC_SPACING, +/* 0636 */ UNO_NAME_FOOTER_DYNAMIC_SPACING, +/* 0637 */ UNO_NAME_BASIC_LIBRARIES, +/* 0638 */ UNO_NAME_IS_FIXED_LANGUAGE, +/* 0639 */ UNO_NAME_SELECTION, +/* 0640 */ UNO_NAME_RESULT_SET, +/* 0641 */ UNO_NAME_CONNECTION, +/* 0642 */ UNO_NAME_MODEL, +/* 0643 */ UNO_NAME_DATA_SOURCE_NAME, +/* 0644 */ UNO_NAME_DATA_COMMAND, +/* 0645 */ UNO_NAME_FILTER, +/* 0646 */ UNO_NAME_DOCUMENT_URL, +/* 0647 */ UNO_NAME_OUTPUT_URL, +/* 0648 */ UNO_NAME_OUTPUT_TYPE, +/* 0649 */ UNO_NAME_ESCAPE_PROCESSING, +/* 0650 */ UNO_NAME_SINGLE_PRINT_JOBS, +/* 0651 */ UNO_NAME_FILE_NAME_FROM_COLUMN, +/* 0652 */ UNO_NAME_FILE_NAME_PREFIX, +/* 0653 */ UNO_NAME_CHAR_STYLE_NAMES, +/* 0654 */ UNO_NAME_DAD_COMMAND, /* DAD = DataAccessDescriptor (see com.sun.star.sdb.DataAccessDescriptor) */ +/* 0655 */ UNO_NAME_DAD_COMMAND_TYPE, +/* 0656 */ UNO_NAME_CLSID, +/* 0657 */ UNO_NAME_COMPONENT, +/* 0658 */ UNO_NAME_SECT_LEFT_MARGIN, +/* 0659 */ UNO_NAME_SECT_RIGHT_MARGIN, +/* 0660 */ UNO_NAME_PARA_IS_CONNECT_BORDER, +/* 0661 */ UNO_NAME_ITEMS, +/* 0662 */ UNO_NAME_SELITEM, +/* 0663 */ SW_PROPNAME_END + +}; + + +struct SwPropNameLen +{ + const char* pName; + USHORT nNameLen; + operator const char*() const { return pName; } +}; + + + +typedef const SwPropNameLen SwPropNameTab[ SW_PROPNAME_END - SW_PROPNAME_BEGIN ]; +extern const SwPropNameTab aPropNameTab; + +#ifdef DBG_UTIL +const SwPropNameLen& GetPropName( USHORT nId ); +#else +inline const SwPropNameLen& GetPropName( USHORT nId ) +{ + return aPropNameTab[ nId - SW_PROPNAME_BEGIN]; +} +#endif + + + +#define SW_PROP_NAME(nId) \ + GetPropName( nId ).pName, GetPropName( nId ).nNameLen + +#define SW_PROP_NAME_STR(nId) \ + GetPropName( nId ).pName + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoredline.hxx b/inc/bf_sw/unoredline.hxx new file mode 100644 index 000000000..e59602e94 --- /dev/null +++ b/inc/bf_sw/unoredline.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOREDLINE_HXX +#define _UNOREDLINE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unoport.hxx> +#include <unoobj.hxx> + +#include <cppuhelper/implbase1.hxx> + +namespace binfilter { + +class SwRedline; + + + +/** + * SwXRedlineText provides an XText which may be used to write + * directly into a redline node. It got implemented to enable XML + * import of redlines and should not be used directly via the API. + */ +class SwXRedlineText : + public SwXText, + public cppu::OWeakObject, + public ::com::sun::star::container::XEnumerationAccess +{ + SwNodeIndex aNodeIndex; + virtual const SwStartNode *GetStartNode() const; + +public: + SwXRedlineText(SwDoc* pDoc, SwNodeIndex aNodeIndex); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();} + virtual void SAL_CALL release( ) throw(){OWeakObject::release();} + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess (via XEnumerationAccess) + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); +}; + + +class SwXRedlinePortion : public SwXTextPortion +{ + const SwRedline* pRedline; + + void Validate() throw( ::com::sun::star::uno::RuntimeException ); +public: + SwXRedlinePortion( const SwRedline* pRed, + const SwUnoCrsr* pPortionCrsr, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, + BOOL bIsStart); + + ~SwXRedlinePortion(); + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + static ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& PropertyName, const SwRedline& rRedline ) throw(); + static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > CreateRedlineProperties( const SwRedline& rRedline, sal_Bool bIsStart ) throw(); + +}; + + +typedef +cppu::WeakImplHelper1 +< + ::com::sun::star::container::XEnumerationAccess +> +SwXRedlineBaseClass; +class SwXRedline : + public SwXRedlineBaseClass, + public SwXText, + public SwClient +{ + SwDoc* pDoc; + SwRedline* pRedline; +public: + SwXRedline(SwRedline& rRedline, SwDoc& rDoc); + ~SwXRedline(); + + TYPEINFO(); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();} + virtual void SAL_CALL release( ) throw(){OWeakObject::release();} + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + const SwRedline* GetRedline() const {return pRedline;} +}; +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unoredlines.hxx b/inc/bf_sw/unoredlines.hxx new file mode 100644 index 000000000..685c57b99 --- /dev/null +++ b/inc/bf_sw/unoredlines.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOREDLINES_HXX +#define _UNOREDLINES_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unocoll.hxx> +#include <unobaseclass.hxx> + +#include <com/sun/star/container/XEnumerationAccess.hpp> +namespace com{ namespace sun{ namespace star{ + namespace beans{ + class XPropertySet; + } +}}} +namespace binfilter { + +class SwRedline; +typedef +cppu::WeakImplHelper3 +< + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::lang::XServiceInfo +> +SwRedlinesBaseClass; +class SwXRedlines : public SwRedlinesBaseClass, + public SwUnoCollection +{ +protected: + virtual ~SwXRedlines(); +public: + SwXRedlines(SwDoc* pDoc); + + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + static ::com::sun::star::beans::XPropertySet* GetObject( SwRedline& rRedline, SwDoc& rDoc ); +}; + + +class SwXRedlineEnumeration : public SwSimpleEnumerationBaseClass, + public SwClient +{ + SwDoc* pDoc; + USHORT nCurrentIndex; +protected: + virtual ~SwXRedlineEnumeration(); +public: + SwXRedlineEnumeration(SwDoc& rDoc); + + + //XEnumeration + virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unosett.hxx b/inc/bf_sw/unosett.hxx new file mode 100644 index 000000000..eb7833aba --- /dev/null +++ b/inc/bf_sw/unosett.hxx @@ -0,0 +1,310 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOSETT_HXX +#define _UNOSETT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <swtypes.hxx> +#include <calbck.hxx> +#include <com/sun/star/text/XTextColumns.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XIndexReplace.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase4.hxx> +#include <cppuhelper/implbase5.hxx> +#include <bf_tools/string.hxx> +namespace binfilter { +struct SfxItemPropertyMap; + +class SwDoc; +class SwFmtCol; +class SwDocShell; +class SwNumRule; + +class SwXFootnoteProperties : public cppu::WeakAggImplHelper2 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +> +{ + SwDoc* pDoc; + const SfxItemPropertyMap* _pMap; +protected: + virtual ~SwXFootnoteProperties(); +public: + SwXFootnoteProperties(SwDoc* pDoc); + + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + void Invalidate() {pDoc = 0;} +}; + + + +class SwXEndnoteProperties : public cppu::WeakAggImplHelper2 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +> +{ + SwDoc* pDoc; + const SfxItemPropertyMap* _pMap; +protected: + virtual ~SwXEndnoteProperties(); +public: + SwXEndnoteProperties(SwDoc* pDoc); + + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + void Invalidate() {pDoc = 0;} +}; + + + +class SwXLineNumberingProperties : public cppu::WeakAggImplHelper2 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +> +{ + SwDoc* pDoc; + const SfxItemPropertyMap* _pMap; +protected: + virtual ~SwXLineNumberingProperties(); +public: + SwXLineNumberingProperties(SwDoc* pDoc); + + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + void Invalidate() {pDoc = 0;} +}; + + + +class SwXNumberingRules : public cppu::WeakAggImplHelper5 +< + ::com::sun::star::container::XIndexReplace, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient +{ + String sNewCharStyleNames[MAXLEVEL]; + String sNewBulletFontNames[MAXLEVEL]; + String sCreatedNumRuleName; //connects to a numbering in SwDoc + SwDoc* pDoc; // wird nur fuers anmelden gebraucht + SwDocShell* pDocShell; //nur, wenn als ChapterNumbering verwendet + SwNumRule* pNumRule; + const SfxItemPropertyMap* _pMap; + sal_Bool bOwnNumRuleCreated; + static String sInvalidStyle; +protected: + virtual ~SwXNumberingRules(); +public: + SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering + SwXNumberingRules(const SwNumRule& rRule); // NumRule for paragraphs, numbering styles + SwXNumberingRules(SwDoc& rDoc); //create a new instance + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + + //XIndexReplace + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex)const; + void setNumberingRuleByIndex(SwNumRule& rNumRule, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rProperties, sal_Int32 nIndex) + throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + const String* GetNewCharStyleNames() const {return sNewCharStyleNames;} + const String* GetBulletFontNames() const {return sNewBulletFontNames;} + const SwNumRule* GetNumRule() {return pNumRule;} + + static const String& GetInvalidStyle(); + void Invalidate() {pDocShell = 0;} + const String& GetCreatedNumRuleName() const{return sCreatedNumRuleName; } +}; + + +class SwXChapterNumbering : public SwXNumberingRules +{ +protected: + virtual ~SwXChapterNumbering(); +public: + SwXChapterNumbering(SwDocShell& rDocSh); + + + void Invalidate() {SwXNumberingRules::Invalidate();} + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + + +class SwXTextColumns : public cppu::WeakAggImplHelper4 +< + + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::text::XTextColumns, + ::com::sun::star::lang::XServiceInfo +> +{ + sal_Int32 nReference; + ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextColumn> aTextColumns; + sal_Bool bIsAutomaticWidth; + sal_Int32 nAutoDistance; + + const SfxItemPropertyMap* _pMap; + + //separator line + sal_Int32 nSepLineWidth; + sal_Int32 nSepLineColor; + sal_Int8 nSepLineHeightRelative; + sal_Int8 nSepLineVertAlign;//style::VerticalAlignment + sal_Bool bSepLineIsOn; +protected: + virtual ~SwXTextColumns(); +public: + SwXTextColumns(sal_uInt16 nColCount); + SwXTextColumns(const SwFmtCol& rFmtCol); + + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextColumns + virtual sal_Int32 SAL_CALL getReferenceValue( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getColumnCount( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumnCount( sal_Int16 nColumns ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextColumn > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumns( const ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextColumn >& Columns ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + sal_Int32 GetSepLineWidth() const {return nSepLineWidth;} + sal_Int32 GetSepLineColor() const {return nSepLineColor;} + sal_Int8 GetSepLineHeightRelative() const {return nSepLineHeightRelative;} + sal_Int8 GetSepLineVertAlign() const {return nSepLineVertAlign;} + sal_Bool GetSepLineIsOn() const {return bSepLineIsOn;} + + sal_Bool IsAutomaticWidth() const {return bIsAutomaticWidth;} +}; +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unosrch.hxx b/inc/bf_sw/unosrch.hxx new file mode 100644 index 000000000..dbf5c3ed8 --- /dev/null +++ b/inc/bf_sw/unosrch.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOSRCH_HXX +#define _UNOSRCH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <com/sun/star/util/XPropertyReplace.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase3.hxx> // helper for implementations +#include <bf_tools/string.hxx> +namespace com{namespace sun{namespace star{namespace util{ + struct SearchOptions; +}}}} +namespace binfilter { + +struct SfxItemPropertyMap; +class SfxItemSet; + +class SwXTextDocument; +class SwSearchProperties_Impl; + + + + + + +class SwXTextSearch : public cppu::WeakImplHelper3 +< + ::com::sun::star::util::XPropertyReplace, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel +> +{ + friend class SwXTextDocument; + + String sSearchText; + String sReplaceText; + + SwSearchProperties_Impl* pSearchProperties; + SwSearchProperties_Impl* pReplaceProperties; + + + const SfxItemPropertyMap* _pMap; + sal_Bool bAll : 1; + sal_Bool bWord : 1; + sal_Bool bBack : 1; + sal_Bool bExpr : 1; + sal_Bool bCase : 1; +// sal_Bool bInSel: 1; // wie geht Suchen in Selektionen? + sal_Bool bStyles:1; + sal_Bool bSimilarity : 1; + sal_Bool bLevRelax :1; + sal_Int16 nLevExchange; + sal_Int16 nLevAdd; + sal_Int16 nLevRemove; + + sal_Bool bIsValueSearch :1; +protected: + virtual ~SwXTextSearch(); +public: + SwXTextSearch(); + + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XSearchDescriptor + virtual ::rtl::OUString SAL_CALL getSearchString( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSearchString( const ::rtl::OUString& aString ) throw(::com::sun::star::uno::RuntimeException); + + //XReplaceDescriptor + virtual ::rtl::OUString SAL_CALL getReplaceString(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setReplaceString(const ::rtl::OUString& aReplaceString) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyReplace + virtual sal_Bool SAL_CALL getValueSearch(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getSearchAttributes(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setSearchAttributes(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aSearchAttribs) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getReplaceAttributes(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setReplaceAttributes(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aSearchAttribs) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + void FillSearchItemSet(SfxItemSet& rSet) const; + void FillReplaceItemSet(SfxItemSet& rSet) const; + + sal_Bool HasSearchAttributes() const; + sal_Bool HasReplaceAttributes() const; + + void FillSearchOptions( ::com::sun::star::util::SearchOptions& + rSearchOpt ) const; +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unostyle.hxx b/inc/bf_sw/unostyle.hxx new file mode 100644 index 000000000..9eda730ab --- /dev/null +++ b/inc/bf_sw/unostyle.hxx @@ -0,0 +1,301 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOSTYLE_HXX +#define _UNOSTYLE_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/style.hxx> +#include <bf_svtools/lstner.hxx> +#include <unocoll.hxx> +#include <unomap.hxx> +#include <com/sun/star/style/XStyle.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/style/XStyleLoader.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <cppuhelper/implbase7.hxx> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <calbck.hxx> +namespace binfilter { +struct SfxItemPropertyMap; + +class SwDocShell; + +class SwXStyle; +class SwStyleProperties_Impl; +class SwStartNode; + +class SwXStyleFamilies : public cppu::WeakImplHelper4 +< + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::style::XStyleLoader +>, + public SwUnoCollection +{ + SwDocShell* pDocShell; + + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > * pxCharStyles; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > * pxParaStyles; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > * pxFrameStyles; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > * pxPageStyles; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > * pxNumberingStyles; +protected: + virtual ~SwXStyleFamilies(); +public: + SwXStyleFamilies(SwDocShell& rDocShell); + + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XStyleLoader + virtual void SAL_CALL loadStylesFromURL(const ::rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aOptions) throw( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getStyleLoaderOptions(void) throw( ::com::sun::star::uno::RuntimeException ); + + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); +}; + + + +class SwXStyleFamily : public cppu::WeakImplHelper3 +< + ::com::sun::star::container::XNameContainer, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::container::XIndexAccess +>, + public SfxListener +{ + SfxStyleFamily eFamily; // Familie + SfxStyleSheetBasePool* pBasePool; +// const SfxItemPropertyMap* _pPropMap; + SwDocShell* pDocShell; + + SwXStyle* _FindStyle(const String& rStyleName) const; +public: + SwXStyleFamily(SwDocShell* pDocShell, sal_uInt16 nFamily); + ~SwXStyleFamily(); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XNameContainer + virtual void SAL_CALL insertByName(const ::rtl::OUString& Name, const ::com::sun::star::uno::Any& Element) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL replaceByName(const ::rtl::OUString& Name, const ::com::sun::star::uno::Any& Element) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //SfxListener + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); +}; + + +class SwXStyle : public cppu::WeakImplHelper7 +< + ::com::sun::star::style::XStyle, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::beans::XMultiPropertyStates +>, + public SfxListener, + public SwClient +{ + friend class SwXStyleFamily; + SwDoc* m_pDoc; + String sStyleName; + SfxStyleSheetBasePool* pBasePool; + SfxStyleFamily eFamily; // fuer Notify + + sal_Bool bIsDescriptor : 1; + sal_Bool bIsConditional : 1; + String sParentStyleName; + SwStyleProperties_Impl* pPropImpl; + + void ApplyDescriptorProperties(); +protected: + void Invalidate(); + + const SfxStyleSheetBasePool* GetBasePool() const {return pBasePool;} + SfxStyleSheetBasePool* GetBasePool() {return pBasePool;} + + void SetStyleName(const String& rSet){ sStyleName = rSet;} + SwStyleProperties_Impl* GetPropImpl(){return pPropImpl;} + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxStyleFamily; + +public: + SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, BOOL bConditional = FALSE); + SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam, + SwDoc* pDoc, + const String& rStyleName);//, + //const SfxItemPropertyMap* _pMap); + ~SwXStyle(); + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XStyle + virtual sal_Bool SAL_CALL isUserDefined(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL isInUse(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getParentStyle(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setParentStyle(const ::rtl::OUString& aParentStyle) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XMultiPropertySet +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XMultiPropertyStates + //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SfxListener + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + const String& GetStyleName() const { return sStyleName;} + SfxStyleFamily GetFamily() const {return eFamily;} + + sal_Bool IsDescriptor() const {return bIsDescriptor;} + sal_Bool IsConditional() const { return bIsConditional;} + const String& GetParentStyleName() const { return sParentStyleName;} + void SetDoc(SwDoc* pDc, SfxStyleSheetBasePool* pPool) + { + bIsDescriptor = sal_False; m_pDoc = pDc; + pBasePool = pPool; + StartListening(*pBasePool); + } + SwDoc* GetDoc() const { return m_pDoc; } + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + +class SwXFrameStyle : public SwXStyle, + public ::com::sun::star::document::XEventsSupplier +{ +public: + SwXFrameStyle(SfxStyleSheetBasePool& rPool, + SwDoc* pDoc, + const String& rStyleName) : + SwXStyle(rPool, SFX_STYLE_FAMILY_FRAME, pDoc, rStyleName){} + SwXFrameStyle( SwDoc *pDoc ); + ~SwXFrameStyle(); + + virtual void SAL_CALL acquire( ) throw(){SwXStyle::acquire();} + virtual void SAL_CALL release( ) throw(){SwXStyle::release();} + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); + + friend class SwFrameStyleEventDescriptor; +}; + + +class SwXPageStyle : public SwXStyle +{ + SwDocShell* pDocShell; +public: + SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, SfxStyleFamily eFam, + const String& rStyleName);//, + //const SfxItemPropertyMap* _pMap); + SwXPageStyle(SwDocShell* pDocSh); + ~SwXPageStyle(); + + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); + +}; +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unotbl.hxx b/inc/bf_sw/unotbl.hxx new file mode 100644 index 000000000..3a9387e72 --- /dev/null +++ b/inc/bf_sw/unotbl.hxx @@ -0,0 +1,575 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOTBL_HXX +#define _UNOTBL_HXX + +#include <bf_svtools/bf_solar.h> + +#include <unoobj.hxx> +#include <com/sun/star/chart/XChartData.hpp> +#include <com/sun/star/chart/XChartDataArray.hpp> +#include <com/sun/star/text/XTextTableCursor.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/sheet/XCellRangeData.hpp> +#include <com/sun/star/table/XAutoFormattable.hpp> + +#include <cppuhelper/implbase10.hxx> // helper for implementations +#include <cppuhelper/implbase7.hxx> // helper for implementations +#include <cppuhelper/implbase5.hxx> // helper for implementations +namespace binfilter { + +class SwTableBoxFmt; +class SwTableLine; +class SwTableCursor; +class SwTableBoxFmt; +class SwTableLine; +class SwTableCursor; + + +class SwChartEventListenerContainer : public SwEventListenerContainer +{ + public: + SwChartEventListenerContainer( ::com::sun::star::uno::XInterface* pxParentIn) : + SwEventListenerContainer(pxParentIn){} + void ChartDataChanged(); +}; + + +typedef +cppu::WeakImplHelper4 +< + ::com::sun::star::table::XCell, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::container::XEnumerationAccess +> +SwXCellBaseClass; +class SwXCell : public SwXCellBaseClass, + public SwXText, + public SwClient +{ + friend void lcl_setString( SwXCell &rCell, const ::rtl::OUString &rTxt ); + friend double lcl_getValue( SwXCell &rCell ); + friend void lcl_setValue( SwXCell &rCell, double nVal ); + + + SfxItemPropertySet aPropSet; + SwTableBox* pBox; // only set in non-XML import + const SwStartNode* pStartNode; // only set in XML import + + // table position where pBox was found last + sal_uInt16 nFndPos; + +protected: + virtual const SwStartNode *GetStartNode() const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + sal_Bool IsValid(); + virtual ~SwXCell(); +public: + SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX ); + SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface + + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); + + //XCell + virtual ::rtl::OUString SAL_CALL getFormula( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw(::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::table::CellContentType SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getError( ) throw(::com::sun::star::uno::RuntimeException); + + //XText + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setString(const ::rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + //XEnumerationAccess - frueher XParagraphEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + SwTableBox* GetTblBox()const {return pBox;} + static SwXCell* CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, const String* pCellName = 0, SwTable *pTbl = 0 ); + SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox); + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } +}; + + +class SwXTextTableRow : public cppu::WeakImplHelper2 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient +{ + SfxItemPropertySet aPropSet; + SwTableLine* pLine; + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } +protected: + virtual ~SwXTextTableRow(); +public: + SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine); + + + TYPEINFO(); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + const SwTableLine* GetTblRow() const {return pLine;} + static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine); +}; + + +typedef cppu::WeakImplHelper3< + ::com::sun::star::text::XTextTableCursor, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::beans::XPropertySet + > SwXTextTableCursor_Base; +class SwXTextTableCursor : public SwXTextTableCursor_Base + ,public SwClient + ,public OTextCursorHelper +{ + SwDepend aCrsrDepend; + SfxItemPropertySet aPropSet; + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + // SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } + +protected: + virtual ~SwXTextTableCursor(); +public: + SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox); + + + DECLARE_XINTERFACE(); + //XTextTableCursor + virtual ::rtl::OUString SAL_CALL getRangeName( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoCellByName( const ::rtl::OUString& aCellName, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL mergeRange( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + // ITextCursorHelper + virtual const SwPaM* GetPaM() const; + virtual SwPaM* GetPaM(); + virtual const SwDoc* GetDoc() const; + virtual SwDoc* GetDoc(); + + const SwUnoCrsr* GetCrsr() const; + SwUnoCrsr* GetCrsr(); +}; + + + +struct SwRangeDescriptor +{ + sal_uInt16 nTop; + sal_uInt16 nBottom; + sal_uInt16 nLeft; + sal_uInt16 nRight; +}; + +class SwTableProperties_Impl; +class SwXTextTable : public cppu::WeakImplHelper10 +< + ::com::sun::star::text::XTextTable, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::table::XCellRange, + ::com::sun::star::chart::XChartDataArray, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::container::XNamed, + ::com::sun::star::table::XAutoFormattable, + ::com::sun::star::util::XSortable, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::sheet::XCellRangeData +>, + public SwClient +{ + SwEventListenerContainer aLstnrCntnr; + SwChartEventListenerContainer aChartLstnrCntnr; + SfxItemPropertySet aPropSet; + const SfxItemPropertyMap* _pMap; + + // Descriptor-interface + SwTableProperties_Impl* pTableProps; + String m_sTableName; + sal_Bool bIsDescriptor; + unsigned short nRows; + unsigned short nColumns; + + + sal_Bool bFirstRowAsLabel :1; + sal_Bool bFirstColumnAsLabel :1; +protected: + virtual ~SwXTextTable(); +public: + SwXTextTable(); + SwXTextTable(SwFrmFmt& rFrmFmt); + + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + TYPEINFO(); + + //XTextTable + virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL getRows( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCellNames( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTableCursor > SAL_CALL createCursorByCellName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException); + + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XCellRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException); + + //XChartDataArray + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException); + + //XChartData + virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException); + + //XSortable + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException ); + + //XAutoFormattable + virtual void SAL_CALL autoFormat(const ::rtl::OUString& aName) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XNamed + virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + + //XCellRangeData + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + sal_uInt16 getRowCount(void); + sal_uInt16 getColumnCount(void); + ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable, + const String& sTLName, const String& sBRName, + SwRangeDescriptor& rDesc); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + + static SwXTextTable* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); +}; + + + +class SwXCellRange : public cppu::WeakImplHelper7 +< + ::com::sun::star::table::XCellRange, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::chart::XChartDataArray, + ::com::sun::star::util::XSortable, + ::com::sun::star::sheet::XCellRangeData +>, + public SwClient +{ + SwDepend aCursorDepend; //the cursor is removed after the doc has been removed + SwChartEventListenerContainer aChartLstnrCntnr; + + SwRangeDescriptor aRgDesc; + SfxItemPropertySet aPropSet; + + SwUnoCrsr* pTblCrsr; + const SfxItemPropertyMap* _pMap; + + sal_Bool bFirstRowAsLabel :1; + sal_Bool bFirstColumnAsLabel :1; + +public: + SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, SwRangeDescriptor& rDesc); + ~SwXCellRange(); + + TYPEINFO(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + + //XCellRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XChartData + virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException); + + //XChartDataArray + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException); + + //XSortable + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException ); + + //XCellRangeData + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + sal_uInt16 getRowCount(void); + sal_uInt16 getColumnCount(void); +}; + + +class SwXTableRows : public cppu::WeakImplHelper2 +< + ::com::sun::star::table::XTableRows, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient + +{ + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } +protected: + virtual ~SwXTableRows(); +public: + SwXTableRows(SwFrmFmt& rFrmFmt); + + + TYPEINFO(); + +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException ); + +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut ); + +// SMART_UNO_DECLARATION( SwXTableRows, UsrObject ); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XTableRows + virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + + + +class SwXTableColumns : public cppu::WeakImplHelper2 +< + ::com::sun::star::table::XTableColumns, + ::com::sun::star::lang::XServiceInfo +>, + public SwClient + +{ + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } +protected: + virtual ~SwXTableColumns(); +public: + SwXTableColumns(SwFrmFmt& rFrmFmt); + + + TYPEINFO(); +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException ); + +// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! +// virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut ); + +// SMART_UNO_DECLARATION( SwXTableColumns, UsrObject ); + + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XTableColumns + virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); +}; + +} //namespace binfilter +#endif + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/unotxdoc.hxx b/inc/bf_sw/unotxdoc.hxx new file mode 100644 index 000000000..aedb8f8d4 --- /dev/null +++ b/inc/bf_sw/unotxdoc.hxx @@ -0,0 +1,514 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _UNOTXDOC_HXX +#define _UNOTXDOC_HXX + +#include <bf_svtools/bf_solar.h> + +#include <bf_svtools/svarray.hxx> +#include <bf_sfx2/sfxbasemodel.hxx> +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <com/sun/star/document/XLinkTargetSupplier.hpp> +#include <com/sun/star/document/XRedlinesSupplier.hpp> +#include <com/sun/star/text/XFootnotesSupplier.hpp> +#include <com/sun/star/text/XEndnotesSupplier.hpp> +#include <com/sun/star/text/XEndnotesSettingsSupplier.hpp> +#include <com/sun/star/text/XTextSectionsSupplier.hpp> +#include <com/sun/star/text/XLineNumberingProperties.hpp> +#include <com/sun/star/text/XChapterNumberingSupplier.hpp> +#include <com/sun/star/text/XPagePrintable.hpp> +#include <com/sun/star/text/XTextFieldsSupplier.hpp> +#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp> +#include <com/sun/star/text/XTextTablesSupplier.hpp> +#include <com/sun/star/text/XDocumentIndexesSupplier.hpp> +#include <com/sun/star/text/XBookmarksSupplier.hpp> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> +#include <com/sun/star/text/XReferenceMarksSupplier.hpp> +#include <com/sun/star/text/XTextFramesSupplier.hpp> +#include <com/sun/star/drawing/XDrawPageSupplier.hpp> +#include <com/sun/star/util/XReplaceable.hpp> +#include <com/sun/star/util/XReplaceDescriptor.hpp> +#include <com/sun/star/util/XRefreshable.hpp> +#include <com/sun/star/util/XLinkUpdate.hpp> +#include <com/sun/star/view/XRenderable.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/i18n/XForbiddenCharacters.hpp> +#include <com/sun/star/lang/Locale.hpp> +#include <bf_svtools/itemprop.hxx> +#include <bf_svx/fmdmod.hxx> +#include <bf_svx/UnoForbiddenCharsTable.hxx> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <cppuhelper/implbase4.hxx> // helper for implementations +#include <RefreshListenerContainer.hxx> + +#define __IFC27 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \ +Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27 + +#define __CLASS_IFC27 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \ +class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12, class Ifc13, class Ifc14, class Ifc15, class Ifc16, \ +class Ifc17, class Ifc18, class Ifc19, class Ifc20, class Ifc21, class Ifc22, class Ifc23, class Ifc24,\ +class Ifc25, class Ifc26, class Ifc27 + +#define __PUBLIC_IFC27 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \ +public Ifc13, public Ifc14, public Ifc15, public Ifc16, public Ifc17, public Ifc18, \ +public Ifc19, public Ifc20, public Ifc21, public Ifc22, public Ifc23 , public Ifc24, \ +public Ifc25, public Ifc26, public Ifc27 + +#include <cppuhelper/implbase_ex.hxx> + +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT27( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \ + __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ), \ + __IFC_EX_TYPE_INIT( class_cast, 11 ), __IFC_EX_TYPE_INIT( class_cast, 12 ), \ + __IFC_EX_TYPE_INIT( class_cast, 13 ), __IFC_EX_TYPE_INIT( class_cast, 14 ), \ + __IFC_EX_TYPE_INIT( class_cast, 15 ), __IFC_EX_TYPE_INIT( class_cast, 16 ), \ + __IFC_EX_TYPE_INIT( class_cast, 17 ), __IFC_EX_TYPE_INIT( class_cast, 18 ), \ + __IFC_EX_TYPE_INIT( class_cast, 19 ), __IFC_EX_TYPE_INIT( class_cast, 20 ), \ + __IFC_EX_TYPE_INIT( class_cast, 21 ), __IFC_EX_TYPE_INIT( class_cast, 22 ), \ + __IFC_EX_TYPE_INIT( class_cast, 23 ), __IFC_EX_TYPE_INIT( class_cast, 24 ), \ + __IFC_EX_TYPE_INIT( class_cast, 25 ), __IFC_EX_TYPE_INIT( class_cast, 26 ), \ + __IFC_EX_TYPE_INIT( class_cast, 27 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 27 ) + +namespace binfilter { + +class SwDoc; +class SvxForbiddenCharactersTable; +class SwDocShell; +class UnoActionContext; +class SwXBodyText; +class SwXDrawPage; +class SwUnoCrsr; +class SwXDocumentPropertyHelper; + +typedef UnoActionContext* UnoActionContextPtr; +SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) + +typedef cppu::WeakImplHelper27 +< + ::com::sun::star::text::XTextDocument, + ::com::sun::star::text::XLineNumberingProperties, + ::com::sun::star::text::XChapterNumberingSupplier, + ::com::sun::star::text::XFootnotesSupplier, + ::com::sun::star::text::XEndnotesSupplier, + ::com::sun::star::util::XReplaceable, + ::com::sun::star::text::XPagePrintable, + ::com::sun::star::text::XReferenceMarksSupplier, + ::com::sun::star::text::XTextTablesSupplier, + ::com::sun::star::text::XTextFramesSupplier, + ::com::sun::star::text::XBookmarksSupplier, + ::com::sun::star::text::XTextSectionsSupplier, + ::com::sun::star::text::XTextGraphicObjectsSupplier, + ::com::sun::star::text::XTextEmbeddedObjectsSupplier, + ::com::sun::star::text::XTextFieldsSupplier, + ::com::sun::star::style::XStyleFamiliesSupplier, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::drawing::XDrawPageSupplier, + ::com::sun::star::text::XDocumentIndexesSupplier, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::document::XLinkTargetSupplier, + ::com::sun::star::document::XRedlinesSupplier, + ::com::sun::star::util::XRefreshable, + ::com::sun::star::util::XLinkUpdate, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::view::XRenderable +> +SwXTextDocumentBaseClass; + +class SwXTextDocument : public SwXTextDocumentBaseClass, + public SvxFmMSFactory, + public SfxBaseModel +{ + ActionContextArr aActionArr; + SwRefreshListenerContainer aRefreshCont; + + SfxItemPropertySet aPropSet; + + SwDocShell* pDocShell; + sal_Bool bObjectValid; + + SwXDrawPage* pDrawPage; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > * pxXDrawPage; + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xBodyText; + SwXBodyText* pBodyText; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xNumFmtAgg; + + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXFootnotes; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXFootnoteSettings; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXEndnotes; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXEndnoteSettings; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXReferenceMarks; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > * pxXTextFieldTypes; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFieldMasters; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextSections; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXBookmarks; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextTables; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFrames; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXGraphicObjects; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXEmbeddedObjects; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXStyleFamilies; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > * pxXChapterNumbering; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXDocumentIndexes; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXLineNumberingProperties; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxLinkTargetSupplier; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >* pxXRedlines; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xPropertyHelper; + SwXDocumentPropertyHelper* pPropertyHelper; + + void GetBodyText(); + void GetNumberFormatter(); + + // used for XRenderable implementation + SwDoc * GetRenderDoc( const ::com::sun::star::uno::Any& rSelection ); + +protected: + virtual ~SwXTextDocument(); +public: + SwXTextDocument(SwDocShell* pShell); + + inline void notifyRefreshListeners() { aRefreshCont.Refreshed(); } + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XWeak + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAdapter > SAL_CALL queryAdapter( ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XTextDocument + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL reformat(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XModel + virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL lockControllers( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unlockControllers( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw(::com::sun::star::uno::RuntimeException); + + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + + //XLineNumberingProperties + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XChapterNumberingSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SAL_CALL getChapterNumberingRules(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XFootnotesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getFootnotes(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getFootnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XEndnotesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getEndnotes(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getEndnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XReplaceable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Int32 SAL_CALL replaceAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + + //XSearchable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL createSearchDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL findAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findFirst(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findNext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xStartAt, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + + //XPagePrintable + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPagePrintSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aSettings) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL printPages(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + //XReferenceMarksSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getReferenceMarks(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextFieldsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getTextFields(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFieldMasters(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextEmbeddedObjectsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getEmbeddedObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + +// // ::com::sun::star::text::XTextShapesSupplier +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > getShapes(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XBookmarksSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getBookmarks(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextSectionsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextSections(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextTablesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextTables(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextGraphicObjectsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGraphicObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XTextFramesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFrames(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XStyleFamiliesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getStyleFamilies(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XMultiServiceFactory + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(const ::rtl::OUString& ServiceSpecifier) + throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const ::rtl::OUString& ServiceSpecifier, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) + throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) + throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::drawing::XDrawPageSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage(void) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::text::XDocumentIndexesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getDocumentIndexes(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XLinkTargetSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XRedlinesSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getRedlines( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::util::XRefreshable + virtual void SAL_CALL refresh(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::util::XLinkUpdate, + virtual void SAL_CALL updateLinks( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::view::XRenderable + virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + using SfxBaseModel::addEventListener; + using SfxBaseModel::removeEventListener; + + // + void Invalidate(); + void Reactivate(SwDocShell* pNewDocShell); + SwXDocumentPropertyHelper * GetPropertyHelper (); + sal_Bool IsValid() const {return bObjectValid;} + + void InitNewDoc(); + + SwUnoCrsr* CreateCursorForSearch(::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr); + SwUnoCrsr* FindAny(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr, sal_Bool bAll, + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xLastResult); + + SwDocShell* GetDocShell() {return pDocShell;} + + void * SAL_CALL operator new( size_t ) throw(); + void SAL_CALL operator delete( void * ) throw(); + +}; + + +class SwXLinkTargetSupplier : public cppu::WeakImplHelper2 +< + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo +> +{ + SwXTextDocument* pxDoc; + String sTables; + String sFrames; + String sGraphics; + String sOLEs; + String sSections; + String sOutlines; + String sBookmarks; + +public: + SwXLinkTargetSupplier(SwXTextDocument& rxDoc); + ~SwXLinkTargetSupplier(); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + // + void Invalidate() {pxDoc = 0;} +}; + + +class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::document::XLinkTargetSupplier +> +{ + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xRealAccess; + SfxItemPropertySet aPropSet; + const String sLinkSuffix; + const String sLinkDisplayName; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xDoc; + SwXTextDocument* pxDoc; + + +public: + SwXLinkNameAccessWrapper(::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xAccess, + const String& rLinkDisplayName, String sSuffix); + SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, + const String& rLinkDisplayName, String sSuffix); + ~SwXLinkNameAccessWrapper(); + + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XLinkTargetSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + +}; + + +class SwXOutlineTarget : public cppu::WeakImplHelper2 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo +> +{ + SfxItemPropertySet aPropSet; + String sOutlineText; + +public: + SwXOutlineTarget(const String& rOutlineText); + ~SwXOutlineTarget(); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); +}; +} //namespace binfilter +#endif +namespace binfilter { +class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable +{ + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xDashTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xGradientTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xHatchTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xBitmapTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xTransGradientTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xMarkerTable; + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xDrawDefaults; + + SwDoc* m_pDoc; +public: + SwXDocumentPropertyHelper(SwDoc& rDoc); + ~SwXDocumentPropertyHelper(); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> GetDrawTable(short nWhich); + void Invalidate(); +}; +}//namespace binfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/usrfld.hxx b/inc/bf_sw/usrfld.hxx new file mode 100644 index 000000000..c156d0fef --- /dev/null +++ b/inc/bf_sw/usrfld.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _USRFLD_HXX +#define _USRFLD_HXX + +#include <bf_svtools/bf_solar.h> + +#include "fldbas.hxx" +namespace binfilter { + +class SfxPoolItem; +class SwCalc; +class SwDoc; + +/*-------------------------------------------------------------------- + Beschreibung: Benutzerfelder + --------------------------------------------------------------------*/ + +class SwUserFieldType : public SwValueFieldType +{ + BOOL bValidValue : 1; + BOOL bDeleted : 1; + double nValue; + String aName; + String aContent; + USHORT nType; + +public: + SwUserFieldType( SwDoc* pDocPtr, const String& ); + + virtual const String& GetName() const; + virtual SwFieldType* Copy() const; + + String Expand(sal_uInt32 nFmt, USHORT nSubType, USHORT nLng); + + String GetContent( sal_uInt32 nFmt = 0 ); + void SetContent( const String& rStr, sal_uInt32 nFmt = 0 ); + + inline BOOL IsValid() const; + inline void ChgValid( BOOL bNew ); + + + double GetValue(SwCalc& rCalc); // Member nValue neu berrechnen + inline double GetValue() const; + inline void SetValue(const double nVal); + + inline USHORT GetType() const; + inline void SetType(USHORT); + + BOOL IsDeleted() const { return bDeleted; } + void SetDeleted( BOOL b ) { bDeleted = b; } + + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +inline BOOL SwUserFieldType::IsValid() const + { return bValidValue; } + +inline void SwUserFieldType::ChgValid( BOOL bNew ) + { bValidValue = bNew; } + +inline double SwUserFieldType::GetValue() const + { return nValue; } + +inline void SwUserFieldType::SetValue(const double nVal) + { nValue = nVal; } + +inline USHORT SwUserFieldType::GetType() const + { return nType; } + +inline void SwUserFieldType::SetType(USHORT nSub) +{ + nType = nSub; + EnableFormat(!(nSub & GSE_STRING)); +} + +/*-------------------------------------------------------------------- + Beschreibung: Benutzerfelder + --------------------------------------------------------------------*/ + +class SwUserField : public SwValueField +{ + USHORT nSubType; + +public: + SwUserField(SwUserFieldType*, USHORT nSub = 0, sal_uInt32 nFmt = 0); + + virtual USHORT GetSubType() const; + virtual void SetSubType(USHORT nSub); + + virtual double GetValue() const; + virtual void SetValue( const double& rVal ); + + virtual String Expand() const; + virtual SwField* Copy() const; + virtual String GetCntnt(BOOL bName = FALSE) const; + + // Name kann nicht geaendert werden + virtual const String& GetPar1() const; + + // Inhalt + virtual String GetPar2() const; + virtual void SetPar2(const String& rStr); + virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const; + virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId ); +}; + +} //namespace binfilter +#endif // _USRFLD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/viewopt.hxx b/inc/bf_sw/viewopt.hxx new file mode 100644 index 000000000..6684051ba --- /dev/null +++ b/inc/bf_sw/viewopt.hxx @@ -0,0 +1,534 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _VIEWOPT_HXX +#define _VIEWOPT_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/gen.hxx> +#include <bf_tools/string.hxx> +#include <tools/color.hxx> + +class Window; +class OutputDevice; + +namespace binfilter { +class ColorConfig; +class SwRect; +class ViewShell; +class SwDocShell; + +#define VIEWOPT_1_IDLE 0x00000001L +#define VIEWOPT_1_TAB 0x00000002L +#define VIEWOPT_1_BLANK 0x00000004L +#define VIEWOPT_1_HARDBLANK 0x00000008L +#define VIEWOPT_1_PARAGRAPH 0x00000010L +#define VIEWOPT_1_LINEBREAK 0x00000020L +#define VIEWOPT_1_PAGEBREAK 0x00000040L +#define VIEWOPT_1_COLUMNBREAK 0x00000080L +#define VIEWOPT_1_SOFTHYPH 0x00000100L + +#define VIEWOPT_1_REF 0x00000400L +#define VIEWOPT_1_FLDNAME 0x00000800L +//#define 0x00001000L +//#define 0x00002000L +#define VIEWOPT_1_POSTITS 0x00004000L +#define VIEWOPT_1_HIDDEN 0x00008000L +//#define 0x00010000L +#define VIEWOPT_1_GRAPHIC 0x00020000L +#define VIEWOPT_1_TABLE 0x00040000L +#define VIEWOPT_1_DRAW 0x00080000L +#define VIEWOPT_1_CONTROL 0x00100000L +//#define 0x00200000L +#define VIEWOPT_1_CROSSHAIR 0x00400000L +#define VIEWOPT_1_SNAP 0x00800000L +#define VIEWOPT_1_SYNCHRONIZE 0x01000000L +#define VIEWOPT_1_GRIDVISIBLE 0x02000000L +#define VIEWOPT_1_ONLINESPELL 0x04000000L +#define VIEWOPT_1_HIDESPELL 0x08000000L +#define VIEWOPT_1_RESERVED1 0x10000000L +#define VIEWOPT_1_VIEWMETACHARS 0x20000000L +#define VIEWOPT_1_PAGEBACK 0x40000000L + +#define VIEWOPT_CORE2_BLACKFONT 0x00000001L +#define VIEWOPT_CORE2_HIDDENPARA 0x00000002L +#define VIEWOPT_CORE2_SMOOTHSCROLL 0x00000004L +#define VIEWOPT_CORE2_CRSR_IN_PROT 0x00000008L +#define VIEWOPT_CORE2_PDF_EXPORT 0x00000010L + + +#define VIEWOPT_CORE2_BIGMARKHDL 0x00000040L + +#define VIEWOPT_2_UNUSED1 0x00000100L +#define VIEWOPT_2_UNUSED2 0x00000200L +#define VIEWOPT_2_H_RULER 0x00000400L +#define VIEWOPT_2_VSCROLLBAR 0x00000800L +#define VIEWOPT_2_HSCROLLBAR 0x00001000L +#define VIEWOPT_2_STATUSLINE 0x00002000L +#define VIEWOPT_2_V_RULER 0x00004000L +#define VIEWOPT_2_ANY_RULER 0x00008000L +#define VIEWOPT_2_MODIFIED 0x00010000L +#define VIEWOPT_2_KEEPASPECTRATIO 0x00020000L +#define VIEWOPT_2_GRFKEEPZOOM 0x00040000L +#define VIEWOPT_2_EXECHYPERLINKS 0x00080000L +#define VIEWOPT_2_PREVENT_TIPS 0x00100000L +#define VIEWOPT_2_RESERVED3 0x00200000L +#define VIEWOPT_2_RESERVED4 0x00400000L +#define VIEWOPT_2_PRTFORMAT 0x00800000L +#define VIEWOPT_2_SHADOWCRSR 0x01000000L +#define VIEWOPT_2_V_RULER_RIGHT 0x02000000L + +//Tabellenhintergrund +#define TBL_DEST_CELL 0 +#define TBL_DEST_ROW 1 +#define TBL_DEST_TBL 2 + +//Appearance flags +#define VIEWOPT_DOC_BOUNDARIES 0x0001 +#define VIEWOPT_OBJECT_BOUNDARIES 0x0002 +#define VIEWOPT_TABLE_BOUNDARIES 0x0004 +#define VIEWOPT_INDEX_SHADINGS 0x0008 +#define VIEWOPT_LINKS 0x0010 +#define VIEWOPT_VISITED_LINKS 0x0020 +#define VIEWOPT_FIELD_SHADINGS 0x0040 +#define VIEWOPT_SECTION_BOUNDARIES 0x0080 + +// Implementierung in core/text/txtpaint.cxx +extern void SyncVout( const OutputDevice *pOut ); + +class SwViewOption +{ + static Color aDocColor; // color of document boundaries + static Color aDocBoundColor; // color of document boundaries + static Color aObjectBoundColor; // color of object boundaries + static Color aAppBackgroundColor; // application background + static Color aTableBoundColor; // color of table boundaries + static Color aFontColor; + static Color aIndexShadingsColor; // background color of indexes + static Color aLinksColor; + static Color aVisitedLinksColor; + static Color aDirectCursorColor; + static Color aTextGridColor; + static Color aSpellColor; // mark color of online spell checking + static Color aFieldShadingsColor; + static Color aSectionBoundColor; + static Color aPageBreakColor; + static Color aNotesIndicatorColor; + static Color aScriptIndicatorColor; + + static sal_Int32 nAppearanceFlags; // +protected: + static USHORT nPixelTwips;// 1 Pixel == ? Twips + + String sSymbolFont; // Symbolzeichensatz + UINT32 nCoreOptions; // Bits fuer die ViewShell + UINT32 nCore2Options; // Bits fuer die ViewShell + UINT32 nUIOptions; // UI-Bits + Color aRetoucheColor; // DefaultBackground fuer BrowseView + Size aSnapSize; // Beschreibt hori. wie vert. Snap + short nDivisionX; // Rasterunterteilung + short nDivisionY; + BYTE nPagePrevRow; // Page Preview Row/Columns + BYTE nPagePrevCol; // Page Preview Row/Columns + BYTE nShdwCrsrFillMode; // FillMode fuer den ShadowCrsr + BOOL bReadonly : 1; // Readonly-Doc + BOOL bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents) + BOOL bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings + BOOL bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents + + // Maszstab + USHORT nZoom; // Angaben in Prozent + BYTE eZoom; // 'enum' fuer Zoom + BYTE nTblDest; // Ziel fuer Tabellenhintergrund + +#ifdef DBG_UTIL + // korrespondieren zu den Angaben in ui/config/cfgvw.src + BOOL bTest1 :1; // Test-Flag "Layout not loading" + BOOL bTest2 :1; // Test-Flag "WYSIWYG++" + BOOL bTest3 :1; // Test-Flag "" + BOOL bTest4 :1; // Test-Flag "WYSIWYG debug" + BOOL bTest5 :1; // Test-Flag "No idle format" + BOOL bTest6 :1; // Test-Flag "No screen adj" + BOOL bTest7 :1; // Test-Flag "win format" + BOOL bTest8 :1; // Test-Flag "" + static BOOL bTest9; // Test-Flag "DrawingLayerNotLoading" + BOOL bTest10 :1; // Test-Flag "Format by Input" +#endif + +public: + SwViewOption(); // CTOR + SwViewOption(const SwViewOption&); // + ~SwViewOption() {} // + + USHORT GetPixelTwips() const { return nPixelTwips; } + + inline UINT32 GetCoreOptions() const {return nCoreOptions;} + inline UINT32 GetUIOptions() const {return nUIOptions;} + inline void SetUIOptions( const SwViewOption& ); + +/*--------------------------------------------------------------------------- + Optionen aus nCoreOptions +----------------------------------------------------------------------------*/ + + inline BOOL IsIdle() const + { return nCoreOptions & VIEWOPT_1_IDLE ? TRUE : FALSE; } + inline void SetIdle( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_IDLE ) : ( nCoreOptions &= ~VIEWOPT_1_IDLE); } + + inline BOOL IsTab(BOOL bHard = FALSE) const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_TAB) && + ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard) + ? TRUE : FALSE; } + inline void SetTab( BOOL b ) { + (b != 0) ? (nCoreOptions |= VIEWOPT_1_TAB ) : ( nCoreOptions &= ~VIEWOPT_1_TAB); } + + inline BOOL IsBlank(BOOL bHard = FALSE) const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_BLANK) && + ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard) + ? TRUE : FALSE; } + inline void SetBlank( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_BLANK ) : ( nCoreOptions &= ~VIEWOPT_1_BLANK); } + + inline BOOL IsHardBlank() const + { return !bReadonly && nCoreOptions & VIEWOPT_1_HARDBLANK ? TRUE : FALSE; } + inline void SetHardBlank( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_HARDBLANK ) : ( nCoreOptions &= ~VIEWOPT_1_HARDBLANK); } + + inline BOOL IsParagraph(BOOL bHard = FALSE) const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_PARAGRAPH) && + ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard) + ? TRUE : FALSE; } + inline void SetParagraph( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_PARAGRAPH ) : ( nCoreOptions &= ~VIEWOPT_1_PARAGRAPH); } + + inline BOOL IsLineBreak(BOOL bHard = FALSE) const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_LINEBREAK) && + ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard) + ? TRUE : FALSE; } + inline void SetLineBreak( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_LINEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_LINEBREAK); } + + inline BOOL IsPageBreak() const { return !bReadonly && (nCoreOptions & VIEWOPT_1_PAGEBREAK) ? TRUE : FALSE; } + inline void SetPageBreak( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBREAK); } + + inline BOOL IsColumnBreak() const { return !bReadonly && (nCoreOptions & VIEWOPT_1_COLUMNBREAK) ? TRUE : FALSE; } + inline void SetColumnBreak( BOOL b) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_COLUMNBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_COLUMNBREAK); } + + inline BOOL IsSoftHyph() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_SOFTHYPH) ? TRUE : FALSE; } + inline void SetSoftHyph( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_SOFTHYPH ) : ( nCoreOptions &= ~VIEWOPT_1_SOFTHYPH); } + + inline BOOL IsFldName() const { return !bReadonly && (nCoreOptions & VIEWOPT_1_FLDNAME) ? TRUE : FALSE; } + inline void SetFldName( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_FLDNAME ) : ( nCoreOptions &= ~VIEWOPT_1_FLDNAME); } + + inline BOOL IsPostIts() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_POSTITS) ? TRUE : FALSE; } + inline void SetPostIts( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_POSTITS ) : ( nCoreOptions &= ~VIEWOPT_1_POSTITS); } + + inline BOOL IsHidden() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_HIDDEN) ? TRUE : FALSE; } + inline void SetHidden( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_HIDDEN); } + + inline BOOL IsGraphic() const + { return nCoreOptions & VIEWOPT_1_GRAPHIC ? TRUE : FALSE; } + inline void SetGraphic( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRAPHIC ) : ( nCoreOptions &= ~VIEWOPT_1_GRAPHIC); } + + inline BOOL IsPageBack() const + { return nCoreOptions & VIEWOPT_1_PAGEBACK ? TRUE : FALSE; } + inline void SetPageBack( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBACK) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBACK); } + + inline BOOL IsBigMarkHdl() const + { return nCore2Options & VIEWOPT_CORE2_BIGMARKHDL ? TRUE : FALSE;} + inline void SetBigMarkHdl(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_BIGMARKHDL ) : (nCore2Options &= ~VIEWOPT_CORE2_BIGMARKHDL);} + + inline BOOL IsTable() const + { return nCoreOptions & VIEWOPT_1_TABLE ? TRUE : FALSE; } + inline void SetTable( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_TABLE ) : ( nCoreOptions &= ~VIEWOPT_1_TABLE); } + + inline BOOL IsDraw() const + { return nCoreOptions & VIEWOPT_1_DRAW ? TRUE : FALSE; } + inline void SetDraw( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_DRAW ) : ( nCoreOptions &= ~VIEWOPT_1_DRAW); } + + inline BOOL IsControl() const + { return nCoreOptions & VIEWOPT_1_CONTROL ? TRUE : FALSE; } + inline void SetControl( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_CONTROL ) : ( nCoreOptions &= ~VIEWOPT_1_CONTROL); } + + inline BOOL IsSnap() const + { return nCoreOptions & VIEWOPT_1_SNAP ? TRUE : FALSE; } + inline void SetSnap( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_SNAP ) : ( nCoreOptions &= ~VIEWOPT_1_SNAP); } + + inline void SetSnapSize( Size &rSz ){ aSnapSize = rSz; } + inline const Size &GetSnapSize() const { return aSnapSize; } + + inline BOOL IsGridVisible() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_GRIDVISIBLE) ? TRUE : FALSE; } + inline void SetGridVisible( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRIDVISIBLE ) : ( nCoreOptions &= ~VIEWOPT_1_GRIDVISIBLE); } + + inline BOOL IsOnlineSpell() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_ONLINESPELL) ? TRUE : FALSE; } + inline void SetOnlineSpell( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_ONLINESPELL ) : ( nCoreOptions &= ~VIEWOPT_1_ONLINESPELL); } + + inline BOOL IsHideSpell() const + { return nCoreOptions & VIEWOPT_1_HIDESPELL ? TRUE : FALSE; } + inline void SetHideSpell( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_HIDESPELL ) : ( nCoreOptions &= ~VIEWOPT_1_HIDESPELL); } + + inline BOOL IsViewMetaChars() const + { return !bReadonly && (nCoreOptions & VIEWOPT_1_VIEWMETACHARS) ? TRUE : FALSE; } + inline void SetViewMetaChars( BOOL b) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_VIEWMETACHARS ) : ( nCoreOptions &= ~VIEWOPT_1_VIEWMETACHARS); } + + inline BOOL IsSynchronize() const + { return nCoreOptions & VIEWOPT_1_SYNCHRONIZE ? TRUE : FALSE;} + inline void SetSynchronize( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_SYNCHRONIZE ) : ( nCoreOptions &= ~VIEWOPT_1_SYNCHRONIZE); } + + inline BOOL IsCrossHair() const + { return nCoreOptions & VIEWOPT_1_CROSSHAIR ? TRUE : FALSE; } + inline void SetCrossHair( BOOL b ) + { (b != 0) ? (nCoreOptions |= VIEWOPT_1_CROSSHAIR ) : ( nCoreOptions &= ~VIEWOPT_1_CROSSHAIR); } + +/*--------------------------------------------------------------------------- + Optionen aus nCore2Options +----------------------------------------------------------------------------*/ + inline BOOL IsBlackFont() const + {return nCore2Options & VIEWOPT_CORE2_BLACKFONT ? TRUE : FALSE;} + + inline void SetBlackFont(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_BLACKFONT) : (nCore2Options &= ~VIEWOPT_CORE2_BLACKFONT);} + + inline BOOL IsShowHiddenPara() const + {return nCore2Options & VIEWOPT_CORE2_HIDDENPARA ? TRUE : FALSE;} + + inline void SetShowHiddenPara(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_HIDDENPARA) : (nCore2Options &= ~VIEWOPT_CORE2_HIDDENPARA);} + + inline BOOL IsSmoothScroll() const + {return nCore2Options & VIEWOPT_CORE2_SMOOTHSCROLL ? TRUE : FALSE;} + + inline void SetSmoothScroll(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_SMOOTHSCROLL) : (nCore2Options &= ~VIEWOPT_CORE2_SMOOTHSCROLL);} + + inline BOOL IsCursorInProtectedArea() const + {return nCore2Options & VIEWOPT_CORE2_CRSR_IN_PROT ? TRUE : FALSE;} + + inline void SetCursorInProtectedArea(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_CRSR_IN_PROT) : (nCore2Options &= ~VIEWOPT_CORE2_CRSR_IN_PROT);} + + inline BOOL IsPDFExport() const + {return nCore2Options & VIEWOPT_CORE2_PDF_EXPORT ? TRUE : FALSE;} + + inline void SetPDFExport(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);} + + + + + inline short GetDivisionX() const { return nDivisionX; } + inline void SetDivisionX( short n ){ nDivisionX = n; } + inline short GetDivisionY() const { return nDivisionY; } + inline void SetDivisionY( short n ){ nDivisionY = n; } + + inline BYTE GetPagePrevRow() const { return nPagePrevRow; } + inline void SetPagePrevRow( BYTE n ) { nPagePrevRow = n; } + inline BYTE GetPagePrevCol() const { return nPagePrevCol; } + inline void SetPagePrevCol( BYTE n ) { nPagePrevCol = n; } + BOOL IsReadonly() const { return bReadonly; } + void SetReadonly(BOOL bSet) { bReadonly = bSet; } + + BOOL IsSelectionInReadonly() const {return bSelectionInReadonly;} + void SetSelectionInReadonly(BOOL bSet) {bSelectionInReadonly = bSet;} + + BOOL IsAutoCompleteWords() const; + + +#ifdef DBG_UTIL + // korrespondieren zu den Angaben in ui/config/cfgvw.src + inline BOOL IsTest1() const { return bTest1; } + inline void SetTest1( BOOL b ) { bTest1 = b; } + inline BOOL IsTest2() const { return bTest2; } + inline void SetTest2( BOOL b ) { bTest2 = b; } + inline BOOL IsTest3() const { return bTest3; } + inline void SetTest3( BOOL b ) { bTest3 = b; } + inline BOOL IsTest4() const { return bTest4; } + inline void SetTest4( BOOL b ) { bTest4 = b; } + inline BOOL IsTest5() const { return bTest5; } + inline void SetTest5( BOOL b ) { bTest5 = b; } + inline BOOL IsTest6() const { return bTest6; } + inline void SetTest6( BOOL b ) { bTest6 = b; } + inline BOOL IsTest7() const { return bTest7; } + inline void SetTest7( BOOL b ) { bTest7 = b; } + inline BOOL IsTest8() const { return bTest8; } + inline void SetTest8( BOOL b ) { bTest8 = b; } + static inline BOOL IsTest9() { return bTest9; } + static inline void SetTest9( BOOL b ) { bTest9 = b; } + inline BOOL IsTest10() const { return bTest10; } + inline void SetTest10( BOOL b ) { bTest10 = b; } +#endif + + inline USHORT GetZoom() const { return nZoom; } + inline void SetZoom( USHORT n ){ nZoom = n; } + + + SwViewOption& operator=( const SwViewOption &rOpt ); + // Vergleichsmethoden + + +/*--------------------------------------------------------------------------- + Optionen aus nUIOptions +----------------------------------------------------------------------------*/ + + BOOL IsViewVScrollBar() const + { return nUIOptions & VIEWOPT_2_VSCROLLBAR ? TRUE : FALSE; } + BOOL IsViewHScrollBar() const + { return nUIOptions & VIEWOPT_2_HSCROLLBAR ? TRUE : FALSE; } + BOOL IsKeepRatio() const + { return nUIOptions & VIEWOPT_2_KEEPASPECTRATIO ? TRUE : FALSE; } + BOOL IsGrfKeepZoom() const + { return nUIOptions & VIEWOPT_2_GRFKEEPZOOM ? TRUE : FALSE; } + BOOL IsExecHyperlinks() const + { return nUIOptions & VIEWOPT_2_EXECHYPERLINKS ? TRUE : FALSE; } + BOOL IsPreventTips() const + { return nUIOptions & VIEWOPT_2_PREVENT_TIPS ? TRUE : FALSE; } + BOOL IsPrtFormat() const + { return nUIOptions & VIEWOPT_2_PRTFORMAT ? TRUE : FALSE; } + + BYTE GetZoomType() const { return eZoom; } + + BYTE GetTblDest() const { return nTblDest; } + + void SetViewVScrollBar(BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_VSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_VSCROLLBAR); } + void SetViewHScrollBar(BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_HSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_HSCROLLBAR); } + void SetKeepRatio (BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_KEEPASPECTRATIO ) : ( nUIOptions &= ~VIEWOPT_2_KEEPASPECTRATIO); } + void SetGrfKeepZoom (BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_GRFKEEPZOOM ) : ( nUIOptions &= ~VIEWOPT_2_GRFKEEPZOOM); } + void SetExecHyperlinks( BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_EXECHYPERLINKS) : (nUIOptions &= ~VIEWOPT_2_EXECHYPERLINKS); } + void SetPreventTips( BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_PREVENT_TIPS) : (nUIOptions &= ~VIEWOPT_2_PREVENT_TIPS); } + void SetPrtFormat( BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_PRTFORMAT) : (nUIOptions &= ~VIEWOPT_2_PRTFORMAT); } + + void SetZoomType (BYTE eZoom_){ eZoom = eZoom_; } + void SetTblDest( BYTE nNew ) { nTblDest = nNew; } + + const String& GetSymbolFont() const {return sSymbolFont;} + void SetSymbolFont(const String& sSet) {sSymbolFont = sSet;} + + const Color& GetRetoucheColor() const { return aRetoucheColor;} + void SetRetoucheColor(const Color&r) { aRetoucheColor = r; } + + BOOL IsViewAnyRuler() const {return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER);} + void SetViewAnyRuler(BOOL bSet) + { bSet ? (nUIOptions |= VIEWOPT_2_ANY_RULER) : (nUIOptions &= ~VIEWOPT_2_ANY_RULER);} + + BOOL IsViewHRuler(BOOL bDirect = FALSE) const + { + BOOL bRet = bDirect ? + 0 != (nUIOptions & VIEWOPT_2_H_RULER) : + !bReadonly ? + (nUIOptions & (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER) + : FALSE; + return bRet; + + } + void SetViewHRuler (BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_H_RULER ) : ( nUIOptions &= ~VIEWOPT_2_H_RULER);} + + BOOL IsViewVRuler(BOOL bDirect = FALSE) const + { + BOOL bRet = bDirect ? + 0 !=(nUIOptions & VIEWOPT_2_V_RULER) : + !bReadonly ? + (nUIOptions & + (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER) + : FALSE; + return bRet; + } + void SetViewVRuler (BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_V_RULER ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER);} + + // ShadowCursor ein schalten/abfragen/Farbe setzen/Modus setzen + BOOL IsShadowCursor() const + { return nUIOptions & VIEWOPT_2_SHADOWCRSR ? TRUE : FALSE; } + void SetShadowCursor(BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_SHADOWCRSR ) : ( nUIOptions &= ~VIEWOPT_2_SHADOWCRSR); } + + //move vertical ruler to the right + BOOL IsVRulerRight() const + { return nUIOptions & VIEWOPT_2_V_RULER_RIGHT ? TRUE : FALSE; } + void SetVRulerRight(BOOL b) + { b ? (nUIOptions |= VIEWOPT_2_V_RULER_RIGHT ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER_RIGHT); } + + BOOL IsStarOneSetting() const {return bStarOneSetting; } + void SetStarOneSetting(BOOL bSet) {bStarOneSetting = bSet; } + + BOOL IsPagePreview() const {return bIsPagePreview; } + void SetPagePreview(BOOL bSet) { bIsPagePreview= bSet; } + + BYTE GetShdwCrsrFillMode() const { return nShdwCrsrFillMode; } + void SetShdwCrsrFillMode( BYTE nMode ) { nShdwCrsrFillMode = nMode; }; + + static Color& GetPageBreakColor(); + + static BOOL IsAppearanceFlag(sal_Int32 nFlag); + + static BOOL IsDocBoundaries() {return IsAppearanceFlag(VIEWOPT_DOC_BOUNDARIES);} + static BOOL IsObjectBoundaries(){return IsAppearanceFlag(VIEWOPT_OBJECT_BOUNDARIES);} + static BOOL IsTableBoundaries() {return IsAppearanceFlag(VIEWOPT_TABLE_BOUNDARIES );} + static BOOL IsIndexShadings() {return IsAppearanceFlag(VIEWOPT_INDEX_SHADINGS );} + static BOOL IsLinks() {return IsAppearanceFlag(VIEWOPT_LINKS );} + static BOOL IsVisitedLinks() {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS );} + static BOOL IsFieldShadings() {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);} + static BOOL IsSectionBoundaries() {return IsAppearanceFlag(VIEWOPT_SECTION_BOUNDARIES);} + + static void ApplyColorConfigValues(const ColorConfig& rConfig); +}; + + + +inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt ) +{ + nUIOptions = rVOpt.nUIOptions; + nTblDest = rVOpt.nTblDest; + nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/viewsh.hxx b/inc/bf_sw/viewsh.hxx new file mode 100644 index 000000000..575a9a38a --- /dev/null +++ b/inc/bf_sw/viewsh.hxx @@ -0,0 +1,202 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _VIEWSH_HXX +#define _VIEWSH_HXX + +#include <bf_svtools/bf_solar.h> + +#include <tools/rtti.hxx> + +#include <ring.hxx> +#include <swrect.hxx> +/*N*/ #include <tools/debug.hxx> //for stripping +#ifdef ACCESSIBLE_LAYOUT +namespace com { namespace sun { namespace star { namespace accessibility { + class XAccessible; } } } } +#endif +class VirtualDevice; +class Window; +class OutputDevice; +class SvtAccessibilityOptions; +class Fraction; +class SvEmbeddedObjectRef; + +namespace binfilter { + +class SfxItemPool; +class SwDoc; +class SfxPrinter; + +class SfxProgress; +class SwNodes; +class SdrView; + +class SfxViewShell; +class SwViewOption; +class SwViewImp; +class SwPrtOptions; +class SwPagePreViewPrtData; +struct ShellResource; +class SwFrm; +struct SwPrintData; +class SwPagePreviewLayout; + +struct SwAccessibilityOptions; + +class ViewShell : public Ring +{ + friend class SwViewImp; + + // OD 12.12.2002 #103492# - for setting visible area for page preview paint + friend class SwPagePreviewLayout; + + Point aPrtOffst; //Ofst fuer den Printer, + //nicht bedruckbarer Rand. + Size aBrowseBorder; //Rand fuer Framedokumente + SwRect aInvalidRect; + + SfxViewShell *pSfxViewShell; + SwViewImp *pImp; //Core-Interna der ViewShell. + //Der Pointer ist niemals 0. + + Window *pWin; // = 0 during printing or pdf export + OutputDevice *pOut; // Window, Printer, VirtDev, ... + OutputDevice* mpTmpRef; // Temporariy reference device. Is used + // during (printer depending) prospect + // and page preview printing + // (because a scaling has to be set at + // the original printer) + + SwViewOption *pOpt; + SwAccessibilityOptions* pAccOptions; + + + sal_Bool bDocSizeChgd :1; //Fuer DocChgNotify(): Neue DocGroesse bei + //EndAction an das DocMDI melden. + sal_Bool bPaintWorks :1; //Normal Painten wenn sal_True, + //Paint merken wenn sal_False + sal_Bool bPaintInProgress :1; //Kein zweifaches Paint durchlassen. + sal_Bool bViewLocked :1; //Lockt den sichtbaren Bereich, + //MakeVisible laeuft dann in's leere. + sal_Bool bInEndAction :1; //Fiese unstaende vermeiden, siehe viewsh.cxx + sal_Bool bPreView :1; //Ist sal_True wenns eine PreView-ViewShell ist. + sal_Bool bFrameView :1; //sal_True wenn es ein (HTML-)Frame ist. + sal_Bool bEnableSmooth :1; //Disable des SmoothScroll z.B. fuer + //Drag der Scrollbars. + sal_Bool bEndActionByVirDev:1; //Paints aus der EndAction immer ueber virtuelles + + // Malen der Wiese und rufen + // PaintDesktop gesplittet, dieser Teil wird auch von PreViewPage benutzt + + sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber + //eine Aktion ausloesen. +protected: + static ShellResource* pShellRes; // Resourcen fuer die Shell + static Window* pCareWindow; // diesem Fenster ausweichen + + SwRect aVisArea; //Die moderne Ausfuerung der VisArea + SwDoc *pDoc; //Das Dokument, niemals 0 + + sal_uInt16 nStartAction; //ist != 0 wenn mindestens eine ::com::sun::star::chaos::Action laeuft + sal_uInt16 nLockPaint; //ist != 0 wenn das Paint gelocked ist. + +public: + TYPEINFO(); + + SwViewImp *Imp() { return pImp; } + const SwViewImp *Imp() const { return pImp; } + + const SwRect &VisArea() const { return aVisArea; } + + inline SwDoc *GetDoc() const { return pDoc; } //niemals 0. + + // 1. GetPrt: The printer at the document + // 3. GetRefDev: Either the printer or the virtual device from the doc + // 2. GetWin: Available if we not printing + // 4. GetOut: Printer, Window or Virtual device + VirtualDevice* GetVirDev( sal_Bool bCreate = sal_False ) const; + OutputDevice& GetRefDev() const; + inline Window* GetWin() const { return pWin; } + inline OutputDevice* GetOut() const { return pOut; } + + // Setzt Drucker fuer ALLE Sichten im Ring; einschl. Invalidierungen + void SetVirDev( VirtualDevice* ); + + //Andern alle PageDescriptoren + + // creates temporary doc with selected text for PDF export + SwDoc * CreatePrtDoc( SfxPrinter* pPrt, SvEmbeddedObjectRef &rDocShellRef ); + + //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. + + //All about fields. + // update all charts, for that exists any table + + // Sollen Absatzabstaende addiert oder maximiert werden? + + // compatible behaviour of tabs + + //formatting by virtual device or printer + sal_Bool IsUseVirtualDevice()const; + void SetUseVirtualDevice(sal_Bool bSet); + + inline const SwViewOption *GetViewOptions() const { return pOpt; } + + //static void SetShellRes( ShellResource* pRes ) { pShellRes = pRes; } + static ShellResource* GetShellRes(); + + // Selektion der Draw ::com::sun::star::script::Engine geaendert + virtual void DrawSelChanged(SdrView*); + + // OD 12.12.2002 #103492# + SwPagePreviewLayout* PagePreviewLayout(); + + // print page/print preview + void PrintPreViewPage( SwPrtOptions& rOptions, sal_uInt16 nRowCol, + SfxProgress& rProgress, + const SwPagePreViewPrtData* = 0 ); + + //sorge dafuer, das auf jedenfall die MarkListe aktuell ist (Bug 57153) + + sal_Bool IsPreView() const { return bPreView; } + + //Damit in der UI nicht ueberall das dochxx includet werden muss + sal_Bool IsBrowseMode() const; + + const Size& GetBrowseBorder() const{ return aBrowseBorder; } + + virtual ~ViewShell(); + +}; + +//---- class CurrShell verwaltet den globalen ShellPointer ------------------- + +class CurrShell +{ +public: + ViewShell *pPrev; + + CurrShell( ViewShell *pNew ); + ~CurrShell(); +}; + +} //namespace binfilter +#endif //_VIEWSH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/viscrs.hxx b/inc/bf_sw/viscrs.hxx new file mode 100644 index 000000000..19c841997 --- /dev/null +++ b/inc/bf_sw/viscrs.hxx @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _VISCRS_HXX +#define _VISCRS_HXX + +#include <bf_svtools/bf_solar.h> + +#include <vcl/cursor.hxx> +#include "swcrsr.hxx" +#include "swrect.hxx" +#include "swregion.hxx" +class Window; +namespace binfilter { + +class SwCrsrShell; +class SwShellCrsr; + + + +// -------- Ab hier Klassen / Methoden fuer den nicht Text-Cursor ------ + +class SwVisCrsr +#ifdef SW_CRSR_TIMER + : private Timer +#endif +{ + friend void _InitCore(); + friend void _FinitCore(); + + BOOL bIsVisible : 1; + BOOL bIsDragCrsr : 1; + +#ifdef SW_CRSR_TIMER + BOOL bTimerOn : 1; +#endif + + Cursor aTxtCrsr; + const SwCrsrShell* pCrsrShell; + +public: + ~SwVisCrsr(); + + bool IsVisible() const { return bIsVisible; } + bool IsDragCrsr() const { return bIsDragCrsr; } + void SetDragCrsr( BOOL bFlag = TRUE ) { bIsDragCrsr = bFlag; } +}; + + +// ------ Ab hier Klassen / Methoden fuer die Selectionen ------- + +class SwSelPaintRects : public SwRects +{ + friend void _InitCore(); + friend void _FinitCore(); + + static long nPixPtX, nPixPtY; + static MapMode *pMapMode; + + // die Shell + const SwCrsrShell* pCShell; + + + virtual void FillRects() = 0; + +public: + virtual ~SwSelPaintRects(); + + void Hide(); + + const SwCrsrShell* GetShell() const { return pCShell; } +}; + + +class SwShellCrsr : public virtual SwCursor, public SwSelPaintRects +{ + // Dokument-Positionen der Start/End-Charakter einer SSelection + Point aMkPt, aPtPt; + const SwPosition* pPt; // fuer Zuordung vom GetPoint() zum aPtPt + + virtual void FillRects() {} // fuer Table- und normalen Crsr + +public: + SwShellCrsr( const SwCrsrShell& rCrsrSh, const SwPosition &rPos ); + virtual ~SwShellCrsr(); + + virtual operator SwShellCrsr* (); + + const Point& GetPtPos() const { return( SwPaM::GetPoint() == pPt ? aPtPt : aMkPt ); } + Point& GetPtPos() { return( SwPaM::GetPoint() == pPt ? aPtPt : aMkPt ); } + const Point& GetMkPos() const { return( SwPaM::GetMark() == pPt ? aPtPt : aMkPt ); } + Point& GetMkPos() { return( SwPaM::GetMark() == pPt ? aPtPt : aMkPt ); } + const Point& GetSttPos() const { return( SwPaM::Start() == pPt ? aPtPt : aMkPt ); } + Point& GetSttPos() { return( SwPaM::Start() == pPt ? aPtPt : aMkPt ); } + const Point& GetEndPos() const { return( SwPaM::End() == pPt ? aPtPt : aMkPt ); } + Point& GetEndPos() { return( SwPaM::End() == pPt ? aPtPt : aMkPt ); } + + + + + bool UpDown( BOOL bUp, USHORT nCnt = 1 ); + + // TRUE: an die Position kann der Cursor gesetzt werden + + DECL_FIXEDMEMPOOL_NEWDEL( SwShellCrsr ) +}; + + + +class SwShellTableCrsr : public virtual SwShellCrsr, public virtual SwTableCursor +{ + // die Selection hat die gleiche Reihenfolge wie die + // TabellenBoxen. D.h., wird aus dem einen Array an einer Position + // etwas geloescht, dann muss es auch im anderen erfolgen!! + + +public: + SwShellTableCrsr( const SwCrsrShell& rCrsrSh, const SwPosition& rPos ); + virtual ~SwShellTableCrsr(); + + virtual operator SwShellTableCrsr* (); + + + // Pruefe, ob sich der SPoint innerhalb der Tabellen-SSelection befindet + + virtual void SetMark(); + virtual operator SwShellCrsr* (); + virtual operator SwTableCursor* (); + +}; + + + +} //namespace binfilter +#endif // _VISCRS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/inc/bf_sw/wdocsh.hxx b/inc/bf_sw/wdocsh.hxx new file mode 100644 index 000000000..6b9735272 --- /dev/null +++ b/inc/bf_sw/wdocsh.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SWWDOCSH_HXX +#define _SWWDOCSH_HXX + +#include "docsh.hxx" +#include <swdll.hxx> +namespace binfilter { + +class SwWebDocShell: public SwDocShell +{ + USHORT nSourcePara; // aktive Zeile in der SourceView +public: + + // aber selbst implementieren + SFX_DECL_OBJECTFACTORY_DLL(SwWebDocShell, SW_DLL()); + TYPEINFO(); + + SwWebDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED); + ~SwWebDocShell(); + +}; + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |