2016-02-17 10:11:00 +03:00
|
|
|
/***************************************************************************
|
|
|
|
* This file is part of the Lime Report project *
|
2021-08-18 20:21:36 +03:00
|
|
|
* Copyright (C) 2021 by Alexander Arin *
|
2016-02-17 10:11:00 +03:00
|
|
|
* arin_a@bk.ru *
|
|
|
|
* *
|
|
|
|
** GNU General Public License Usage **
|
|
|
|
* *
|
|
|
|
* This library is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
** GNU Lesser General Public License **
|
|
|
|
* *
|
|
|
|
* This library is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Lesser General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this library. *
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
* This library is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef LRFONTEDITORWIDGET_H
|
|
|
|
#define LRFONTEDITORWIDGET_H
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
#include <QAction>
|
2016-02-17 10:11:00 +03:00
|
|
|
#include <QFontComboBox>
|
|
|
|
#include <QStringListModel>
|
2024-09-04 17:31:16 +03:00
|
|
|
#include <QToolBar>
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2017-11-27 23:14:05 +03:00
|
|
|
#ifdef HAVE_REPORT_DESIGNER
|
2016-02-17 10:11:00 +03:00
|
|
|
#include "lrreportdesignwidget.h"
|
2017-11-24 00:13:47 +03:00
|
|
|
#endif
|
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
#include "lritemeditorwidget.h"
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
namespace LimeReport {
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class FontEditorWidget: public ItemEditorWidget {
|
2016-02-17 10:11:00 +03:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
explicit FontEditorWidget(const QString& title, QWidget* parent = 0);
|
2017-11-24 00:13:47 +03:00
|
|
|
bool ignoreSlots() const;
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
protected:
|
2024-09-04 17:31:16 +03:00
|
|
|
void setItemEvent(BaseDesignIntf* item);
|
|
|
|
QFontComboBox* fontNameEditor() { return m_fontNameEditor; }
|
2018-07-11 13:29:12 +03:00
|
|
|
void initEditor();
|
2017-11-24 00:13:47 +03:00
|
|
|
protected slots:
|
2018-05-16 11:00:15 +03:00
|
|
|
virtual void slotFontChanged(const QFont&);
|
2017-11-24 00:13:47 +03:00
|
|
|
virtual void slotFontSizeChanged(const QString& value);
|
|
|
|
virtual void slotFontAttribsChanged(bool);
|
2024-09-04 17:31:16 +03:00
|
|
|
void slotPropertyChanged(const QString& objectName, const QString& property,
|
|
|
|
const QVariant& oldValue, const QVariant& newValue);
|
|
|
|
|
2017-11-24 00:13:47 +03:00
|
|
|
protected:
|
2024-09-04 17:31:16 +03:00
|
|
|
QFont resFont() { return m_resFont; }
|
2017-11-24 00:13:47 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
private:
|
|
|
|
void updateValues(const QFont& font);
|
2016-02-17 10:11:00 +03:00
|
|
|
|
|
|
|
QFontComboBox* m_fontNameEditor;
|
|
|
|
QComboBox* m_fontSizeEditor;
|
|
|
|
QStringListModel m_fontSizeModel;
|
|
|
|
|
|
|
|
QAction* m_fontBold;
|
|
|
|
QAction* m_fontItalic;
|
|
|
|
QAction* m_fontUnderline;
|
|
|
|
|
|
|
|
bool m_ignoreSlots;
|
2017-11-24 00:13:47 +03:00
|
|
|
QFont m_resFont;
|
2016-02-17 10:11:00 +03:00
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class FontEditorWidgetForPage: public FontEditorWidget {
|
2017-11-24 00:13:47 +03:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
explicit FontEditorWidgetForPage(PageDesignIntf* page, const QString& title,
|
|
|
|
QWidget* parent = 0):
|
|
|
|
FontEditorWidget(title, parent),
|
|
|
|
m_page(page)
|
|
|
|
{
|
|
|
|
}
|
2017-11-24 00:13:47 +03:00
|
|
|
protected slots:
|
|
|
|
virtual void slotFontChanged(const QFont& font);
|
|
|
|
virtual void slotFontSizeChanged(const QString& value);
|
|
|
|
virtual void slotFontAttribsChanged(bool value);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2017-11-24 00:13:47 +03:00
|
|
|
private:
|
|
|
|
PageDesignIntf* m_page;
|
|
|
|
};
|
|
|
|
|
2017-11-27 23:14:05 +03:00
|
|
|
#ifdef HAVE_REPORT_DESIGNER
|
2024-09-04 17:31:16 +03:00
|
|
|
class FontEditorWidgetForDesigner: public FontEditorWidget {
|
2017-11-24 00:13:47 +03:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
explicit FontEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString& title,
|
|
|
|
QWidget* parent = 0):
|
|
|
|
FontEditorWidget(title, parent),
|
|
|
|
m_reportEditor(reportEditor)
|
|
|
|
{
|
|
|
|
initEditor();
|
|
|
|
}
|
2017-11-24 00:13:47 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void initEditor();
|
|
|
|
protected slots:
|
|
|
|
virtual void slotFontChanged(const QFont& font);
|
|
|
|
virtual void slotFontSizeChanged(const QString& value);
|
|
|
|
virtual void slotFontAttribsChanged(bool value);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2017-11-24 00:13:47 +03:00
|
|
|
private:
|
|
|
|
ReportDesignWidget* m_reportEditor;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
} // namespace LimeReport
|
2016-02-17 10:11:00 +03:00
|
|
|
|
|
|
|
#endif // LRFONTEDITORWIDGET_H
|