File indexing completed on 2024-05-05 05:21:42

0001 /*
0002   SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: LGPL-2.0-or-later
0005 
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QDialog>
0011 
0012 #include <QTextCharFormat>
0013 
0014 namespace KPIMTextEdit
0015 {
0016 class TableCellFormatDialog : public QDialog
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit TableCellFormatDialog(QWidget *parent);
0021     ~TableCellFormatDialog() override;
0022 
0023     /**
0024      * @brief tableCellBackgroundColor
0025      * @return background color of cell.
0026      */
0027     [[nodiscard]] QColor tableCellBackgroundColor() const;
0028 
0029     /**
0030      * @brief setTableCellBackgroundColor
0031      * @param color set the background color of cell
0032      */
0033     void setTableCellBackgroundColor(const QColor &color);
0034 
0035     /**
0036      * @brief verticalAlignment
0037      * @return vertical alignment for current cell.
0038      */
0039     [[nodiscard]] QTextCharFormat::VerticalAlignment verticalAlignment() const;
0040 
0041     /**
0042      * @brief setVerticalAlignment
0043      * @param vertical vertical alignment for current cell.
0044      */
0045     void setVerticalAlignment(QTextCharFormat::VerticalAlignment vertical);
0046 
0047     /**
0048      * @brief useBackgroundColor
0049      * @return true if we define background color. Otherwise false and allows to clear it.
0050      */
0051     [[nodiscard]] bool useBackgroundColor() const;
0052 
0053 private:
0054     class TableCellFormatDialogPrivate;
0055     std::unique_ptr<TableCellFormatDialogPrivate> const d;
0056 };
0057 }