LibreOffice Module sfx2 (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
TemplateLocalView Class Reference

#include <templatelocalview.hxx>

Inheritance diagram for TemplateLocalView:
[legend]
Collaboration diagram for TemplateLocalView:
[legend]

Public Member Functions

 TemplateLocalView (std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Menu > xMenu)
 
virtual ~TemplateLocalView () override
 
void insertItems (const std::vector< TemplateItemProperties > &rTemplates, bool isRegionSelected=true, bool bShowCategoryInTooltip=false)
 
void Populate ()
 
void reload ()
 
virtual void showAllTemplates ()
 
void showRegion (TemplateContainerItem const *pItem)
 
void ContextMenuSelectHdl (std::u16string_view rIdent)
 
TemplateContainerItemgetRegion (std::u16string_view sStr)
 
sal_uInt16 getRegionId (size_t pos) const
 
sal_uInt16 getRegionId (std::u16string_view sRegionName) const
 
OUString getRegionName (const sal_uInt16 nRegionId) const
 
OUString getRegionItemName (const sal_uInt16 nItemId) const
 
std::vector< OUString > getFolderNames ()
 
std::vector< TemplateItemPropertiesgetFilteredItems (const std::function< bool(const TemplateItemProperties &) > &rFunc) const
 
sal_uInt16 createRegion (const OUString &rName)
 
bool renameRegion (std::u16string_view rTitle, const OUString &rNewTitle)
 
bool removeRegion (const sal_uInt16 nItemId)
 
bool removeTemplate (const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId)
 
void moveTemplates (const std::set< const ThumbnailViewItem *, selection_cmp_fn > &rItems, const sal_uInt16 nTargetItem)
 
bool copyFrom (TemplateContainerItem *pItem, const OUString &rPath)
 
bool exportTo (const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, std::u16string_view rName)
 
virtual bool renameItem (ThumbnailViewItem *pItem, const OUString &sNewTitle) override
 
virtual bool MouseButtonDown (const MouseEvent &rMEvt) override
 
virtual bool Command (const CommandEvent &rPos) override
 
virtual bool KeyInput (const KeyEvent &rKEvt) override
 
sal_uInt16 getCurRegionId () const
 
void setCurRegionId (sal_uInt16 nCurRegionId)
 
void setOpenRegionHdl (const Link< void *, void > &rLink)
 
void setCreateContextMenuHdl (const Link< ThumbnailViewItem *, void > &rLink)
 
void setOpenTemplateHdl (const Link< ThumbnailViewItem *, void > &rLink)
 
void setEditTemplateHdl (const Link< ThumbnailViewItem *, void > &rLink)
 
void setDeleteTemplateHdl (const Link< void *, void > &rLink)
 
void setDefaultTemplateHdl (const Link< ThumbnailViewItem *, void > &rLink)
 
void setMoveTemplateHdl (const Link< void *, void > &rLink)
 
void setExportTemplateHdl (const Link< void *, void > &rLink)
 
void updateThumbnailDimensions (tools::Long itemMaxSize)
 
void RemoveDefaultTemplateIcon (std::u16string_view rPath)
 
bool IsBuiltInRegion (const OUString &rRegionName)
 
- Public Member Functions inherited from ThumbnailView
 ThumbnailView (std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Menu > xMenu)
 
virtual ~ThumbnailView () override
 
virtual bool MouseMove (const MouseEvent &rMEvt) override
 
virtual void Reload ()
 Updates information in the view; used only in RecentDocsView ATM. More...
 
void AppendItem (std::unique_ptr< ThumbnailViewItem > pItem)
 
void RemoveItem (sal_uInt16 nItemId)
 
virtual void Clear ()
 
void updateItems (std::vector< std::unique_ptr< ThumbnailViewItem > > items)
 
size_t GetItemPos (sal_uInt16 nItemId) const
 
sal_uInt16 GetItemId (size_t nPos) const
 
sal_uInt16 GetItemId (const Point &rPos) const
 
virtual bool renameItem (ThumbnailViewItem *pItem, const OUString &sNewTitle)
 
bool isDrawMnemonic () const
 
void setItemMaxTextLength (sal_uInt32 nLength)
 
void setItemDimensions (tools::Long ItemWidth, tools::Long ThumbnailHeight, tools::Long DisplayHeight, int itemPadding)
 
void SelectItem (sal_uInt16 nItemId)
 
bool IsItemSelected (sal_uInt16 nItemId) const
 
void deselectItems ()
 deselect all current selected items. More...
 
void ShowTooltips (bool bShowTooltips)
 
void DrawMnemonics (bool bDrawMnemonics)
 
void filterItems (const std::function< bool(const ThumbnailViewItem *) > &func)
 
void setItemStateHdl (const Link< const ThumbnailViewItem *, void > &aLink)
 
virtual void Resize () override
 
virtual void Show () override
 
virtual void Hide () override
 
virtual void SetDrawingArea (weld::DrawingArea *pDrawingArea) override
 
- Public Member Functions inherited from weld::CustomWidgetController
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible ()
 
virtual void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)=0
 
virtual void Resize ()
 
virtual bool MouseButtonDown (const MouseEvent &)
 
virtual bool MouseMove (const MouseEvent &)
 
virtual bool MouseButtonUp (const MouseEvent &)
 
virtual void GetFocus ()
 
virtual void LoseFocus ()
 
virtual void StyleUpdated ()
 
virtual bool Command (const CommandEvent &)
 
virtual bool KeyInput (const KeyEvent &)
 
virtual tools::Rectangle GetFocusRect ()
 
virtual FactoryFunction GetUITestFactory () const
 
virtual OUString RequestHelp (tools::Rectangle &)
 
virtual OUString GetHelpText () const
 
Size const & GetOutputSizePixel () const
 
void SetOutputSizePixel (const Size &rSize)
 
virtual void SetDrawingArea (weld::DrawingArea *pDrawingArea)
 
weld::DrawingAreaGetDrawingArea () const
 
void Invalidate ()
 
void Invalidate (const tools::Rectangle &rRect)
 
virtual void Show ()
 
virtual void Hide ()
 
void SetCursor (void *pData)
 
void GrabFocus ()
 
bool HasFocus () const
 
bool HasChildFocus () const
 
bool IsVisible () const
 
bool IsReallyVisible () const
 
bool IsEnabled () const
 
void Enable () const
 
void Disable () const
 
bool IsActive () const
 
int GetTextHeight () const
 
int GetTextWidth (const OUString &rText) const
 
OUString GetAccessibleName () const
 
OUString GetAccessibleDescription () const
 
void CaptureMouse ()
 
bool IsMouseCaptured () const
 
Point GetPointerPosPixel () const
 
void EnableRTL (bool bEnable)
 
bool IsRTLEnabled () const
 
void ReleaseMouse ()
 
void SetPointer (PointerStyle ePointerStyle)
 
void SetHelpId (const OUString &rHelpId)
 
void SetAccessibleName (const OUString &rName)
 
void SetInputContext (const InputContext &rInputContext)
 
void SetCursorRect (const tools::Rectangle &rCursorRect, int nExtTextInputWidth)
 
virtual int GetSurroundingText (OUString &)
 
virtual bool DeleteSurroundingText (const Selection &)
 
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget ()
 
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard () const
 
void SetDragDataTransferable (rtl::Reference< TransferDataContainer > &rTransferable, sal_uInt8 eDNDConstants)
 
virtual bool StartDrag ()
 
void set_size_request (int nWidth, int nHeight)
 
void queue_resize ()
 
 CustomWidgetController ()
 
virtual ~CustomWidgetController ()
 
 CustomWidgetController (CustomWidgetController const &)=default
 
 CustomWidgetController (CustomWidgetController &&)=default
 
CustomWidgetControlleroperator= (CustomWidgetController const &)=default
 
CustomWidgetControlleroperator= (CustomWidgetController &&)=default
 

Static Public Member Functions

static BitmapEx scaleImg (const BitmapEx &rImg, tools::Long width, tools::Long height)
 
static BitmapEx getDefaultThumbnail (std::u16string_view rPath)
 
static BitmapEx fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height)
 
static bool IsDefaultTemplate (const OUString &rPath)
 
static bool IsInternalTemplate (const OUString &rPath)
 
- Static Public Member Functions inherited from ThumbnailView
static BitmapEx readThumbnail (const OUString &msURL)
 
- Static Public Member Functions inherited from weld::CustomWidgetController
static bool IsUpdateMode ()
 

Protected Member Functions

virtual void OnItemDblClicked (ThumbnailViewItem *pItem) override
 
- Protected Member Functions inherited from ThumbnailView
virtual bool KeyInput (const KeyEvent &rKEvt) override
 
virtual bool MouseButtonDown (const MouseEvent &rMEvt) override
 
virtual void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
 
virtual void GetFocus () override
 
virtual void LoseFocus () override
 
virtual OUString RequestHelp (tools::Rectangle &rRect) override
 
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible () override
 
const css::uno::Reference< css::accessibility::XAccessible > & getAccessible () const
 
void DrawItem (ThumbnailViewItem const *pItem)
 
virtual void OnItemDblClicked (ThumbnailViewItem *pItem)
 
void UpdateColors ()
 
void CalculateItemPositions (bool bScrollBarUsed=false)
 
void MakeItemVisible (sal_uInt16 nId)
 
void ImplInit ()
 
void ImplDeleteItems ()
 
size_t ImplGetItem (const Point &rPoint) const
 
ThumbnailViewItemImplGetItem (size_t nPos)
 
sal_uInt16 ImplGetVisibleItemCount () const
 
ThumbnailViewItemImplGetVisibleItem (sal_uInt16 nVisiblePos)
 
void ImplFireAccessibleEvent (short nEventId, const css::uno::Any &rOldValue, const css::uno::Any &rNewValue)
 
bool ImplHasAccessibleListeners () const
 
 DECL_DLLPRIVATE_LINK (ImplScrollHdl, weld::ScrolledWindow &, void)
 

Protected Attributes

sal_uInt16 mnCurRegionId
 
TemplateViewItemmaSelectedItem
 
tools::Long mnThumbnailWidth
 
tools::Long mnThumbnailHeight
 
Point maPosition
 
Link< void *, void > maOpenRegionHdl
 
Link< ThumbnailViewItem *, void > maCreateContextMenuHdl
 
Link< ThumbnailViewItem *, void > maOpenTemplateHdl
 
Link< ThumbnailViewItem *, void > maEditTemplateHdl
 
Link< void *, void > maDeleteTemplateHdl
 
Link< ThumbnailViewItem *, void > maDefaultTemplateHdl
 
Link< void *, void > maMoveTemplateHdl
 
Link< void *, void > maExportTemplateHdl
 
std::unique_ptr< SfxDocumentTemplatesmpDocTemplates
 
std::vector< std::unique_ptr< TemplateContainerItem > > maRegions
 
std::vector< TemplateItemPropertiesmaAllTemplates
 
- Protected Attributes inherited from ThumbnailView
std::vector< std::unique_ptr< ThumbnailViewItem > > mItemList
 
css::uno::Reference< css::accessibility::XAccessible > mxAccessible
 
ThumbnailValueItemList mFilteredItemList
 Cache to store the filtered items. More...
 
ThumbnailValueItemList::iterator mpStartSelRange
 
tools::Long mnItemWidth
 
tools::Long mnItemHeight
 
tools::Long mnItemPadding
 
tools::Long mnThumbnailHeight
 
tools::Long mnDisplayHeight
 
tools::Long mnVItemSpace
 
tools::Long mnVisLines
 
tools::Long mnLines
 
sal_uInt16 mnCols
 
sal_uInt16 mnFirstLine
 
bool mbScroll: 1
 
bool mbAllowVScrollBar: 1
 
bool mbHasVisibleItems: 1
 
bool mbShowTooltips: 1
 
bool mbDrawMnemonics: 1
 
bool mbSelectOnFocus: 1
 
Color maFillColor
 Background color of the thumbnail view widget. More...
 
Color maTextColor
 Text color. More...
 
Color maHighlightColor
 Color of the highlight (background) of the hovered item. More...
 
Color maHighlightTextColor
 Color of the text for the highlighted item. More...
 
Color maSelectHighlightColor
 Color of the highlight (background) of the selected and hovered item. More...
 
Color maSelectHighlightTextColor
 Color of the text of the selected and hovered item. More...
 
double mfHighlightTransparence
 Transparence of the highlight. More...
 
Link< const ThumbnailViewItem *, void > maItemStateHdl
 
std::unique_ptr< ThumbnailItemAttributesmpItemAttrs
 
std::unique_ptr< weld::ScrolledWindowmxScrolledWindow
 
std::unique_ptr< weld::MenumxContextMenu
 
std::function< bool(const ThumbnailViewItem *)> maFilterFunc
 

Private Types

typedef bool(* selection_cmp_fn) (const ThumbnailViewItem *, const ThumbnailViewItem *)
 

Detailed Description

Definition at line 65 of file templatelocalview.hxx.

Member Typedef Documentation

◆ selection_cmp_fn

typedef bool(* TemplateLocalView::selection_cmp_fn) (const ThumbnailViewItem *, const ThumbnailViewItem *)
private

Definition at line 67 of file templatelocalview.hxx.

Constructor & Destructor Documentation

◆ TemplateLocalView()

TemplateLocalView::TemplateLocalView ( std::unique_ptr< weld::ScrolledWindow xWindow,
std::unique_ptr< weld::Menu xMenu 
)

Definition at line 85 of file templatelocalview.cxx.

References maPosition.

◆ ~TemplateLocalView()

TemplateLocalView::~TemplateLocalView ( )
overridevirtual

Definition at line 97 of file templatelocalview.cxx.

Member Function Documentation

◆ Command()

bool TemplateLocalView::Command ( const CommandEvent rPos)
overridevirtual

◆ ContextMenuSelectHdl()

void TemplateLocalView::ContextMenuSelectHdl ( std::u16string_view  rIdent)

◆ copyFrom()

bool TemplateLocalView::copyFrom ( TemplateContainerItem pItem,
const OUString &  rPath 
)

◆ createRegion()

sal_uInt16 TemplateLocalView::createRegion ( const OUString &  rName)

Definition at line 325 of file templatelocalview.cxx.

References maRegions, and mpDocTemplates.

◆ exportTo()

bool TemplateLocalView::exportTo ( const sal_uInt16  nItemId,
const sal_uInt16  nRegionItemId,
std::u16string_view  rName 
)

Definition at line 583 of file templatelocalview.cxx.

References maRegions, and mpDocTemplates.

◆ fetchThumbnail()

BitmapEx TemplateLocalView::fetchThumbnail ( const OUString &  msURL,
tools::Long  width,
tools::Long  height 
)
static

Definition at line 891 of file templatelocalview.cxx.

References ThumbnailView::readThumbnail(), and scaleImg().

Referenced by copyFrom(), and Populate().

◆ getCurRegionId()

sal_uInt16 TemplateLocalView::getCurRegionId ( ) const
inline

Definition at line 127 of file templatelocalview.hxx.

References mnCurRegionId.

◆ getDefaultThumbnail()

BitmapEx TemplateLocalView::getDefaultThumbnail ( std::u16string_view  rPath)
static

◆ getFilteredItems()

std::vector< TemplateItemProperties > TemplateLocalView::getFilteredItems ( const std::function< bool(const TemplateItemProperties &) > &  rFunc) const

◆ getFolderNames()

std::vector< OUString > TemplateLocalView::getFolderNames ( )

Definition at line 284 of file templatelocalview.cxx.

References i, maRegions, maTitle, and n.

◆ getRegion()

TemplateContainerItem * TemplateLocalView::getRegion ( std::u16string_view  sStr)

Definition at line 187 of file templatelocalview.cxx.

References maRegions.

Referenced by renameRegion().

◆ getRegionId() [1/2]

sal_uInt16 TemplateLocalView::getRegionId ( size_t  pos) const

Definition at line 250 of file templatelocalview.cxx.

References maRegions, and pos.

Referenced by TemplateDlgLocalView::reload(), and reload().

◆ getRegionId() [2/2]

sal_uInt16 TemplateLocalView::getRegionId ( std::u16string_view  sRegionName) const

Definition at line 257 of file templatelocalview.cxx.

References maRegions.

◆ getRegionItemName()

OUString TemplateLocalView::getRegionItemName ( const sal_uInt16  nItemId) const

Definition at line 273 of file templatelocalview.cxx.

References maRegions.

Referenced by TemplateDlgLocalView::reload(), and reload().

◆ getRegionName()

OUString TemplateLocalView::getRegionName ( const sal_uInt16  nRegionId) const

◆ insertItems()

void TemplateLocalView::insertItems ( const std::vector< TemplateItemProperties > &  rTemplates,
bool  isRegionSelected = true,
bool  bShowCategoryInTooltip = false 
)

◆ IsBuiltInRegion()

bool TemplateLocalView::IsBuiltInRegion ( const OUString &  rRegionName)

◆ IsDefaultTemplate()

bool TemplateLocalView::IsDefaultTemplate ( const OUString &  rPath)
static

◆ IsInternalTemplate()

bool TemplateLocalView::IsInternalTemplate ( const OUString &  rPath)
static

◆ KeyInput()

bool TemplateLocalView::KeyInput ( const KeyEvent rKEvt)
overridevirtual

◆ MouseButtonDown()

bool TemplateLocalView::MouseButtonDown ( const MouseEvent rMEvt)
overridevirtual

◆ moveTemplates()

void TemplateLocalView::moveTemplates ( const std::set< const ThumbnailViewItem *, selection_cmp_fn > &  rItems,
const sal_uInt16  nTargetItem 
)

◆ OnItemDblClicked()

void TemplateLocalView::OnItemDblClicked ( ThumbnailViewItem pItem)
overrideprotectedvirtual

Reimplemented from ThumbnailView.

Definition at line 896 of file templatelocalview.cxx.

References Link< typename Arg, typename Ret >::Call(), and maOpenTemplateHdl.

◆ Populate()

void TemplateLocalView::Populate ( )

◆ reload()

void TemplateLocalView::reload ( )

◆ RemoveDefaultTemplateIcon()

void TemplateLocalView::RemoveDefaultTemplateIcon ( std::u16string_view  rPath)

◆ removeRegion()

bool TemplateLocalView::removeRegion ( const sal_uInt16  nItemId)

Definition at line 355 of file templatelocalview.cxx.

References maRegions, and mpDocTemplates.

◆ removeTemplate()

bool TemplateLocalView::removeTemplate ( const sal_uInt16  nItemId,
const sal_uInt16  nSrcItemId 
)

◆ renameItem()

bool TemplateLocalView::renameItem ( ThumbnailViewItem pItem,
const OUString &  sNewTitle 
)
overridevirtual

◆ renameRegion()

bool TemplateLocalView::renameRegion ( std::u16string_view  rTitle,
const OUString &  rNewTitle 
)

◆ scaleImg()

BitmapEx TemplateLocalView::scaleImg ( const BitmapEx rImg,
tools::Long  width,
tools::Long  height 
)
static

◆ setCreateContextMenuHdl()

void TemplateLocalView::setCreateContextMenuHdl ( const Link< ThumbnailViewItem *, void > &  rLink)

Definition at line 792 of file templatelocalview.cxx.

References maCreateContextMenuHdl.

◆ setCurRegionId()

void TemplateLocalView::setCurRegionId ( sal_uInt16  nCurRegionId)
inline

Definition at line 129 of file templatelocalview.hxx.

References mnCurRegionId.

◆ setDefaultTemplateHdl()

void TemplateLocalView::setDefaultTemplateHdl ( const Link< ThumbnailViewItem *, void > &  rLink)

Definition at line 812 of file templatelocalview.cxx.

References maDefaultTemplateHdl.

◆ setDeleteTemplateHdl()

void TemplateLocalView::setDeleteTemplateHdl ( const Link< void *, void > &  rLink)

Definition at line 807 of file templatelocalview.cxx.

References maDeleteTemplateHdl.

◆ setEditTemplateHdl()

void TemplateLocalView::setEditTemplateHdl ( const Link< ThumbnailViewItem *, void > &  rLink)

Definition at line 802 of file templatelocalview.cxx.

References maEditTemplateHdl.

◆ setExportTemplateHdl()

void TemplateLocalView::setExportTemplateHdl ( const Link< void *, void > &  rLink)

Definition at line 822 of file templatelocalview.cxx.

References maExportTemplateHdl.

◆ setMoveTemplateHdl()

void TemplateLocalView::setMoveTemplateHdl ( const Link< void *, void > &  rLink)

Definition at line 817 of file templatelocalview.cxx.

References maMoveTemplateHdl.

◆ setOpenRegionHdl()

void TemplateLocalView::setOpenRegionHdl ( const Link< void *, void > &  rLink)

Definition at line 787 of file templatelocalview.cxx.

References maOpenRegionHdl.

◆ setOpenTemplateHdl()

void TemplateLocalView::setOpenTemplateHdl ( const Link< ThumbnailViewItem *, void > &  rLink)

Definition at line 797 of file templatelocalview.cxx.

References maOpenTemplateHdl.

◆ showAllTemplates()

void TemplateLocalView::showAllTemplates ( )
virtual

◆ showRegion()

void TemplateLocalView::showRegion ( TemplateContainerItem const *  pItem)

◆ updateThumbnailDimensions()

void TemplateLocalView::updateThumbnailDimensions ( tools::Long  itemMaxSize)

Definition at line 79 of file templatelocalview.cxx.

References mnThumbnailHeight, and mnThumbnailWidth.

Referenced by TemplateDefaultView::TemplateDefaultView().

Member Data Documentation

◆ maAllTemplates

std::vector<TemplateItemProperties > TemplateLocalView::maAllTemplates
protected

◆ maCreateContextMenuHdl

Link<ThumbnailViewItem*,void> TemplateLocalView::maCreateContextMenuHdl
protected

Definition at line 176 of file templatelocalview.hxx.

Referenced by Command(), and setCreateContextMenuHdl().

◆ maDefaultTemplateHdl

Link<ThumbnailViewItem*,void> TemplateLocalView::maDefaultTemplateHdl
protected

◆ maDeleteTemplateHdl

Link<void*,void> TemplateLocalView::maDeleteTemplateHdl
protected

◆ maEditTemplateHdl

Link<ThumbnailViewItem*,void> TemplateLocalView::maEditTemplateHdl
protected

◆ maExportTemplateHdl

Link<void*,void> TemplateLocalView::maExportTemplateHdl
protected

◆ maMoveTemplateHdl

Link<void*,void> TemplateLocalView::maMoveTemplateHdl
protected

◆ maOpenRegionHdl

Link<void*,void> TemplateLocalView::maOpenRegionHdl
protected

◆ maOpenTemplateHdl

Link<ThumbnailViewItem*,void> TemplateLocalView::maOpenTemplateHdl
protected

◆ maPosition

Point TemplateLocalView::maPosition
protected

◆ maRegions

std::vector<std::unique_ptr<TemplateContainerItem> > TemplateLocalView::maRegions
protected

◆ maSelectedItem

TemplateViewItem* TemplateLocalView::maSelectedItem
protected

◆ mnCurRegionId

sal_uInt16 TemplateLocalView::mnCurRegionId
protected

◆ mnThumbnailHeight

tools::Long TemplateLocalView::mnThumbnailHeight
protected

Definition at line 171 of file templatelocalview.hxx.

Referenced by Populate(), and updateThumbnailDimensions().

◆ mnThumbnailWidth

tools::Long TemplateLocalView::mnThumbnailWidth
protected

Definition at line 170 of file templatelocalview.hxx.

Referenced by Populate(), and updateThumbnailDimensions().

◆ mpDocTemplates

std::unique_ptr<SfxDocumentTemplates> TemplateLocalView::mpDocTemplates
protected

The documentation for this class was generated from the following files: