2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-18 23:08:29 +00:00
|
|
|
#ifndef _FLYFRMS_HXX
|
|
|
|
#define _FLYFRMS_HXX
|
2012-06-02 19:45:46 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#include "flyfrm.hxx"
|
2012-06-02 19:45:46 +02:00
|
|
|
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
class SwFlyAtCntFrm;
|
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// Base class for those Flys that can "move freely" or better that are not
|
|
|
|
// bound in Cntnt.
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwFlyFreeFrm : public SwFlyFrm
|
|
|
|
{
|
2012-06-02 19:41:10 +02:00
|
|
|
SwPageFrm *pPage; // page where the Fly is registered
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i34753# - flag for at-page anchored Writer fly frames
|
2004-12-23 09:05:53 +00:00
|
|
|
// to prevent a positioning - call of method <MakeObjPos()> -, if Writer
|
|
|
|
// fly frame is already clipped during its format by the object formatter.
|
|
|
|
bool mbNoMakePos;
|
2011-04-05 09:45:35 +02:00
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// #i37068# - flag to prevent move in method <CheckClip(..)>
|
2004-12-23 09:05:53 +00:00
|
|
|
bool mbNoMoveOnCheckClip;
|
2011-04-05 09:45:35 +02:00
|
|
|
|
2012-08-30 22:15:58 +02:00
|
|
|
SwRect maUnclippedFrm;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void CheckClip( const SwFmtFrmSize &rSz ); //'Emergency' Clipping.
|
|
|
|
|
2003-09-04 10:47:16 +00:00
|
|
|
/** determines, if direct environment of fly frame has 'auto' size
|
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
#i17297#
|
2003-09-04 10:47:16 +00:00
|
|
|
start with anchor frame and search for a header, footer, row or fly frame
|
|
|
|
stopping at page frame.
|
|
|
|
return <true>, if such a frame is found and it has 'auto' size.
|
|
|
|
otherwise <false> is returned.
|
|
|
|
|
|
|
|
@return boolean indicating, that direct environment has 'auto' size
|
|
|
|
*/
|
|
|
|
bool HasEnvironmentAutoSize() const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
protected:
|
2011-02-05 18:00:33 +01:00
|
|
|
// #i28701# - new friend class <SwFlyNotify> for access to
|
2004-08-02 13:04:50 +00:00
|
|
|
// method <NotifyBackground>
|
|
|
|
friend class SwFlyNotify;
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual void NotifyBackground( SwPageFrm *pPage,
|
|
|
|
const SwRect& rRect, PrepareHint eHint);
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
|
2004-08-02 13:04:50 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
TYPEINFO();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual ~SwFlyFreeFrm();
|
|
|
|
|
|
|
|
virtual void MakeAll();
|
2004-11-16 14:41:21 +00:00
|
|
|
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i37068# - accessors for member <mbNoMoveOnCheckClip>
|
2004-12-23 09:05:53 +00:00
|
|
|
inline void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
|
|
|
|
{
|
|
|
|
mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
|
|
|
|
}
|
|
|
|
inline bool IsNoMoveOnCheckClip() const
|
|
|
|
{
|
|
|
|
return mbNoMoveOnCheckClip;
|
|
|
|
}
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i34753# - accessors for member <mbNoMakePos>
|
2004-12-23 09:05:53 +00:00
|
|
|
inline void SetNoMakePos( const bool _bNoMakePos )
|
2004-11-16 14:41:21 +00:00
|
|
|
{
|
2004-12-23 09:05:53 +00:00
|
|
|
if ( IsFlyLayFrm() )
|
|
|
|
{
|
|
|
|
mbNoMakePos = _bNoMakePos;
|
|
|
|
}
|
2004-11-16 14:41:21 +00:00
|
|
|
}
|
2004-12-23 09:05:53 +00:00
|
|
|
inline bool IsNoMakePos() const
|
2004-11-16 14:41:21 +00:00
|
|
|
{
|
2004-12-23 09:05:53 +00:00
|
|
|
if ( IsFlyLayFrm() )
|
|
|
|
{
|
|
|
|
return mbNoMakePos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2004-11-16 14:41:21 +00:00
|
|
|
}
|
2005-03-23 11:57:43 +00:00
|
|
|
|
2012-08-30 22:15:58 +02:00
|
|
|
inline const SwRect& GetUnclippedFrm( ) const
|
|
|
|
{
|
|
|
|
if ( maUnclippedFrm.HasArea( ) )
|
|
|
|
return maUnclippedFrm;
|
|
|
|
else
|
|
|
|
return Frm();
|
|
|
|
}
|
|
|
|
|
2005-03-23 11:57:43 +00:00
|
|
|
/** method to determine, if a format on the Writer fly frame is possible
|
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
#i28701#
|
2005-03-23 11:57:43 +00:00
|
|
|
refine 'IsFormatPossible'-conditions of method
|
|
|
|
<SwFlyFrm::IsFormatPossible()> by:
|
|
|
|
format isn't possible, if Writer fly frame isn't registered at a page frame
|
|
|
|
and its anchor frame isn't inside another Writer fly frame.
|
|
|
|
*/
|
|
|
|
virtual bool IsFormatPossible() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// Flys that are bound to LayoutFrms and not to Cntnt
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwFlyLayFrm : public SwFlyFreeFrm
|
|
|
|
{
|
|
|
|
public:
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
TYPEINFO();
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFlyLayFrm( SwFlyLayFrm& );
|
2010-12-17 09:02:23 +01:00
|
|
|
protected:
|
|
|
|
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// Flys that are bound to Cntnt but not in Cntnt
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwFlyAtCntFrm : public SwFlyFreeFrm
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
virtual void MakeAll();
|
2004-06-28 12:36:26 +00:00
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
|
|
|
|
|
|
|
|
/** method to assure that anchored object is registered at the correct
|
|
|
|
page frame
|
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
#i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
*/
|
|
|
|
virtual void RegisterAtCorrectPage();
|
2010-12-17 09:02:23 +01:00
|
|
|
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
|
2004-08-02 13:04:50 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
TYPEINFO();
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void SetAbsPos( const Point &rNew );
|
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
// #i26791#
|
2004-06-28 12:36:26 +00:00
|
|
|
virtual void MakeObjPos();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-08-02 13:04:50 +00:00
|
|
|
/** method to determine, if a format on the Writer fly frame is possible
|
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
#i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
refine 'IsFormatPossible'-conditions of method
|
|
|
|
<SwFlyFreeFrm::IsFormatPossible()> by:
|
|
|
|
format isn't possible, if method <MakeAll()> is already in progress.
|
|
|
|
*/
|
|
|
|
virtual bool IsFormatPossible() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// Flys that are bound to a character in Cntnt
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwFlyInCntFrm : public SwFlyFrm
|
|
|
|
{
|
|
|
|
Point aRef; //Relativ zu diesem Point wird die AbsPos berechnet.
|
|
|
|
long nLine; //Zeilenhoehe, Ref.Y() - nLine == Zeilenanfang.
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bInvalidLayout :1;
|
|
|
|
sal_Bool bInvalidCntnt :1;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void NotifyBackground( SwPageFrm *pPage,
|
|
|
|
const SwRect& rRect, PrepareHint eHint);
|
|
|
|
virtual void MakeAll();
|
2010-12-17 09:02:23 +01:00
|
|
|
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
public:
|
2011-04-05 09:45:35 +02:00
|
|
|
// #i28701#
|
2004-08-02 13:04:50 +00:00
|
|
|
TYPEINFO();
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual ~SwFlyInCntFrm();
|
|
|
|
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
|
|
|
|
|
2001-02-01 13:05:11 +00:00
|
|
|
void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
|
|
|
|
const Point &rRelPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
const Point &GetRefPoint() const { return aRef; }
|
2004-06-28 12:36:26 +00:00
|
|
|
const Point GetRelPos() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
long GetLineHeight() const { return nLine; }
|
|
|
|
|
|
|
|
inline void InvalidateLayout() const;
|
|
|
|
inline void InvalidateCntnt() const;
|
|
|
|
inline void ValidateLayout() const;
|
|
|
|
inline void ValidateCntnt() const;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsInvalid() const { return (bInvalidLayout || bInvalidCntnt); }
|
|
|
|
sal_Bool IsInvalidLayout() const { return bInvalidLayout; }
|
|
|
|
sal_Bool IsInvalidCntnt() const { return bInvalidCntnt; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// (26.11.93, see tabfrm.hxx, but might also be valid for others)
|
|
|
|
// For creation of a Fly after a FlyCnt was created _and_ inserted.
|
|
|
|
// Must be called by creator because can be pasted only after creation.
|
|
|
|
// Sometimes the page for registering the Flys is not visible until then
|
|
|
|
// as well.
|
2000-09-18 23:08:29 +00:00
|
|
|
void RegistFlys();
|
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
//see layact.cxx
|
2000-09-18 23:08:29 +00:00
|
|
|
void AddRefOfst( long nOfst ) { aRef.Y() += nOfst; }
|
2004-06-28 12:36:26 +00:00
|
|
|
|
2011-02-05 18:00:33 +01:00
|
|
|
// #i26791#
|
2004-06-28 12:36:26 +00:00
|
|
|
virtual void MakeObjPos();
|
2004-12-23 09:05:53 +00:00
|
|
|
|
2012-06-02 19:41:10 +02:00
|
|
|
// invalidate anchor frame on invalidation of the position, because the
|
|
|
|
// position is calculated during the format of the anchor frame
|
2004-12-23 09:05:53 +00:00
|
|
|
virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline void SwFlyInCntFrm::InvalidateLayout() const
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwFlyInCntFrm*)this)->bInvalidLayout = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
inline void SwFlyInCntFrm::InvalidateCntnt() const
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwFlyInCntFrm*)this)->bInvalidCntnt = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2012-06-02 19:45:46 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
inline void SwFlyInCntFrm::ValidateLayout() const
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwFlyInCntFrm*)this)->bInvalidLayout = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
inline void SwFlyInCntFrm::ValidateCntnt() const
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwFlyInCntFrm*)this)->bInvalidCntnt = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|