Source: /app/hbasic/hbasic/src/project_tree.h
|
|
|
|
/* **************************************************************************
File: project_tree.h
Desc: This source file creates and manages the project tree subwindow in the
* main HBasic window.
----------------------------------------------------------------------------
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 CProjectTree : Class that handles the project tree dialog.
*/
/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file. */
/* Please report with date, maintainer and change description. */
/* ----------------------------------------------------------------------- */
#ifndef PROJECTTREE_H
#define PROJECTTREE_H
class QPushButton;
#include
#include
#include
#include
#include
#include
#include
#include "../hbdata/hbobject.h"
#include "window_list.h"
class QComboBox;
class CBasicDocument;
class CReportDocument;
class CProject;
#define PT_ENTRY_OTHER 0
#define PT_ENTRY_TABLE 1
#define PT_ENTRY_QUERY 2
#define PT_ENTRY_SOURCE 3
#define PT_ENTRY_FORM 4
#define PT_ENTRY_REPORT 5
#define PT_ENTRY_ICON 6
#define PT_ENTRY_EXAMPLE 7
#define PT_ENTRY_DIRXPL 8
#define PT_ENTRY_SQLSTMT 9
#define PT_ENTRY_CSSOURCE 10
#define PT_ENTRY_SHEET 11
#define PT_ENTRY_PERL 12
#define PT_ENTRY_DB 13
#define PT_ENTRY_GSOURCE 14
#define LV_DISPLAY_ALL 0
#define LV_DISPLAY_FORMS 1
#define LV_DISPLAY_TABLES 2
#define LV_DISPLAY_QUERIES 3
#define LV_DISPLAY_REPORTS 4
#define LV_DISPLAY_IMAGES 5
#define LV_DISPLAY_EXAMPLES 6
#define LV_DISPLAY_SQLSTMT 7
/**
* One entry in the project tree listview widget.
*/
class ProjectTreeEntry : public QListViewItem
{
public:
ProjectTreeEntry( ProjectTreeEntry *parent, ProjectTreeEntry *after,
QString *entry_text, short new_entry_type = PT_ENTRY_OTHER,
void *new_struct_ptr = NULL );
ProjectTreeEntry( QListView *parent, QString entry_text, short new_entry_type = PT_ENTRY_OTHER );
ProjectTreeEntry( QListView *parent, ProjectTreeEntry *after, QString entry_text, short new_entry_type, void *new_struct_ptr = NULL );
short entry_type;
void *struct_ptr;
private:
void setup( void );
void setEntryPixmap( short new_entry_type );
};
/* ########################################################### */
/**
* Main treeview widget in the project tree display.
*/
class ProjectTree : public CWindowListChild, public HBObject
{
Q_OBJECT
protected:
QListView *lv_project_tree;
QPopupMenu *popup_menu; /* Popup menu for submenu */
CReportDocument *current_report;
public:
ProjectTree( QWidget *parent = 0, const char *name = 0);
ProjectTreeEntry *last_selected_entry; /* Last selected ListView item */
void addSourceEntry( CProject *project_ptr, CBasicDocument *srcptr );
void rebuildProjectTree( void );
void setDialogFont( QFont *new_font );
void resizeEvent( QResizeEvent *evt );
QString getSelectedEntryText( void );
void setSelectedReport( CReportDocument *rep_ptr );
public slots:
void new_selection( QListViewItem *new_select );
void slotDoubleClicked( QListViewItem *new_select );
void slotRightMousePressed( QListViewItem *item, const QPoint &pos, int num);
protected slots:
void slotRemoveForm( void );
void slotRemoveGui( void );
void slotCreateGui( void );
void createNewProject( void );
private:
short widget_order;
QFrame *select_frame;
QPushButton *btn_new;
QPushButton *btn_view;
QPushButton *btn_edit;
QPushButton *btn_delete;
QComboBox *cb_display_type;
short lv_display_mode; /* How to display list view entries. */
private: /* methods */
void popupCreateNewEntry( void );
void rebuildFullTree( void );
void rebuildTableEntries( ProjectTreeEntry *parent_entry );
void rebuildQueryEntries( ProjectTreeEntry *parent_entry );
void rebuildReportEntries( ProjectTreeEntry *parent_entry );
void rebuildFormEntries( ProjectTreeEntry *forms_parent );
void rebuildSourceEntries( ProjectTreeEntry *forms_parent );
void rebuildImageEntries( ProjectTreeEntry *parent_entry );
void rebuildSheetEntries( ProjectTreeEntry *parent_entry );
void rebuildSqlStmtEntries( ProjectTreeEntry *parent_entry );
void rebuildProgramExamples( void );
void readProgramExamples( QFile *f, ProjectTreeEntry *hte_parent );
void createReportPartTree( QListViewItem *lv_parent );
void closeEvent( QCloseEvent *evt );
void createReport( void );
void openReportDesigner( short edit_mode );
void createForm( void );
void deleteForm( void );
private slots:
void slotEditCurrent( void );
void slotRenameCurrent( void );
void slotDeleteCurrent( void );
void slotViewCurrent( void );
void slotRemoveReport( void );
void slotDisplayType ( int new_entry );
void slotShowAll( void );
void slotShowForms( void );
void slotShowTables( void );
void slotShowQueries( void );
void slotShowReports( void );
void slotShowImages( void );
void slotShowSQLStmt( void );
void slotShowExamples( void );
void slotCreateNewForm( void );
void slotCreateGlobalSource( void );
/* Database admin slots. */
void slotAnalyzeTable( void );
void slotStatusTable( void );
void slotDescribeTable( void );
void slotCreateTableSql( void );
void slotStatusDb( void );
void slotProcessDb( void );
void slotVarDb( void );
void slotStatusAllTables( void );
void slotReconnectDatabase( void );
};
#endif
Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54. |