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

Class to display thumbnails with their names below their respective icons. More...

#include <thumbnailview.hxx>

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

Public Member Functions

 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 readThumbnail (const OUString &msURL)
 
- Static Public Member Functions inherited from weld::CustomWidgetController
static bool IsUpdateMode ()
 

Protected Member Functions

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

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
 

Friends

class ThumbnailViewAcc
 
class ThumbnailViewItemAcc
 

Detailed Description

Class to display thumbnails with their names below their respective icons.

Definition at line 162 of file thumbnailview.hxx.

Constructor & Destructor Documentation

◆ ThumbnailView()

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

Definition at line 147 of file thumbnailview.cxx.

References ImplInit(), LINK, mxScrolledWindow, and NEVER.

◆ ~ThumbnailView()

ThumbnailView::~ThumbnailView ( )
overridevirtual

Definition at line 161 of file thumbnailview.cxx.

References ImplDeleteItems(), mpItemAttrs, and mxAccessible.

Member Function Documentation

◆ AppendItem()

void ThumbnailView::AppendItem ( std::unique_ptr< ThumbnailViewItem pItem)

◆ CalculateItemPositions()

void ThumbnailView::CalculateItemPositions ( bool  bScrollBarUsed = false)
protected

◆ Clear()

void ThumbnailView::Clear ( )
virtual

◆ CreateAccessible()

css::uno::Reference< css::accessibility::XAccessible > ThumbnailView::CreateAccessible ( )
overrideprotectedvirtual

Reimplemented from weld::CustomWidgetController.

Definition at line 325 of file thumbnailview.cxx.

References mxAccessible, and ThumbnailViewAcc.

◆ DECL_DLLPRIVATE_LINK()

ThumbnailView::DECL_DLLPRIVATE_LINK ( ImplScrollHdl  ,
weld::ScrolledWindow ,
void   
)
protected

◆ deselectItems()

void ThumbnailView::deselectItems ( )

◆ DrawItem()

void ThumbnailView::DrawItem ( ThumbnailViewItem const *  pItem)
protected

◆ DrawMnemonics()

void ThumbnailView::DrawMnemonics ( bool  bDrawMnemonics)

Definition at line 1172 of file thumbnailview.cxx.

References mbDrawMnemonics.

◆ filterItems()

void ThumbnailView::filterItems ( const std::function< bool(const ThumbnailViewItem *) > &  func)

◆ getAccessible()

const css::uno::Reference< css::accessibility::XAccessible > & ThumbnailView::getAccessible ( ) const
protected

Definition at line 331 of file thumbnailview.cxx.

References mxAccessible.

Referenced by ThumbnailViewItemAcc::getAccessibleParent().

◆ GetFocus()

void ThumbnailView::GetFocus ( )
overrideprotectedvirtual

◆ GetItemId() [1/2]

sal_uInt16 ThumbnailView::GetItemId ( const Point rPos) const

Definition at line 1062 of file thumbnailview.cxx.

References GetItemId(), ImplGetItem(), and THUMBNAILVIEW_ITEM_NOTFOUND.

◆ GetItemId() [2/2]

sal_uInt16 ThumbnailView::GetItemId ( size_t  nPos) const

Definition at line 1057 of file thumbnailview.cxx.

References mFilteredItemList, and nPos.

Referenced by ThumbnailViewAcc::getAccessibleAtPoint(), and GetItemId().

◆ GetItemPos()

size_t ThumbnailView::GetItemPos ( sal_uInt16  nItemId) const

◆ Hide()

virtual void ThumbnailView::Hide ( )
inlineoverridevirtual

◆ ImplDeleteItems()

void ThumbnailView::ImplDeleteItems ( )
protected

◆ ImplFireAccessibleEvent()

void ThumbnailView::ImplFireAccessibleEvent ( short  nEventId,
const css::uno::Any &  rOldValue,
const css::uno::Any &  rNewValue 
)
protected

◆ ImplGetItem() [1/2]

size_t ThumbnailView::ImplGetItem ( const Point rPoint) const
protected

◆ ImplGetItem() [2/2]

ThumbnailViewItem * ThumbnailView::ImplGetItem ( size_t  nPos)
protected

Definition at line 517 of file thumbnailview.cxx.

References mFilteredItemList, and nPos.

◆ ImplGetVisibleItem()

ThumbnailViewItem * ThumbnailView::ImplGetVisibleItem ( sal_uInt16  nVisiblePos)
protected

◆ ImplGetVisibleItemCount()

sal_uInt16 ThumbnailView::ImplGetVisibleItemCount ( ) const
protected

◆ ImplHasAccessibleListeners()

bool ThumbnailView::ImplHasAccessibleListeners ( ) const
protected

◆ ImplInit()

void ThumbnailView::ImplInit ( )
protected

◆ isDrawMnemonic()

bool ThumbnailView::isDrawMnemonic ( ) const
inline

Definition at line 194 of file thumbnailview.hxx.

Referenced by ThumbnailViewItem::addTextPrimitives().

◆ IsItemSelected()

bool ThumbnailView::IsItemSelected ( sal_uInt16  nItemId) const

◆ KeyInput()

bool ThumbnailView::KeyInput ( const KeyEvent rKEvt)
overrideprotectedvirtual

◆ LoseFocus()

void ThumbnailView::LoseFocus ( )
overrideprotectedvirtual

◆ MakeItemVisible()

void ThumbnailView::MakeItemVisible ( sal_uInt16  nId)
protected

◆ MouseButtonDown()

bool ThumbnailView::MouseButtonDown ( const MouseEvent rMEvt)
overrideprotectedvirtual

◆ MouseMove()

bool ThumbnailView::MouseMove ( const MouseEvent rMEvt)
overridevirtual

◆ OnItemDblClicked()

void ThumbnailView::OnItemDblClicked ( ThumbnailViewItem pItem)
protectedvirtual

Reimplemented in TemplateLocalView, and sfx2::RecentDocsView.

Definition at line 321 of file thumbnailview.cxx.

Referenced by KeyInput(), and MouseButtonDown().

◆ Paint()

void ThumbnailView::Paint ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 
)
overrideprotectedvirtual

◆ readThumbnail()

BitmapEx ThumbnailView::readThumbnail ( const OUString &  msURL)
static

◆ Reload()

virtual void ThumbnailView::Reload ( )
inlinevirtual

Updates information in the view; used only in RecentDocsView ATM.

Reimplemented in sfx2::RecentDocsView.

Definition at line 175 of file thumbnailview.hxx.

Referenced by RecentDocsViewItem::MouseButtonUp().

◆ RemoveItem()

void ThumbnailView::RemoveItem ( sal_uInt16  nItemId)

◆ renameItem()

bool ThumbnailView::renameItem ( ThumbnailViewItem pItem,
const OUString &  sNewTitle 
)
virtual

Reimplemented in TemplateLocalView.

Definition at line 51 of file thumbnailview.cxx.

Referenced by ThumbnailViewItem::setTitle().

◆ RequestHelp()

OUString ThumbnailView::RequestHelp ( tools::Rectangle rRect)
overrideprotectedvirtual

◆ Resize()

void ThumbnailView::Resize ( )
overridevirtual

◆ SelectItem()

void ThumbnailView::SelectItem ( sal_uInt16  nItemId)

◆ SetDrawingArea()

void ThumbnailView::SetDrawingArea ( weld::DrawingArea pDrawingArea)
overridevirtual

◆ setItemDimensions()

void ThumbnailView::setItemDimensions ( tools::Long  ItemWidth,
tools::Long  ThumbnailHeight,
tools::Long  DisplayHeight,
int  itemPadding 
)

◆ setItemMaxTextLength()

void ThumbnailView::setItemMaxTextLength ( sal_uInt32  nLength)

Definition at line 1071 of file thumbnailview.cxx.

References mpItemAttrs, and nLength.

Referenced by sfx2::RecentDocsView::RecentDocsView().

◆ setItemStateHdl()

void ThumbnailView::setItemStateHdl ( const Link< const ThumbnailViewItem *, void > &  aLink)
inline

Definition at line 219 of file thumbnailview.hxx.

◆ Show()

virtual void ThumbnailView::Show ( )
inlineoverridevirtual

Reimplemented from weld::CustomWidgetController.

Reimplemented in TemplateDlgLocalView.

Definition at line 223 of file thumbnailview.hxx.

References weld::CustomWidgetController::Show().

Referenced by TemplateDlgLocalView::Show().

◆ ShowTooltips()

void ThumbnailView::ShowTooltips ( bool  bShowTooltips)

Definition at line 1167 of file thumbnailview.cxx.

References mbShowTooltips.

◆ UpdateColors()

void ThumbnailView::UpdateColors ( )
protected

◆ updateItems()

void ThumbnailView::updateItems ( std::vector< std::unique_ptr< ThumbnailViewItem > >  items)

Friends And Related Function Documentation

◆ ThumbnailViewAcc

Definition at line 164 of file thumbnailview.hxx.

Referenced by CreateAccessible().

◆ ThumbnailViewItemAcc

Definition at line 165 of file thumbnailview.hxx.

Member Data Documentation

◆ maFillColor

Color ThumbnailView::maFillColor
protected

Background color of the thumbnail view widget.

Definition at line 310 of file thumbnailview.hxx.

Referenced by ImplInit(), Paint(), sfx2::RecentDocsView::RecentDocsView(), TemplateDefaultView::TemplateDefaultView(), and UpdateColors().

◆ maFilterFunc

std::function<bool (const ThumbnailViewItem*)> ThumbnailView::maFilterFunc
protected

Definition at line 323 of file thumbnailview.hxx.

Referenced by AppendItem(), filterItems(), ImplInit(), and updateItems().

◆ maHighlightColor

Color ThumbnailView::maHighlightColor
protected

Color of the highlight (background) of the hovered item.

Definition at line 312 of file thumbnailview.hxx.

Referenced by ImplInit(), sfx2::RecentDocsView::RecentDocsView(), TemplateDefaultView::TemplateDefaultView(), and UpdateColors().

◆ maHighlightTextColor

Color ThumbnailView::maHighlightTextColor
protected

Color of the text for the highlighted item.

Definition at line 313 of file thumbnailview.hxx.

Referenced by ImplInit(), sfx2::RecentDocsView::RecentDocsView(), TemplateDefaultView::TemplateDefaultView(), and UpdateColors().

◆ maItemStateHdl

Link<const ThumbnailViewItem*, void> ThumbnailView::maItemStateHdl
protected

◆ maSelectHighlightColor

Color ThumbnailView::maSelectHighlightColor
protected

Color of the highlight (background) of the selected and hovered item.

Definition at line 314 of file thumbnailview.hxx.

Referenced by ImplInit(), and UpdateColors().

◆ maSelectHighlightTextColor

Color ThumbnailView::maSelectHighlightTextColor
protected

Color of the text of the selected and hovered item.

Definition at line 315 of file thumbnailview.hxx.

Referenced by ImplInit(), and UpdateColors().

◆ maTextColor

Color ThumbnailView::maTextColor
protected

◆ mbAllowVScrollBar

bool ThumbnailView::mbAllowVScrollBar
protected

Definition at line 305 of file thumbnailview.hxx.

Referenced by CalculateItemPositions().

◆ mbDrawMnemonics

bool ThumbnailView::mbDrawMnemonics
protected

Definition at line 308 of file thumbnailview.hxx.

Referenced by DrawMnemonics(), and ImplInit().

◆ mbHasVisibleItems

bool ThumbnailView::mbHasVisibleItems
protected

Definition at line 306 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplGetItem(), and ImplInit().

◆ mbScroll

bool ThumbnailView::mbScroll
protected

Definition at line 304 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), and SelectItem().

◆ mbSelectOnFocus

bool ThumbnailView::mbSelectOnFocus
protected

Definition at line 309 of file thumbnailview.hxx.

Referenced by GetFocus().

◆ mbShowTooltips

bool ThumbnailView::mbShowTooltips
protected

Definition at line 307 of file thumbnailview.hxx.

Referenced by ImplInit(), RequestHelp(), and ShowTooltips().

◆ mfHighlightTransparence

double ThumbnailView::mfHighlightTransparence
protected

Transparence of the highlight.

Definition at line 316 of file thumbnailview.hxx.

Referenced by ImplInit(), sfx2::RecentDocsView::RecentDocsView(), TemplateDefaultView::TemplateDefaultView(), and UpdateColors().

◆ mFilteredItemList

ThumbnailValueItemList ThumbnailView::mFilteredItemList
protected

◆ mItemList

std::vector< std::unique_ptr<ThumbnailViewItem> > ThumbnailView::mItemList
protected

◆ mnCols

sal_uInt16 ThumbnailView::mnCols
protected

◆ mnDisplayHeight

tools::Long ThumbnailView::mnDisplayHeight
protected

Definition at line 297 of file thumbnailview.hxx.

Referenced by setItemDimensions().

◆ mnFirstLine

sal_uInt16 ThumbnailView::mnFirstLine
protected

◆ mnItemHeight

tools::Long ThumbnailView::mnItemHeight
protected

Definition at line 294 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), and setItemDimensions().

◆ mnItemPadding

tools::Long ThumbnailView::mnItemPadding
protected

Definition at line 295 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), and setItemDimensions().

◆ mnItemWidth

tools::Long ThumbnailView::mnItemWidth
protected

Definition at line 293 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), and setItemDimensions().

◆ mnLines

tools::Long ThumbnailView::mnLines
protected

Definition at line 300 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), and KeyInput().

◆ mnThumbnailHeight

tools::Long ThumbnailView::mnThumbnailHeight
protected

Definition at line 296 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), and setItemDimensions().

◆ mnVisLines

tools::Long ThumbnailView::mnVisLines
protected

Definition at line 299 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), ImplInit(), MakeItemVisible(), and SelectItem().

◆ mnVItemSpace

tools::Long ThumbnailView::mnVItemSpace
protected

Definition at line 298 of file thumbnailview.hxx.

Referenced by CalculateItemPositions().

◆ mpItemAttrs

std::unique_ptr<ThumbnailItemAttributes> ThumbnailView::mpItemAttrs
protected

◆ mpStartSelRange

ThumbnailValueItemList::iterator ThumbnailView::mpStartSelRange
protected

◆ mxAccessible

css::uno::Reference<css::accessibility::XAccessible> ThumbnailView::mxAccessible
protected

◆ mxContextMenu

std::unique_ptr<weld::Menu> ThumbnailView::mxContextMenu
protected

◆ mxScrolledWindow

std::unique_ptr<weld::ScrolledWindow> ThumbnailView::mxScrolledWindow
protected

Definition at line 320 of file thumbnailview.hxx.

Referenced by CalculateItemPositions(), and ThumbnailView().


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