File indexing completed on 2025-01-19 03:51:10

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-02-06
0007  * Description : image editor printing interface.
0008  *
0009  * SPDX-FileCopyrightText: 2009      by Angelo Naselli <anaselli at linux dot it>
0010  * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_PRINT_OPTIONS_PAGE_H
0017 #define DIGIKAM_PRINT_OPTIONS_PAGE_H
0018 
0019 // Qt includes
0020 
0021 #include <QWidget>
0022 
0023 // Local includes
0024 
0025 #include "iccprofile.h"
0026 
0027 using namespace Digikam;
0028 
0029 namespace DigikamEditorPrintToolPlugin
0030 {
0031 
0032 class PrintOptionsPage : public QWidget
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037 
0038     enum ScaleMode
0039     {
0040         NoScale,
0041         ScaleToPage,
0042         ScaleToCustomSize
0043     };
0044 
0045     /**
0046      * Order should match the content of the unit combbox in the ui file
0047      */
0048     enum Unit
0049     {
0050         Millimeters,
0051         Centimeters,
0052         Inches
0053     };
0054 
0055 public:
0056 
0057     explicit PrintOptionsPage(QWidget* const parent, const QSize& imageSize);
0058     ~PrintOptionsPage() override;
0059 
0060     void loadConfig();
0061     void saveConfig();
0062 
0063     bool          enlargeSmallerImages() const;
0064     bool          colorManaged()         const;
0065     bool          autoRotation()         const;
0066     Qt::Alignment alignment()            const;
0067     IccProfile    outputProfile()        const;
0068 
0069     ScaleMode     scaleMode()            const;
0070     Unit          scaleUnit()            const;
0071     double        scaleWidth()           const;
0072     double        scaleHeight()          const;
0073 
0074 private Q_SLOTS:
0075 
0076     void adjustWidthToRatio();
0077     void adjustHeightToRatio();
0078     void slotAlertSettings(bool);
0079     void slotSetupDlg();
0080 
0081 private:
0082 
0083     class Private;
0084     Private* const d;
0085 };
0086 
0087 } // namespace DigikamEditorPrintToolPlugin
0088 
0089 #endif // DIGIKAM_PRINT_OPTIONS_PAGE_H