LibreOffice Module sw (master) 1
postithelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_INC_POSTITHELPER_HXX
20#define INCLUDED_SW_INC_POSTITHELPER_HXX
21
22#include "swrect.hxx"
23#include "fmtfld.hxx"
24#include <cstddef>
25#include <vcl/vclptr.hxx>
27#include "nodeoffset.hxx"
28
29class SfxBroadcaster;
30class SwRootFrame;
31class SwPostItMgr;
32class SwEditWin;
33class SwFrame;
35namespace sw::annotation { class SwAnnotationWin; }
36namespace sw::mark { class IMark; }
37
38struct SwPosition;
39
41{
44
45 // optional start of the annotation
47 sal_Int32 mnStartContent;
48
52
54
55 std::size_t mRedlineAuthor;
56
62
64 : mpAnchorFrame(nullptr)
65 , mPosition()
66 , mnStartNodeIdx( 0 )
67 , mnStartContent( -1 )
68 , mPageFrame()
69 , mPagePrtArea()
70 , mnPageNumber(1)
71 , meSidebarPosition(sw::sidebarwindows::SidebarPosition::NONE)
74 {}
75};
76
78{
80 {
82 };
83
85 SwLayoutInfo& o_rInfo,
86 const SwPosition& rAnchorPos,
87 const sw::mark::IMark* pAnnotationMark = nullptr );
88
90 void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode );
91 tools::ULong getPageInfo( SwRect& rPageFrame, const SwRootFrame* , const Point& );
92}
93
94class SAL_DLLPUBLIC_RTTI SwSidebarItem
95{
96public:
98 bool mbShow;
99 bool mbFocus;
101
104
105 SwSidebarItem( const bool aFocus);
106
107 virtual ~SwSidebarItem();
108
109 SwSidebarItem(SwSidebarItem const &) = default;
111 SwSidebarItem & operator =(SwSidebarItem const &) = default;
112 SwSidebarItem & operator =(SwSidebarItem &&) = default;
113
114 virtual SwPosition GetAnchorPosition() const = 0;
115 virtual bool UseElement(SwRootFrame const&, IDocumentRedlineAccess const&) = 0;
116 virtual const SwFormatField& GetFormatField() const = 0;
117 virtual const SfxBroadcaster* GetBroadcaster() const = 0;
119 SwPostItMgr& aMgr) = 0;
120};
121
122class SwAnnotationItem final : public SwSidebarItem
123{
124public:
126 SwFormatField& rFormatField,
127 const bool aFocus)
128 : SwSidebarItem( aFocus )
129 , mrFormatField( rFormatField )
130 {
131 }
132
133 virtual SwPosition GetAnchorPosition() const override;
134 virtual bool UseElement(SwRootFrame const&, IDocumentRedlineAccess const&) override;
135 virtual const SwFormatField& GetFormatField() const override
136 {
137 return mrFormatField;
138 }
139 virtual const SfxBroadcaster* GetBroadcaster() const override
140 {
141 return &mrFormatField;
142 }
144 SwEditWin& rEditWin,
145 SwPostItMgr& aMgr ) override;
146
147private:
149};
150
151#endif // INCLUDED_SW_INC_POSTITHELPER_HXX
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual VclPtr< sw::annotation::SwAnnotationWin > GetSidebarWindow(SwEditWin &rEditWin, SwPostItMgr &aMgr) override
virtual const SwFormatField & GetFormatField() const override
SwAnnotationItem(SwFormatField &rFormatField, const bool aFocus)
virtual const SfxBroadcaster * GetBroadcaster() const override
SwFormatField & mrFormatField
virtual SwPosition GetAnchorPosition() const override
virtual bool UseElement(SwRootFrame const &, IDocumentRedlineAccess const &) override
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
Base class of the Writer layout elements.
Definition: frame.hxx:315
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual bool UseElement(SwRootFrame const &, IDocumentRedlineAccess const &)=0
virtual VclPtr< sw::annotation::SwAnnotationWin > GetSidebarWindow(SwEditWin &rEditWin, SwPostItMgr &aMgr)=0
virtual SwPosition GetAnchorPosition() const =0
SwSidebarItem(SwSidebarItem const &)=default
VclPtr< sw::annotation::SwAnnotationWin > mpPostIt
SwLayoutInfo maLayoutInfo
virtual const SfxBroadcaster * GetBroadcaster() const =0
SwSidebarItem(SwSidebarItem &&)=default
SwPostItHelper::SwLayoutStatus mLayoutStatus
virtual const SwFormatField & GetFormatField() const =0
tools::Long getLayoutHeight(const SwRootFrame *pRoot)
tools::ULong getPageInfo(SwRect &rPageFrame, const SwRootFrame *, const Point &)
SwLayoutStatus getLayoutInfos(SwLayoutInfo &o_rInfo, const SwPosition &rAnchorPos, const sw::mark::IMark *pAnnotationMark=nullptr)
void setSidebarChanged(SwRootFrame *pRoot, bool bBrowseMode)
NONE
Dialog to specify the properties of date form field.
unsigned long ULong
long Long
std::size_t mRedlineAuthor
sal_Int32 mnStartContent
SwNodeOffset mnStartNodeIdx
tools::ULong mnPageNumber
sw::sidebarwindows::SidebarPosition meSidebarPosition
SwRect mPageFrame
SwRect mPosition
const SwFrame * mpAnchorFrame
bool mPositionFromCommentAnchor
If true, the overlay arrow points to the comment anchor, otherwise it points to the commented frame.
SwRect mPagePrtArea
Marks a position in the document model.
Definition: pam.hxx:37