bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / postithelper.hxx
blob2a304d50278837fcaf87d9f6894ba5300b7bddf4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include <swrect.hxx>
23 #include <fmtfld.hxx>
24 #include <redline.hxx>
25 #include <vector>
26 #include <vcl/window.hxx>
27 #include <SidebarWindowsTypes.hxx>
28 #include <svl/brdcst.hxx>
30 class SwTxtFld;
31 class SwRootFrm;
32 class String;
33 class SwPostItMgr;
34 class SwEditWin;
35 namespace sw { namespace sidebarwindows {
36 class SwSidebarWin;
37 } }
39 struct SwPosition;
41 typedef sal_Int64 SwPostItBits;
43 struct SwLayoutInfo
45 const SwFrm* mpAnchorFrm;
46 SwRect mPosition;
47 SwRect mPageFrame;
48 SwRect mPagePrtArea;
49 unsigned long mnPageNumber;
50 sw::sidebarwindows::SidebarPosition meSidebarPosition;
51 sal_uInt16 mRedlineAuthor;
53 SwLayoutInfo()
54 : mpAnchorFrm(0)
55 , mPosition()
56 , mPageFrame()
57 , mPagePrtArea()
58 , mnPageNumber(1)
59 , meSidebarPosition(sw::sidebarwindows::SIDEBAR_NONE)
60 , mRedlineAuthor(0)
64 namespace SwPostItHelper
66 enum SwLayoutStatus
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& );
77 class SwSidebarItem
79 public:
80 sw::sidebarwindows::SwSidebarWin* pPostIt;
81 bool bShow;
82 bool bFocus;
84 SwPostItHelper::SwLayoutStatus mLayoutStatus;
85 SwLayoutInfo maLayoutInfo;
87 SwSidebarItem( const bool aShow,
88 const bool aFocus)
89 : pPostIt(0)
90 , bShow(aShow)
91 , bFocus(aFocus)
92 , mLayoutStatus( SwPostItHelper::INVISIBLE )
93 , maLayoutInfo()
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,
101 WinBits nBits,
102 SwPostItMgr& aMgr,
103 SwPostItBits aBits) = 0;
106 class SwAnnotationItem: public SwSidebarItem
108 private:
109 SwFmtFld* pFmtFld;
111 public:
112 SwAnnotationItem( SwFmtFld* p,
113 const bool aShow,
114 const bool aFocus)
115 : SwSidebarItem( aShow, aFocus )
116 , pFmtFld(p)
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,
124 WinBits nBits,
125 SwPostItMgr& aMgr,
126 SwPostItBits aBits);
129 #endif // _POSTITHELPER_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */