Add a crazy amount of missed files from the previous commit.
[dcpomatic.git] / src / wx / recipient_dialog.h
1 /*
2     Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic 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 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic 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 DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include "editable_list.h"
22 #include "email_dialog.h"
23 #include "wx_util.h"
24 #include "lib/screen.h"
25 #include <dcp/certificate.h>
26 #include <wx/wx.h>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/optional.hpp>
29
30 class Progress;
31 class TrustedDeviceDialog;
32
33 class RecipientDialog : public wxDialog
34 {
35 public:
36         RecipientDialog (
37                 wxWindow *,
38                 wxString,
39                 std::string name = "",
40                 std::string notes = "",
41                 std::list<std::string> emails = std::list<std::string>(),
42                 int utc_offset_hour = 0,
43                 int utc_offset_minute = 0,
44                 boost::optional<dcp::Certificate> c = boost::optional<dcp::Certificate>()
45                 );
46
47         std::string name () const;
48         std::string notes () const;
49         boost::optional<dcp::Certificate> recipient () const;
50         std::list<std::string> emails () const;
51         int utc_offset_hour () const;
52         int utc_offset_minute () const;
53
54 private:
55         void get_recipient_from_file ();
56         void load_recipient (boost::filesystem::path);
57         void setup_sensitivity ();
58         void set_recipient (boost::optional<dcp::Certificate>);
59         std::vector<std::string> get_emails () const;
60         void set_emails (std::vector<std::string>);
61
62         wxGridBagSizer* _sizer;
63         wxTextCtrl* _name;
64         wxTextCtrl* _notes;
65         wxStaticText* _recipient_thumbprint;
66         wxButton* _get_recipient_from_file;
67         EditableList<std::string, EmailDialog>* _email_list;
68         std::vector<std::string> _emails;
69         wxChoice* _utc_offset;
70         std::vector<Offset> _offsets;
71
72         boost::optional<dcp::Certificate> _recipient;
73 };