diff options
Diffstat (limited to 'include/vcl')
26 files changed, 192 insertions, 350 deletions
diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx index 120c3140909c..b5444afc877b 100644 --- a/include/vcl/BitmapBuffer.hxx +++ b/include/vcl/BitmapBuffer.hxx @@ -26,7 +26,6 @@ #include <vcl/dllapi.h> #include <vcl/BitmapPalette.hxx> -#include <vcl/ColorMask.hxx> #include <vcl/Scanline.hxx> #include <tools/long.hxx> @@ -40,13 +39,13 @@ struct VCL_DLLPUBLIC BitmapBuffer BitmapPalette maPalette; sal_uInt8* mpBits; ScanlineFormat meFormat = ScanlineFormat::NONE; - ColorMask maColorMask; + ScanlineDirection meDirection = ScanlineDirection::BottomUp; sal_uInt16 mnBitCount; }; VCL_DLLPUBLIC std::optional<BitmapBuffer> StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect, - ScanlineFormat nDstBitmapFormat, std::optional<BitmapPalette> pDstPal = std::nullopt, const ColorMask* pDstMask = nullptr ); + ScanlineFormat nDstBitmapFormat, std::optional<BitmapPalette> pDstPal = std::nullopt ); #endif // INCLUDED_VCL_BITMAPBUFFER_HXX diff --git a/include/vcl/BitmapInfoAccess.hxx b/include/vcl/BitmapInfoAccess.hxx index 1896dc9bfc44..e01c2aba7a8f 100644 --- a/include/vcl/BitmapInfoAccess.hxx +++ b/include/vcl/BitmapInfoAccess.hxx @@ -27,9 +27,8 @@ bool Bitmap32IsPreMultipled(); -typedef BitmapColor (*FncGetPixel)(ConstScanline pScanline, tools::Long nX, const ColorMask& rMask); -typedef void (*FncSetPixel)(Scanline pScanline, tools::Long nX, const BitmapColor& rBitmapColor, - const ColorMask& rMask); +typedef BitmapColor (*FncGetPixel)(ConstScanline pScanline, tools::Long nX); +typedef void (*FncSetPixel)(Scanline pScanline, tools::Long nX, const BitmapColor& rBitmapColor); class VCL_DLLPUBLIC BitmapInfoAccess { @@ -48,6 +47,15 @@ public: tools::Long Height() const { return mpBuffer ? mpBuffer->mnHeight : 0L; } + bool IsTopDown() const + { + assert(mpBuffer && "Access is not valid!"); + + return mpBuffer && mpBuffer->meDirection == ScanlineDirection::TopDown; + } + + bool IsBottomUp() const { return !IsTopDown(); } + ScanlineFormat GetScanlineFormat() const { assert(mpBuffer && "Access is not valid!"); @@ -124,15 +132,6 @@ public: /// of the required color. Returns SAL_MAX_UINT16 if nothing found. sal_uInt16 GetMatchingPaletteIndex(const BitmapColor& rBitmapColor) const; - const ColorMask& GetColorMask() const - { - const BitmapBuffer* pBuffer = mpBuffer; - - assert(pBuffer && "Access is not valid!"); - - return pBuffer->maColorMask; - } - private: BitmapInfoAccess(const BitmapInfoAccess&) = delete; BitmapInfoAccess& operator=(const BitmapInfoAccess&) = delete; @@ -140,7 +139,6 @@ private: protected: Bitmap maBitmap; BitmapBuffer* mpBuffer; - ColorMask maColorMask; BitmapAccessMode mnAccessMode; }; diff --git a/include/vcl/BitmapReadAccess.hxx b/include/vcl/BitmapReadAccess.hxx index b3895afa5c2e..3d6a47b33535 100644 --- a/include/vcl/BitmapReadAccess.hxx +++ b/include/vcl/BitmapReadAccess.hxx @@ -49,14 +49,18 @@ public: assert(mpBuffer && "Access is not valid!"); assert(nY < mpBuffer->mnHeight && "y-coordinate out of range!"); - return mpBuffer->mpBits + (nY * mpBuffer->mnScanlineSize); + if (mpBuffer->meDirection == ScanlineDirection::TopDown) + { + return mpBuffer->mpBits + (nY * mpBuffer->mnScanlineSize); + } + return mpBuffer->mpBits + ((mpBuffer->mnHeight - 1 - nY) * mpBuffer->mnScanlineSize); } BitmapColor GetPixelFromData(const sal_uInt8* pData, tools::Long nX) const { assert(pData && "Access is not valid!"); - return mFncGetPixel(pData, nX, maColorMask); + return mFncGetPixel(pData, nX); } sal_uInt8 GetIndexFromData(const sal_uInt8* pData, tools::Long nX) const @@ -68,7 +72,7 @@ public: { assert(pData && "Access is not valid!"); - mFncSetPixel(pData, nX, rBitmapColor, maColorMask); + mFncSetPixel(pData, nX, rBitmapColor); } BitmapColor GetPixel(tools::Long nY, tools::Long nX) const @@ -127,59 +131,43 @@ protected: public: BitmapBuffer* ImplGetBitmapBuffer() const { return mpBuffer; } - static BitmapColor GetPixelForN1BitMsbPal(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN8BitPal(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN24BitTcBgr(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN24BitTcRgb(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcAbgr(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcXbgr(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcArgb(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcXrgb(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcBgra(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcBgrx(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcRgba(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcRgbx(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); - static BitmapColor GetPixelForN32BitTcMask(ConstScanline pScanline, tools::Long nX, - const ColorMask& rMask); + static BitmapColor GetPixelForN1BitMsbPal(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN8BitPal(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN24BitTcBgr(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN24BitTcRgb(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcAbgr(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcXbgr(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcArgb(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcXrgb(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcBgra(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcBgrx(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcRgba(ConstScanline pScanline, tools::Long nX); + static BitmapColor GetPixelForN32BitTcRgbx(ConstScanline pScanline, tools::Long nX); static void SetPixelForN1BitMsbPal(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN8BitPal(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN24BitTcBgr(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN24BitTcRgb(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcAbgr(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcXbgr(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcArgb(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcXrgb(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcBgra(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcBgrx(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcRgba(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static void SetPixelForN32BitTcRgbx(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); - static void SetPixelForN32BitTcMask(Scanline pScanline, tools::Long nX, - const BitmapColor& rBitmapColor, const ColorMask& rMask); + const BitmapColor& rBitmapColor); static FncGetPixel GetPixelFunction(ScanlineFormat nFormat); static FncSetPixel SetPixelFunction(ScanlineFormat nFormat); diff --git a/include/vcl/BitmapWriteAccess.hxx b/include/vcl/BitmapWriteAccess.hxx index 631b097438bf..97611b30d96f 100644 --- a/include/vcl/BitmapWriteAccess.hxx +++ b/include/vcl/BitmapWriteAccess.hxx @@ -54,7 +54,7 @@ public: assert(nX < mpBuffer->mnWidth && "x-coordinate out of range!"); assert(nY < mpBuffer->mnHeight && "y-coordinate out of range!"); - mFncSetPixel(GetScanline(nY), nX, rBitmapColor, maColorMask); + mFncSetPixel(GetScanline(nY), nX, rBitmapColor); } void SetPixelIndex(tools::Long nY, tools::Long nX, sal_uInt8 cIndex) diff --git a/include/vcl/ColorMask.hxx b/include/vcl/ColorMask.hxx index 7610aa87e8fe..7fa23a154215 100644 --- a/include/vcl/ColorMask.hxx +++ b/include/vcl/ColorMask.hxx @@ -107,14 +107,10 @@ public: inline sal_uInt32 GetGreenMask() const; inline sal_uInt32 GetBlueMask() const; - inline void GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const; - inline void SetColorFor16BitMSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const; inline void GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const; - inline void SetColorFor16BitLSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const; inline void GetColorFor32Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const; inline void GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, const sal_uInt8* pPixel ) const; - inline void SetColorFor32Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const; }; inline sal_uInt32 ColorMask::GetRedMask() const @@ -132,21 +128,6 @@ inline sal_uInt32 ColorMask::GetBlueMask() const return maB.mnMask; } -inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const -{ - const sal_uInt32 nVal = pPixel[ 1 ] | ( static_cast<sal_uInt32>(pPixel[ 0 ]) << 8 ); - - MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor ); -} - -inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const -{ - const sal_uInt16 nVal = static_cast<sal_uInt16>(COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ )); - - pPixel[ 0 ] = static_cast<sal_uInt8>(nVal >> 8); - pPixel[ 1 ] = static_cast<sal_uInt8>(nVal); -} - inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const { const sal_uInt32 nVal = pPixel[ 0 ] | ( static_cast<sal_uInt32>(pPixel[ 1 ]) << 8 ); @@ -154,14 +135,6 @@ inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8 MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor ); } -inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const -{ - const sal_uInt16 nVal = static_cast<sal_uInt16>(COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ )); - - pPixel[ 0 ] = static_cast<sal_uInt8>(nVal); - pPixel[ 1 ] = static_cast<sal_uInt8>(nVal >> 8); -} - inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const { const sal_uInt32 nVal = static_cast<sal_uInt32>(pPixel[ 0 ]) | ( static_cast<sal_uInt32>(pPixel[ 1 ]) << 8 ) | @@ -179,15 +152,6 @@ inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor ); } -inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const -{ - const sal_uInt32 nVal = COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ ); - pPixel[ 0 ] = static_cast<sal_uInt8>(nVal); - pPixel[ 1 ] = static_cast<sal_uInt8>( nVal >> 8 ); - pPixel[ 2 ] = static_cast<sal_uInt8>( nVal >> 16 ); - pPixel[ 3 ] = static_cast<sal_uInt8>( nVal >> 24 ); -} - #endif // INCLUDED_VCL_COLORMASK_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/Scanline.hxx b/include/vcl/Scanline.hxx index b754e581d0c5..7432b48354f9 100644 --- a/include/vcl/Scanline.hxx +++ b/include/vcl/Scanline.hxx @@ -43,8 +43,13 @@ enum class ScanlineFormat : sal_uInt8 N32BitTcBgra, // premultiplied N32BitTcBgrx, // ignore alpha channel N32BitTcRgba, // premultiplied - N32BitTcRgbx, // ignore alpha channel - N32BitTcMask, + N32BitTcRgbx // ignore alpha channel +}; + +enum class ScanlineDirection : sal_uInt8 +{ + BottomUp, + TopDown }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/UserResourceScanner.hxx b/include/vcl/UserResourceScanner.hxx new file mode 100644 index 000000000000..2b2d4da0e7c5 --- /dev/null +++ b/include/vcl/UserResourceScanner.hxx @@ -0,0 +1,58 @@ +/* -*- 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/. + */ + +#pragma once + +#include <vcl/dllapi.h> +#include <rtl/ustring.hxx> +#include <memory> +#include <vector> +#include <deque> +#include <osl/file.hxx> + +namespace vcl +{ +namespace file +{ +VCL_DLLPUBLIC bool readFileStatus(osl::FileStatus& rStatus, const OUString& rFile); +VCL_DLLPUBLIC void splitPathString(std::u16string_view aPathString, std::deque<OUString>& rPaths); +} + +class VCL_DLLPUBLIC UserResourceScanner +{ +protected: + /** Scans the provided directory for the resource. + * + * The returned strings will contain the URLs to the resources. + */ + std::vector<OUString> readFilesFromPath(const OUString& dir); + + /** Return true if the filename is a valid resource */ + virtual bool isValidResource(const OUString& rFilename) = 0; + + /** Adds the provided resource by path. */ + virtual bool addResource(const OUString& /*path*/) = 0; + +public: + UserResourceScanner(); + virtual ~UserResourceScanner() {} + + /** Provide a semicolon-separated list of paths to search for resource. + * + * There are several cases when scan will fail: + * - The directory does not exist + * - There are no files which have a valid resource + */ + + void addPaths(std::u16string_view paths); +}; + +} // end namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index 1a6a83fc77ef..a333a2252be6 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -157,6 +157,16 @@ protected: virtual ~AbstractDiagramDialog() override = default; }; +class VCL_DLLPUBLIC AbstractQueryDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractQueryDialog() override = default; +public: + virtual bool ShowAgain() const = 0; + virtual void SetYesLabel(const OUString& sLabel) = 0; + virtual void SetNoLabel(const OUString& sLabel) = 0; +}; + class VCL_DLLPUBLIC VclAbstractDialogFactory { public: @@ -200,6 +210,11 @@ public: weld::Window* pParent, SdrObjGroup& rDiagram) = 0; + virtual VclPtr<AbstractQueryDialog> CreateQueryDialog( + weld::Window* pParent, + const OUString& sTitle, const OUString& sText, const OUString& sQuestion, + bool bShowAgain) = 0; + #ifdef _WIN32 virtual VclPtr<VclAbstractDialog> CreateFileExtCheckDialog(weld::Window* _pParent, const OUString& sTitle, const OUString& sMsg) diff --git a/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx index c2bb476aebd6..584127ab5e7a 100644 --- a/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx +++ b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx @@ -32,8 +32,8 @@ * but others should be reported as object attributes (e.g. text alignment is reported * via the "text-align" object attribute on the paragraph object). * - * https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes - * https://wiki.linuxfoundation.org/accessibility/iaccessible2/objectattributes + * https://github.com/LinuxA11y/IAccessible2/blob/master/spec/textattributes.md + * https://github.com/LinuxA11y/IAccessible2/blob/master/spec/objectattributes.md * * This enum class is used to specify the type(s) of attributes of interest. */ diff --git a/include/vcl/accessibility/vclxaccessiblecomponent.hxx b/include/vcl/accessibility/vclxaccessiblecomponent.hxx index 1026da164bf7..fa52ac9650aa 100644 --- a/include/vcl/accessibility/vclxaccessiblecomponent.hxx +++ b/include/vcl/accessibility/vclxaccessiblecomponent.hxx @@ -79,7 +79,6 @@ public: sal_Int64 SAL_CALL getAccessibleChildCount( ) override; css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; sal_Int16 SAL_CALL getAccessibleRole( ) override; OUString SAL_CALL getAccessibleDescription( ) override; OUString SAL_CALL getAccessibleName( ) override; diff --git a/include/vcl/accessiblefactory.hxx b/include/vcl/accessiblefactory.hxx index e1897e9dc4a5..734d0a4d62d0 100644 --- a/include/vcl/accessiblefactory.hxx +++ b/include/vcl/accessiblefactory.hxx @@ -40,7 +40,6 @@ namespace com::sun::star { } namespace vcl { class IAccessibleBrowseBox; } -namespace vcl { class IAccessibleTabListBox; } namespace vcl { class IAccessibleTableProvider; } namespace vcl { class Window; } @@ -62,15 +61,6 @@ class SvTreeListBox; class TextEngine; class TextView; -namespace vcl -{ - namespace table - { - class IAccessibleTable; - class IAccessibleTableControl; - } -} - class VCL_DLLPUBLIC AccessibleFactory { public: @@ -103,18 +93,10 @@ public: static css::uno::Reference<css::accessibility::XAccessibleContext> createAccessibleContext(vcl::Window* pWindow); - static vcl::IAccessibleTabListBox* - createAccessibleTabListBox(const css::uno::Reference<css::accessibility::XAccessible>& rxParent, - SvHeaderTabListBox& rBox); - static rtl::Reference<vcl::IAccessibleBrowseBox> createAccessibleBrowseBox(const css::uno::Reference<css::accessibility::XAccessible>& _rxParent, vcl::IAccessibleTableProvider& _rBrowseBox); - static rtl::Reference<vcl::table::IAccessibleTableControl> createAccessibleTableControl( - const css::uno::Reference<css::accessibility::XAccessible>& _rxParent, - vcl::table::IAccessibleTable& _rTable); - static css::uno::Reference<css::accessibility::XAccessible> createAccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl, const css::uno::Reference<css::accessibility::XAccessible>& _xParent); diff --git a/include/vcl/accessibletable.hxx b/include/vcl/accessibletable.hxx deleted file mode 100644 index 66f5a1e5c050..000000000000 --- a/include/vcl/accessibletable.hxx +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- 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_VCL_ACCESSIBLETABLE_HXX -#define INCLUDED_VCL_ACCESSIBLETABLE_HXX - -#include <tools/gen.hxx> -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/accessibility/XAccessible.hpp> -#include <cppuhelper/implbase.hxx> - -namespace vcl { class Window; } - -namespace vcl::table -{ - -typedef sal_Int32 RowPos; - -enum class AccessibleTableControlObjType -{ - GRIDCONTROL, /// The GridControl itself. - TABLE, /// The data table. - ROWHEADERBAR, /// The row header bar. - COLUMNHEADERBAR, /// The horizontal column header bar. - TABLECELL, /// A cell of the data table. - ROWHEADERCELL, /// A cell of the row header bar. - COLUMNHEADERCELL, /// A cell of the column header bar. -}; - - -/** This abstract class provides methods to implement an accessible table object. -*/ -class IAccessibleTable -{ -public: - /** @return The position of the current row. */ - virtual sal_Int32 GetCurrentRow() const = 0; - /** @return The position of the current column. */ - virtual sal_Int32 GetCurrentColumn() const = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex )= 0; - virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0; - virtual void GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0; - virtual bool HasColHeader() = 0; - virtual bool HasRowHeader() = 0; - - /** return the description of the specified object. - @param eObjType - The type to ask for - @return - The description of the specified object. - */ - virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType) const= 0; - - /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by - the accessible object), depending on the specified object type. */ - virtual void FillAccessibleStateSet( sal_Int64& rStateSet, - AccessibleTableControlObjType eObjType ) const= 0; - - // Window - virtual AbsoluteScreenPixelRectangle GetWindowExtentsAbsolute() const = 0; - virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window& rRelativeWindow) const = 0; - virtual void GrabFocus()= 0; - virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible()= 0; - virtual vcl::Window* GetAccessibleParentWindow() const= 0; - virtual vcl::Window* GetWindowInstance()= 0; - virtual sal_Int32 GetAccessibleControlCount() const = 0; - virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0; - virtual sal_Int32 GetRowCount() const= 0; - virtual sal_Int32 GetColumnCount() const= 0; - virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0; - virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) = 0; - virtual tools::Rectangle calcHeaderCellRect( bool _bColHeader, sal_Int32 _nPos ) = 0; - virtual tools::Rectangle calcTableRect() = 0; - virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0; - virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0; - virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0; - virtual OUString GetRowName(sal_Int32 _nIndex) const = 0; - virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0; - virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; - - virtual sal_Int32 GetSelectedRowCount() const = 0; - virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0; - virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0; - virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0; - virtual void SelectAllRows( bool const i_select ) = 0; - -protected: - ~IAccessibleTable() {} -}; - - -/** interface for an implementation of a table control's Accessible component -*/ -class IAccessibleTableControl : public ::cppu::WeakImplHelper< css::accessibility::XAccessible > -{ -public: - - /** disposes the accessible implementation, so that it becomes defunc - */ - virtual void DisposeAccessImpl() = 0; - - /** checks whether the accessible implementation, and its context, are still alive - @return <TRUE/>, if the object is not disposed or disposing. - */ - virtual bool isAlive() const = 0; - - /** commits the event at all listeners of the cell - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitCellEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - /** commits the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitTableEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - - ///** Commits an event to all listeners. */ - virtual void commitEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue - ) = 0; - -protected: - ~IAccessibleTableControl() {} -}; - -} // namespace vcl::table - -#endif // INCLUDED_VCL_ACCESSIBLETABLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/accessibletableprovider.hxx b/include/vcl/accessibletableprovider.hxx index 30eafea49646..e9fe3d6b5fb0 100644 --- a/include/vcl/accessibletableprovider.hxx +++ b/include/vcl/accessibletableprovider.hxx @@ -127,35 +127,6 @@ protected: ~IAccessibleTableProvider() {} }; - -/** interface for an implementation of a table control's Accessible component -*/ -class IAccessibleTabListBox -{ -public: - /** returns the XAccessible object itself - - The reference returned here can be used to control the life time of the - IAccessibleTableImplementation object. - - The returned reference is guaranteed to not be <NULL/>. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() = 0; - - /** returns the accessible object for the column header bar - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getHeaderBar() = 0; - - /** Returns the accessible object for the table. - */ - virtual css::uno::Reference< css::accessibility::XAccessible> getTable() = 0; - -protected: - ~IAccessibleTabListBox() {} -}; - /** interface for an implementation of a browse box's Accessible component */ class IAccessibleBrowseBox : public cppu::WeakImplHelper<css::accessibility::XAccessible> diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index d501ef0192de..b69290ba41e9 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -304,7 +304,7 @@ namespace BuilderUtils void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition); //Convert an accessibility role name to accessibility role number - sal_Int16 getRoleFromName(const OUString& roleName); + sal_Int16 getRoleFromName(std::u16string_view roleName); } //sID may not exist, but must be of type T if it does diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 531633b3f738..1f0e0cf99f53 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -103,7 +103,7 @@ public: bool IsNative() const; - bool LoadNative( Graphic& rGraphic ) const; + bool LoadNative(Graphic& rGraphic, sal_Int32 nPageNum = -1) const; bool ExportNative( SvStream& rOStream ) const; diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 38cf0f3b1d30..350545ea0207 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -148,7 +148,6 @@ public: sal_uLong GetSizeBytes() const; - void Draw(OutputDevice& rOutDev, const Point& rDestPt) const; void Draw(OutputDevice& rOutDev, const Point& rDestPt, const Size& rDestSize) const; static void DrawEx(OutputDevice& rOutDev, const OUString& rText, diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index 293e2720b76f..140fdaacff9c 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -272,10 +272,11 @@ public: sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat); - ErrCode ImportGraphic( Graphic& rGraphic, std::u16string_view rPath, - SvStream& rStream, - sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, - sal_uInt16 * pDeterminedFormat = nullptr, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE ); + ErrCode ImportGraphic(Graphic& rGraphic, std::u16string_view rPath, SvStream& rStream, + sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, + sal_uInt16* pDeterminedFormat = nullptr, + GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE, + sal_Int32 nPageNum = -1); /// Imports multiple graphics. /// @@ -289,7 +290,8 @@ public: void MakeGraphicsAvailableThreaded(std::vector< Graphic* >& rGraphics); // Setting sizeLimit limits how much will be read from the stream. - Graphic ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 sizeLimit = 0, const Size* pSizeHint = nullptr); + Graphic ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 sizeLimit = 0, + const Size* pSizeHint = nullptr, sal_Int32 nPage = -1); const ErrCode& GetLastError() const { return *mxErrorEx;} SAL_DLLPRIVATE void ResetLastError(); @@ -317,7 +319,8 @@ public: SAL_DLLPRIVATE static ErrCode readWMF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType); SAL_DLLPRIVATE static ErrCode readEMF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType); - SAL_DLLPRIVATE static ErrCode readPDF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType); + SAL_DLLPRIVATE static ErrCode readPDF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType, + sal_Int32 nPageIndex = -1); SAL_DLLPRIVATE static ErrCode readTIFF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType); SAL_DLLPRIVATE static ErrCode readWithTypeSerializer(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType, std::u16string_view aFilterName); SAL_DLLPRIVATE static ErrCode readBMP(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType); diff --git a/include/vcl/notebookbar/notebookbar.hxx b/include/vcl/notebookbar/notebookbar.hxx index 05707a29ae6f..f519ccf86c45 100644 --- a/include/vcl/notebookbar/notebookbar.hxx +++ b/include/vcl/notebookbar/notebookbar.hxx @@ -60,7 +60,6 @@ private: Link<const SfxViewShell*, void> m_rDisposeLink; AllSettings DefaultSettings; - AllSettings PersonaSettings; void UpdateBackground(); diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx index 00b6b44969c1..894cf8af0d85 100644 --- a/include/vcl/pdfread.hxx +++ b/include/vcl/pdfread.hxx @@ -31,10 +31,11 @@ VCL_DLLPUBLIC size_t RenderPDFBitmaps(const void* pBuffer, int nSize, /// Imports a PDF stream as a VectorGraphicData. VCL_DLLPUBLIC bool importPdfVectorGraphicData(SvStream& rStream, - std::shared_ptr<VectorGraphicData>& rVectorGraphicData); + std::shared_ptr<VectorGraphicData>& rVectorGraphicData, + sal_Int32 nPageIndex = -1); /// Imports a PDF stream into rGraphic. -VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic); +VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic, sal_Int32 nPageIndex = -1); // When inserting a PDF file as an image or pasting PDF data from the clipboard, at least on a // Retina iMac, the resulting rendered image does not look sharp without this surprisingly large diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index 0fb7c2122090..5cd034c9878a 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -797,12 +797,6 @@ public: */ VCL_DLLPUBLIC std::set< ErrorCode > const & GetErrors() const; - // uses 128bit encryption - VCL_DLLPUBLIC static css::uno::Reference< css::beans::XMaterialHolder > - InitEncryption( const OUString& i_rOwnerPassword, - const OUString& i_rUserPassword - ); - /* functions for graphics state */ /* flag values: see vcl/outdev.hxx */ VCL_DLLPUBLIC void Push( PushFlags nFlags = PushFlags::ALL ); diff --git a/include/vcl/rendercontext/RasterOp.hxx b/include/vcl/rendercontext/RasterOp.hxx index 44b2a6c03a17..3bfa85fb6044 100644 --- a/include/vcl/rendercontext/RasterOp.hxx +++ b/include/vcl/rendercontext/RasterOp.hxx @@ -19,12 +19,13 @@ #pragma once +// Note that the values in this class must line up exactly with the values in css::awt::RasterOperation enum class RasterOp { OverPaint, Xor, - N0, - N1, + N0, // All bits which are affected by this operation are set to 0. + N1, // All bits which are affected by this operation are set to 1. Invert }; diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 4f335a0b02a1..29c4744670d3 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -228,6 +228,9 @@ public: SAL_DLLPRIVATE void Set3DColors( const Color& rColor ); + void SetSystemColorsLoaded( bool bLoaded ); + bool GetSystemColorsLoaded() const; + void SetFaceColor( const Color& rColor ); const Color& GetFaceColor() const; @@ -252,7 +255,7 @@ public: const Color& GetDarkShadowColor() const; void SetDefaultButtonTextColor( const Color& rColor ); - SAL_DLLPRIVATE const Color& GetDefaultButtonTextColor() const; + const Color& GetDefaultButtonTextColor() const; void SetButtonTextColor( const Color& rColor ); const Color& GetButtonTextColor() const; @@ -362,13 +365,10 @@ public: void SetWarningColor( const Color& rColor ); const Color& GetWarningColor() const; - void SetWarningTextColor( const Color& rColor ); const Color& GetWarningTextColor() const; - void SetErrorColor( const Color& rColor ); const Color& GetErrorColor() const; - void SetErrorTextColor( const Color& rColor ); const Color& GetErrorTextColor() const; void SetHelpColor( const Color& rColor ); @@ -384,7 +384,7 @@ public: const Color& GetMenuBarColor() const; void SetMenuBarRolloverColor( const Color& rColor ); - SAL_DLLPRIVATE const Color& GetMenuBarRolloverColor() const; + const Color& GetMenuBarRolloverColor() const; void SetMenuBorderColor( const Color& rColor ); const Color& GetMenuBorderColor() const; @@ -396,7 +396,7 @@ public: const Color& GetMenuBarTextColor() const; void SetMenuBarRolloverTextColor( const Color& rColor ); - SAL_DLLPRIVATE const Color& GetMenuBarRolloverTextColor() const; + const Color& GetMenuBarRolloverTextColor() const; void SetMenuBarHighlightTextColor( const Color& rColor ); const Color& GetMenuBarHighlightTextColor() const; diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index f8a70d2be2a4..c1a5a8879310 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -107,6 +107,7 @@ private: bool mbSysChild : 1 = false; bool mbIsCalculatingInitialLayoutSize : 1 = false; bool mbInitialLayoutSizeCalculated : 1 = false; + bool mbInSetNoteBookBar : 1 = false; bool mbPaintComplete : 1 = false; bool mbIsDeferredInit : 1 = false; Idle maLayoutIdle; @@ -162,6 +163,7 @@ public: SAL_DLLPRIVATE bool isLayoutEnabled() const; SAL_DLLPRIVATE void setOptimalLayoutSize(bool bAllowWindowShrink); bool isCalculatingInitialLayoutSize() const { return mbIsCalculatingInitialLayoutSize; } + bool isSettingUpNoteBookBar() const { return mbInSetNoteBookBar; } void SetIcon( sal_uInt16 nIcon ); sal_uInt16 GetIcon() const { return mnIcon; } diff --git a/include/vcl/themecolors.hxx b/include/vcl/themecolors.hxx index 3e23368bd351..80bc1308565d 100644 --- a/include/vcl/themecolors.hxx +++ b/include/vcl/themecolors.hxx @@ -18,6 +18,7 @@ enum class ThemeState { DISABLED = 0, ENABLED = 1, + RESET = 2, }; class VCL_DLLPUBLIC ThemeColors @@ -42,13 +43,13 @@ public: static bool IsThemeDisabled() { return GetThemeState() == ThemeState::DISABLED; }; static bool IsThemeEnabled() { return GetThemeState() == ThemeState::ENABLED; }; + static bool IsThemeReset() { return GetThemeState() == ThemeState::RESET; } + static void ResetTheme() { SetThemeState(ThemeState::RESET); } // !IsThemeCached means that the ThemeColors object doesn't have the colors from the registry yet. - static bool VclPluginCanUseThemeColors() - { - return IsThemeCached() - && !ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName()); - }; + // IsThemeReset means that the user pressed the Reset All button and the UI colors in the registry + // are not valid anymore => read from the system again + static bool VclPluginCanUseThemeColors() { return IsThemeCached() && !IsThemeReset(); }; void SetWindowColor(const Color& rColor) { m_aWindowColor = rColor; } void SetWindowTextColor(const Color& rColor) { m_aWindowTextColor = rColor; } diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx index 9e676601f8a8..2448626cd597 100644 --- a/include/vcl/toolkit/combobox.hxx +++ b/include/vcl/toolkit/combobox.hxx @@ -28,7 +28,6 @@ #include <vcl/toolkit/edit.hxx> #define COMBOBOX_APPEND (SAL_MAX_INT32) -#define COMBOBOX_ENTRY_NOTFOUND (SAL_MAX_INT32) #define COMBOBOX_MAX_ENTRIES (SAL_MAX_INT32 - 1) class ImplBtn; diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx index 94b0077f44fe..322925b437bf 100644 --- a/include/vcl/toolkit/svtabbx.hxx +++ b/include/vcl/toolkit/svtabbx.hxx @@ -24,6 +24,7 @@ #endif #include <config_options.h> +#include <accessibility/accessibletablistbox.hxx> #include <vcl/dllapi.h> #include <vcl/toolkit/treelistbox.hxx> #include <vcl/accessibletableprovider.hxx> @@ -60,7 +61,7 @@ public: SvTabListBox( vcl::Window* pParent, WinBits ); virtual ~SvTabListBox() override; virtual void dispose() override; - void SetTabs(sal_uInt16 nTabs, tools::Long const pTabPositions[], MapUnit = MapUnit::MapAppFont); + void SetTabs(const std::vector<tools::Long>& rTabPositions, MapUnit = MapUnit::MapAppFont); using SvTreeListBox::GetTab; tools::Long GetLogicTab( sal_uInt16 nTab ); @@ -95,23 +96,25 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvHeaderTabListBox : public SvTabList { private: bool m_bFirstPaint; - std::unique_ptr<::vcl::SvHeaderTabListBoxImpl> m_pImpl; - ::vcl::IAccessibleTabListBox* m_pAccessible; + VclPtr<HeaderBar> m_xHeaderBar; + rtl::Reference<AccessibleTabListBox> m_xAccessible; std::vector<css::uno::Reference<css::accessibility::XAccessible>> m_aAccessibleChildren; + Link<SvTreeListEntry*, bool> m_aEditingEntryHdl; + Link<const IterString&, bool> m_aEditedEntryHdl; + DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, SvTreeListBox*, void ); DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, HeaderBar*, void ); void RecalculateAccessibleChildren(); public: - SvHeaderTabListBox( vcl::Window* pParent, WinBits nBits ); + SvHeaderTabListBox(vcl::Window* pParent, WinBits nBits, HeaderBar* pHeaderBar); virtual ~SvHeaderTabListBox() override; virtual void dispose() override; virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override; - void InitHeaderBar(HeaderBar* pHeaderBar); HeaderBar* GetHeaderBar(); static bool IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ); @@ -203,6 +206,32 @@ public: virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override; virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override; + + void SetEditingEntryHdl(const Link<SvTreeListEntry*, bool>& rLink) + { + m_aEditingEntryHdl = rLink; + } + + void SetEditedEntryHdl(const Link<const IterString&, bool>& rLink) + { + m_aEditedEntryHdl = rLink; + } + + //the default NotifyStartDrag is weird to me, and defaults to enabling all + //possibilities when drag starts, while restricting it to some subset of + //the configured drag drop mode would make more sense to me, but I'm not + //going to change the baseclass + virtual DragDropMode NotifyStartDrag() override { return GetDragDropMode(); } + + virtual bool EditingEntry(SvTreeListEntry* pEntry) override + { + return m_aEditingEntryHdl.Call(pEntry); + } + + virtual bool EditedEntry(SvTreeListEntry* pEntry, const OUString& rNewText) override + { + return m_aEditedEntryHdl.Call(IterString(pEntry, rNewText)); + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |