2 Copyright (C) 2015-2020 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
21 #include "lib/dkdm_recipient.h"
23 #include <wx/srchctrl.h>
24 #include <wx/treectrl.h>
25 #include <boost/shared_ptr.hpp>
26 #include <boost/signals2.hpp>
32 class RecipientsPanel : public wxPanel
35 explicit RecipientsPanel (wxWindow* parent);
38 void setup_sensitivity ();
40 std::list<boost::shared_ptr<DKDMRecipient> > recipients () const;
41 boost::signals2::signal<void ()> RecipientsChanged;
44 void add_recipients ();
45 void add_recipient (boost::shared_ptr<DKDMRecipient>);
46 void add_recipient_clicked ();
47 void edit_recipient_clicked ();
48 void remove_recipient_clicked ();
49 void selection_changed_shim (wxTreeEvent &);
50 void selection_changed ();
51 void search_changed ();
53 wxSearchCtrl* _search;
55 wxButton* _add_recipient;
56 wxButton* _edit_recipient;
57 wxButton* _remove_recipient;
60 typedef std::map<wxTreeItemId, boost::shared_ptr<DKDMRecipient> > RecipientMap;
61 RecipientMap _recipients;
62 RecipientMap _selected;
64 bool _ignore_selection_change;