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 <sfx2/recentdocsviewitem.hxx>
15 #include <vcl/image.hxx>
17 #include <com/sun/star/frame/XFrame.hpp>
18 #include <com/sun/star/frame/XDispatchProvider.hpp>
19 #include <com/sun/star/frame/XDispatch.hpp>
23 css::util::URL aTargetURL
;
24 css::uno::Sequence
< css::beans::PropertyValue
> aArgSeq
;
25 css::uno::Reference
< css::frame::XDispatch
> xDispatch
;
26 VclPtr
< ThumbnailView
> pView
;
34 TYPE_IMPRESS
= 1 << 2,
36 TYPE_DATABASE
= 1 << 4,
42 class SFX2_DLLPUBLIC RecentDocsView
: public ThumbnailView
45 RecentDocsView( vcl::Window
* pParent
);
47 void insertItem(const OUString
&rURL
, const OUString
&rTitle
, const BitmapEx
&rThumbnail
, sal_uInt16 nId
);
49 long GetThumbnailSize() const { return mnItemMaxSize
;}
51 static bool typeMatchesExtension(ApplicationType type
, const OUString
&rExt
);
52 static BitmapEx
getDefaultThumbnail(const OUString
&rURL
);
56 virtual void Clear() override
;
58 /// Update the information in the view.
59 virtual void Reload() override
;
61 DECL_STATIC_LINK_TYPED( RecentDocsView
, ExecuteHdl_Impl
, void*, void );
64 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
66 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
68 virtual void OnItemDblClicked(ThumbnailViewItem
*pItem
) override
;
70 virtual void Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) override
;
72 virtual void LoseFocus() override
;
74 bool isAcceptedFile(const OUString
&rURL
) const;
79 long mnItemMaxTextLength
;
80 size_t mnLastMouseDownItem
;
82 /// Image that appears when there is no recent document.
84 OUString maWelcomeLine1
;
85 OUString maWelcomeLine2
;
88 #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */