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 INCLUDED_SW_INC_POSTITHELPER_HXX
20 #define INCLUDED_SW_INC_POSTITHELPER_HXX
24 #include <redline.hxx>
26 #include <vcl/window.hxx>
27 #include <SidebarWindowsTypes.hxx>
34 namespace sw
{ namespace sidebarwindows
{
40 typedef sal_Int64 SwPostItBits
;
44 const SwFrm
* mpAnchorFrm
;
47 // optional start of the annotation
48 sal_uLong mnStartNodeIdx
;
49 sal_Int32 mnStartContent
;
53 unsigned long mnPageNumber
;
55 sw::sidebarwindows::SidebarPosition meSidebarPosition
;
57 sal_uInt16 mRedlineAuthor
;
63 , mnStartContent( -1 )
67 , meSidebarPosition(sw::sidebarwindows::SidebarPosition::NONE
)
72 namespace SwPostItHelper
76 INVISIBLE
, VISIBLE
, INSERTED
, DELETED
, NONE
, HIDDEN
79 SwLayoutStatus
getLayoutInfos(
80 SwLayoutInfo
& o_rInfo
,
81 const SwPosition
& rAnchorPos
,
82 const SwPosition
* pAnnotationStartPos
= NULL
);
84 long getLayoutHeight( const SwRootFrm
* pRoot
);
85 void setSidebarChanged( SwRootFrm
* pRoot
, bool bBrowseMode
);
86 unsigned long getPageInfo( SwRect
& rPageFrm
, const SwRootFrm
* , const Point
& );
92 VclPtr
<sw::sidebarwindows::SwSidebarWin
> pPostIt
;
96 SwPostItHelper::SwLayoutStatus mLayoutStatus
;
97 SwLayoutInfo maLayoutInfo
;
99 SwSidebarItem( const bool aShow
,
104 , mLayoutStatus( SwPostItHelper::INVISIBLE
)
109 virtual ~SwSidebarItem()
113 virtual SwPosition
GetAnchorPosition() const = 0;
114 virtual bool UseElement() = 0;
115 virtual const SwFormatField
& GetFormatField() const = 0;
116 virtual const SfxBroadcaster
* GetBroadCaster() const = 0;
117 virtual VclPtr
<sw::sidebarwindows::SwSidebarWin
> GetSidebarWindow( SwEditWin
& rEditWin
,
120 SwPostItBits aBits
) = 0;
123 class SwAnnotationItem
: public SwSidebarItem
127 SwFormatField
& rFormatField
,
130 : SwSidebarItem( aShow
, aFocus
)
131 , mrFormatField( rFormatField
)
135 virtual ~SwAnnotationItem()
139 virtual SwPosition
GetAnchorPosition() const SAL_OVERRIDE
;
140 virtual bool UseElement() SAL_OVERRIDE
;
141 virtual const SwFormatField
& GetFormatField() const SAL_OVERRIDE
143 return mrFormatField
;
145 virtual const SfxBroadcaster
* GetBroadCaster() const SAL_OVERRIDE
147 return dynamic_cast<const SfxBroadcaster
*> (&mrFormatField
);
149 virtual VclPtr
<sw::sidebarwindows::SwSidebarWin
> GetSidebarWindow(
153 SwPostItBits aBits
) SAL_OVERRIDE
;
156 SwFormatField
& mrFormatField
;
159 #endif // INCLUDED_SW_INC_POSTITHELPER_HXX
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */