digiKam
iccprofilescombobox.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 : 2009-08-11
7  * Description : a combo box containing ICC profiles
8  *
9  * Copyright (C) 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_ICC_PROFILES_COMBOBOX_H
25 #define DIGIKAM_ICC_PROFILES_COMBOBOX_H
26 
27 // Qt includes
28 
29 #include <QComboBox>
30 #include <QIcon>
31 #include <QMenu>
32 
33 // Local includes
34 
35 #include "squeezedcombobox.h"
36 #include "digikam_export.h"
37 #include "iccprofile.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT IccProfilesComboBox : public SqueezedComboBox
43 {
44  Q_OBJECT
45 
46 public:
51  explicit IccProfilesComboBox(QWidget* const parent = nullptr);
52  ~IccProfilesComboBox() override;
53 
58  void addProfilesSqueezed(const QList<IccProfile>& profiles);
59 
64  void addProfileSqueezed(const IccProfile& profile, const QString& description = QString());
65 
69  void replaceProfilesSqueezed(const QList<IccProfile>& profiles);
70 
75  void setNoProfileIfEmpty(const QString& message);
76 
80  IccProfile currentProfile() const;
81 
85  void setCurrentProfile(const IccProfile& profile);
86 };
87 
88 // ----------------------------------------------------------------------------
89 
90 class DIGIKAM_EXPORT IccRenderingIntentComboBox : public QComboBox
91 {
92  Q_OBJECT
93 
94 public:
95 
96  explicit IccRenderingIntentComboBox(QWidget* const parent = nullptr);
97 
98  void setIntent(int intent);
99  int intent() const;
100 };
101 
102 // ----------------------------------------------------------------------------
103 
104 class DIGIKAM_EXPORT IccProfilesMenuAction : public QMenu
105 {
106  Q_OBJECT
107 
108 public:
109 
110  IccProfilesMenuAction(const QIcon& icon, const QString& text, QObject* const parent);
111  IccProfilesMenuAction(const QString& text, QObject* const parent);
112 
117  void addProfiles(const QList<IccProfile>& profile);
118 
123  void addProfile(const IccProfile& profile, const QString& description = QString());
124 
128  void replaceProfiles(const QList<IccProfile>& profile);
129 
133  void disableIfEmpty();
134 
138  QObject* parentObject() const;
139 
140 Q_SIGNALS:
141 
142  void triggered(const IccProfile& profile);
143 
144 protected Q_SLOTS:
145 
146  void slotTriggered(QObject*);
147 
148 protected:
149 
150  QObject* m_parent;
151 
152 private:
153 
154  // Disable
155  IccProfilesMenuAction(QWidget*);
156 };
157 
158 } // namespace Digikam
159 
160 #endif // DIGIKAM_ICC_PROFILES_COMBOBOX_H
Definition: iccprofile.h:43
Definition: iccprofilescombobox.h:43
Definition: iccprofilescombobox.h:105
QObject * m_parent
Definition: iccprofilescombobox.h:150
void triggered(const IccProfile &profile)
Definition: iccprofilescombobox.h:91
Definition: squeezedcombobox.h:51
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43