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


Annotated List
Files
Globals
Hierarchy
Index
/* **************************************************************************
 File: db_design_widget.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 DbDesign : This class is the surrounding widget for all 
    DbDesignTable widgets that will be connected within the database
    designer.
*/

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

#ifndef DB_DESIGN_WGT_H
#define DB_DESIGN_WGT_H

#include 
#include 

#include 
#include 

#include "../src/structs.h"
#include "db_design_table.h"
#include "../src/project.h"
#include "../src/project_group.h"

class QueryDesigner;
class QPoint;

extern CProjectGroup *all_projects;

/**
  Class DbDesign : This class is the surrounding widget for all 
    DbDesignTable widgets that will be connected within the database
    designer.
*/

class DbDesign : public QWorkspace
{
	Q_OBJECT

public:
	DbDesign(QWidget* parent );
	DbDesign(QWidget* parent, QueryDesigner *query_ptr, HBQueryDesc *query_desc_ptr );
	void queryColumnsChanged( void );
	void getSelectedColumns( void );
	void storeTableConnections( QPoint mouse_pos );
	void storeQueryConnections( QPoint mouse_pos );
	void setStartTable( DbDesignTable *new_table_ptr );
	void getTableGeometry( void );
	void deleteSelectedConnection( void );

private:
	/* 1=db design  2=query designer */
	short query_design_type;
	QueryDesigner *query_dlg_ptr;
	QueryDefine *query_dest;
	QWidget *parent_widget;
	HBQueryDesc *query_desc_ptr;
	DbDesignTable *mouse_from_table;
	HBDesignConnect *selected_connection;
	HBDesignConnect *old_selection;
	double selected_distance;
	short max_xpos;

	void init_query_desc( void );
	bool eventFilter( QObject *o, QEvent *evt );
	void paintEvent( QPaintEvent *evt );
	void mousePressEvent( QMouseEvent *evt );
	void repaint( void );
	void addDbConnections( void );
	void insertQueryConnection( HBDesignConnect *connect_ptr );
	void editConnectionType( QPoint mouse_pos );
	void checkMouseSelect( QPoint mouse_pos );
	HBDesignTable *getMouseTable( QPoint pos );
	HBQueryTable *getQueryMouseTable( QPoint mouse_pos );
	HBDesignTable *getDesignTable( HBDbTable *table_desc_ptr );
	HBQueryTable *getQueryTable( HBDbTable *table_desc_ptr );

public slots:
	void slotAddTable( void );
};

#endif


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