added filter builder widget and filter tree

filter builder takes filter options from user, then adds
completed filters to the filter tree. the filter tree does
not currently do anything. in the future it will filter the
cards in the database view.
This commit is contained in:
sylvanbasilisk 2014-01-17 10:06:45 +00:00
parent 0b2231639f
commit 863e437d4c
12 changed files with 847 additions and 26 deletions

View file

@ -0,0 +1,39 @@
#ifndef CARDFILTER_H
#define CARDFILTER_H
#include <QString>
class CardFilter {
public:
enum Type {
TypeAnd = 0,
TypeOr,
TypeAndNot,
TypeOrNot,
TypeEnd
};
enum Attr {
AttrName = 0,
AttrType,
AttrColor,
AttrEnd
};
private:
enum Type t;
enum Attr a;
QString trm;
public:
CardFilter(QString term, Type type, Attr attr) : trm(term), t(type), a(attr) {};
Type type() const { return t; }
const QString &term() const { return trm; }
Attr attr() const { return a; }
static const char *typeName(Type t);
static const char *attrName(Attr a);
};
#endif