1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_SFX2_RECENTDOCSVIEW_HXX
11 #define INCLUDED_SFX2_RECENTDOCSVIEW_HXX
13 #include <sfx2/thumbnailview.hxx>
14 #include <vcl/image.hxx>
16 #include <o3tl/typed_flags_set.hxx>
18 #include <com/sun/star/util/URL.hpp>
19 #include <com/sun/star/beans/PropertyValue.hpp>
21 namespace com::sun::star::frame
{ class XDispatch
; }
28 css::util::URL aTargetURL
;
29 css::uno::Sequence
< css::beans::PropertyValue
> aArgSeq
;
30 css::uno::Reference
< css::frame::XDispatch
> xDispatch
;
31 VclPtr
< ThumbnailView
> pView
;
34 enum class ApplicationType
39 TYPE_IMPRESS
= 1 << 2,
41 TYPE_DATABASE
= 1 << 4,
50 template<> struct typed_flags
<sfx2::ApplicationType
> : is_typed_flags
<sfx2::ApplicationType
, 0x7f> {};
57 class SFX2_DLLPUBLIC RecentDocsView final
: public ThumbnailView
60 RecentDocsView( vcl::Window
* pParent
);
62 void insertItem(const OUString
&rURL
, const OUString
&rTitle
, const BitmapEx
&rThumbnail
, sal_uInt16 nId
);
64 static bool typeMatchesExtension(ApplicationType type
, const OUString
&rExt
);
65 static BitmapEx
getDefaultThumbnail(const OUString
&rURL
);
67 ApplicationType mnFileTypes
;
69 virtual void Clear() override
;
71 /// Update the information in the view.
72 virtual void Reload() override
;
74 DECL_STATIC_LINK( RecentDocsView
, ExecuteHdl_Impl
, void*, void );
77 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
79 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
81 virtual void OnItemDblClicked(ThumbnailViewItem
*pItem
) override
;
83 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
85 virtual void LoseFocus() override
;
87 bool isAcceptedFile(const OUString
&rURL
) const;
90 size_t mnLastMouseDownItem
;
92 /// Image that appears when there is no recent document.
93 Image
const maWelcomeImage
;
94 OUString
const maWelcomeLine1
;
95 OUString
const maWelcomeLine2
;
100 #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */