Files
libreoffice/sw/inc/frmfmt.hxx

324 lines
10 KiB
C++
Raw Normal View History

2000-09-18 16:15:01 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:15:01 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:15:01 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:15:01 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:15:01 +00:00
*
************************************************************************/
#ifndef _FRMFMT_HXX
#define _FRMFMT_HXX
// --> OD 2004-08-06 #i28749#
#include <com/sun/star/text/PositionLayoutDir.hpp>
// <--
#include <cppuhelper/weakref.hxx>
#include <format.hxx>
#include "swdllapi.h"
2000-09-18 16:15:01 +00:00
class SwFlyFrm;
class SwAnchoredObject;
2000-09-18 16:15:01 +00:00
class Graphic;
class Point;
class ImageMap;
class IMapObject;
class SwRect;
class SwContact;
class SdrObject;
class SW_DLLPUBLIC SwFrmFmt: public SwFmt
2000-09-18 16:15:01 +00:00
{
friend class SwDoc;
friend class SwPageDesc; //darf den protected CTor rufen.
::com::sun::star::uno::WeakReference<
::com::sun::star::uno::XInterface> m_wXObject;
2000-09-18 16:15:01 +00:00
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 Graphic MakeGraphic( ImageMap* pMap = NULL );
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.
IMapObject* GetIMapObject( const Point& rPoint,
const SwFlyFrm *pFly = 0 ) const;
// 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(); }
BOOL IsLowerOf( const SwFrmFmt& rFmt ) const;
// --> OD 2004-07-27 #i31698#
enum tLayoutDir
{
HORI_L2R,
HORI_R2L,
VERT_R2L,
VERT_L2R // not supported yet
};
virtual SwFrmFmt::tLayoutDir GetLayoutDir() const;
virtual void SetLayoutDir( const SwFrmFmt::tLayoutDir _eLayoutDir );
// <--
// --> OD 2004-08-06 #i28749#
virtual sal_Int16 GetPositionLayoutDir() const;
virtual void SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir );
// <--
virtual String GetDescription() const;
SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
::com::sun::star::uno::XInterface> const& GetXObject() const
{ return m_wXObject; }
SW_DLLPRIVATE void SetXObject(::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface> const& xObject)
{ m_wXObject = xObject; }
DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
2000-09-18 16:15:01 +00:00
};
//Das FlyFrame-Format ------------------------------
CWS-TOOLING: integrate CWS libmsword 2008-12-18 12:33:19 +0100 kendy r265681 : Export less symbols. 2008-12-17 19:26:56 +0100 kendy r265655 : Move libmsword to the -writer package. 2008-12-15 17:46:16 +0100 kendy r265516 : Enable exceptions for iodetect.cxx. 2008-12-15 15:17:53 +0100 kendy r265504 : Deliver the msword.dll. 2008-12-09 19:38:17 +0100 kendy r265138 : Remove accidentally added method. 2008-12-09 19:33:57 +0100 kendy r265137 : Fix linking on Win32. 2008-12-09 18:37:16 +0100 kendy r265135 : Move SwFltControlStack::Delete() to ww1/fltshell.cxx to fix linking. 2008-12-09 18:01:56 +0100 kendy r265127 : Visibility fixes. 2008-12-09 15:51:52 +0100 kendy r265109 : Fix ambiguous usage of class Color. 2008-12-09 14:54:27 +0100 kendy r265091 : Add #include "precompiled_sw.hxx" to fix --enable-pch build. 2008-12-09 14:44:59 +0100 kendy r265088 : Add #include "precompiled_sw.hxx" to fix --enable-pch build. 2008-12-08 19:14:49 +0100 kendy r265015 : #i96313# Get rid of inc/iodetect.cxx, it's a really bad idea to share code by #ifdefing parts of it, and #including a .cxx file ;-) This change moves it to iodetect.cxx, which is compiled to a .o/.obj that is used where needed. 2008-11-20 17:45:08 +0100 kendy r264083 : #i96313# Make the destruction of Readers consistent. 2008-11-20 17:18:11 +0100 kendy r264070 : #i96313# Added missing SW_DLLPUBLIC for (Import|Export)(DOC|RTF). 2008-11-18 19:21:07 +0100 kendy r263797 : #i96313# Remove accidentally added file. 2008-11-18 17:14:31 +0100 kendy r263790 : #i96313# Split doc and rtf filters into a separate library From: Radek Doulik <rodo@novell.com> fix SwFieldBookmark class visibility (suggested by kendy) 2008-11-18 17:14:01 +0100 kendy r263789 : #i96313# Split doc and rtf filters into a separate library From: Fridrich Strba <fstrba@novell.com> add visibility markup to allow linking 2008-11-18 17:13:29 +0100 kendy r263788 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Visibility markup for libmsword. This is the most trivial approach, every class that had a symbol that needed to be visible was marked with SW_DLLPUBLIC; the correct (but more time consuming) way would be to mark just the exact methods that were needed. To be done later if generally shows that the separate libmsword makes sense; and also now we have the upper limit of symbols that needed to be added, and we can only make it better [decrease the number] ;-) 2008-11-18 17:12:58 +0100 kendy r263787 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Added the missing msword.map. 2008-11-18 17:12:25 +0100 kendy r263786 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> scp2 change for libmsword. 2008-11-18 17:11:55 +0100 kendy r263785 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Convert the binary .doc and .rtf filters into a separate library. It is called 'libmsword' and loaded on demand when either of the formats (.doc, .rtf) is loaded or saved.
2009-01-05 14:06:42 +00:00
class SW_DLLPUBLIC SwFlyFrmFmt: public SwFrmFmt
2000-09-18 16:15:01 +00:00
{
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;
SwAnchoredObject* GetAnchoredObj( const Point* pDocPos = 0,
const BOOL bCalcFrm = FALSE ) const;
2000-09-18 16:15:01 +00:00
virtual Graphic MakeGraphic( ImageMap* pMap = NULL );
virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
CWS-TOOLING: integrate CWS sw32a11y01 2009-08-27 10:11:46 +0200 hde r275457 : new testcase i103265 2009-08-27 08:24:31 +0200 hde r275454 : new testcase i103265 2009-08-27 08:23:05 +0200 hde r275453 : new document for testcase i103265 2009-08-26 13:43:33 +0200 hde r275421 : added new autotest 2009-08-26 13:36:28 +0200 hde r275420 : added new autotest 2009-08-18 15:41:18 +0200 od r275113 : #i104300# method <SwEditWin::RequestHelp(..)> - improve help tip for hyperlinks to cross-reference bookmarks. 2009-08-10 15:18:41 +0200 od r274816 : #i73249# method <SwFrameShell::Execute(..)> - no update of fly frame manager on dialog "Title and Description" 2009-08-10 14:24:15 +0200 od r274813 : #i92125# correction of end of file - missing newline end 2009-08-10 14:10:14 +0200 od r274811 : #i92125# correction of end of file - newline missing 2009-08-10 14:00:30 +0200 od r274808 : #i92125# - correct end of file - new line missing 2009-08-10 09:12:30 +0200 od r274794 : CWS-TOOLING: rebase CWS sw32a11y01 to trunk@274622 (milestone: DEV300:m54) 2009-08-07 15:52:59 +0200 od r274775 : #i73249# minor adjustment due to compiler warning 2009-08-07 15:40:38 +0200 od r274774 : #i92125# method <MarkManager::deleteMarks(..)> - do not delete cross-reference bookmark, if deletion occurs inside a certain node 2009-08-06 12:53:05 +0200 od r274717 : #i92125# method <MarkManager::deleteMarks(..) - no move of position for cross-reference bookmark, if move occurs inside certain node. 2009-08-06 12:50:27 +0200 od r274716 : #i92125# method <SwUndoSaveCntnt::DelCntntIndex(..)> - keep cross-reference bookmarks, if deletion occurs inside a certain node. 2009-08-06 09:53:29 +0200 od r274705 : #i103265# method <SwTOXPara::GetURL()> - For outline and template entries create link to bookmark. The bookmark of type CROSSREF_HEADING_BOOKMARK is created, if needed 2009-07-22 13:57:04 +0200 od r274236 : #i73249# adjustment for export of svg:title and svg:description 2009-07-22 13:51:58 +0200 od r274234 : #i73249# adjust and enhance import/export of svg:title and svg:description for Writer's text frames, graphics and embedded objects 2009-07-21 10:26:27 +0200 od r274168 : #i73249# implement support for attributes Title and Description for text frames, graphics and embedded objects in Writer - core, UNO-API, undo/redo and UI 2009-07-21 10:05:15 +0200 od r274164 : #i73249# new optional properties Title and Description as basis frame properties in text documents 2009-07-13 12:19:54 +0200 od r273928 : #i73249# Implementation of Undo/Redo of drawing object's name, title and description
2009-08-27 11:59:20 +00:00
// --> OD 2009-07-14 #i73249#
const String GetObjTitle() const;
void SetObjTitle( const String& rTitle,
bool bBroadcast = false );
const String GetObjDescription() const;
void SetObjDescription( const String& rDescription,
bool bBroadcast = false );
// <--
/** 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.
*/
2008-10-10 13:02:43 +00:00
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
*/
2008-10-10 13:02:43 +00:00
sal_Bool IsBackgroundBrushInherited() const;
2000-09-18 16:15:01 +00:00
DECL_FIXEDMEMPOOL_NEWDEL(SwFlyFrmFmt)
};
//Das DrawFrame-Format -----------------------------
CWS-TOOLING: integrate CWS libmsword 2008-12-18 12:33:19 +0100 kendy r265681 : Export less symbols. 2008-12-17 19:26:56 +0100 kendy r265655 : Move libmsword to the -writer package. 2008-12-15 17:46:16 +0100 kendy r265516 : Enable exceptions for iodetect.cxx. 2008-12-15 15:17:53 +0100 kendy r265504 : Deliver the msword.dll. 2008-12-09 19:38:17 +0100 kendy r265138 : Remove accidentally added method. 2008-12-09 19:33:57 +0100 kendy r265137 : Fix linking on Win32. 2008-12-09 18:37:16 +0100 kendy r265135 : Move SwFltControlStack::Delete() to ww1/fltshell.cxx to fix linking. 2008-12-09 18:01:56 +0100 kendy r265127 : Visibility fixes. 2008-12-09 15:51:52 +0100 kendy r265109 : Fix ambiguous usage of class Color. 2008-12-09 14:54:27 +0100 kendy r265091 : Add #include "precompiled_sw.hxx" to fix --enable-pch build. 2008-12-09 14:44:59 +0100 kendy r265088 : Add #include "precompiled_sw.hxx" to fix --enable-pch build. 2008-12-08 19:14:49 +0100 kendy r265015 : #i96313# Get rid of inc/iodetect.cxx, it's a really bad idea to share code by #ifdefing parts of it, and #including a .cxx file ;-) This change moves it to iodetect.cxx, which is compiled to a .o/.obj that is used where needed. 2008-11-20 17:45:08 +0100 kendy r264083 : #i96313# Make the destruction of Readers consistent. 2008-11-20 17:18:11 +0100 kendy r264070 : #i96313# Added missing SW_DLLPUBLIC for (Import|Export)(DOC|RTF). 2008-11-18 19:21:07 +0100 kendy r263797 : #i96313# Remove accidentally added file. 2008-11-18 17:14:31 +0100 kendy r263790 : #i96313# Split doc and rtf filters into a separate library From: Radek Doulik <rodo@novell.com> fix SwFieldBookmark class visibility (suggested by kendy) 2008-11-18 17:14:01 +0100 kendy r263789 : #i96313# Split doc and rtf filters into a separate library From: Fridrich Strba <fstrba@novell.com> add visibility markup to allow linking 2008-11-18 17:13:29 +0100 kendy r263788 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Visibility markup for libmsword. This is the most trivial approach, every class that had a symbol that needed to be visible was marked with SW_DLLPUBLIC; the correct (but more time consuming) way would be to mark just the exact methods that were needed. To be done later if generally shows that the separate libmsword makes sense; and also now we have the upper limit of symbols that needed to be added, and we can only make it better [decrease the number] ;-) 2008-11-18 17:12:58 +0100 kendy r263787 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Added the missing msword.map. 2008-11-18 17:12:25 +0100 kendy r263786 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> scp2 change for libmsword. 2008-11-18 17:11:55 +0100 kendy r263785 : #i96313# Split doc and rtf filters into a separate library From: Jan Holesovsky <kendy@suse.cz> Convert the binary .doc and .rtf filters into a separate library. It is called 'libmsword' and loaded on demand when either of the formats (.doc, .rtf) is loaded or saved.
2009-01-05 14:06:42 +00:00
class SW_DLLPUBLIC SwDrawFrmFmt: public SwFrmFmt
2000-09-18 16:15:01 +00:00
{
friend class SwDoc;
mutable const SdrObject * pSdrObjCached;
mutable String sSdrObjCachedComment;
2000-09-18 16:15:01 +00:00
//Beide nicht vorhanden.
SwDrawFrmFmt( const SwDrawFrmFmt &rCpy );
SwDrawFrmFmt &operator=( const SwDrawFrmFmt &rCpy );
// --> OD 2004-07-27 #i31698#
SwFrmFmt::tLayoutDir meLayoutDir;
// <--
// --> OD 2004-08-06 #i28749#
sal_Int16 mnPositionLayoutDir;
// <--
// --> OD 2005-03-11 #i44334#, #i44681#
bool mbPosAttrSet;
// <--
2000-09-18 16:15:01 +00:00
protected:
SwDrawFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
SwFrmFmt *pDrvdFrm )
: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_DRAWFRMFMT ),
pSdrObjCached(NULL),
// --> OD 2004-07-28 #i31698#
meLayoutDir( SwFrmFmt::HORI_L2R ),
// <--
// --> OD 2004-08-06 #i28749#
// --> OD 2005-03-10 #i44344#, #i44681# - undo change of issue #i36010#
mnPositionLayoutDir( com::sun::star::text::PositionLayoutDir::PositionInLayoutDirOfAnchor ),
// <--
// --> OD 2005-03-11 #i44334#, #i44681#
mbPosAttrSet( false )
// <--
2000-09-18 16:15:01 +00:00
{}
SwDrawFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
SwFrmFmt *pDrvdFrm )
: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_DRAWFRMFMT ),
pSdrObjCached(NULL),
// --> OD 2004-07-28 #i31698#
meLayoutDir( SwFrmFmt::HORI_L2R ),
// <--
// --> OD 2004-08-06 #i28749#
// --> OD 2005-03-10 #i44344#, #i44681# - undo change of issue #i36010#
mnPositionLayoutDir( com::sun::star::text::PositionLayoutDir::PositionInLayoutDirOfAnchor ),
// <--
// --> OD 2005-03-11 #i44334#, #i44681#
mbPosAttrSet( false )
// <--
2000-09-18 16:15:01 +00:00
{}
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();
virtual Graphic MakeGraphic( ImageMap* pMap = NULL );
// --> OD 2004-07-27 #i31698#
virtual SwFrmFmt::tLayoutDir GetLayoutDir() const;
virtual void SetLayoutDir( const SwFrmFmt::tLayoutDir _eLayoutDir );
// <--
// --> OD 2004-08-06 #i28749#
virtual sal_Int16 GetPositionLayoutDir() const;
virtual void SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir );
// <--
// --> OD 2005-03-11 #i44334#, #i44681#
inline bool IsPosAttrSet() const { return mbPosAttrSet; }
inline void PosAttrSet() { mbPosAttrSet = true; }
// <--
// --> OD 2005-08-16 #i53320#
inline void ResetPosAttr()
{
mbPosAttrSet = false;
}
// <--
virtual String GetDescription() const;
2000-09-18 16:15:01 +00:00
DECL_FIXEDMEMPOOL_NEWDEL(SwDrawFrmFmt);
};
#endif