File indexing completed on 2024-04-21 03:44:29

0001 /*
0002     SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PWIZFOVCONFIG_H
0008 #define PWIZFOVCONFIG_H
0009 
0010 #include "ui_pwizfovconfig.h"
0011 #include "legend.h"
0012 
0013 /**
0014   * \class PWizFovConfigUI
0015   * \brief User interface for "Configure common FOV export options" step of the Printing Wizard.
0016   * \author Rafał Kułaga
0017   */
0018 class PWizFovConfigUI : public QFrame, public Ui::PWizFovConfig
0019 {
0020     Q_OBJECT
0021   public:
0022     /**
0023           * \brief Constructor.
0024           */
0025     explicit PWizFovConfigUI(QWidget *parent = nullptr);
0026 
0027     /**
0028           * \brief Check if switching to "Sky Chart" color scheme is enabled.
0029           * \return True if color scheme switching is enabled.
0030           */
0031     bool isSwitchColorsEnabled() { return switchColorsBox->isChecked(); }
0032 
0033     /**
0034           * \brief Check if FOV shape is always rectangular.
0035           * \return True if FOV shape is always rectangular.
0036           */
0037     bool isFovShapeOverriden() { return overrideShapeBox->isChecked(); }
0038 
0039     /**
0040           * \brief Check if legend will be added to FOV images.
0041           * \return True if legend will be added to FOV images.
0042           */
0043     bool isLegendEnabled() { return addLegendBox->isChecked(); }
0044 
0045     /**
0046           * \brief Check if alpha blending is enabled.
0047           * \return True if alpha blending is enabled.
0048           */
0049     bool isAlphaBlendingEnabled() { return useAlphaBlendBox->isChecked(); }
0050 
0051     /**
0052           * \brief Get selected legend type.
0053           * \return Selected legend type.
0054           */
0055     Legend::LEGEND_TYPE getLegendType();
0056 
0057     /**
0058           * \brief Get selected legend orientation.
0059           * \return Selected legend orientation.
0060           */
0061     Legend::LEGEND_ORIENTATION getLegendOrientation()
0062     {
0063         return static_cast<Legend::LEGEND_ORIENTATION>(orientationCombo->currentIndex());
0064     }
0065 
0066     /**
0067           * \brief Get selected legend position.
0068           * \return Selected legend position.
0069           */
0070     Legend::LEGEND_POSITION getLegendPosition()
0071     {
0072         return static_cast<Legend::LEGEND_POSITION>(positionCombo->currentIndex());
0073     }
0074 
0075   private slots:
0076     /**
0077           * \brief Slot: enable or disable legend configuration fields.
0078           * \param enabled True if legend configuration fields should be enabled.
0079           */
0080     void slotUpdateLegendFields(bool enabled);
0081 
0082   private:
0083     /**
0084           * \brief Configure widgets.
0085           */
0086     void setupWidgets();
0087 
0088     /**
0089           * \brief Configure signal-slot connections.
0090           */
0091     void setupConnections();
0092 };
0093 
0094 #endif // PWIZFOVCONFIG_H