QElectroTech  0.8-dev
templatelogomanager.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef TITLEBLOCK_SLASH_TEMPLATE_LOGO_MANAGER
19 #define TITLEBLOCK_SLASH_TEMPLATE_LOGO_MANAGER
20 #include <QtWidgets>
21 class TitleBlockTemplate;
22 
27 class TitleBlockTemplateLogoManager : public QWidget {
28  Q_OBJECT
29  // Constructor, destructor
30  public:
31  TitleBlockTemplateLogoManager(TitleBlockTemplate *, QWidget * = nullptr);
33 
34  // methods
35  public:
36  QString currentLogo() const;
37  bool isReadOnly() const;
38  void setReadOnly(bool);
39 
40  signals:
42 
43  protected:
45 
46  private:
47  void initWidgets();
48  void fillView();
49  QSize iconsize() const;
50  QString confirmLogoName(const QString &);
51 
52  private slots:
53  void updateLogoInformations(QListWidgetItem *, QListWidgetItem *);
54  void addLogo();
55  void exportLogo();
56  void removeLogo();
57  void renameLogo();
58 
59  // attributes
60  private:
62  QVBoxLayout *vlayout0_, *vlayout1_;
63  QHBoxLayout *hlayout0_, *hlayout1_;
64  QLabel *logos_label_;
65  QListWidget *logos_view_;
66  QPushButton *add_button_;
67  QPushButton *export_button_;
68  QPushButton *delete_button_;
69  QGroupBox *logo_box_;
70  QLabel *logo_name_label_;
71  QLineEdit *logo_name_;
72  QPushButton *rename_button_;
73  QLabel *logo_type_;
74  QDialogButtonBox *buttons_;
76  bool read_only_;
77 };
78 #endif
TitleBlockTemplateLogoManager
Definition: templatelogomanager.h:27
TitleBlockTemplateLogoManager::logo_name_
QLineEdit * logo_name_
current logo name
Definition: templatelogomanager.h:71
TitleBlockTemplateLogoManager::~TitleBlockTemplateLogoManager
~TitleBlockTemplateLogoManager() override
Definition: templatelogomanager.cpp:40
TitleBlockTemplateLogoManager::hlayout1_
QHBoxLayout * hlayout1_
horizontal layouts
Definition: templatelogomanager.h:63
TitleBlockTemplateLogoManager::logo_name_label_
QLabel * logo_name_label_
"name:" label
Definition: templatelogomanager.h:70
TitleBlockTemplateLogoManager::currentLogo
QString currentLogo() const
Definition: templatelogomanager.cpp:47
TitleBlockTemplateLogoManager::renameLogo
void renameLogo()
Definition: templatelogomanager.cpp:332
TitleBlockTemplateLogoManager::logos_label_
QLabel * logos_label_
simple displayed label
Definition: templatelogomanager.h:64
TitleBlockTemplateLogoManager::logo_type_
QLabel * logo_type_
current logo type
Definition: templatelogomanager.h:73
TitleBlockTemplateLogoManager::initWidgets
void initWidgets()
Definition: templatelogomanager.cpp:74
TitleBlockTemplateLogoManager::logosChanged
void logosChanged(const TitleBlockTemplate *)
TitleBlockTemplateLogoManager::delete_button_
QPushButton * delete_button_
button to delete an embedded logo
Definition: templatelogomanager.h:68
TitleBlockTemplateLogoManager::fillView
void fillView()
Definition: templatelogomanager.cpp:136
TitleBlockTemplateLogoManager::addLogo
void addLogo()
Definition: templatelogomanager.cpp:264
TitleBlockTemplateLogoManager::vlayout0_
QVBoxLayout * vlayout0_
Definition: templatelogomanager.h:62
TitleBlockTemplateLogoManager::buttons_
QDialogButtonBox * buttons_
ok/cancel buttons
Definition: templatelogomanager.h:74
TitleBlockTemplateLogoManager::emitLogosChangedSignal
void emitLogosChangedSignal()
Definition: templatelogomanager.cpp:67
QET::Icons::DocumentExport
QIcon DocumentExport
Definition: qeticons.cpp:50
TitleBlockTemplateLogoManager::isReadOnly
bool isReadOnly() const
Definition: templatelogomanager.cpp:60
TitleBlockTemplateLogoManager::iconsize
QSize iconsize() const
Definition: templatelogomanager.cpp:170
TitleBlockTemplateLogoManager::updateLogoInformations
void updateLogoInformations(QListWidgetItem *, QListWidgetItem *)
Definition: templatelogomanager.cpp:245
TitleBlockTemplate
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition: titleblocktemplate.h:36
TitleBlockTemplateLogoManager::confirmLogoName
QString confirmLogoName(const QString &)
Definition: templatelogomanager.cpp:182
qeticons.h
TitleBlockTemplateLogoManager::logos_view_
QListWidget * logos_view_
area showing the logos
Definition: templatelogomanager.h:65
TitleBlockTemplateLogoManager::hlayout0_
QHBoxLayout * hlayout0_
Definition: templatelogomanager.h:63
TitleBlockTemplateLogoManager::vlayout1_
QVBoxLayout * vlayout1_
vertical layouts
Definition: templatelogomanager.h:62
TitleBlockTemplateLogoManager::add_button_
QPushButton * add_button_
button to add a new logo
Definition: templatelogomanager.h:66
TitleBlockTemplateLogoManager::read_only_
bool read_only_
Whether this logo manager should allow logo edition (renaming, addition, deletion)
Definition: templatelogomanager.h:76
QET::Icons::EditRename
QIcon EditRename
Definition: qeticons.cpp:69
TitleBlockTemplateLogoManager::setReadOnly
void setReadOnly(bool)
Definition: templatelogomanager.cpp:375
TitleBlockTemplateLogoManager::removeLogo
void removeLogo()
Definition: templatelogomanager.cpp:319
TitleBlockTemplateLogoManager::exportLogo
void exportLogo()
Definition: templatelogomanager.cpp:296
TitleBlockTemplateLogoManager::logo_box_
QGroupBox * logo_box_
current logo properties box
Definition: templatelogomanager.h:69
templatelogomanager.h
QET::Icons::InsertImage
QIcon InsertImage
Definition: qeticons.cpp:116
TitleBlockTemplateLogoManager::export_button_
QPushButton * export_button_
button to export an embedded logo
Definition: templatelogomanager.h:67
QET::QetMessageBox::warning
QMessageBox::StandardButton warning(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:68
TitleBlockTemplateLogoManager::open_dialog_dir_
QDir open_dialog_dir_
last opened directory
Definition: templatelogomanager.h:75
TitleBlockTemplateLogoManager::managed_template_
TitleBlockTemplate * managed_template_
title block template which this class manages logos
Definition: templatelogomanager.h:61
QET::QetMessageBox::critical
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:23
titleblocktemplate.h
QET::Icons::Add
QIcon Add
Definition: qeticons.cpp:24
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
TitleBlockTemplateLogoManager::TitleBlockTemplateLogoManager
TitleBlockTemplateLogoManager(TitleBlockTemplate *, QWidget *=nullptr)
Definition: templatelogomanager.cpp:29
QET::Icons::Cancel
QIcon Cancel
Definition: qeticons.cpp:34
TitleBlockTemplateLogoManager::rename_button_
QPushButton * rename_button_
button to rename the current logo
Definition: templatelogomanager.h:72
QET::Icons::Remove
QIcon Remove
Definition: qeticons.cpp:155