digiKam
subjectwidget.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-10-15
7  * Description : IPTC subjects editor.
8  *
9  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at googlemail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_SUBJECT_WIDGET_H
26 #define DIGIKAM_SUBJECT_WIDGET_H
27 
28 // Qt includes
29 
30 #include <QByteArray>
31 #include <QMap>
32 #include <QStringList>
33 #include <QUrl>
34 #include <QWidget>
35 #include <QCheckBox>
36 #include <QLabel>
37 #include <QLineEdit>
38 
39 // Local includes
40 
41 #include "digikam_export.h"
42 
43 namespace Digikam
44 {
45 
46 class DIGIKAM_EXPORT SubjectData
47 {
48 public:
49 
50  SubjectData(const QString& n, const QString& m, const QString& d)
51  : name(n),
52  matter(m),
53  detail(d)
54  {
55  }
56 
57  QString name;
58  QString matter;
59  QString detail;
60 };
61 
62 // --------------------------------------------------------------------------------
63 
64 class DIGIKAM_EXPORT SubjectWidget : public QWidget
65 {
66  Q_OBJECT
67 
68 public:
69 
70  explicit SubjectWidget(QWidget* const parent, bool sizesLimited = false);
71  ~SubjectWidget() override;
72 
73  void setSubjectsList(const QStringList& list);
74  QStringList subjectsList() const;
75 
76 Q_SIGNALS:
77 
79 
80 protected Q_SLOTS:
81 
82  virtual void slotSubjectsToggled(bool);
83  virtual void slotRefChanged();
84  virtual void slotEditOptionChanged(int);
85  virtual void slotSubjectSelectionChanged();
86  virtual void slotAddSubject();
87  virtual void slotDelSubject();
88  virtual void slotRepSubject();
89 
90 protected:
91 
92  virtual bool loadSubjectCodesFromXML(const QUrl& url);
93  virtual QString buildSubject() const;
94 
95 protected:
96 
97  QLabel* m_note;
98 
99  QCheckBox* m_subjectsCheck;
100 
101  QLineEdit* m_iprEdit;
102  QLineEdit* m_refEdit;
103  QLineEdit* m_nameEdit;
104  QLineEdit* m_matterEdit;
105  QLineEdit* m_detailEdit;
106 
107  QString m_iprDefault;
108 
109 private:
110 
111  class Private;
112  Private* const d;
113 };
114 
115 } // namespace Digikam
116 
117 #endif // DIGIKAM_SUBJECT_WIDGET_H
Definition: subjectwidget.h:47
SubjectData(const QString &n, const QString &m, const QString &d)
Definition: subjectwidget.h:50
QString name
English and Name of subject.
Definition: subjectwidget.h:57
QString matter
English and Matter Name of subject.
Definition: subjectwidget.h:58
QString detail
English and Detail Name of subject.
Definition: subjectwidget.h:59
Definition: subjectwidget.h:65
QString m_iprDefault
Definition: subjectwidget.h:107
QCheckBox * m_subjectsCheck
Definition: subjectwidget.h:99
QLineEdit * m_matterEdit
Definition: subjectwidget.h:104
QLabel * m_note
Definition: subjectwidget.h:97
QLineEdit * m_detailEdit
Definition: subjectwidget.h:105
QLineEdit * m_iprEdit
Definition: subjectwidget.h:101
QLineEdit * m_refEdit
Definition: subjectwidget.h:102
QLineEdit * m_nameEdit
Definition: subjectwidget.h:103
Definition: datefolderview.cpp:43