1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _POSTITHELPER_HXX
20 #define _POSTITHELPER_HXX
24 #include <redline.hxx>
26 #include <vcl/window.hxx>
27 #include <SidebarWindowsTypes.hxx>
28 #include <svl/brdcst.hxx>
35 namespace sw
{ namespace sidebarwindows
{
41 typedef sal_Int64 SwPostItBits
;
45 const SwFrm
* mpAnchorFrm
;
49 unsigned long mnPageNumber
;
50 sw::sidebarwindows::SidebarPosition meSidebarPosition
;
51 sal_uInt16 mRedlineAuthor
;
59 , meSidebarPosition(sw::sidebarwindows::SIDEBAR_NONE
)
64 namespace SwPostItHelper
68 INVISIBLE
, VISIBLE
, INSERTED
, DELETED
, NONE
, HIDDEN
71 SwLayoutStatus
getLayoutInfos( std::vector
< SwLayoutInfo
>&, SwPosition
& );
72 long getLayoutHeight( const SwRootFrm
* pRoot
);
73 void setSidebarChanged( SwRootFrm
* pRoot
, bool bBrowseMode
);
74 unsigned long getPageInfo( SwRect
& rPageFrm
, const SwRootFrm
* , const Point
& );
80 sw::sidebarwindows::SwSidebarWin
* pPostIt
;
84 SwPostItHelper::SwLayoutStatus mLayoutStatus
;
85 SwLayoutInfo maLayoutInfo
;
87 SwSidebarItem( const bool aShow
,
92 , mLayoutStatus( SwPostItHelper::INVISIBLE
)
95 virtual ~SwSidebarItem(){}
96 virtual SwPosition
GetAnchorPosition() const = 0;
97 virtual bool UseElement() = 0;
98 virtual SwFmtFld
* GetFmtFld() const = 0;
99 virtual SfxBroadcaster
* GetBroadCaster() const = 0;
100 virtual sw::sidebarwindows::SwSidebarWin
* GetSidebarWindow( SwEditWin
& rEditWin
,
103 SwPostItBits aBits
) = 0;
106 class SwAnnotationItem
: public SwSidebarItem
112 SwAnnotationItem( SwFmtFld
* p
,
115 : SwSidebarItem( aShow
, aFocus
)
118 virtual ~SwAnnotationItem() {}
119 virtual SwPosition
GetAnchorPosition() const;
120 virtual bool UseElement();
121 virtual SwFmtFld
* GetFmtFld() const {return pFmtFld
;}
122 virtual SfxBroadcaster
* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster
*> (pFmtFld
); }
123 virtual sw::sidebarwindows::SwSidebarWin
* GetSidebarWindow( SwEditWin
& rEditWin
,
129 #endif // _POSTITHELPER_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */