Source: /app/hbasic/hbasic/gui_db_access/db_table_contents.h


Annotated List
Files
Globals
Hierarchy
Index
/* **************************************************************************
 File: db_table_contents.h
 Desc: 
 ----------------------------------------------------------------------------
	copyright            : (C) 2001 HBasic project (Marcus Engels)
 ***************************************************************************/

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

/* ----------------------------------------------------------------------- */
/* Classlist: List of classes that will be defined in this source file.    */
/* ----------------------------------------------------------------------- */

/*
  Class DbTableContents : This class may display or edit the contents of 
     a database table.
*/

/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file.           */
/*            Please report with date, maintainer and change description.  */
/* ----------------------------------------------------------------------- */

#ifndef DLG_DIRECT_H
#define DLG_DIRECT_H

#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include "hbdatabase.h"

/**
  Class queryResultTable : Display contents of database table.
*/

class queryResultTable : public QScrollView 
{
Q_OBJECT

public:
	short rows_on_screen;       /* Number of rows that could be displayed on the current screen */
	long selected_row;
	queryResultTable(QWidget* parent );
	void setCursor( QSqlCursor *query_cursor, QString *new_table_name );
	void deleteSelectedRow( void );
	void saveOldChanges( void );

protected:
	QLineEdit *editField;
	QSqlCursor *query_cursor;
	QSqlRecord *query_buffer;
	HBDbTable *table_desc;
	QString *table_name_ptr;

	short selected_column;
	short xstart;
	short ystart;
	short text_line_height;
	short new_row_created;
	short value_changed;

	void viewportMousePressEvent( QMouseEvent *evt );
	void drawContents(QPainter* p, int cx, int cy, int cw, int ch);
	void initDataForInsert( void );

protected slots:
	void valueChanged( const QString & new_value );
};

/**
  Class dlgTableEditor : Main widget to edit database table structure.
*/

class dlgTableEditor : public QDialog
{
	Q_OBJECT

public:
	dlgTableEditor( QString *new_table_name );
	QLabel *lab_header;
	QPushButton *btn_quit;
	QPushButton *btn_cancel;
	QPushButton *btn_delete;

	QPushButton *btn_next;
	QPushButton *btn_last;
	QPushButton *btn_back;
	QPushButton *btn_first;
	QPushButton *btn_new;
	QLineEdit *le_data_pos;
	QLabel *la_data_count;
	QScrollBar *sc_hscroll;
	QMultiLineEdit *mu_query_input;
	queryResultTable *lv_query_result;
	void defineQuery( QString *new_query, QString *new_table_name );
	void defineTable( QString *new_table_name );

	void resizeEvent( QResizeEvent *evt );

protected:
	QSqlCursor *query_cursor;
	short dlg_query_type;
	QSqlCursor *table_cursor;
	QDataTable *tbl_data;
	QString *table_name_ptr;
//	DBP_TABLE_DESC *query_desc;

public slots:
	void slotDelete( void );
	void slotOk( void );
	void startQuery( void );
};

#endif

Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54.