/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_SVX_GALCTRL_HXX #define INCLUDED_SVX_GALCTRL_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class GalleryTheme; class GalleryBrowser2; class SVX_DLLPUBLIC GalleryPreview : public vcl::Window, public DropTargetHelper, public DragSourceHelper { private: GraphicObject aGraphicObj; Rectangle aPreviewRect; GalleryTheme* mpTheme; SVX_DLLPRIVATE bool ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const; SVX_DLLPRIVATE void InitSettings(); // Window SVX_DLLPRIVATE virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; SVX_DLLPRIVATE virtual Size GetOptimalSize() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; // DropTargetHelper SVX_DLLPRIVATE virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE; // DragSourceHelper SVX_DLLPRIVATE virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE; public: GalleryPreview(vcl::Window* pParent, WinBits nStyle = WB_TABSTOP | WB_BORDER, GalleryTheme* pTheme = NULL); void SetGraphic( const Graphic& rGraphic ) { aGraphicObj.SetGraphic( rGraphic ); } bool SetGraphic( const INetURLObject& ); static void PreviewMedia( const INetURLObject& rURL ); }; class GalleryIconView : public ValueSet, public DropTargetHelper, public DragSourceHelper { using ValueSet::StartDrag; private: GalleryTheme* mpTheme; void InitSettings(); // ValueSet virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE; // Window virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; // DropTargetHelper virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE; virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE; // DragSourceHelper virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE; public: GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme ); }; class GalleryListView : public BrowseBox { using BrowseBox::AcceptDrop; using BrowseBox::ExecuteDrop; private: Link<> maSelectHdl; GalleryTheme* mpTheme; long mnCurRow; void InitSettings(); // BrowseBox virtual bool SeekRow( long nRow ) SAL_OVERRIDE; virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const SAL_OVERRIDE; virtual void DoubleClick( const BrowserMouseEvent& rEvt ) SAL_OVERRIDE; virtual void Select() SAL_OVERRIDE; virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt ) SAL_OVERRIDE; virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) SAL_OVERRIDE; virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; // Window virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; // DragSourceHelper virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE; public: GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme ); void SetSelectHdl( const Link<>& rSelectHdl ) { maSelectHdl = rSelectHdl; } /** GetCellText returns the text at the given position @param _nRow the number of the row @param _nColId the ID of the column @return the text out of the cell */ virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const SAL_OVERRIDE; // from IAccessibleTableProvider virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) SAL_OVERRIDE; virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) SAL_OVERRIDE; }; #endif // INCLUDED_SVX_GALCTRL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ kports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-03replace ErrorInfo with simpler mechanismNoel Grandin
Instead of returning ErrCode class everywhere, return a new class ErrrCodeMsg, which combines an ErrCode with the other parameters that are used to control the error reporting. I do not change everything that uses ErrCode here, I started from SfxBaseController/SfxMedium and worked outwards. This change serves two purposes (1) Replace the extremely whacky ErrorInfo mechanism we were using to smuggle information into the error handler reporting mechanism with a very straightforward approach of just combining it into the error class. (2) Allow us to capture the source location that produced the error, which makes debugging the source of a problem soooo much easier. Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-14move ErrCode to comphelper and improve debug output stringNoel Grandin
need to move it, because modules "below" vcl want to use the debug output method Change-Id: Ibcaf4089a1e0b3fcc0b5189c7ebf1aae90f50b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-07clang-tidy modernize-pass-by-value in scNoel Grandin
Change-Id: Ia7ff651d1cbc119b36a9f8052594d03650988f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-12Typo *Successfull->*SuccessfulJulien Nabet
Change-Id: I837241da936ac013312228f774d08bb8dafa45e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121967 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-23tdf#124176 Use pragma once in s*Vincent LE GARREC
sc, scaddins, sccomp, scripting Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-10-16sc: use the fastparser API when possibleNoel
part of the process of making SvXMLImport fastparser-only Change-Id: Idf785f38b233e26c00d699302b7eab7e41fe817a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-11remove archaic Content.xml fallbackCaolán McNamara
there's no evidence that Content.xml (or Meta.xml) was written by any released version to necessitate the fallback reportdesign Settings.xml and Style.xml fallbacks appear to be cargocult influenced by the Content.xml/Meta.xml examples Change-Id: I51d138344edaffc6d21e17c2d28047ea6316304e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93970 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
2020-05-09compact namespace in scNoel Grandin
Change-Id: I05ffad6b92883d3eb6d337fe75f5fc7864485861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93860 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>