aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h')
-rw-r--r--Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h b/Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h
new file mode 100644
index 0000000..dde25c8
--- /dev/null
+++ b/Plugins/SqlFormatterSimple/sqlformattersimpleplugin.h
@@ -0,0 +1,38 @@
+#ifndef SQLFORMATTERSIMPLEPLUGIN_H
+#define SQLFORMATTERSIMPLEPLUGIN_H
+
+#include "sqlformattersimple_global.h"
+#include "plugins/sqlformatterplugin.h"
+#include "config_builder.h"
+#include "plugins/genericplugin.h"
+#include "plugins/uiconfiguredplugin.h"
+#include <QObject>
+
+CFG_CATEGORIES(SqlFormatterSimpleConfig,
+ CFG_CATEGORY(SqlFormatterSimple,
+ CFG_ENTRY(bool, UpperCaseKeywords, true)
+ CFG_ENTRY(bool, TrimLongSpaces, true)
+ )
+)
+
+class SQLFORMATTERSIMPLESHARED_EXPORT SqlFormatterSimplePlugin : public GenericPlugin, public SqlFormatterPlugin, public UiConfiguredPlugin
+{
+ Q_OBJECT
+ SQLITESTUDIO_PLUGIN("sqlformattersimple.json")
+
+ public:
+ SqlFormatterSimplePlugin();
+
+ QString format(SqliteQueryPtr query);
+ bool init();
+ void deinit();
+ QString getConfigUiForm() const;
+ CfgMain* getMainUiConfig();
+ void configDialogOpen();
+ void configDialogClosed();
+
+ private:
+ CFG_LOCAL_PERSISTABLE(SqlFormatterSimpleConfig, cfg)
+};
+
+#endif // SQLFORMATTERSIMPLEPLUGIN_H