1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#ifndef COLLATIONMANAGER_H
#define COLLATIONMANAGER_H
#include "coreSQLiteStudio_global.h"
#include <QList>
#include <QSharedPointer>
#include <QObject>
#include <QStringList>
class Db;
class API_EXPORT CollationManager : public QObject
{
Q_OBJECT
public:
enum CollationType
{
FUNCTION_BASED = 0,
EXTENSION_BASED = 1
};
struct API_EXPORT Collation
{
QString name;
CollationType type;
QString lang;
QString code;
QStringList databases;
bool allDatabases = true;
};
typedef QSharedPointer<Collation> CollationPtr;
virtual void setCollations(const QList<CollationPtr>& newCollations) = 0;
virtual QList<CollationPtr> getAllCollations() const = 0;
virtual QList<CollationPtr> getCollationsForDatabase(const QString& dbName) const = 0;
virtual int evaluate(const QString& name, const QString& value1, const QString& value2) = 0;
virtual int evaluateDefault(const QString& value1, const QString& value2) = 0;
virtual CollationPtr getCollation(const QString &name) const = 0;
signals:
void collationListChanged();
};
#define COLLATIONS SQLITESTUDIO->getCollationManager()
#endif // COLLATIONMANAGER_H
|