new_object_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef RVIZ_NEW_OBJECT_DIALOG_H
31 #define RVIZ_NEW_OBJECT_DIALOG_H
32 
33 #include <QDialog>
34 
35 #include <rviz/factory.h>
36 
37 class QTreeWidget;
38 class QTreeWidgetItem;
39 class QTextBrowser;
40 class QLineEdit;
41 class QDialogButtonBox;
42 class QLabel;
43 
44 namespace rviz
45 {
46 class NewObjectDialog : public QDialog
47 {
48  Q_OBJECT
49 public:
65  NewObjectDialog(Factory* factory,
66  const QString& object_type,
67  const QStringList& disallowed_display_names,
68  const QStringList& disallowed_class_lookup_names,
69  QString* lookup_name_output,
70  QString* display_name_output = nullptr,
71  QWidget* parent = nullptr);
72 
73  QSize sizeHint() const override;
74 
75 public Q_SLOTS:
76  void accept() override;
77 
78 private Q_SLOTS:
79  void onDisplaySelected(QTreeWidgetItem* selected_item);
80  void onNameChanged();
81 
82 private:
84  void fillTree(QTreeWidget* tree);
85 
88  bool isValid();
89 
92  void setError(const QString& error_text);
93 
95  const QStringList& disallowed_display_names_;
96  const QStringList& disallowed_class_lookup_names_;
97 
100 
102  QTextBrowser* description_;
103 
104  QLineEdit* name_editor_;
105 
107  QDialogButtonBox* button_box_;
108 
111  QString lookup_name_;
112 };
113 
114 } // namespace rviz
115 
116 #endif // RVIZ_NEW_OBJECT_DIALOG_H
rviz::NewObjectDialog::onDisplaySelected
void onDisplaySelected(QTreeWidgetItem *selected_item)
Definition: new_object_dialog.cpp:172
factory.h
rviz::NewObjectDialog::sizeHint
QSize sizeHint() const override
Definition: new_object_dialog.cpp:121
rviz::NewObjectDialog::NewObjectDialog
NewObjectDialog(Factory *factory, const QString &object_type, const QStringList &disallowed_display_names, const QStringList &disallowed_class_lookup_names, QString *lookup_name_output, QString *display_name_output=nullptr, QWidget *parent=nullptr)
Definition: new_object_dialog.cpp:51
rviz::NewObjectDialog::lookup_name_output_
QString * lookup_name_output_
Definition: new_object_dialog.h:98
rviz::NewObjectDialog::display_name_output_
QString * display_name_output_
Definition: new_object_dialog.h:99
rviz::NewObjectDialog::onNameChanged
void onNameChanged()
Definition: new_object_dialog.cpp:244
rviz::NewObjectDialog::description_
QTextBrowser * description_
Definition: new_object_dialog.h:102
tree
tree
rviz::NewObjectDialog::disallowed_display_names_
const QStringList & disallowed_display_names_
Definition: new_object_dialog.h:95
rviz::NewObjectDialog::setError
void setError(const QString &error_text)
Definition: new_object_dialog.cpp:239
rviz
Definition: add_display_dialog.cpp:54
rviz::NewObjectDialog::name_editor_
QLineEdit * name_editor_
Definition: new_object_dialog.h:104
rviz::NewObjectDialog::disallowed_class_lookup_names_
const QStringList & disallowed_class_lookup_names_
Definition: new_object_dialog.h:96
rviz::NewObjectDialog::isValid
bool isValid()
Definition: new_object_dialog.cpp:214
rviz::NewObjectDialog::fillTree
void fillTree(QTreeWidget *tree)
Definition: new_object_dialog.cpp:126
rviz::NewObjectDialog
Definition: new_object_dialog.h:46
rviz::NewObjectDialog::factory_
Factory * factory_
Definition: new_object_dialog.h:94
rviz::Factory
Abstract superclass representing the ability to get a list of class IDs and the ability to get name,...
Definition: factory.h:42
rviz::NewObjectDialog::button_box_
QDialogButtonBox * button_box_
Definition: new_object_dialog.h:107
rviz::NewObjectDialog::lookup_name_
QString lookup_name_
Definition: new_object_dialog.h:111
rviz::NewObjectDialog::accept
void accept() override
Definition: new_object_dialog.cpp:249


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Sat Jun 1 2024 02:31:53