diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h new file mode 100644 index 0000000..f4e9feb --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.h @@ -0,0 +1,47 @@ +#ifndef POPULATERANDOM_H +#define POPULATERANDOM_H + +#include "builtinplugin.h" +#include "populateplugin.h" +#include "config_builder.h" + +CFG_CATEGORIES(PopulateRandomConfig, + CFG_CATEGORY(PopulateRandom, + CFG_ENTRY(int, MinValue, 0) + CFG_ENTRY(int, MaxValue, 99999999) + CFG_ENTRY(QString, Prefix, QString()) + CFG_ENTRY(QString, Suffix, QString()) + ) +) + +class PopulateRandom : public BuiltInPlugin, public PopulatePlugin +{ + Q_OBJECT + + SQLITESTUDIO_PLUGIN_TITLE("Random") + SQLITESTUDIO_PLUGIN_DESC("Support for populating tables with random numbers.") + SQLITESTUDIO_PLUGIN_VERSION(10001) + SQLITESTUDIO_PLUGIN_AUTHOR("sqlitestudio.pl") + + public: + PopulateRandom(); + + QString getTitle() const; + PopulateEngine* createEngine(); +}; + +class PopulateRandomEngine : 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(PopulateRandomConfig, cfg) + int range; +}; +#endif // POPULATERANDOM_H |
