diff options
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.h b/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.h new file mode 100644 index 0000000..1061519 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.h @@ -0,0 +1,44 @@ +#ifndef POPULATECONSTANT_H +#define POPULATECONSTANT_H + +#include "builtinplugin.h" +#include "populateplugin.h" +#include "config_builder.h" + +CFG_CATEGORIES(PopulateConstantConfig, + CFG_CATEGORY(PopulateConstant, + CFG_ENTRY(QString, Value, QString()) + ) +) + +class PopulateConstant : public BuiltInPlugin, public PopulatePlugin +{ + Q_OBJECT + + SQLITESTUDIO_PLUGIN_TITLE("Constant") + SQLITESTUDIO_PLUGIN_DESC("Support for populating tables with a constant value.") + SQLITESTUDIO_PLUGIN_VERSION(10001) + SQLITESTUDIO_PLUGIN_AUTHOR("sqlitestudio.pl") + + public: + PopulateConstant(); + + QString getTitle() const; + PopulateEngine* createEngine(); +}; + +class PopulateConstantEngine : public PopulateEngine +{ + public: + bool beforePopulating(Db* db, const QString& table); + QVariant nextValue(bool& nextValueError); + void afterPopulating(); + CfgMain* getConfig(); + QString getPopulateConfigFormName() const; + bool validateOptions(); + + private: + CFG_LOCAL(PopulateConstantConfig, cfg) +}; + +#endif // POPULATECONSTANT_H |
