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 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_POSTITHELPER_HXX
|
|
|
|
#define INCLUDED_SW_INC_POSTITHELPER_HXX
|
2008-06-16 07:14:01 +00:00
|
|
|
|
|
|
|
#include <swrect.hxx>
|
2009-01-02 15:51:45 +00:00
|
|
|
#include <fmtfld.hxx>
|
|
|
|
#include <redline.hxx>
|
2008-06-16 07:14:01 +00:00
|
|
|
#include <vector>
|
2009-01-02 15:51:45 +00:00
|
|
|
#include <vcl/window.hxx>
|
2010-01-12 10:43:45 +01:00
|
|
|
#include <SidebarWindowsTypes.hxx>
|
2008-06-16 07:14:01 +00:00
|
|
|
|
2014-05-14 08:33:54 +02:00
|
|
|
class SfxBroadcaster;
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwTextField;
|
2015-11-25 06:03:10 -05:00
|
|
|
class SwRootFrame;
|
2009-01-02 15:51:45 +00:00
|
|
|
class SwPostItMgr;
|
2010-01-12 10:43:45 +01:00
|
|
|
class SwEditWin;
|
|
|
|
namespace sw { namespace sidebarwindows {
|
|
|
|
class SwSidebarWin;
|
|
|
|
} }
|
2008-06-16 07:14:01 +00:00
|
|
|
|
|
|
|
struct SwPosition;
|
|
|
|
|
2009-01-02 15:51:45 +00:00
|
|
|
typedef sal_Int64 SwPostItBits;
|
|
|
|
|
2008-06-16 07:14:01 +00:00
|
|
|
struct SwLayoutInfo
|
|
|
|
{
|
2015-11-25 06:03:10 -05:00
|
|
|
const SwFrame* mpAnchorFrame;
|
2008-06-16 07:14:01 +00:00
|
|
|
SwRect mPosition;
|
2013-12-19 18:50:58 +00:00
|
|
|
|
|
|
|
// optional start of the annotation
|
|
|
|
sal_uLong mnStartNodeIdx;
|
|
|
|
sal_Int32 mnStartContent;
|
|
|
|
|
2008-06-16 07:14:01 +00:00
|
|
|
SwRect mPageFrame;
|
|
|
|
SwRect mPagePrtArea;
|
|
|
|
unsigned long mnPageNumber;
|
2013-12-19 18:50:58 +00:00
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
sw::sidebarwindows::SidebarPosition meSidebarPosition;
|
2013-12-19 18:50:58 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 mRedlineAuthor;
|
2010-01-19 08:57:57 +01:00
|
|
|
|
|
|
|
SwLayoutInfo()
|
2015-11-25 06:03:10 -05:00
|
|
|
: mpAnchorFrame(nullptr)
|
2010-01-19 08:57:57 +01:00
|
|
|
, mPosition()
|
2013-12-19 18:50:58 +00:00
|
|
|
, mnStartNodeIdx( 0 )
|
|
|
|
, mnStartContent( -1 )
|
2010-01-19 08:57:57 +01:00
|
|
|
, mPageFrame()
|
|
|
|
, mPagePrtArea()
|
|
|
|
, mnPageNumber(1)
|
2015-03-12 08:33:40 +02:00
|
|
|
, meSidebarPosition(sw::sidebarwindows::SidebarPosition::NONE)
|
2010-01-19 08:57:57 +01:00
|
|
|
, mRedlineAuthor(0)
|
|
|
|
{}
|
2008-06-16 07:14:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace SwPostItHelper
|
|
|
|
{
|
|
|
|
enum SwLayoutStatus
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
INVISIBLE, VISIBLE, INSERTED, DELETED, NONE, HIDDEN
|
2008-06-16 07:14:01 +00:00
|
|
|
};
|
|
|
|
|
2013-12-19 18:50:58 +00:00
|
|
|
SwLayoutStatus getLayoutInfos(
|
|
|
|
SwLayoutInfo& o_rInfo,
|
|
|
|
const SwPosition& rAnchorPos,
|
2015-11-10 10:25:48 +01:00
|
|
|
const SwPosition* pAnnotationStartPos = nullptr );
|
2013-12-19 18:50:58 +00:00
|
|
|
|
2015-11-25 06:03:10 -05:00
|
|
|
long getLayoutHeight( const SwRootFrame* pRoot );
|
|
|
|
void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode );
|
|
|
|
unsigned long getPageInfo( SwRect& rPageFrame, const SwRootFrame* , const Point& );
|
2008-06-16 07:14:01 +00:00
|
|
|
}
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
class SwSidebarItem
|
2008-06-16 07:14:01 +00:00
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
public:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<sw::sidebarwindows::SwSidebarWin> pPostIt;
|
2008-06-16 07:14:01 +00:00
|
|
|
bool bShow;
|
|
|
|
bool bFocus;
|
2010-01-19 08:57:57 +01:00
|
|
|
|
2008-06-16 07:14:01 +00:00
|
|
|
SwPostItHelper::SwLayoutStatus mLayoutStatus;
|
2010-01-19 08:57:57 +01:00
|
|
|
SwLayoutInfo maLayoutInfo;
|
|
|
|
|
2016-03-30 11:59:33 +02:00
|
|
|
SwSidebarItem( const bool aFocus)
|
2015-11-10 10:25:48 +01:00
|
|
|
: pPostIt(nullptr)
|
2016-03-30 11:59:33 +02:00
|
|
|
, bShow(true)
|
2010-01-19 08:57:57 +01:00
|
|
|
, bFocus(aFocus)
|
|
|
|
, mLayoutStatus( SwPostItHelper::INVISIBLE )
|
|
|
|
, maLayoutInfo()
|
2013-12-19 18:50:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~SwSidebarItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-02-02 15:11:26 +01:00
|
|
|
virtual SwPosition GetAnchorPosition() const = 0;
|
2009-01-02 15:51:45 +00:00
|
|
|
virtual bool UseElement() = 0;
|
2015-05-20 13:05:49 +02:00
|
|
|
virtual const SwFormatField& GetFormatField() const = 0;
|
2013-12-19 18:50:58 +00:00
|
|
|
virtual const SfxBroadcaster* GetBroadCaster() const = 0;
|
2015-04-17 15:54:21 +02:00
|
|
|
virtual VclPtr<sw::sidebarwindows::SwSidebarWin> GetSidebarWindow( SwEditWin& rEditWin,
|
2016-03-30 11:59:33 +02:00
|
|
|
SwPostItMgr& aMgr) = 0;
|
2009-01-02 15:51:45 +00:00
|
|
|
};
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
class SwAnnotationItem: public SwSidebarItem
|
2009-01-02 15:51:45 +00:00
|
|
|
{
|
2013-12-19 18:50:58 +00:00
|
|
|
public:
|
|
|
|
SwAnnotationItem(
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatField& rFormatField,
|
2013-12-19 18:50:58 +00:00
|
|
|
const bool aFocus)
|
2016-03-30 11:59:33 +02:00
|
|
|
: SwSidebarItem( aFocus )
|
2015-05-20 13:05:49 +02:00
|
|
|
, mrFormatField( rFormatField )
|
2013-12-19 18:50:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SwAnnotationItem() override
|
2013-12-19 18:50:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual SwPosition GetAnchorPosition() const override;
|
|
|
|
virtual bool UseElement() override;
|
|
|
|
virtual const SwFormatField& GetFormatField() const override
|
2013-12-19 18:50:58 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return mrFormatField;
|
2013-12-19 18:50:58 +00:00
|
|
|
}
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual const SfxBroadcaster* GetBroadCaster() const override
|
2013-12-19 18:50:58 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return dynamic_cast<const SfxBroadcaster *> (&mrFormatField);
|
2013-12-19 18:50:58 +00:00
|
|
|
}
|
2015-04-17 15:54:21 +02:00
|
|
|
virtual VclPtr<sw::sidebarwindows::SwSidebarWin> GetSidebarWindow(
|
2013-12-19 18:50:58 +00:00
|
|
|
SwEditWin& rEditWin,
|
2016-03-30 11:59:33 +02:00
|
|
|
SwPostItMgr& aMgr ) override;
|
2013-12-19 18:50:58 +00:00
|
|
|
|
|
|
|
private:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatField& mrFormatField;
|
2008-06-16 07:14:01 +00:00
|
|
|
};
|
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#endif // INCLUDED_SW_INC_POSTITHELPER_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|