API Documentation
Loading...
Searching...
No Matches
ApplicationLauncherButton.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Button.h>
4#include <NDEVR/BasicThread.h>
5#include <NDEVR/File.h>
6#include <NDEVR/Pointer.h>
7#include <NDEVR/LocalApplicationLauncher.h>
8namespace NDEVR
9{
10 /**--------------------------------------------------------------------------------------------------
11 Class: ApplicationLauncherButtonManager
12
13 \brief Creates a button for launching a 3rd party application. While the application is running the button is pressed. When application terminates button is unpressed automatically.
14 *-----------------------------------------------------------------------------------------------**/
16 {
17 public:
20 ApplicationLauncherButtonManager(const File& application_file, const String& args = String());
22 ApplicationLauncherButtonManager(Button* button, const File& application_file, const String& args = String());
24 void setAppFinishedCallback(std::function<void()> callback);
25 void setAppLaunchCallback(std::function<void()> callback);
26 void setMakeChildProcess(bool is_child_process);
27 void setApplication(DynamicPointer<LocalApplicationLauncher> launcher);
28 void setEnabled(bool enabled);
29 const DynamicPointer<LocalApplicationLauncher>& launcher() const;
30 void launch();
31 void killProcess();
32 void setEnvironment(const String& env);
33 void setArgs(const String& args);
34 void setIconToApp(Button* button);
35 void setNameToApp(Button* button);
36 Button* createButton();
37 void setupButton(Button* button);
38 protected:
39 void execute();
40 void _setupButton(Button* button);
41 protected:
44 std::function<void()> m_callback_function;
45 std::function<void()> m_launch_function;
46#if NDEVR_SUPPORTS_THREADING
47 BasicThread* m_launch_thread = nullptr;
48#endif
49 bool m_is_enabled = true;
50 };
51}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Creates a button for launching a 3rd party application. While the application is running the button i...
Definition ApplicationLauncherButton.h:16
std::function< void()> m_callback_function
Definition ApplicationLauncherButton.h:44
DynamicPointer< LocalApplicationLauncher > m_launcher
Definition ApplicationLauncherButton.h:43
Buffer< QPointer< Button > > m_buttons
Definition ApplicationLauncherButton.h:42
std::function< void()> m_launch_function
Definition ApplicationLauncherButton.h:45
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Button.h:60
Definition Pointer.hpp:303
Definition File.h:47
Definition String.h:40
Definition ACIColor.h:37