/***************************************************************************
    copyright     : (C) 1999 by Edwin Glaser
    email         : edwin@pannenleiter.de
    version       : $Id: dbnavigator.h,v 1.1.1.1 2000/02/07 21:42:02 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 DBNAVIGATOR_H
#define DBNAVIGATOR_H

#include <qwidget.h>

#include "dbdatasource.h"


class QPushButton;

/**
  * Offers the navigation buttons.
  * 
  *@author Edwin Glaser
  */

class DBNavigator : public QWidget  {
   Q_OBJECT

public:
  static const int First = 1;
  static const int Prior = 2;
  static const int Next = 4;
  static const int Last = 8;
  static const int Edit = 0x10;
  static const int Append = 0x20;
  static const int Copy = 0x40;
  static const int Post = 0x80;
  static const int Cancel = 0x100;
  static const int Delete = 0x200;
  static const int Refresh = 0x400;

  static const int All = 0xFFF;
  static const int Move = First + Prior + Next + Last + Refresh;
  static const int Change = Edit + Append + Copy + Delete;
  static const int ChangeAuto = Append + Copy + Delete;
  static const int Save = Post + Cancel;
  static const int AutoEdit = Move + ChangeAuto + Save;
   
protected:
  DBDataSource *data;
  DBNavigator(QWidget *parent=0, const char *name=0);

public:
  DBNavigator(DBDataSource *d, QWidget *parent=0, const char *name=0);
  DBNavigator(DBDataSource *d, int buttons, QWidget *parent=0, const char *name=0);
  virtual ~DBNavigator();

  DBDataSource *getDataSource() { return data; };

public slots:
  virtual void enableButtons();

protected:
  void init(int buttons);

protected:
  QPushButton *BtnFirst;
  QPushButton *BtnPrior;
  QPushButton *BtnNext;
  QPushButton *BtnLast;
  QPushButton *BtnEdit;
  QPushButton *BtnAppend;
  QPushButton *BtnCopy;
  QPushButton *BtnPost;
  QPushButton *BtnCancel;
  QPushButton *BtnDelete;
  QPushButton *BtnRefresh;

  virtual QPushButton *makeBtnFirst();
  virtual QPushButton *makeBtnPrior();
  virtual QPushButton *makeBtnNext();
  virtual QPushButton *makeBtnLast();
  virtual QPushButton *makeBtnEdit();
  virtual QPushButton *makeBtnAppend();
  virtual QPushButton *makeBtnCopy();
  virtual QPushButton *makeBtnPost();
  virtual QPushButton *makeBtnCancel();
  virtual QPushButton *makeBtnDelete();
  virtual QPushButton *makeBtnRefresh();
};

#endif

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