Bump version to 6.4-15
[LibreOffice.git] / include / sfx2 / recentdocsview.hxx
blob9469aeec14ef57358fe705a6c4a3696689b7a14a
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 <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; }
23 namespace sfx2
26 struct LoadRecentFile
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
36 TYPE_NONE = 0,
37 TYPE_WRITER = 1 << 0,
38 TYPE_CALC = 1 << 1,
39 TYPE_IMPRESS = 1 << 2,
40 TYPE_DRAW = 1 << 3,
41 TYPE_DATABASE = 1 << 4,
42 TYPE_MATH = 1 << 5,
43 TYPE_OTHER = 1 << 6
46 } // namespace sfx2
48 namespace o3tl {
50 template<> struct typed_flags<sfx2::ApplicationType> : is_typed_flags<sfx2::ApplicationType, 0x7f> {};
52 } // namespace o3tl
54 namespace sfx2
57 class SFX2_DLLPUBLIC RecentDocsView final : public ThumbnailView
59 public:
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 );
76 private:
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;
89 long mnItemMaxSize;
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;
98 } // namespace sfx2
100 #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */