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;
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 QMainWindow *mainWindow()
const;
214 bool isReservedPropertyName(QString name);
219 void registerReservedProperty(QString);
225 virtual void redrawPanels(
bool center =
false) = 0;
231 virtual void centerPanelsForGraph(
tlp::Graph *);
234 emit resetWindowTitle();
241 static void showStatusMessage(
const QString &);
255 static void redirectStatusTipOfMenu(QMenu *menu);
268 void resetWindowTitle();
274 void showPluginsCenter();
280 void showFullScreen(
bool f);
285 void showProjectsPage();
290 void showAboutPage();
297 void showTrayMessage(
const QString &s);
305 void showErrorMessage(
const QString &title,
const QString &s);
311 virtual void openProjectFile(
const QString &path);
317 void createPerspective(
const QString &name);
323 void showStatusTipOf(QAction *action);
325 Q_DECLARE_OPERATORS_FOR_FLAGS(Perspective::ProgressOptions)
328 #endif //_PERSPECTIVE_H QVariantMap _parameters
Contains extra parameters that have not been parsed by the overleying system. Those are considered to...
QMainWindow * _mainWindow
The main window on which the perspective should build the GUI.
The TulipProject object handles the content of a Tulip project.
TulipProject * _project
The project associated to this perspective. This project can be empty or contain data depending on ho...
virtual bool terminated()
Called when the user wants to close the application.
Contains runtime parameters for a plugin.
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 messages on mainWindow()->statusBar()