LibreOffice Module sfx2 (master) 1
recentdocsview.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10#pragma once
11
13#include <vcl/bitmapex.hxx>
14
16
17#include <com/sun/star/util/URL.hpp>
18#include <com/sun/star/beans/PropertyValue.hpp>
19
20class INetURLObject;
21struct ImplSVEvent;
22namespace com::sun::star::frame { class XDispatch; }
23
24namespace sfx2
25{
26
27class RecentDocsView;
28
30{
31 css::util::URL aTargetURL;
32 css::uno::Sequence< css::beans::PropertyValue > aArgSeq;
33 css::uno::Reference< css::frame::XDispatch > xDispatch;
35};
36
38{
39 TYPE_NONE = 0,
40 TYPE_WRITER = 1 << 0,
41 TYPE_CALC = 1 << 1,
42 TYPE_IMPRESS = 1 << 2,
43 TYPE_DRAW = 1 << 3,
44 TYPE_DATABASE = 1 << 4,
45 TYPE_MATH = 1 << 5,
46 TYPE_OTHER = 1 << 6
47};
48
49} // namespace sfx2
50
51namespace o3tl {
52
53template<> struct typed_flags<sfx2::ApplicationType> : is_typed_flags<sfx2::ApplicationType, 0x7f> {};
54
55} // namespace o3tl
56
57namespace sfx2
58{
59
60class RecentDocsView final : public ThumbnailView
61{
62public:
63 RecentDocsView(std::unique_ptr<weld::ScrolledWindow> xWindow, std::unique_ptr<weld::Menu> xMenu);
64 virtual ~RecentDocsView() override;
65
66 void insertItem(const OUString& rURL, const OUString& rTitle, const OUString& rThumbnail,
67 bool isReadOnly, bool isPinned, sal_uInt16 nId);
68
69 static bool typeMatchesExtension(ApplicationType type, std::u16string_view rExt);
70
72
73 virtual void Clear() override;
74
76 virtual void Reload() override;
77
78 // launch load of recently used file
79 void PostLoadRecentUsedFile(LoadRecentFile* pLoadRecentFile);
80
81 // received on load of recently used file
83
85
86 void setFilter(ApplicationType aFilter);
87
88private:
89 virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
90
91 virtual bool MouseButtonUp( const MouseEvent& rMEvt ) override;
92
93 virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
94
95 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
96
97 virtual void LoseFocus() override;
98
99 bool isAcceptedFile(const INetURLObject& rURL) const;
100
101 DECL_LINK( ExecuteHdl_Impl, void*, void );
102
105
110
113};
114
115} // namespace sfx2
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Class to display thumbnails with their names below their respective icons.
void setFilter(ApplicationType aFilter)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
sfx2::LoadRecentFile * mpLoadRecentFile
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override
void PostLoadRecentUsedFile(LoadRecentFile *pLoadRecentFile)
ApplicationType mnFileTypes
void insertItem(const OUString &rURL, const OUString &rTitle, const OUString &rThumbnail, bool isReadOnly, bool isPinned, sal_uInt16 nId)
virtual ~RecentDocsView() override
virtual void LoseFocus() override
static bool typeMatchesExtension(ApplicationType type, std::u16string_view rExt)
BitmapEx maWelcomeImage
Image that appears when there is no recent document.
virtual void Reload() override
Update the information in the view.
DECL_LINK(ExecuteHdl_Impl, void *, void)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
ImplSVEvent * m_nExecuteHdlId
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
bool isAcceptedFile(const INetURLObject &rURL) const
RecentDocsView(std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Menu > xMenu)
virtual void Clear() override
const sal_uInt16 TYPE_OTHER
long Long
sal_Int16 nId
css::uno::Sequence< css::beans::PropertyValue > aArgSeq
css::uno::Reference< css::frame::XDispatch > xDispatch
RecentDocsView * pView
css::util::URL aTargetURL
ResultType type