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_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
11 #define INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
13 #include <sfx2/thumbnailview.hxx>
15 class TemplateViewItem
;
19 class TemplateSearchView final
: public ThumbnailView
23 TemplateSearchView(std::unique_ptr
<weld::ScrolledWindow
> xWindow
,
24 std::unique_ptr
<weld::Menu
> xMenu
);
26 void setOpenTemplateHdl (const Link
<ThumbnailViewItem
*, void> &rLink
);
28 void ContextMenuSelectHdl(const OString
& rIdent
);
30 void setCreateContextMenuHdl(const Link
<ThumbnailViewItem
*,void> &rLink
);
32 void setEditTemplateHdl(const Link
<ThumbnailViewItem
*,void> &rLink
);
34 void setDeleteTemplateHdl(const Link
<ThumbnailViewItem
*,void> &rLink
);
36 void setDefaultTemplateHdl(const Link
<ThumbnailViewItem
*,void> &rLink
);
38 void createContextMenu(const bool bIsDefault
);
40 void AppendItem(sal_uInt16 nAssocItemId
, sal_uInt16 nRegionId
, sal_uInt16 nIdx
,
41 const OUString
&rTitle
, const OUString
&rSubtitle
,
42 const OUString
&rPath
, const BitmapEx
&rImage
);
44 static BitmapEx
getDefaultThumbnail( const OUString
& rPath
);
46 void RemoveDefaultTemplateIcon(std::u16string_view rPath
);
49 virtual void OnItemDblClicked(ThumbnailViewItem
*pItem
) override
;
51 virtual bool MouseButtonDown( const MouseEvent
& rMEvt
) override
;
53 virtual bool Command(const CommandEvent
& rPos
) override
;
55 virtual bool KeyInput( const KeyEvent
& rKEvt
) override
;
57 TemplateViewItem
*maSelectedItem
;
61 Link
<ThumbnailViewItem
*, void> maOpenTemplateHdl
;
62 Link
<ThumbnailViewItem
*, void> maCreateContextMenuHdl
;
63 Link
<ThumbnailViewItem
*,void> maEditTemplateHdl
;
64 Link
<ThumbnailViewItem
*,void> maDeleteTemplateHdl
;
65 Link
<ThumbnailViewItem
*,void> maDefaultTemplateHdl
;
68 #endif // INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */