20 #include <boost/property_tree/json_parser.hpp>
57 #include <strings.hrc>
75 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
82 #define POSTIT_INITIAL_ANCHOR_DISTANCE 20
84 #define POSTIT_SPACE_BETWEEN 8
85 #define POSTIT_MINIMUMSIZE_WITH_META 60
86 #define POSTIT_SCROLL_SIDEBAR_HEIGHT 20
89 #define MAX_LOOP_COUNT 50
98 bool comp_pos(
const std::unique_ptr<SwSidebarItem>& a,
const std::unique_ptr<SwSidebarItem>& b)
101 SwPosition aPosAnchorA = a->GetAnchorPosition();
102 SwPosition aPosAnchorB = b->GetAnchorPosition();
104 bool aAnchorAInFooter =
false;
105 bool aAnchorBInFooter =
false;
109 aAnchorAInFooter =
true;
111 aAnchorBInFooter =
true;
116 if( aAnchorAInFooter && !aAnchorBInFooter )
120 else if( !aAnchorAInFooter && aAnchorBInFooter )
127 return aPosAnchorA < aPosAnchorB;
136 boost::property_tree::ptree aAnnotation;
137 aAnnotation.put(
"action", (nType == CommentNotificationType::Add ?
"Add" :
138 (nType == CommentNotificationType::Remove ?
"Remove" :
139 (nType == CommentNotificationType::Modify ?
"Modify" :
140 (nType == CommentNotificationType::Resolve ?
"Resolve" :
"???")))));
141 aAnnotation.put(
"id", nPostItId);
142 if (nType != CommentNotificationType::Remove && pItem !=
nullptr)
150 aRect.
Pos().getX() + aRect.
SSize().Width(),
151 aRect.
Pos().getY() + aRect.
SSize().Height());
159 std::vector<OString> aRects;
162 const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeight());
163 aRects.push_back(rect.SVRect().toString());
168 aAnnotation.put(
"parent", pWin->
CalcParent());
169 aAnnotation.put(
"author", pField->
GetPar1().toUtf8().getStr());
170 aAnnotation.put(
"text", pField->
GetPar2().toUtf8().getStr());
171 aAnnotation.put(
"resolved", pField->
GetResolved() ?
"true" :
"false");
173 aAnnotation.put(
"anchorPos", aSVRect.toString());
174 aAnnotation.put(
"textRange", sRects.getStr());
177 boost::property_tree::ptree aTree;
178 aTree.add_child(
"comment", aAnnotation);
179 std::stringstream aStream;
180 boost::property_tree::write_json(aStream, aTree);
181 std::string aPayload = aStream.str();
193 , mpWrtShell(
mpView->GetDocShell()->GetWrtShell())
194 , mpEditWin(&
mpView->GetEditWin())
196 , mbWaitingForCalcRects(false)
197 , mpActivePostIt(nullptr)
204 , mbIsShowAnchor( false )
213 SW_MOD()->GetRedlineAuthor();
244 bool bRemoved =
false;
250 EndListening(const_cast<SfxBroadcaster&>(*(*it)->GetBroadcaster()));
251 std::unique_ptr<SwSidebarItem>
p = std::move(*it);
255 p->mpPostIt.disposeAndClear();
284 if ( postItField->GetBroadcaster() == pItem )
291 if (
auto pSwFormatField = dynamic_cast< SwFormatField *>( pItem ))
293 mvPostItFields.push_back(std::make_unique<SwAnnotationItem>(*pSwFormatField, bFocus));
296 OSL_ENSURE(dynamic_cast< const SwFormatField *>( pItem ) !=
nullptr,
"Mgr::InsertItem: seems like new stuff was added");
298 return pAnnotationItem;
305 [&pBroadcast](
const std::unique_ptr<SwSidebarItem>& pField) {
return pField->GetBroadcaster() == pBroadcast; });
308 std::unique_ptr<SwSidebarItem>
p = std::move(*
i);
317 p->mpPostIt.disposeAndClear();
325 if (
const SfxEventHint* pSfxEventHint = dynamic_cast<const SfxEventHint*>(&rHint) )
327 if ( pSfxEventHint->GetEventId() == SfxEventHintId::SwEventLayoutFinished )
336 else if (
const SwFormatFieldHint * pFormatHint = dynamic_cast<const SwFormatFieldHint*>(&rHint) )
339 switch ( pFormatHint->Which() )
363 OSL_FAIL(
"Inserted field not in document!" );
382 lcl_CommentNotification(
mpView, CommentNotificationType::Remove,
nullptr, pPostItField->
GetPostItId());
389 if (pFormatHint->GetView()==
mpView)
399 if ( pFormatField == postItField->GetBroadcaster() )
401 if (postItField->mpPostIt)
403 postItField->mpPostIt->SetPostItText();
411 lcl_CommentNotification(
mpView, CommentNotificationType::Modify, postItField.get(), 0);
413 lcl_CommentNotification(
mpView, CommentNotificationType::Resolve, postItField.get(), 0);
426 if ( pFormatField == postItField->GetBroadcaster() )
428 if (postItField->mpPostIt)
431 sal_uInt16 nLangWhichId = 0;
439 postItField->mpPostIt->SetLanguage(
441 postItField->GetFormatField().GetField()->GetLanguage(),
456 case SfxHintId::ModeChanged:
466 case SfxHintId::DocChanged:
478 case SfxHintId::SwSplitNodeOperation:
484 case SfxHintId::Dying:
489 OSL_FAIL(
"Notification for removed SwFormatField was not sent!");
510 if ( &rBC == postItField->GetBroadcaster() )
512 if (postItField->mpPostIt)
514 postItField->mpPostIt->GrabFocus();
520 postItField->mbFocus =
true;
536 bool bChange =
false;
537 bool bRepair =
false;
546 OSL_FAIL(
"PostIt is not in doc or other wrong use");
558 const ::sw::mark::IMark* pAnnotationMark =
559 pTextAnnotationField !=
nullptr ? pTextAnnotationField->
GetAnnotationMark() :
nullptr;
560 if ( pAnnotationMark !=
nullptr )
583 if (mvPostItFields.size()>1 )
584 std::stable_sort(mvPostItFields.begin(), mvPostItFields.end(), comp_pos);
587 for (
auto const& pItem : mvPostItFields)
607 if (aPageNum >
mPages.size())
611 for (
tools::ULong j=0; j<aPageNum - nNumberOfPages; ++j)
614 mPages[aPageNum-1]->mvSidebarItems.push_back(pItem.get());
647 if (postItField->mbShow && postItField->mpPostIt && postItField->mpPostIt->HasScrollbar())
659 if (lContainerSize < lPageSize)
661 mPages.reserve(lPageSize);
665 else if (lContainerSize > lPageSize)
667 for (
int i=
mPages.size()-1;
i >= lPageSize;--
i)
673 for (
auto const& page :
mPages)
675 page->mvSidebarItems.clear();
677 page->bScrollbar =
false;
695 bool bUpdate =
false;
696 for (std::unique_ptr<SwPostItPageItem>& pPage :
mPages)
699 if (!pPage->mvSidebarItems.empty())
701 std::vector<SwAnnotationWin*> aVisiblePostItList;
706 for (
auto const& pItem : pPage->mvSidebarItems)
718 : pPage->mPageRect.Left() + 350;
728 pPage->mPageRect.Right() - 350;
775 aVisiblePostItList.push_back(pPostIt);
785 if ((!aVisiblePostItList.empty()) &&
ShowNotes())
787 bool bOldScrollbar = pPage->bScrollbar;
789 pPage->bScrollbar =
LayoutByPage(aVisiblePostItList, pPage->mPageRect.SVRect(), lNeededHeight);
791 pPage->bScrollbar =
false;
792 if (!pPage->bScrollbar)
800 tools::Long lOffset = -1 * nScrollSize * (aVisiblePostItList.size() - aAvailableHeight / nScrollSize);
801 if (pPage->lOffset < lOffset)
802 pPage->lOffset = lOffset;
804 bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
811 for (
auto const& visiblePostIt : aVisiblePostItList)
813 if (pPage->lOffset != 0)
814 visiblePostIt->TranslateTopPosition(pPage->lOffset);
816 bool bBottom =
mpEditWin->
PixelToLogic(
Point(0,visiblePostIt->VirtualPos().Y()+visiblePostIt->VirtualSize().Height())).Y() <= (pPage->mPageRect.Bottom()-aSidebarheight);
818 if ( bBottom && bTop )
828 visiblePostIt->ShowNote();
837 visiblePostIt->ShowAnchorOnly(
Point( pPage->mPageRect.Left(),
838 pPage->mPageRect.Top()));
840 visiblePostIt->ShowAnchorOnly(
Point( pPage->mPageRect.Right(),
841 pPage->mPageRect.Top()));
846 visiblePostIt->ShowAnchorOnly(
Point(pPage->mPageRect.Left(),
847 pPage->mPageRect.Bottom()));
849 visiblePostIt->ShowAnchorOnly(
Point(pPage->mPageRect.Right(),
850 pPage->mPageRect.Bottom()));
852 OSL_ENSURE(pPage->bScrollbar,
"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true");
858 for (
auto const& visiblePostIt : aVisiblePostItList)
860 visiblePostIt->SetPosAndSize();
863 bool bOldScrollbar = pPage->bScrollbar;
864 pPage->bScrollbar =
false;
865 bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
868 for (
auto const& visiblePostIt : aVisiblePostItList)
872 if (visiblePostIt->GetSidebarItem().mbPendingLayout)
873 lcl_CommentNotification(
mpView, CommentNotificationType::Add, &visiblePostIt->GetSidebarItem(), 0);
874 else if (visiblePostIt->IsAnchorRectChanged())
876 lcl_CommentNotification(
mpView, CommentNotificationType::Modify, &visiblePostIt->GetSidebarItem(), 0);
877 visiblePostIt->ResetAnchorRectChanged();
882 visiblePostIt->GetSidebarItem().mbPendingLayout =
false;
887 if (pPage->bScrollbar)
889 pPage->bScrollbar =
false;
896 bool bRepair =
false;
901 OSL_FAIL(
"PostIt is not in doc!");
906 if (postItField->mpPostIt)
908 postItField->mpPostIt->HideNote();
909 if (postItField->mpPostIt->HasChildPathFocus())
912 postItField->mpPostIt->GrabFocusToDocument();
935 if (
mPages[aPage-1]->mvSidebarItems.empty() )
937 OSL_FAIL(
"Notes SidePane painted but no rects and page lists calculated!");
941 auto aItem =
mPages[aPage-1]->mvSidebarItems.end();
943 OSL_ENSURE ((*aItem)->mpPostIt,
"BorderOverPageBorder: NULL postIt, should never happen");
944 if ((*aItem)->mpPostIt)
948 return aEndValue <=
mPages[aPage-1]->mPageRect.Bottom()-aSidebarheight;
957 if (nPage >=
mPages.size())
959 for (
auto const& pItem :
mPages[nPage]->mvSidebarItems)
971 for (
const std::unique_ptr<SwSidebarItem>& pItem :
mvPostItFields)
979 rRenderContext.
Push(PushFlags::MAPMODE);
982 aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
987 pPostIt->
PaintTile(rRenderContext, aRectangle);
989 rRenderContext.
Pop();
997 OSL_ENSURE((lScroll %
GetScrollSize() )==0,
"SwPostItMgr::Scroll: scrolling by wrong value");
1005 for (
auto const& item :
mPages[aPage-1]->mvSidebarItems)
1016 if ( bBottom && bTop)
1039 mPages[aPage-1]->lOffset += lScroll;
1050 if (!
mPages[aPage-1]->bScrollbar)
1056 if ( !(bBottom && bTop))
1064 const tools::Long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % nScrollSize))) : (aDiff - (nScrollSize + (aDiff % nScrollSize)));
1073 std::vector<SwPostItPageItem*>::size_type
n=0;
1074 for (
auto const& page :
mPages)
1076 for (
auto const& item : page->mvSidebarItems)
1078 if (item->mpPostIt==pPostIt)
1089 if (!aNoteRect.IsEmpty())
1099 return (
mPages[aPage-1]->lOffset != 0);
1105 default:
return false;
1136 const tools::Long lVisibleHeight = lBottomBorder - lTopBorder;
1137 const size_t nPostItListSize = aVisiblePostItList.size();
1139 bool bScrollbars =
false;
1142 if (nPostItListSize > 0 && lVisibleHeight < lNeededHeight)
1151 for (
auto const& visiblePostIt : aVisiblePostItList)
1152 visiblePostIt->SetSize(
Size(visiblePostIt->VirtualSize().getWidth(),visiblePostIt->GetMinimumSizeWithMeta()));
1156 for (
auto const& visiblePostIt : aVisiblePostItList)
1158 if ( visiblePostIt->VirtualSize().getHeight() > lAverageHeight)
1159 visiblePostIt->SetSize(
Size(visiblePostIt->VirtualSize().getWidth(),lAverageHeight));
1165 if (aVisiblePostItList.size()>1)
1175 for(
auto i = aVisiblePostItList.begin();
i != aVisiblePostItList.end() ; ++
i)
1177 auto aNextPostIt =
i;
1180 if (aNextPostIt != aVisiblePostItList.end())
1182 lTranslatePos = ( (*i)->VirtualPos().Y() + (*i)->VirtualSize().Height()) - (*aNextPostIt)->VirtualPos().Y();
1183 if (lTranslatePos > 0)
1190 if ( (lSpaceUsed <= (*i)->VirtualPos().Y()) || (
i==aVisiblePostItList.begin()))
1193 if ( ((*i)->VirtualPos().Y()- lTranslatePos -
GetSpaceBetween()) > lTopBorder)
1195 if ((*aNextPostIt)->IsFollow())
1198 (*i)->TranslateTopPosition(-1*(lTranslatePos+GetSpaceBetween()));
1202 tools::Long lMoveUp = (*i)->VirtualPos().Y() - lTopBorder;
1203 (*i)->TranslateTopPosition(-1* lMoveUp);
1204 if ((*aNextPostIt)->IsFollow())
1205 (*aNextPostIt)->TranslateTopPosition( (lTranslatePos+
ANCHORLINE_WIDTH) - lMoveUp);
1207 (*aNextPostIt)->TranslateTopPosition( (lTranslatePos+GetSpaceBetween()) - lMoveUp);
1213 if ((*aNextPostIt)->IsFollow())
1216 (*aNextPostIt)->TranslateTopPosition(lTranslatePos+GetSpaceBetween());
1222 if (
i==aVisiblePostItList.begin())
1224 tools::Long lMoveDown = lTopBorder - (*i)->VirtualPos().Y();
1228 (*i)->TranslateTopPosition( lMoveDown);
1232 if ( (*aNextPostIt)->IsFollow() )
1240 auto aPrevPostIt =
i;
1242 lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)->VirtualSize().Height() ) - (*i)->VirtualPos().Y();
1243 if (lTranslatePos > 0)
1246 if ( ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height()+lTranslatePos) < lBottomBorder)
1248 if ( (*i)->IsFollow() )
1251 (*i)->TranslateTopPosition(lTranslatePos+GetSpaceBetween());
1255 (*i)->TranslateTopPosition(lBottomBorder - ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height()) );
1262 if (!bScrollbars && ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height() > lBottomBorder) )
1265 (*i)->TranslateTopPosition(lBottomBorder - ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height()));
1273 OSL_FAIL(
"PostItMgr::Layout(): We are looping forever");
1281 auto i = aVisiblePostItList.begin();
1282 lTranslatePos = lTopBorder - (*i)->VirtualPos().Y();
1283 if (lTranslatePos>0)
1287 lTranslatePos = lBottomBorder - ((*i)->VirtualPos().Y()+ (*i)->VirtualSize().Height());
1288 if (lTranslatePos<0)
1290 (*i)->TranslateTopPosition(lTranslatePos);
1301 std::vector<SwFormatField*> vFormatFields;
1303 for(
auto pFormatField : vFormatFields)
1304 InsertItem(pFormatField, bCheckExistence, bFocus);
1314 EndListening( *const_cast<SfxBroadcaster*>(postItField->GetBroadcaster()) );
1315 postItField->mpPostIt.disposeAndClear();
1316 postItField.reset();
1318 mvPostItFields.clear();
1329 virtual bool operator()(
const SwFormatField* pField)
const = 0;
1330 virtual ~FilterFunctor() {}
1333 class IsPostitField :
public FilterFunctor
1342 class IsPostitFieldWithAuthorOf :
public FilterFunctor
1346 explicit IsPostitFieldWithAuthorOf(
const OUString &rAuthor)
1347 : m_sAuthor(rAuthor)
1358 class IsPostitFieldWithPostitId :
public FilterFunctor
1360 sal_uInt32 m_nPostItId;
1362 explicit IsPostitFieldWithPostitId(sal_uInt32 nPostItId)
1363 : m_nPostItId(nPostItId)
1374 class IsFieldNotDeleted :
public FilterFunctor
1378 FilterFunctor
const& m_rNext;
1382 const FilterFunctor & rNext)
1389 if (!m_rNext(pField))
1406 std::vector<std::unique_ptr<SwSidebarItem>>& sidebarItemVector;
1407 std::vector<const SwFormatField*>
v;
1409 FilterFunctor& m_rFilter;
1417 bool bAllInvalidated =
false;
1421 bAllInvalidated = pField ==
nullptr;
1422 if (!bAllInvalidated && m_rFilter(pField))
1425 v.erase(std::remove(v.begin(), v.end(), pField), v.end());
1431 bAllInvalidated = pField ==
nullptr;
1432 if (!bAllInvalidated && m_rFilter(pField))
1435 v.push_back(pField);
1439 if (bAllInvalidated)
1446 FieldDocWatchingStack(std::vector<std::unique_ptr<SwSidebarItem>>& in,
SwDocShell &rDocShell, FilterFunctor& rFilter)
1447 : sidebarItemVector(
in)
1448 , m_rDocShell(rDocShell)
1449 , m_rFilter(rFilter)
1456 EndListeningToAllFields();
1458 v.reserve(sidebarItemVector.size());
1459 for (
auto const& p : sidebarItemVector)
1462 if (!m_rFilter(&rField))
1465 v.push_back(&rField);
1468 void EndListeningToAllFields()
1470 for (
auto const& pField : v)
1475 virtual ~FieldDocWatchingStack()
override
1477 EndListeningToAllFields();
1507 IsPostitFieldWithAuthorOf aFilter(rAuthor);
1509 IsFieldNotDeleted aFilter2(rIDRA, aFilter);
1536 IsPostitFieldWithPostitId aFilter(nPostItId);
1538 IsFieldNotDeleted aFilter2(rIDRA, aFilter);
1560 IsPostitFieldWithPostitId aFilter(nPostItId);
1584 IsPostitFieldWithPostitId aFilter(nPostItId);
1609 IsPostitFieldWithPostitId aFilter(nPostItId);
1634 IsPostitField aFilter;
1636 IsFieldNotDeleted aFilter2(rIDRA, aFilter);
1663 pWin = postItField->mpPostIt;
1675 aDlgAttr.Put(aEditAttr);
1678 sal_uInt16 nRet = pDlg->Execute();
1697 if (!postItField->mpPostIt)
1699 OutlinerView* pOLV = postItField->mpPostIt->GetOutlinerView();
1715 postItField->mpPostIt->UpdateData();
1730 if ( postItField->mpPostIt && (postItField->mpPostIt->GetAuthor() == rAuthor) )
1732 postItField->mbShow =
false;
1733 postItField->mpPostIt->HideNote();
1744 postItField->mbShow =
false;
1745 postItField->mpPostIt->HideNote();
1753 postItField->mbShow =
true;
1762 if ( postItField->GetBroadcaster() == pBroadcaster)
1763 return postItField->mpPostIt;
1772 if ( postItField->GetFormatField().GetField() == pField )
1773 return postItField->mpPostIt.get();
1782 if ( static_cast<const SwPostItField*>(postItField->GetFormatField().GetField())->GetPostItId() == nPostItId )
1783 return postItField->mpPostIt.get();
1794 [&aPostIt](
const std::unique_ptr<SwSidebarItem>& pField) {
return pField->mpPostIt == aPostIt; });
1798 auto iNextPostIt =
i;
1816 if ( (*iNextPostIt)->mpPostIt == aPostIt)
1818 return (*iNextPostIt)->mpPostIt;
1826 for (
auto const& pPage :
mPages)
1828 for(
auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
1834 bool bFollow = (aNext != pPage->mvSidebarItems.end()) && (*aNext)->mpPostIt->IsFollow();
1835 if ( pPage->bScrollbar || bFollow )
1842 if (aNext == pPage->mvSidebarItems.end())
1851 OSL_FAIL(
"SwPostItMgr::GetNextBorder(): We have to find a next border here");
1923 if (
mPages.size() > aPage-1)
1940 OSL_ENSURE(
mPages.size()>nPageNum-1,
"SwPostitMgr:: page container size wrong");
1944 if (aRect.IsInside(aPoint))
1948 if (
mPages[nPageNum-1]->bScrollbar)
1968 for (
const std::unique_ptr<SwSidebarItem>& pItem :
mvPostItFields)
2023 if (aRectBottom.IsInside(aPoint))
2031 else if (aRectTop.
IsInside(aPoint))
2051 pFirstPostIt = postItField->mpPostIt;
2073 for (
const std::unique_ptr<SwPostItPageItem>& pPage :
mPages)
2075 for (
auto const& item : pPage->mvSidebarItems)
2078 if ( item->mbShow && item->mpPostIt && item->mpPostIt->Anchor() )
2083 aAnchorPosY =
mpEditWin->
LogicToPixel(
Point(0,static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSixthPosition().getY()))).
Y() + 1;
2084 item->mpPostIt->SetPosPixel(
Point(aAnchorPosX,aAnchorPosY));
2109 nZoom = fScaleX * 100;
2139 static const Color aArrayNormal[] = {
2144 return aArrayNormal[ aAuthorIndex %
SAL_N_ELEMENTS( aArrayNormal )];
2154 static const Color aArrayLight[] = {
2159 return aArrayLight[ aAuthorIndex %
SAL_N_ELEMENTS( aArrayLight )];
2169 static const Color aArrayAnchor[] = {
2174 return aArrayAnchor[ aAuthorIndex %
SAL_N_ELEMENTS( aArrayAnchor )];
2198 mpView->AttrChangedNotify(
nullptr);
2208 OSL_FAIL(
"Reentrance problem in Layout Manager!");
2209 mbWaitingForCalcRects =
false;
2214 if (CalcRects() || mbLayout)
2224 if ( postItField->mpPostIt )
2225 postItField->mpPostIt->Rescale();
2261 if ( postItField->mpPostIt )
2262 postItField->mpPostIt->SetSpellChecking();
2268 if ( postItField->mpPostIt )
2269 postItField->mpPostIt->SetReadonly(
mbReadOnly );
2275 if ( postItField->mpPostIt )
2276 postItField->mpPostIt->CheckMetaText();
2303 sal_uInt16 aResult = 0;
2447 const sal_Int32 nIndex )
2460 std::vector< vcl::Window* >* pChildren )
2469 for (
auto const& pPage :
mPages)
2471 for(
auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
2473 if ((*b)->mpPostIt->IsResolved())
2475 (*b)->mpPostIt->SetResolved(
true);
2476 (*b)->mpPostIt->GetSidebarItem().mbShow = visible;
2488 for (
auto const& pPage :
mPages)
2490 for(
auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
2492 if((*b)->mpPostIt->GetTopReplyNote() == topNote) {
2493 (*b)->mpPostIt->SetResolved(resolved);
virtual Point GetPosPixel() const
vcl::RenderContext * GetOut() const
SfxViewFrame * GetViewFrame() const
#define LINK(Instance, Class, Member)
const Fraction & GetScaleX() const
Instances of SwFields and those derived from it occur 0 to n times.
sal_Int32 GetMetaHeight() const
bool IsHit(const Point &aPointPixel)
Base class of the Writer layout elements.
bool mbWaitingForCalcRects
void CheckForRemovedPostIts()
void Right(const tools::Long nRight)
Marks a position in the document model.
vcl::Window * GetSidebarWinForFrameByIndex(const SwFrame &rFrame, const sal_Int32 nIndex)
void SetViewState(::sw::sidebarwindows::ViewState bViewState)
void HideActiveSidebarWin()
virtual void DrawSelChanged() override
void FormatAll(const SfxItemSet &rNewAttr)
constexpr::Color COL_AUTHOR9_LIGHT(255, 231, 199)
const SwStartNode * FindFooterStartNode() const
virtual ~SwPostItMgr() override
OUString toISO8601(const css::util::DateTime &rDateTime)
const SwRect & GetAnchorRect() const
constexpr::Color COL_AUTHOR6_LIGHT(230, 250, 250)
virtual const SfxItemSet * GetOutputItemSet() const =0
sal_Int32 GetInitialAnchorDistance() const
constexpr::Color COL_AUTHOR3_NORMAL(218, 248, 193)
#define POSTIT_INITIAL_ANCHOR_DISTANCE
void CollectPostIts(std::vector< SwFormatField * > &rvFormatFields, IDocumentRedlineAccess const &rIDRA, bool HideRedlines)
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
bool isTiledAnnotations()
void Left(const tools::Long nLeft)
IMPL_LINK_NOARG(SwPostItMgr, CalcHdl, void *, void)
bool HasScrollbars() const
sal_Int32 StartSearchAndReplace(const SvxSearchItem &rSearchItem)
void SetSearchOptions(const i18nutil::SearchOptions2 &rOpt)
constexpr::Color COL_AUTHOR6_NORMAL(210, 246, 246)
static const AllSettings & GetSettings()
std::size_t mRedlineAuthor
bool IsMapModeEnabled() const
virtual Size GetSizePixel() const
tools::ULong getPageInfo(SwRect &rPageFrame, const SwRootFrame *, const Point &)
constexpr::Color COL_AUTHOR2_LIGHT(233, 242, 255)
sal_Int32 GetMinimumSizeWithoutMeta() const
constexpr::Color COL_AUTHOR4_DARK(105, 43, 157)
#define POSTIT_MINIMUMSIZE_WITH_META
sw::annotation::SwAnnotationWin * GetSidebarWin(const SfxBroadcaster *pBroadcaster) const
VclPtr< sw::annotation::SwAnnotationWin > mpActivePostIt
constexpr::Color COL_AUTHOR8_NORMAL(211, 222, 232)
virtual OUString GetPar1() const override
Author.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
const MapMode & GetMapMode() const
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
void SetActiveSidebarWin(sw::annotation::SwAnnotationWin *p)
vcl::Window * IsHitSidebarWindow(const Point &rPointLogic)
Get the matching window that is responsible for handling mouse events of rPointLogic, if any.
sal_Int32 GetParagraphCount() const
tools::Long getLayoutHeight(const SwRootFrame *pRoot)
void Pos(const Point &rNew)
bool mPositionFromCommentAnchor
If true, the overlay arrow points to the comment anchor, otherwise it points to the commented frame...
static Color GetColorAnchor(std::size_t aAuthorIndex)
bool HasActiveAnnotationWin() const
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
SwSidebarItem * InsertItem(SfxBroadcaster *pItem, bool bCheckExistence, bool bFocus)
void EnableMapMode(bool bEnable=true)
Of course Writer needs its own rectangles.
bool IsHitWindow(const Point &rPointLogic)
Is there a matching sub-widget inside this sidebar widget for rPointLogic?
void setTiledPainting(bool bTiledPainting)
constexpr::Color COL_AUTHOR2_NORMAL(216, 232, 255)
void ToggleResolvedForThread()
The root element of a Writer document layout.
constexpr::Color COL_AUTHOR7_NORMAL(237, 252, 163)
bool LayoutByPage(std::vector< sw::annotation::SwAnnotationWin * > &aVisiblePostItList, const tools::Rectangle &rBorder, tools::Long lNeededHeight)
SwWrtShell & GetWrtShell() const
const SwPostItField * GetPostItField() const
tools::Long GetPostItTextHeight()
void ShowHideResolvedNotes(bool visible)
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void PaintTile(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
void InvalidatePosOrSize(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, const SwRect &rOldFrame)
std::unique_ptr< sw::sidebarwindows::SwFrameSidebarWinContainer > mpFrameSidebarWinContainer
#define COL_NOTES_SIDEPANE_ARROW_DISABLED
void SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSidebarPosition)
const SwView & GetView() const
constexpr::Color COL_AUTHOR8_LIGHT(226, 234, 241)
void DisconnectSidebarWinFromFrame(const SwFrame &rFrame, sw::annotation::SwAnnotationWin &rSidebarWin)
SwAccessibleMap * GetAccessibleMap()
constexpr::Color COL_AUTHOR4_NORMAL(228, 210, 245)
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const Fraction & GetScaleY() const
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
void DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage)
SW_DLLPUBLIC void UpdateDataOnActiveSidebarWin()
constexpr::Color COL_AUTHOR7_LIGHT(242, 254, 181)
void SelectRange(sal_Int32 nFirst, sal_Int32 nCount)
constexpr sal_uInt16 KEY_PAGEUP
static Color GetColorDark(std::size_t aAuthorIndex)
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr::Color COL_AUTHOR6_DARK(0, 128, 128)
void ExecViewOptions(SfxRequest &)
constexpr::Color COL_AUTHOR8_DARK(53, 85, 107)
constexpr::Color COL_AUTHOR2_DARK(6, 70, 162)
static SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
constexpr::Color COL_AUTHOR1_LIGHT(255, 255, 195)
void PrepareView(bool bIgnoreCount=false)
OutlinerParaObject * mpAnswer
#define POSTIT_SPACE_BETWEEN
void MakeVisible(const SwRect &)
void PaintTile(OutputDevice &rRenderContext)
void SetBackward(bool bNewBackward)
void GetAllSidebarWinForFrame(const SwFrame &rFrame, std::vector< vcl::Window * > *pChildren)
#define SAL_N_ELEMENTS(arr)
sal_Int32 GetSpaceBetween() const
css::util::DateTime GetUNODateTime() const
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
SwDoc * GetDoc()
returns Doc. But be careful!
void ConnectSidebarWinToFrame(const SwFrame &rFrame, const SwFormatField &rFormatField, sw::annotation::SwAnnotationWin &rSidebarWin)
sal_uInt32 GetPostItId() const
#define POSTIT_SCROLL_SIDEBAR_HEIGHT
const DateTime & GetDateTime() const
void DeleteCommentThread(sal_uInt32 nPostItId)
void ToggleResolved(sal_uInt32 nPostItId)
constexpr::Color COL_AUTHOR1_NORMAL(255, 255, 158)
void SetAttribs(const SfxItemSet &)
::sw::mark::IMark * GetAnnotationMark() const
void InitAnswer(OutlinerParaObject const *pText)
void DeleteActiveSidebarWin()
void Scroll(const tools::Long lScroll, const tools::ULong aPage)
sal_uInt16 SearchReplace(const SwFormatField &pField, const i18nutil::SearchOptions2 &rSearchOptions, bool bSrchForward)
FieldShadowState mShadowState
bool BorderOverPageBorder(tools::ULong aPage) const
void Focus(SfxBroadcaster &rBC)
constexpr::Color COL_AUTHOR9_DARK(209, 118, 0)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void AddPostIts(bool bCheckExistence=true, bool bFocus=true)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
void MakeVisible(const sw::annotation::SwAnnotationWin *pPostIt)
void AddRule(SwUndoArg eWhat, const OUString &rWith)
void AutoScroll(const sw::annotation::SwAnnotationWin *pPostIt, const tools::ULong aPage)
constexpr sal_uInt16 KEY_PAGEDOWN
void SetVirtualPosSize(const Point &aPoint, const Size &aSize)
Outliner * GetOutliner() const
static SwAbstractDialogFactory * Create()
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
const sal_Int16 mnEventId
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
OUString SwResId(const char *pId)
constexpr::Color COL_AUTHOR4_LIGHT(239, 228, 248)
void SSize(const Size &rNew)
tools::ULong GetSidebarWidth(bool bPx=false) const
VclPtr< SwEditWin > mpEditWin
tools::ULong mnPageNumber
constexpr::Color COL_AUTHOR3_LIGHT(226, 250, 207)
sal_uInt32 CalcParent()
Calculate parent postit id of current annotation window.
SwDocShell * GetDocShell()
const SwPostItField * mpShadowField
bool HasFrameConnectedSidebarWins(const SwFrame &rFrame)
SwFieldType * GetTyp() const
::sw::sidebarwindows::AnchorOverlayObject * Anchor()
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
bool ScrollbarHit(const tools::ULong aPage, const Point &aPoint)
void PreparePageContainer()
ESelection GetSelection() const
void ExecuteFormatAllDialog(SwView &rView)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr::Color COL_AUTHOR1_DARK(198, 146, 0)
void A11yDispose(const SwFrame *pFrame, const SdrObject *pObj, vcl::Window *pWindow, bool bRecursive=false, bool bCanSkipInvisible=true)
void DrawForPage(OutputDevice *pDev, const Point &rPos)
void SetFollow(bool bIsFollow)
void ChangeSidebarItem(SwSidebarItem const &rSidebarItem)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
void TranslateTopPosition(const tools::Long aAmount)
sal_uInt16 GetNumPages() const
void Bottom(const tools::Long nBottom)
void AssureStdModeAtShell()
void ShowAnchorOnly(const Point &aPoint)
void GrabFocusOnActiveSidebarWin()
void SetSelection(const ESelection &)
sal_uInt16 Replace(SvxSearchItem const *pItem)
void ToggleInsModeOnActiveSidebarWin()
bool GotoField(const SwFormatField &rField)
virtual bool IsTextEdit() const final override
weld::Window * GetFrameWeld() const
sal_Int32 GetSidebarScrollerHeight() const
static Color GetColorLight(std::size_t aAuthorIndex)
const std::vector< basegfx::B2DRange > & GetAnnotationTextRanges() const
virtual void ImplCommit() override
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
sal_Int32 GetScrollSize() const
constexpr tools::Long Height() const
sw::sidebarwindows::SidebarPosition meSidebarPosition
const SwViewOption * GetViewOptions() const
#define COL_NOTES_SIDEPANE_ARROW_ENABLED
constexpr::Color COL_AUTHOR5_DARK(197, 0, 11)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
bool ArrowEnabled(sal_uInt16 aDirection, tools::ULong aPage) const
bool ShowScrollbar(const tools::ULong aPage) const
void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void SetChangeTracking(const SwPostItHelper::SwLayoutStatus aStatus, const Color &aColor)
void UpdateResolvedStatus(const sw::annotation::SwAnnotationWin *topNote)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
sal_Int32 GetMinimumSizeWithMeta() const
void Top(const tools::Long nTop)
constexpr::Color COL_AUTHOR9_NORMAL(255, 226, 185)
sal_uInt16 GetZoom() const
void EndTextEdit()
Deletes object if required.
size_t IsObjSelected() const
constexpr::Color COL_AUTHOR7_DARK(140, 132, 0)
#define EE_TEXTPOS_MAX_COUNT
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
void setSidebarChanged(SwRootFrame *pRoot, bool bBrowseMode)
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
sw::annotation::SwAnnotationWin * GetActiveSidebarWin()
OutlinerView * GetOutlinerView()
std::vector< std::unique_ptr< SwPostItPageItem > > mPages
tools::Rectangle GetTopScrollRect(const tools::ULong aPage) const
sw::annotation::SwAnnotationWin * GetNextPostIt(sal_uInt16 aDirection, sw::annotation::SwAnnotationWin *aPostIt)
tools::Long mbLayoutHeight
SwPostItMgr(SwView *aDoc)
reference_type * get() const
virtual OUString GetPar2() const override
Text.
void SetReadonly(bool bSet)
void SetPosSizePixelRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const SwRect &aAnchorRect, const tools::Long PageBorder)
Color GetArrowColor(sal_uInt16 aDirection, tools::ULong aPage) const
void(* f)(TrueTypeTable *)
tools::Long GetNextBorder()
constexpr::Color COL_AUTHOR5_LIGHT(255, 227, 229)
bool IsShowAnchor() const
bool IsShowHiddenChar(bool bHard=false) const
::sw::sidebarwindows::ShadowOverlayObject * Shadow()
virtual SdrView * GetDrawView() const override
virtual VclPtr< SfxAbstractTabDialog > CreateSwCharDlg(weld::Window *pParent, SwView &pVw, const SfxItemSet &rCoreSet, SwCharDlgMode nDialogMode, const OUString *pFormatStr=nullptr)=0
#define EE_PARA_MAX_COUNT
void SetShadowState(const SwPostItField *pField, bool bCursor=true)
void StartAllAction()
For all views of this document.
constexpr::Color COL_AUTHOR3_DARK(87, 157, 28)
SwRootFrame * GetLayout() const
void Push(PushFlags nFlags=PushFlags::ALL)
static SfxItemPool * GetAnnotationPool(SwView const &rV)
SwLayoutStatus getLayoutInfos(SwLayoutInfo &o_rInfo, const SwPosition &rAnchorPos, const sw::mark::IMark *pAnnotationMark=nullptr)
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
void Height(tools::Long nNew)
void ToggleResolvedForThread(sal_uInt32 nPostItId)
constexpr::Color COL_AUTHOR5_NORMAL(254, 205, 208)
std::vector< std::unique_ptr< SwSidebarItem > > mvPostItFields
sw::annotation::SwAnnotationWin * GetAnnotationWin(const SwPostItField *pField) const
const SwStartNode * FindFootnoteStartNode() const
bool IsViewLocked() const
void RemoveItem(SfxBroadcaster *pBroadcast)
sal_uInt16 FinishSearchReplace(const i18nutil::SearchOptions2 &rSearchOptions, bool bSrchForward)
bool IsSelFrameMode() const
tools::Rectangle GetBottomScrollRect(const tools::ULong aPage) const