aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
commit7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch)
treea35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h b/SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h
new file mode 100644
index 0000000..c9af8e0
--- /dev/null
+++ b/SQLiteStudio3/coreSQLiteStudio/plugins/uiconfiguredplugin.h
@@ -0,0 +1,56 @@
+#ifndef UICONFIGUREDPLUGIN_H
+#define UICONFIGUREDPLUGIN_H
+
+#include "coreSQLiteStudio_global.h"
+
+class API_EXPORT UiConfiguredPlugin
+{
+ public:
+ /**
+ * @brief Gets name of the configuration UI form.
+ * @return Name of the form object.
+ *
+ * Some plugins may link (during compilation) only to the coreSQLiteStudio part of the application, but they can still
+ * benefit from SQLiteStudio GUI application by providing UI form that will be used in ConfigDialog.
+ *
+ * This method should return the object name of the top-most widget found in the provided *.ui file.
+ *
+ * For more details see: http://wiki.sqlitestudio.pl/index.php/Plugin_UI_forms
+ */
+ virtual QString getConfigUiForm() const = 0;
+
+ /**
+ * @brief Provides config object for ConfigDialog.
+ * @return Config used by the plugin, or null when there's no config, or when config should not be configured with property binding.
+ *
+ * When this method returns null, but getConfigUiForm() returns existing form, then configuration is assumed to be kept
+ * in global CfgMain object (which is known to application, as all global CfgMain objects). In this case configuration is loaded/stored
+ * using initial and final calls to load/store values from the form. This is different from when this method returns not null. Keep reading.
+ *
+ * When this method returns pointer to an object, then ConfigDialog uses ConfigMapper to bind widgets from getConfigUiForm() with
+ * config values from CfgMain returned by this method. See ConfigMapper for details about binding.
+ * In this case ConfigDialog uses CfgMain::begin(), CfgMain::commit() and CfgMain::rollback() methods to make changes to the config
+ * transactional (when users clicks "cancel" or "apply").
+ */
+ virtual CfgMain* getMainUiConfig() = 0;
+
+ /**
+ * @brief Notifies about ConfigDialog being just open.
+ *
+ * This is called just after the config dialog was open and all its contents are already initialized.
+ * This is a good moment to connect to plugin's CfgMain configuration object to listen for changes,
+ * so all uncommited (yet) configuration changes can be reflected by this plugin.
+ */
+ virtual void configDialogOpen() = 0;
+
+ /**
+ * @brief Notifies about ConfigDialog being closed.
+ *
+ * This is called just before the config dialog gets closed.
+ * This is a good moment to disconnect from configuration object and not listen to changes in the configuration anymore
+ * (couse config can change for example when application is starting and loading entire configuration, etc).
+ */
+ virtual void configDialogClosed() = 0;
+};
+
+#endif // UICONFIGUREDPLUGIN_H