mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 11:03:54 -07:00
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:
parent
0b2231639f
commit
863e437d4c
12 changed files with 847 additions and 26 deletions
39
cockatrice/src/cardfilter.h
Normal file
39
cockatrice/src/cardfilter.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue