/src/libreoffice/sfx2/source/control/recentdocsviewitem.hxx
Line | Count | Source |
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 | | |
10 | | #ifndef INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX |
11 | | #define INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX |
12 | | |
13 | | #include <sfx2/thumbnailviewitem.hxx> |
14 | | |
15 | | namespace sfx2 |
16 | | { |
17 | | class RecentDocsView; |
18 | | } |
19 | | |
20 | | class RecentDocsViewItem final : public ThumbnailViewItem |
21 | | { |
22 | | public: |
23 | | RecentDocsViewItem(sfx2::RecentDocsView& rView, const OUString& rURL, const OUString& rTitle, |
24 | | std::u16string_view sThumbnailBase64, sal_uInt16 nId, |
25 | | tools::Long nThumbnailSize, bool isReadOnly, bool isPinned); |
26 | | |
27 | | /** Updates own highlight status based on the aPoint position. |
28 | | |
29 | | Calls the ancestor's updateHighlight, and then takes care of m_bRemoveIconHighlighted. |
30 | | |
31 | | Returns rectangle that needs to be invalidated. |
32 | | */ |
33 | | virtual tools::Rectangle updateHighlight(bool bVisible, const Point& rPoint) override; |
34 | | |
35 | | /// Text to be used for the tooltip. |
36 | | virtual OUString getHelpText() const override; |
37 | | |
38 | | virtual void Paint(drawinglayer::processor2d::BaseProcessor2D *pProcessor, |
39 | | const ThumbnailItemAttributes *pAttrs) override; |
40 | | |
41 | | virtual void MouseButtonUp(const MouseEvent& rMEvt) override; |
42 | | |
43 | | /// Called when the user clicks a document - it will open it. |
44 | | void OpenDocument(); |
45 | | |
46 | 0 | bool isPinned () const { return m_bPinned; } |
47 | | |
48 | | private: |
49 | | sfx2::RecentDocsView& mrParentView; |
50 | | |
51 | | /// Return area where is the icon to remove document from the recent documents. |
52 | | tools::Rectangle getRemoveIconArea() const; |
53 | | tools::Rectangle getPinnedIconArea() const; |
54 | | |
55 | | OUString maURL; |
56 | | |
57 | | bool m_isReadOnly = false; |
58 | | |
59 | | OUString m_sHelpText; |
60 | | |
61 | | /// Is the icon that the user can click to remove the document from the recent documents highlighted? |
62 | | bool m_bRemoveIconHighlighted; |
63 | | |
64 | | Bitmap m_aRemoveRecentBitmap; |
65 | | |
66 | | Bitmap m_aRemoveRecentBitmapHighlighted; |
67 | | |
68 | | bool m_bPinned; |
69 | | bool m_bPinnedIconHighlighted; |
70 | | Bitmap m_aPinnedDocumentBitmap; |
71 | | Bitmap m_aPinnedDocumentBitmapHighlighted; |
72 | | }; |
73 | | |
74 | | #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX |
75 | | |
76 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |