File indexing completed on 2024-07-21 12:11:57

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2020 Méven Car <meven.car@kdemail.net>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 #ifndef THUMBDEVICEPIXELRATIODEPENDENTCREATOR_H
0008 #define THUMBDEVICEPIXELRATIODEPENDENTCREATOR_H
0009 
0010 #include "thumbcreator.h"
0011 
0012 #include <qglobal.h>
0013 
0014 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 101)
0015 
0016 namespace KIO
0017 {
0018 /**
0019  * @class ThumbDevicePixelRatioDependentCreator thumbdevicepixelratiodependentcreator.h <KIO/ThumbDevicePixelratioDependentCreator>
0020  *
0021  * @see ThumbCreator
0022  *
0023  * This is an extension of ThumbCreator that allows to pass to the thumbCreator
0024  * a device pixel ratio to use for the output thumbnail.
0025  *
0026  * The dimensions are then passed to the thumbnail creator without scaling with the dpr.
0027  *
0028  * You also need to set the following key in the thumbcreator .desktop file
0029  * \code
0030  * DevicePixelRatioDependent=true;
0031  * \endcode
0032  *
0033  * @since 5.80
0034  *
0035  * @deprecated since 5.101, use KIO::ThumbnailCreator instead
0036  */
0037 class KIOWIDGETS_EXPORT ThumbDevicePixelRatioDependentCreator : public ThumbCreator
0038 {
0039 public:
0040     Q_DISABLE_COPY(ThumbDevicePixelRatioDependentCreator)
0041 
0042     /**
0043      * @deprecated since 5.101, use KIO::ThumbnailCreator instead
0044      */
0045     KIOWIDGETS_DEPRECATED_VERSION(5, 101, "Use KIO::ThumbnailCreator instead")
0046     ThumbDevicePixelRatioDependentCreator();
0047     ~ThumbDevicePixelRatioDependentCreator() override;
0048 
0049     /**
0050      * The device Pixel Ratio used for thumbnail creation
0051      */
0052     int devicePixelRatio() const;
0053 
0054     /**
0055      * Sets device Pixel Ratio used for thumbnail creation
0056      */
0057     void setDevicePixelRatio(int dpr);
0058 
0059 private:
0060     class Private;
0061     Private *d;
0062 };
0063 
0064 }
0065 
0066 typedef ThumbCreator *(*newCreator)();
0067 
0068 #endif
0069 
0070 #endif // THUMBDEVICEPIXELRATIODEPENDENTCREATOR_H