NDEVR
API Documentation
StatusBar.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: StatusBar
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/LogStream.h>
34#include <NDEVR/String.h>
35#include <NDEVR/ProgressWidget.h>
36#include <NDEVR/QCustomLabel.h>
37#include <QWidget>
38#include <QPointer>
39#include <QVBoxLayout>
40namespace NDEVR
41{
42 class Button;
43 class QTModelManager;
48 class StatusBar : public QWidget, public LogStream
49 {
50 Q_OBJECT
51 public:
56 StatusBar(QWidget* parent = nullptr);
62 StatusBar(QTModelManager* manager, QWidget* parent= nullptr);
63 ~StatusBar();
67 void allowCancel(bool) final override {};
73 void setProgress(uint04 idx, fltp04 progress) final override;
78 bool ownsWidgets() const { return m_owns_widgets; };
84 void addMessage(uint04 id, const LogMessage& message) final override;
88 void setVertical(bool)
89 {
90 //ui->information_layout->se
91 }
92
96 void setVisible(bool visible) override;
106 QSize minimumSizeHint() const override;
111 QSize sizeHint() const override;
117 private:
121 void _updateUI();
122 signals:
131 void requestRemoteWidgetSignal(bool use_remote);
132 public slots:
140 void updateUI();
141 private:
145 void init();
146 String m_log_message;
147 fltp04 m_progress;
148 QTimer* m_hide_timer;
149 QVBoxLayout* m_layout;
150 QHBoxLayout* m_widget_layout;
151 QCustomLabel* m_command_label;
152 mutable QPointer<ProgressWidget> m_progress_bar;
153 TranslatedString m_command_name;
154 TranslatedString m_command_hint;
155 QTModelManager* m_manager;
156 QTResourceListener* m_ui_change;
157 Buffer<QPointer<Button>> m_quick_widgets;
158 bool m_owns_widgets;
159 bool m_pending_update = false;
160 bool m_is_sub_session = false;
161 };
162}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A class that allows for specific log information to be conveyed to a InfoPipe object including inform...
Definition LogMessage.h:48
A listener that receives and processes log messages and progress updates from an InfoPipe.
Definition LogStream.h:49
Displays the progress, either horizontally as a bar or as a round spin dial.
Displays translated text.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Definition QTTools.h:493
void requestUpdateLog()
Signal emitted to request a UI update for the log display.
void allowCancel(bool) final override
No-op implementation; cancellation is not supported by the status bar.
Definition StatusBar.h:67
StatusBar(QTModelManager *manager, QWidget *parent=nullptr)
Constructs a StatusBar managed by a QTModelManager.
void addMessage(uint04 id, const LogMessage &message) final override
Adds a log message to the status bar display.
void setVertical(bool)
Placeholder for setting vertical orientation.
Definition StatusBar.h:88
void hideLogMessage()
Slot that hides the currently displayed log message.
QSize sizeHint() const override
Returns the preferred size hint for the status bar.
void updateUI()
Slot that triggers a UI refresh.
void requestRemoteWidgetSignal(bool use_remote)
Signal emitted to request toggling between local and remote widget display.
void setVisible(bool visible) override
Shows or hides the status bar widget.
StatusBar(QWidget *parent=nullptr)
Constructs a standalone StatusBar widget.
Buffer< QPointer< QWidget > > remoteWidgets()
Returns a buffer of widgets that can be displayed remotely.
ProgressWidget * progressBar()
Returns the progress bar widget, creating it if necessary.
bool ownsWidgets() const
Checks whether this status bar owns its child widgets.
Definition StatusBar.h:78
QSize minimumSizeHint() const override
Returns the minimum size hint for the status bar.
void setProgress(uint04 idx, fltp04 progress) final override
Updates the progress bar to reflect the current progress value.
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...