20#include <config_features.h>
24#include <sfx2/sfxsids.hrc>
36#include <bitmaps.hlst>
39 : mxScrolledWindow(
std::move(xScrolledWindow))
63 CustomWidgetController::SetDrawingArea(pDrawingArea);
81 if( aNewSize.Width() && aNewSize.Height() )
84 const double fGrfWH =
static_cast<double>(aNewSize.Width()) / aNewSize.Height();
85 const double fWinWH =
static_cast<double>(aWinSize.Width()) / aWinSize.Height();
87 if ( fGrfWH < fWinWH )
89 aNewSize.setWidth(
static_cast<tools::Long>( aWinSize.Height() * fGrfWH ) );
90 aNewSize.setHeight( aWinSize.Height() );
94 aNewSize.setWidth( aWinSize.Width() );
95 aNewSize.setHeight(
static_cast<tools::Long>( aWinSize.Width() / fGrfWH) );
98 const Point aNewPos( ( aWinSize.Width() - aNewSize.Width() ) >> 1,
99 ( aWinSize.Height() - aNewSize.Height() ) >> 1 );
111 return ::ImplGetGraphicCenterRect(*
this, rGraphic, rResultRect);
117 rRenderContext.
Erase();
200#if HAVE_FEATURE_AVMEDIA
209 pViewFrm->GetBindings().GetDispatcher()->Execute( SID_AVMEDIA_PLAYER, SfxCallMode::SYNCHRON );
226 CustomWidgetController::SetDrawingArea(pDrawingArea);
236#if HAVE_FEATURE_AVMEDIA
239 aGraphic =
BitmapEx(RID_SVXBMP_GALLERY_MEDIA);
257 return ::ImplGetGraphicCenterRect(*
this, rGraphic, rResultRect);
279 static const sal_uInt32 nLen(8);
281 static const Color aG(0xef, 0xef, 0xef);
323 OUString aItemTextTitle;
324 OUString aItemTextPath;
328 bool bNeedToCreate(aBitmapEx.
IsEmpty());
330 if (!bNeedToCreate && aItemTextTitle.isEmpty())
332 bNeedToCreate =
true;
335 if (!bNeedToCreate && aPreparedSize != aSize)
337 bNeedToCreate =
true;
346 aBitmapEx = pObj->createPreviewBitmapEx(aSize);
357 ((aSize.
Width() - aBitmapExSizePixel.
Width()) >> 1) + rRect.
Left(),
385 bool bRet = ValueSet::Command(rCEvt);
387 if (!bRet && rCEvt.
GetCommand() == CommandEventId::ContextMenu)
const Size & GetSizePixel() const
CommandEventId GetCommand() const
void SetGraphic(const Graphic &rGraphic)
GraphicObject aGraphicObj
tools::Rectangle aPreviewRect
virtual SVX_DLLPRIVATE void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
SVX_DLLPRIVATE bool ImplGetGraphicCenterRect(const Graphic &rGraphic, tools::Rectangle &rResultRect) const
void Travel(GalleryBrowserTravel eTravel)
bool KeyInput(const KeyEvent &rEvt)
bool ShowContextMenu(const CommandEvent &rCEvt)
static OUString GetItemText(const SgaObject &rObj, GalleryItemFlags nItemTextFlags)
virtual void UserDraw(const UserDrawEvent &rUDEvt) override
virtual bool Command(const CommandEvent &rCEvt) override
GalleryIconView(GalleryBrowser2 *pParent, std::unique_ptr< weld::ScrolledWindow > xScrolledWindow)
GalleryBrowser2 * mpParent
virtual bool StartDrag() override
static void drawTransparenceBackground(vcl::RenderContext &rOut, const Point &rPos, const Size &rSize)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
virtual bool KeyInput(const KeyEvent &rKEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual ~GalleryIconView() override
std::unique_ptr< GalleryDragDrop > mxDragDropTargetHelper
virtual bool Command(const CommandEvent &rCEvt) override
virtual bool KeyInput(const KeyEvent &rKEvt) override
virtual void Show() override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool StartDrag() override
virtual void Hide() override
tools::Rectangle aPreviewRect
virtual ~GalleryPreview() override
std::unique_ptr< weld::ScrolledWindow > mxScrolledWindow
static void PreviewMedia(const INetURLObject &rURL)
GalleryBrowser2 * mpParent
GraphicObject aGraphicObj
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
std::unique_ptr< GalleryDragDrop > mxDragDropTargetHelper
bool ImplGetGraphicCenterRect(const Graphic &rGraphic, tools::Rectangle &rResultRect) const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
GalleryPreview(GalleryBrowser2 *pParent, std::unique_ptr< weld::ScrolledWindow > xScrolledWindow)
std::unique_ptr< SgaObject > AcquireObject(sal_uInt32 nPos)
SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const BitmapEx &rBitmapEx, const Size &rSize, const OUString &rTitle, const OUString &rPath)
SAL_DLLPRIVATE void GetPreviewBitmapExAndStrings(sal_uInt32 nPos, BitmapEx &rBitmapEx, Size &rSize, OUString &rTitle, OUString &rPath)
static GraphicFilter & GetGraphicFilter()
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
const Graphic & GetGraphic() const
bool StartAnimation(OutputDevice &rOut, const Point &rPt, const Size &rSz, tools::Long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
bool Draw(OutputDevice &rOut, const Point &rPt, const Size &rSz, const GraphicAttr *pAttr=nullptr) const
MapMode GetPrefMapMode() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
INetProtocol GetProtocol() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void DrawCheckered(const Point &rPos, const Size &rSize, sal_uInt32 nLen=8, Color aStart=COL_WHITE, Color aEnd=COL_BLACK)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
vcl::RenderContext * GetRenderContext() const
const tools::Rectangle & GetRect() const
sal_uInt16 GetItemId() const
void SetItemText(sal_uInt16 nItemId, const OUString &rStr)
void SetStyle(WinBits nStyle)
void EnableFullItemMode(bool bFullMode)
void SetItemHeight(tools::Long nLineHeight)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool KeyInput(const KeyEvent &rKEvt) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
void SetExtraSpacing(sal_uInt16 nNewSpacing)
void SetItemWidth(tools::Long nItemWidth)
sal_uInt16 GetCode() const
virtual OutputDevice & get_ref_device()=0
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
virtual void SetHelpId(const OUString &) override
RegionData_Impl * mpParent
constexpr OUStringLiteral HID_GALLERY_WINDOW
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END