Goby v2
liaison_container.h
1 // Copyright 2009-2018 Toby Schneider (http://gobysoft.org/index.wt/people/toby)
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 //
6 //
7 // This file is part of the Goby Underwater Autonomy Project Libraries
8 // ("The Goby Libraries").
9 //
10 // The Goby Libraries are free software: you can redistribute them and/or modify
11 // them under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 2.1 of the License, or
13 // (at your option) any later version.
14 //
15 // The Goby Libraries are distributed in the hope that they will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef LIAISONCONTAINER20130128H
24 #define LIAISONCONTAINER20130128H
25 
26 #include <Wt/WColor>
27 #include <Wt/WContainerWidget>
28 #include <Wt/WText>
29 
30 #include "goby/common/protobuf/liaison_config.pb.h"
31 
32 namespace goby
33 {
34 namespace common
35 {
36 enum
37 {
38  LIAISON_INTERNAL_PUBLISH_SOCKET = 1,
39  LIAISON_INTERNAL_SUBSCRIBE_SOCKET = 2
40  // LIAISON_INTERNAL_COMMANDER_SUBSCRIBE_SOCKET = 3,
41  // LIAISON_INTERNAL_COMMANDER_PUBLISH_SOCKET = 4,
42  // LIAISON_INTERNAL_SCOPE_SUBSCRIBE_SOCKET = 5,
43  // LIAISON_INTERNAL_SCOPE_PUBLISH_SOCKET = 6,
44 };
45 
46 const Wt::WColor goby_blue(28, 159, 203);
47 const Wt::WColor goby_orange(227, 96, 52);
48 
49 inline std::string liaison_internal_publish_socket_name()
50 {
51  return "liaison_internal_publish_socket";
52 }
53 inline std::string liaison_internal_subscribe_socket_name()
54 {
55  return "liaison_internal_subscribe_socket";
56 }
57 
58 class LiaisonContainer : public Wt::WContainerWidget
59 {
60  public:
61  LiaisonContainer(Wt::WContainerWidget* parent) : Wt::WContainerWidget(parent)
62  {
63  setStyleClass("fill");
64  /* addWidget(new Wt::WText("<hr/>")); */
65  /* addWidget(name_); */
66  /* addWidget(new Wt::WText("<hr/>")); */
67  }
68 
69  virtual ~LiaisonContainer() {}
70 
71  void set_name(const Wt::WString& name) { name_.setText(name); }
72 
73  const Wt::WString& name() { return name_.text(); }
74 
75  virtual void focus() {}
76  virtual void unfocus() {}
77  virtual void cleanup() {}
78 
79  private:
80  Wt::WText name_;
81 };
82 
83 } // namespace common
84 } // namespace goby
85 #endif
The global namespace for the Goby project.