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;
118 virtual const SfxBroadcaster* GetBroadcaster() const = 0;
120 SwPostItMgr& aMgr) = 0;
121};
122
123class SwAnnotationItem final : public SwSidebarItem
124{
125public:
127 SwFormatField& rFormatField,
128 const bool aFocus)
129 : SwSidebarItem( aFocus )
130 , mrFormatField( rFormatField )
131 {
132 }
133
134 virtual SwPosition GetAnchorPosition() const override;
135 virtual bool UseElement(SwRootFrame const&, IDocumentRedlineAccess const&) override;
136 virtual const SwFormatField& GetFormatField() const override
137 {
138 return mrFormatField;
139 }
141 {
142 return mrFormatField;
143 }
144 virtual const SfxBroadcaster* GetBroadcaster() const override
145 {
146 return &mrFormatField;
147 }
149 SwEditWin& rEditWin,
150 SwPostItMgr& aMgr ) override;
151
152private:
154};
155
156#endif // INCLUDED_SW_INC_POSTITHELPER_HXX
157
158/* 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)
SwFormatField & GetFormatField() override
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:85
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
virtual SwFormatField & GetFormatField()=0
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:38