bump product version to 4.2.0.1
[LibreOffice.git] / include / sfx2 / recentdocsview.hxx
blob63a067d7a0e2f057016ec2e203ba34101a4303aa
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 ::com::sun::star::util::URL aTargetURL;
24 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgSeq;
25 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
28 enum ApplicationType
30 TYPE_NONE = 0,
31 TYPE_WRITER = 1 << 0,
32 TYPE_CALC = 1 << 1,
33 TYPE_IMPRESS = 1 << 2,
34 TYPE_DRAW = 1 << 3,
35 TYPE_DATABASE = 1 << 4,
36 TYPE_MATH = 1 << 5,
37 TYPE_OTHER = 1 << 6
41 class SFX2_DLLPUBLIC RecentDocsView : protected ::comphelper::OBaseMutex,
42 public ThumbnailView
44 public:
45 RecentDocsView( Window* pParent );
46 virtual ~RecentDocsView();
48 void insertItem(const OUString &rURL, const OUString &rTitle, sal_uInt16 nId);
49 void loadRecentDocs();
51 void SetThumbnailSize(long thumbnailSize);
52 long GetThumbnailSize() const;
54 static bool typeMatchesExtension(ApplicationType type, const OUString &rExt);
55 static BitmapEx getDefaultThumbnail(const OUString &rURL);
57 int mnFileTypes;
59 DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile* );
61 protected:
62 virtual void MouseButtonDown( const MouseEvent& rMEvt );
63 virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
64 void OpenItem( const ThumbnailViewItem *pItem );
65 virtual void Paint( const Rectangle& rRect );
67 bool isAcceptedFile(const OUString &rURL) const;
69 long mnItemMaxSize;
70 long mnTextHeight;
71 long mnItemPadding;
72 long mnItemMaxTextLength;
74 Image maWelcomeImage;
75 OUString maWelcomeLine1;
76 OUString maWelcomeLine2;
79 #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */