#ifndef EXPRESSION_H
#define EXPRESSION_H

#include <QMetaType>
#include <QVariant>
#include <QString>
#include "dal.h"
#include "argument.h"
class BaseAdaptor;
class Query;
class Expression : public Argument
{
public:

    Expression( const BaseAdaptor * const db = 0,
                QString (BaseAdaptor::*call)( const QVariantList& )const = 0,
                const QVariantList &args = QVariantList());

    static bool canConvert( const QVariant &other );
    static Expression convert( const QVariant &other );

    Expression operator + ( const QVariant &other ) const;
    Expression operator / ( const QVariant &other ) const;
    Expression operator * ( const QVariant &other ) const;
    Expression operator - ( const QVariant &other ) const;
    Expression operator | ( const QVariant &other ) const;

    Query operator < ( const QVariant &other ) const;
    Query operator <=( const QVariant &other ) const;
    Query operator ==( const QVariant &other ) const;
    Query operator !=( const QVariant &other ) const;
    Query operator > ( const QVariant &other ) const;
    Query operator >=( const QVariant &other ) const;

    Query like( const QVariant &other ) const;
    Query belongs( const QVariant &other ) const;

    Expression operator ! () const;
};
Q_DECLARE_METATYPE(Expression)
#endif // EXPRESSION_H

