Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

filterkeyentry.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef FilterKeyEntry_H
00021 #define FilterKeyEntry_H
00022 
00023 #include <qwidget.h>
00024 #include <qhbox.h>
00025 #include <qlayout.h>
00026 #include "../db/common.h"
00027 
00028 /* Forward class declarations */
00029 class QWidgetStack;
00030 class QToolButton;
00031 class QLineEdit;
00032 class DateEdit;
00033 class TimeEdit;
00034 class IntEdit;
00035 class QPopupMenu;
00036 class QComboBox;
00037 
00038 typedef enum _CmpType {
00039     ct_less = 0,
00040     ct_more,
00041     ct_equal,
00042     ct_contains,
00043     ct_startswith,
00044     ct_endswith
00045 } CmpType;
00046 
00047 
00048 class TVFilterKeyEntry: public QWidget
00049 {
00050     Q_OBJECT
00051 public:
00052     TVFilterKeyEntry( QWidget *parent = 0, 
00053                         const char *name = 0, WFlags f = 0 );
00054     ~TVFilterKeyEntry();
00055 
00056     void setTableState(TableState *t);
00057     void setKey(int i);
00058 
00059     CmpType getCompareType();
00060     TVVariant getCompareValue();
00061 
00062 signals:
00063         void valueChanged();
00064 
00065 private:
00066     /* include widgets for each type of data entry you need here. */
00067     QLineEdit *textKey;
00068     QComboBox *textCombo;
00069     QHBox *textEntry;
00070 
00071     IntEdit *intKey;
00072     QComboBox *intCombo;
00073     QHBox *intEntry;
00074 
00075     TimeEdit *timeKey;
00076     QComboBox *timeCombo;
00077     QHBox *timeEntry;
00078 
00079     DateEdit *dateKey;
00080     QComboBox *dateCombo;
00081     QHBox *dateEntry;
00082 
00083     TableState *ts;
00084 
00085     /* each type of possible data entry will be put on the stack */
00086     QWidgetStack *ws;
00087 
00088     /* This allows for the inherited functions dealing with prefered size
00089      * etc to simply get the information from the layout.  
00090      */
00091     QHBoxLayout *layout; 
00092 
00093     TVVariant::KeyType current_type;
00094 };
00095 
00096 #endif

Generated on Sat Nov 5 16:17:08 2005 for OPIE by  doxygen 1.4.2