Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / sfx2 / recentdocsview.hxx
blobaf3ce1badb805821a7cac1d2eb2e9fdd28ca1a91
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_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>
21 struct LoadRecentFile
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;
29 enum ApplicationType
31 TYPE_NONE = 0,
32 TYPE_WRITER = 1 << 0,
33 TYPE_CALC = 1 << 1,
34 TYPE_IMPRESS = 1 << 2,
35 TYPE_DRAW = 1 << 3,
36 TYPE_DATABASE = 1 << 4,
37 TYPE_MATH = 1 << 5,
38 TYPE_OTHER = 1 << 6
42 class SFX2_DLLPUBLIC RecentDocsView : public ThumbnailView
44 public:
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);
54 int mnFileTypes;
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 );
63 protected:
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;
76 long mnItemMaxSize;
77 long mnTextHeight;
78 long mnItemPadding;
79 long mnItemMaxTextLength;
80 size_t mnLastMouseDownItem;
82 /// Image that appears when there is no recent document.
83 Image maWelcomeImage;
84 OUString maWelcomeLine1;
85 OUString maWelcomeLine2;
88 #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */