mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Created V0.3.x branch and moved the head into the trunk directory.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@246 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
commit
935745a08e
1318 changed files with 348809 additions and 0 deletions
93
retroshare-gui/src/gui/advsearch/expressionwidget.h
Normal file
93
retroshare-gui/src/gui/advsearch/expressionwidget.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006, 2007 The RetroShare Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#ifndef _ExpressionWidget_h_
|
||||
#define _ExpressionWidget_h_
|
||||
#include <iostream>
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
|
||||
#include "rsiface/rsexpr.h"
|
||||
#include "guiexprelement.h"
|
||||
#include "ui_expressionwidget.h"
|
||||
|
||||
|
||||
/**
|
||||
Represents an Advanced Search GUI Expression object which acts as a container
|
||||
for a series of GuiExprElement objects. The structure of the expression can
|
||||
change dynamically, dependant on user choices made while assembling an expression.
|
||||
The default appearance is simply a search on name.
|
||||
*/
|
||||
class ExpressionWidget : public QWidget, public Ui::ExpressionWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ExpressionWidget( QWidget * parent = 0, bool initial=false );
|
||||
|
||||
/** delivers the expression represented by this widget
|
||||
the operator to join this expression with any previous
|
||||
expressions is provided by the getOperator method */
|
||||
Expression* getRsExpression();
|
||||
|
||||
/** supplies the operator to be used when joining this expression
|
||||
to the whole query */
|
||||
LogicalOperator getOperator();
|
||||
|
||||
QString toString();
|
||||
|
||||
signals:
|
||||
/** associates an expression object with the delete event */
|
||||
void signalDelete(ExpressionWidget*);
|
||||
|
||||
private slots:
|
||||
/** emits the signalDelete signal with a pointer to this object
|
||||
for use by listeners */
|
||||
void deleteExpression();
|
||||
|
||||
/** dynbamically changes the structure of the expression based on
|
||||
the terms combobox changes */
|
||||
void adjustExprForTermType(int);
|
||||
|
||||
/** dynamically adjusts the expression dependant on the choices
|
||||
made in the condition combobox e.g. inRange and equals
|
||||
have different parameter fields */
|
||||
void adjustExprForConditionType(int);
|
||||
|
||||
|
||||
private:
|
||||
QLayout * createLayout(QWidget* parent = 0);
|
||||
|
||||
bool isStringSearchExpression();
|
||||
|
||||
QList <GuiExprElement *> * elements;
|
||||
QLayout * exprLayout;
|
||||
|
||||
ExprOpElement * exprOpElem;
|
||||
ExprTermsElement * exprTermElem;
|
||||
ExprConditionElement * exprCondElem;
|
||||
ExprParamElement* exprParamElem;
|
||||
|
||||
bool inRangedConfig;
|
||||
bool isFirst;
|
||||
ExprSearchType searchType;
|
||||
};
|
||||
|
||||
#endif // _ExpressionWidget_h_
|
Loading…
Add table
Add a link
Reference in a new issue