/***************************************************************************
    copyright     : (C) 1999 by Edwin Glaser
    email         : edwin@pannenleiter.de
    version       : $Id: dbvalueadaptor.h,v 1.1.1.1 2000/02/07 21:42:16 ege Exp $
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   * 
 *                                                                         *
 ***************************************************************************/



#ifndef DBVALUEADAPTOR_H
#define DBVALUEADAPTOR_H

#include "qobject.h"
#include "qstrlist.h"

#include "dbdatasource.h"

/**
  * Translates database values to listbox/combobox labels.
  * 
  *@author Edwin Glaser
  */

class DBValueAdaptor : public QObject
{
   Q_OBJECT

protected:
  QStrList widgetList;
  QStrList dbList;
  QString widgetDefault;
  QString dbDefault;  

public: 
	DBValueAdaptor();                          
	virtual ~DBValueAdaptor();
	
	virtual void add(const QString &db, const QString &widget);
	virtual bool remove(const QString &db);
	virtual void clear();
	virtual void setWidgetDefault(const QString &db);
	virtual void setDbDefault(const QString &db);
	
	virtual const QString widgetValue(const QString &dbValue);
	virtual const QString dbValue(const QString &widgetValue);
	
	virtual int count();
	QString widgetAt(int pos);

protected:
	
signals:
  void listChanged(int row);
};

#endif








Documentation generated by eg@wonko on Sam Feb 19 00:09:53 MET 2000