##

RestUiWidget.hh
Go to the documentation of this file.
/*
* Copyright 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_PLUGINS_REST_WEB_RESTUIWIDGET_HH_
#define GAZEBO_PLUGINS_REST_WEB_RESTUIWIDGET_HH_
#include <string>
#include <list>
#include <vector>
// See: https://bugreports.qt-project.org/browse/QTBUG-22829
#ifndef Q_MOC_RUN
# include <gazebo/gazebo.hh>
#endif
#include <gazebo/util/system.hh>
#include "RestUiLoginDialog.hh"
namespace gazebo
{
namespace gui
{
class TopToolbar;
}
class GAZEBO_VISIBLE RestUiWidget : public QWidget
{
Q_OBJECT
public: RestUiWidget(QWidget *_parent,
QAction &_login,
QAction &_logout,
const std::string &_menuTitle,
const std::string &_loginTitle,
const std::string &_urlLabel,
const std::string &_defautlUrl);
public: virtual ~RestUiWidget() = default;
public slots: void Login();
public slots: void Logout();
public: void Update();
private: void OnResponse(ConstRestResponsePtr &_msg);
private: void OnWindowMode(const std::string &_mode);
private: QAction &loginMenuAction;
private: QAction &logoutMenuAction;
private: std::string title;
private: gazebo::transport::NodePtr node;
private: gui::RestUiLoginDialog loginDialog;
private: gazebo::transport::PublisherPtr loginPub;
private: gazebo::transport::PublisherPtr logoutPub;
private: gazebo::transport::SubscriberPtr responseSub;
private: std::list<boost::shared_ptr<const gazebo::msgs::RestResponse>>
msgRespQ;
private: gui::TopToolbar *toolbar;
private: QLabel *loginLabel;
private: unsigned int restID;
private: QAction *loginLabelAct;
private: QAction *spacerAct;
public: std::vector<event::ConnectionPtr> connections;
};
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::gui::RestUiLoginDialog
Provides a means to login to a webservice.
Definition: RestUiLoginDialog.hh:34
gazebo::RestUiWidget::connections
std::vector< event::ConnectionPtr > connections
Event based connections.
Definition: RestUiWidget.hh:126
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
system.hh
gazebo::transport::SubscriberPtr
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
gazebo.hh
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::gui::TopToolbar
Toolbar on the top of the main window.
Definition: TopToolbar.hh:32
gui
gui
Definition: KeyEventHandler.hh:29
RestUiLoginDialog.hh
gazebo::RestUiWidget
REST user interface widget.
Definition: RestUiWidget.hh:41
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59