1 /*
2  *  This file is part of RawTherapee.
3  *
4  *  Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
5  *
6  *  RawTherapee is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation, either version 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  RawTherapee is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with RawTherapee.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 #pragma once
20 
21 #include <memory>
22 
23 #include <gtkmm.h>
24 
25 #include "guiutils.h"
26 #include "toolpanel.h"
27 
28 class IPTCPanel :
29     public Gtk::VBox,
30     public ToolPanel
31 {
32 
33 private:
34     const std::unique_ptr<rtengine::procparams::IPTCPairs> changeList;
35     const std::unique_ptr<rtengine::procparams::IPTCPairs> defChangeList;
36     const std::unique_ptr<rtengine::procparams::IPTCPairs> embeddedData;
37 
38     Gtk::TextView*  captionView;
39     Glib::RefPtr<Gtk::TextBuffer> captionText;
40     Gtk::Entry*     captionWriter;
41     Gtk::Entry*     headline;
42     Gtk::Entry*     instructions;
43     MyComboBoxText* keyword;
44     Gtk::ListViewText*  keywords;
45     Gtk::Button*    addKW;
46     Gtk::Button*    delKW;
47     MyComboBoxText* category;
48     MyComboBoxText* suppCategory;
49     Gtk::ListViewText*      suppCategories;
50     Gtk::Button*    addSC;
51     Gtk::Button*    delSC;
52 
53     Gtk::Entry*     creator;
54     Gtk::Entry*     creatorJobTitle;
55     Gtk::Entry*     credit;
56     Gtk::Entry*     source;
57     Gtk::Entry*     copyright;
58     Gtk::Entry*     city;
59     Gtk::Entry*     province;
60     Gtk::Entry*     country;
61     Gtk::Entry*     title;
62     Gtk::Entry*     dateCreated;
63     Gtk::Entry*     transReference;
64 
65     Gtk::Button*    reset;
66     Gtk::Button*    file;
67     Gtk::Button*    copy;
68     Gtk::Button*    paste;
69 
70     sigc::connection conns[16];
71 
72     void applyChangeList ();
73     void updateChangeList ();
74 
75 public:
76     IPTCPanel ();
77 
78     void read           (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
79     void write          (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override;
80     void setDefaults    (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
81 
82     void setImageData   (const rtengine::FramesMetaData* id);
83 
84     void notifyListener ();
85 
86     void addKeyWord     ();
87     void delKeyWord     ();
88     void addSuppCategory ();
89     void delSuppCategory ();
90 
91     void resetClicked   ();
92     void fileClicked    ();
93     void copyClicked    ();
94     void pasteClicked   ();
95 };
96