1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: postithelper.hxx,v $
10 * $Revision: 1.2.118.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _POSTITHELPER_HXX
31 #define _POSTITHELPER_HXX
35 #include <redline.hxx>
37 #include <vcl/window.hxx>
38 #include <svtools/brdcst.hxx>
49 typedef sal_Int64 SwPostItBits
;
56 unsigned long mnPageNumber
;
58 USHORT mRedlineAuthor
;
61 namespace SwPostItHelper
65 INVISIBLE
, VISIBLE
, INSERTED
, DELETED
, NONE
, HIDDEN
68 SwLayoutStatus
getLayoutInfos( std::vector
< SwLayoutInfo
>&, SwPosition
& );
69 SwLayoutStatus
getLayoutInfos( std::vector
< SwLayoutInfo
>&, SwTxtFld
* );
70 long getLayoutHeight( const SwRootFrm
* pRoot
);
71 void setSidebarChanged( SwRootFrm
* pRoot
, bool bBrowseMode
);
72 unsigned long getPageInfo( SwRect
& rPageFrm
, const SwRootFrm
* , const Point
& );
85 unsigned long mnPageNumber
;
86 SwPostItHelper::SwLayoutStatus mLayoutStatus
;
87 USHORT mRedlineAuthor
;
88 SwMarginItem(bool aShow
, bool aFocus
)
94 mLayoutStatus( SwPostItHelper::INVISIBLE
),
97 virtual ~SwMarginItem(){}
98 virtual SwPosition
GetPosition() = 0;
99 virtual bool UseElement() = 0;
100 virtual SwFmtFld
* GetFmtFld() = 0;
101 virtual SfxBroadcaster
* GetBroadCaster() const = 0;
102 virtual SwMarginWin
* GetMarginWindow(Window
* pParent
, WinBits nBits
,SwPostItMgr
* aMgr
,SwPostItBits aBits
) = 0;
105 class SwRedCommentItem: public SwMarginItem
111 SwRedCommentItem( SwRedline* pRed, bool aShow, bool aFocus)
112 : SwMarginItem(aShow,aFocus),
114 virtual ~SwRedCommentItem() {}
115 virtual SwPosition GetPosition();
116 virtual bool UseElement();
117 virtual SwFmtFld* GetFmtFld() {return 0; }
118 virtual SfxBroadcaster* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster *> (pRedline); }
119 virtual SwMarginWin* GetMarginWindow(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits);
123 class SwPostItItem
: public SwMarginItem
129 SwPostItItem( SwFmtFld
* p
, bool aShow
, bool aFocus
)
130 : SwMarginItem(aShow
,aFocus
) ,
134 virtual ~SwPostItItem() {}
135 virtual SwPosition
GetPosition();
136 virtual bool UseElement();
137 virtual SwFmtFld
* GetFmtFld() {return pFmtFld
;}
138 virtual SfxBroadcaster
* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster
*> (pFmtFld
); }
139 virtual SwMarginWin
* GetMarginWindow(Window
* pParent
, WinBits nBits
,SwPostItMgr
* aMgr
,SwPostItBits aBits
);
142 #endif // _POSTITHELPER_HXX