10#ifndef INCLUDED_SFX2_TEMPLATELOCALVIEW_HXX
11#define INCLUDED_SFX2_TEMPLATELOCALVIEW_HXX
20#define TEMPLATE_ITEM_MAX_WIDTH 160
21#define TEMPLATE_ITEM_MAX_HEIGHT 148
22#define TEMPLATE_ITEM_PADDING 5
23#define TEMPLATE_ITEM_MAX_TEXT_LENGTH 20
24#define TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT 96
27#define TEMPLATE_ITEM_MAX_HEIGHT_SUB 160
30#define TEMPLATE_THUMBNAIL_MAX_HEIGHT TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT - 2*TEMPLATE_ITEM_PADDING
31#define TEMPLATE_THUMBNAIL_MAX_WIDTH TEMPLATE_ITEM_MAX_WIDTH - 2*TEMPLATE_ITEM_PADDING
58 bool isValid (std::u16string_view rPath)
const;
72 std::unique_ptr<weld::Menu> xMenu);
77 void insertItems (
const std::vector<TemplateItemProperties> &rTemplates,
bool isRegionSelected =
true,
bool bShowCategoryInTooltip =
false);
94 sal_uInt16
getRegionId (std::u16string_view sRegionName)
const;
102 std::vector<TemplateItemProperties>
107 bool renameRegion(std::u16string_view rTitle,
const OUString &rNewTitle);
111 bool removeTemplate (
const sal_uInt16 nItemId,
const sal_uInt16 nSrcItemId);
113 void moveTemplates (
const std::set<const ThumbnailViewItem*,selection_cmp_fn> &rItems,
const sal_uInt16 nTargetItem);
117 bool exportTo (
const sal_uInt16 nItemId,
const sal_uInt16 nRegionItemId, std::u16string_view rName);
185 std::vector<std::unique_ptr<TemplateContainerItem> >
maRegions;
bool(* selection_cmp_fn)(const ThumbnailViewItem *, const ThumbnailViewItem *)
bool exportTo(const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, std::u16string_view rName)
void setCurRegionId(sal_uInt16 nCurRegionId)
tools::Long mnThumbnailWidth
TemplateLocalView(std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Menu > xMenu)
std::vector< TemplateItemProperties > maAllTemplates
void RemoveDefaultTemplateIcon(std::u16string_view rPath)
TemplateContainerItem * getRegion(std::u16string_view sStr)
bool IsBuiltInRegion(const OUString &rRegionName)
static BitmapEx getDefaultThumbnail(std::u16string_view rPath)
static bool IsInternalTemplate(const OUString &rPath)
Link< ThumbnailViewItem *, void > maEditTemplateHdl
void ContextMenuSelectHdl(std::u16string_view rIdent)
void setMoveTemplateHdl(const Link< void *, void > &rLink)
sal_uInt16 getCurRegionId() const
OUString getRegionName(const sal_uInt16 nRegionId) const
void setCreateContextMenuHdl(const Link< ThumbnailViewItem *, void > &rLink)
Link< ThumbnailViewItem *, void > maDefaultTemplateHdl
bool removeTemplate(const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId)
sal_uInt16 getRegionId(size_t pos) const
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override
void moveTemplates(const std::set< const ThumbnailViewItem *, selection_cmp_fn > &rItems, const sal_uInt16 nTargetItem)
OUString getRegionItemName(const sal_uInt16 nItemId) const
sal_uInt16 createRegion(const OUString &rName)
static BitmapEx fetchThumbnail(const OUString &msURL, tools::Long width, tools::Long height)
virtual bool Command(const CommandEvent &rPos) override
void setEditTemplateHdl(const Link< ThumbnailViewItem *, void > &rLink)
Link< ThumbnailViewItem *, void > maCreateContextMenuHdl
void showRegion(TemplateContainerItem const *pItem)
std::vector< OUString > getFolderNames()
Link< void *, void > maOpenRegionHdl
Link< void *, void > maExportTemplateHdl
virtual bool renameItem(ThumbnailViewItem *pItem, const OUString &sNewTitle) override
void setDeleteTemplateHdl(const Link< void *, void > &rLink)
void setExportTemplateHdl(const Link< void *, void > &rLink)
virtual ~TemplateLocalView() override
void updateThumbnailDimensions(tools::Long itemMaxSize)
Link< void *, void > maDeleteTemplateHdl
virtual bool KeyInput(const KeyEvent &rKEvt) override
void setDefaultTemplateHdl(const Link< ThumbnailViewItem *, void > &rLink)
std::unique_ptr< SfxDocumentTemplates > mpDocTemplates
std::vector< TemplateItemProperties > getFilteredItems(const std::function< bool(const TemplateItemProperties &) > &rFunc) const
bool copyFrom(TemplateContainerItem *pItem, const OUString &rPath)
tools::Long mnThumbnailHeight
void insertItems(const std::vector< TemplateItemProperties > &rTemplates, bool isRegionSelected=true, bool bShowCategoryInTooltip=false)
Link< ThumbnailViewItem *, void > maOpenTemplateHdl
bool removeRegion(const sal_uInt16 nItemId)
std::vector< std::unique_ptr< TemplateContainerItem > > maRegions
TemplateViewItem * maSelectedItem
void setOpenTemplateHdl(const Link< ThumbnailViewItem *, void > &rLink)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Link< void *, void > maMoveTemplateHdl
void setOpenRegionHdl(const Link< void *, void > &rLink)
static bool IsDefaultTemplate(const OUString &rPath)
virtual void showAllTemplates()
bool renameRegion(std::u16string_view rTitle, const OUString &rNewTitle)
static BitmapEx scaleImg(const BitmapEx &rImg, tools::Long width, tools::Long height)
Class to display thumbnails with their names below their respective icons.
static bool isFilteredExtension(FILTER_APPLICATION filter, std::u16string_view rExt)
bool isValid(std::u16string_view rPath) const
bool operator()(const ThumbnailViewItem *pItem)
ViewFilter_Application(FILTER_APPLICATION App)