Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / sfx2 / recentdocsviewitem.hxx
blob299778c519632b22ab8c2b734ef32cb3f6b91264
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/.
8 */
10 #ifndef INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
11 #define INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
13 #include <sfx2/thumbnailview.hxx>
15 class RecentDocsViewItem : public ThumbnailViewItem
17 public:
18 RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL,
19 const OUString &rTitle, const BitmapEx& rThumbnail, sal_uInt16 nId, long nThumbnailSize = 256);
21 /** Updates own highlight status based on the aPoint position.
23 Calls the ancestor's updateHighlight, and then takes care of m_bRemoveIconHighlighted.
25 Returns rectangle that needs to be invalidated.
27 virtual Rectangle updateHighlight(bool bVisible, const Point& rPoint) override;
29 /// Text to be used for the tooltip.
30 virtual OUString getHelpText() const override;
32 virtual void Paint(drawinglayer::processor2d::BaseProcessor2D *pProcessor,
33 const ThumbnailItemAttributes *pAttrs) override;
35 virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
37 /// Called when the user clicks a document - it will open it.
38 void OpenDocument();
40 protected:
41 /// Return area where is the icon to remove document from the recent documents.
42 Rectangle getRemoveIconArea() const;
44 private:
45 OUString maURL;
47 OUString m_sHelpText;
49 /// Is the icon that the user can click to remove the document from the recent documents highlighted?
50 bool m_bRemoveIconHighlighted;
52 BitmapEx m_aRemoveRecentBitmap;
54 BitmapEx m_aRemoveRecentBitmapHighlighted;
57 #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */