2010-10-14 01:30:41 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2008-06-16 02:14:01 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2008-06-16 02:14:01 -05:00
|
|
|
*
|
|
|
|
* 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 _POSTITHELPER_HXX
|
|
|
|
#define _POSTITHELPER_HXX
|
|
|
|
|
|
|
|
#include <swrect.hxx>
|
2009-01-02 09:51:45 -06:00
|
|
|
#include <fmtfld.hxx>
|
|
|
|
#include <redline.hxx>
|
2008-06-16 02:14:01 -05:00
|
|
|
#include <vector>
|
2009-01-02 09:51:45 -06:00
|
|
|
#include <vcl/window.hxx>
|
2010-01-12 03:43:45 -06:00
|
|
|
#include <SidebarWindowsTypes.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/brdcst.hxx>
|
2008-06-16 02:14:01 -05:00
|
|
|
|
|
|
|
class SwTxtFld;
|
|
|
|
class SwRootFrm;
|
|
|
|
class SwPostIt;
|
2009-01-02 09:51:45 -06:00
|
|
|
class String;
|
|
|
|
class SwPostItMgr;
|
2010-01-12 03:43:45 -06:00
|
|
|
class SwEditWin;
|
|
|
|
namespace sw { namespace sidebarwindows {
|
|
|
|
class SwSidebarWin;
|
|
|
|
} }
|
2008-06-16 02:14:01 -05:00
|
|
|
|
|
|
|
struct SwPosition;
|
|
|
|
|
2009-01-02 09:51:45 -06:00
|
|
|
typedef sal_Int64 SwPostItBits;
|
|
|
|
|
2008-06-16 02:14:01 -05:00
|
|
|
struct SwLayoutInfo
|
|
|
|
{
|
2010-02-02 08:11:26 -06:00
|
|
|
const SwFrm* mpAnchorFrm;
|
2008-06-16 02:14:01 -05:00
|
|
|
SwRect mPosition;
|
|
|
|
SwRect mPageFrame;
|
|
|
|
SwRect mPagePrtArea;
|
|
|
|
unsigned long mnPageNumber;
|
2010-01-12 03:43:45 -06:00
|
|
|
sw::sidebarwindows::SidebarPosition meSidebarPosition;
|
2011-01-17 08:06:54 -06:00
|
|
|
sal_uInt16 mRedlineAuthor;
|
2010-01-19 01:57:57 -06:00
|
|
|
|
|
|
|
SwLayoutInfo()
|
2010-02-02 08:11:26 -06:00
|
|
|
: mpAnchorFrm(0)
|
2010-01-19 01:57:57 -06:00
|
|
|
, mPosition()
|
|
|
|
, mPageFrame()
|
|
|
|
, mPagePrtArea()
|
|
|
|
, mnPageNumber(1)
|
|
|
|
, meSidebarPosition(sw::sidebarwindows::SIDEBAR_NONE)
|
|
|
|
, mRedlineAuthor(0)
|
|
|
|
{}
|
2008-06-16 02:14:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace SwPostItHelper
|
|
|
|
{
|
|
|
|
enum SwLayoutStatus
|
|
|
|
{
|
2009-01-02 09:51:45 -06:00
|
|
|
INVISIBLE, VISIBLE, INSERTED, DELETED, NONE, HIDDEN
|
2008-06-16 02:14:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
SwLayoutStatus getLayoutInfos( std::vector< SwLayoutInfo >&, SwPosition& );
|
|
|
|
long getLayoutHeight( const SwRootFrm* pRoot );
|
|
|
|
void setSidebarChanged( SwRootFrm* pRoot, bool bBrowseMode );
|
|
|
|
unsigned long getPageInfo( SwRect& rPageFrm, const SwRootFrm* , const Point& );
|
|
|
|
}
|
|
|
|
|
2010-01-12 03:43:45 -06:00
|
|
|
class SwSidebarItem
|
2008-06-16 02:14:01 -05:00
|
|
|
{
|
2009-01-02 09:51:45 -06:00
|
|
|
public:
|
2010-01-12 03:43:45 -06:00
|
|
|
sw::sidebarwindows::SwSidebarWin* pPostIt;
|
2008-06-16 02:14:01 -05:00
|
|
|
bool bShow;
|
|
|
|
bool bFocus;
|
2010-01-19 01:57:57 -06:00
|
|
|
|
2008-06-16 02:14:01 -05:00
|
|
|
SwPostItHelper::SwLayoutStatus mLayoutStatus;
|
2010-01-19 01:57:57 -06:00
|
|
|
SwLayoutInfo maLayoutInfo;
|
|
|
|
|
2010-01-12 03:43:45 -06:00
|
|
|
SwSidebarItem( const bool aShow,
|
|
|
|
const bool aFocus)
|
2010-01-19 01:57:57 -06:00
|
|
|
: pPostIt(0)
|
|
|
|
, bShow(aShow)
|
|
|
|
, bFocus(aFocus)
|
|
|
|
, mLayoutStatus( SwPostItHelper::INVISIBLE )
|
|
|
|
, maLayoutInfo()
|
2009-01-02 09:51:45 -06:00
|
|
|
{}
|
2010-01-12 03:43:45 -06:00
|
|
|
virtual ~SwSidebarItem(){}
|
2010-02-02 08:11:26 -06:00
|
|
|
virtual SwPosition GetAnchorPosition() const = 0;
|
2009-01-02 09:51:45 -06:00
|
|
|
virtual bool UseElement() = 0;
|
2010-02-02 08:11:26 -06:00
|
|
|
virtual SwFmtFld* GetFmtFld() const = 0;
|
2009-01-02 09:51:45 -06:00
|
|
|
virtual SfxBroadcaster* GetBroadCaster() const = 0;
|
2010-01-12 03:43:45 -06:00
|
|
|
virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin,
|
|
|
|
WinBits nBits,
|
|
|
|
SwPostItMgr& aMgr,
|
|
|
|
SwPostItBits aBits) = 0;
|
2009-01-02 09:51:45 -06:00
|
|
|
};
|
|
|
|
|
2010-01-12 03:43:45 -06:00
|
|
|
class SwAnnotationItem: public SwSidebarItem
|
2009-01-02 09:51:45 -06:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
SwFmtFld* pFmtFld;
|
|
|
|
|
|
|
|
public:
|
2010-01-12 03:43:45 -06:00
|
|
|
SwAnnotationItem( SwFmtFld* p,
|
|
|
|
const bool aShow,
|
|
|
|
const bool aFocus)
|
|
|
|
: SwSidebarItem( aShow, aFocus )
|
|
|
|
, pFmtFld(p)
|
|
|
|
{}
|
|
|
|
virtual ~SwAnnotationItem() {}
|
2010-02-02 08:11:26 -06:00
|
|
|
virtual SwPosition GetAnchorPosition() const;
|
2009-01-02 09:51:45 -06:00
|
|
|
virtual bool UseElement();
|
2010-02-02 08:11:26 -06:00
|
|
|
virtual SwFmtFld* GetFmtFld() const {return pFmtFld;}
|
2009-01-02 09:51:45 -06:00
|
|
|
virtual SfxBroadcaster* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster *> (pFmtFld); }
|
2010-01-12 03:43:45 -06:00
|
|
|
virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin,
|
|
|
|
WinBits nBits,
|
|
|
|
SwPostItMgr& aMgr,
|
|
|
|
SwPostItBits aBits);
|
2008-06-16 02:14:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _POSTITHELPER_HXX
|
2010-10-14 01:30:41 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|