20 #ifndef _PERSPECTIVE_H 21 #define _PERSPECTIVE_H 23 #include <tulip/PluginContext.h> 24 #include <tulip/Plugin.h> 25 #include <tulip/TlpQtTools.h> 28 #include <QVariantMap> 40 static const std::string PERSPECTIVE_CATEGORY =
"Perspective";
51 QMainWindow *mainWindow;
52 TulipProject *project;
54 QVariantMap parameters;
86 QSet<QString> _reservedProperties;
87 QTcpSocket *_agentSocket;
88 unsigned int _perspectiveId;
90 void sendAgentMessage(
const QString &);
91 void notifyProjectLocation(
const QString &path);
135 bool checkSocketConnected();
138 enum ProgressOption {
139 NoProgressOption = 0x0,
144 Q_DECLARE_FLAGS(ProgressOptions, ProgressOption)
146 std::
string category()
const override {
147 return PERSPECTIVE_CATEGORY;
149 std::string
icon()
const override {
150 return ":/tulip/gui/icons/32/plugin_controller.png";
173 template <
typename T>
175 return dynamic_cast<T *
>(instance());
201 progress(ProgressOptions options = ProgressOptions(IsPreviewable | IsStoppable | IsCancellable));
206 virtual void usage(std::string &usage_str)
const {
207 usage_str =
"No options for this perspective.";
213 QMainWindow *mainWindow()
const;
221 bool isReservedPropertyName(QString name);
226 void registerReservedProperty(QString);
232 virtual void redrawPanels(
bool center =
false) = 0;
238 virtual void centerPanelsForGraph(
tlp::Graph *);
241 emit resetWindowTitle();
262 static void redirectStatusTipOfMenu(QMenu *menu);
269 const QString &msg) {
291 void resetWindowTitle();
297 void showPluginsCenter();
303 void showFullScreen(
bool f);
308 void showProjectsPage();
313 void showAboutPage();
320 void showTrayMessage(
const QString &s);
328 void showErrorMessage(
const QString &title,
const QString &s);
334 virtual void openProjectFile(
const QString &path);
340 void createPerspective(
const QString &name);
346 void showStatusTipOf(QAction *action);
351 virtual void displayStatusMessage(
const QString &s);
356 virtual void clearStatusMessage();
366 virtual void logMessage(QtMsgType,
const QMessageLogContext &,
const QString &) {}
368 Q_DECLARE_OPERATORS_FOR_FLAGS(Perspective::ProgressOptions)
371 #endif //_PERSPECTIVE_H QVariantMap _parameters
Contains extra parameters that have not been parsed by the overleying system. Those are considered to...
virtual void usage(std::string &usage_str) const
usage Displays a usage message when called from the tulip_perspective executable
QMainWindow * _mainWindow
The main window on which the perspective should build the GUI.
virtual void logMessage(QtMsgType, const QMessageLogContext &, const QString &)
a virtual function to log a message
virtual void displayLogMessages()
a virtual function to display the whole logs
TulipProject * _project
The project associated to this perspective. This project can be empty or contain data depending on ho...
static void showLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg)
a static function to log a message see qInstallMessageHandler
virtual void displayStatusMessage(const QString &s)
a virtual function to display a status message
virtual bool terminated()
Called when the user wants to close the application.
Contains runtime parameters for a plugin.
static void showLogMessages()
a static function to display the log messages
static T * typedInstance()
A context data structure for tlp::Perspective instances.
Top-level interface for plug-ins.
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...
A Perspective is a Tulip plugin that completely re-defines the user interface.
QString tlpStringToQString(const std::string &toConvert)
Convert a Tulip UTF-8 encoded std::string to a QString.
std::string icon() const override
The icon (preferably a thumbnail) of the plugin.
static void showStatusMessage(const std::string &msg)
a static function to ease the display of status messages
static void showStatusMessage(const QString &msg)
a static function to ease the display of status messages