File indexing completed on 2024-05-19 04:49:49

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Thomas Lübking <thomas.luebking@web.de                            *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016  
0017 #ifndef LAYOUTEDITDIALOG_H
0018 #define LAYOUTEDITDIALOG_H
0019 
0020 #include <QDialog>
0021 #include <QPointer>
0022 
0023 class HintingLineEdit;
0024 class QLabel;
0025 class QRadioButton;
0026 class QSlider;
0027 class QToolButton;
0028 class TokenWithLayout;
0029 
0030 class LayoutEditDialog : public QDialog
0031 {
0032     Q_OBJECT
0033 public:
0034     explicit LayoutEditDialog( QWidget *parent = nullptr );
0035     void setToken( TokenWithLayout *t );
0036 public Q_SLOTS:
0037     void close();
0038 private Q_SLOTS:
0039     void apply();
0040     void setAutomaticWidth( bool peer );
0041 private:
0042     QPointer<TokenWithLayout> m_token;
0043     HintingLineEdit *m_prefix;
0044     HintingLineEdit *m_suffix;
0045     QLabel *m_element;
0046     QSlider *m_width;
0047 
0048     /** Stores the width that the widget had before switching to automatic width. */
0049     int m_previousWidth;
0050 
0051     QToolButton *m_bold, *m_italic, *m_underline;
0052     QToolButton *m_alignLeft, *m_alignCenter, *m_alignRight;
0053     QRadioButton *m_fixedWidth;
0054     QRadioButton *m_automaticWidth;
0055 };
0056 
0057 #endif