98 lines
1.3 KiB
C++
98 lines
1.3 KiB
C++
|
/*
|
||
|
* This file is a part of Winix
|
||
|
* and is not publicly distributed
|
||
|
*
|
||
|
* Copyright (c) 2010, Tomasz Sowa
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include "dbitemquery.h"
|
||
|
|
||
|
|
||
|
|
||
|
DbItemQuery::DbItemQuery()
|
||
|
{
|
||
|
sort_asc = true;
|
||
|
auth_equal = true;
|
||
|
|
||
|
SetAll(true, false);
|
||
|
|
||
|
id = -1;
|
||
|
parent_id = -1;
|
||
|
type = Item::none;
|
||
|
auth = Item::auth_none;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::SetAllSel(bool sel)
|
||
|
{
|
||
|
sel_parent_id = sel;
|
||
|
sel_user_id = sel;
|
||
|
sel_group_id = sel;
|
||
|
sel_guest_name = sel;
|
||
|
sel_privileges = sel;
|
||
|
sel_date = sel;
|
||
|
sel_subject = sel;
|
||
|
sel_content = sel;
|
||
|
sel_url = sel;
|
||
|
sel_type = sel;
|
||
|
sel_default_item = sel;
|
||
|
sel_auth = sel;
|
||
|
sel_html_template = sel;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::SetAllWhere(bool where_)
|
||
|
{
|
||
|
where_id = where_;
|
||
|
where_parent_id = where_;
|
||
|
where_type = where_;
|
||
|
where_auth = where_;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::SetAll(bool sel, bool where_)
|
||
|
{
|
||
|
SetAllSel(sel);
|
||
|
SetAllWhere(where_);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::WhereId(long id_)
|
||
|
{
|
||
|
where_id = true;
|
||
|
id = id_;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::WhereParentId(long parent_id_)
|
||
|
{
|
||
|
where_parent_id = true;
|
||
|
parent_id = parent_id_;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::WhereType(Item::Type type_)
|
||
|
{
|
||
|
where_type = true;
|
||
|
type = type_;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void DbItemQuery::WhereAuth(Item::Auth st, bool equal)
|
||
|
{
|
||
|
where_auth = true;
|
||
|
auth = st;
|
||
|
auth_equal = equal;
|
||
|
}
|
||
|
|