Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

queries.h File Reference

Interface to query display module. More...

#include <gtk/gtk.h>
#include "querydata.h"

Include dependency graph for queries.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define MAXCOLWID   25
 Maximum result column width.


Functions

void do_export_dialog (GtkWidget *widget, gpointer data)
 Run the export dialog.

int query_close ()
 Close the current query.

int query_delete_at_position (int position)
 Delete the selected query.

GtkWidget * query_get_current ()
char * query_get_current_name ()
void * query_get_current_result (void)
 Return the query text widget selected by 'n'.

GtkWidget * query_get_no (int n)
 Retrieve a query widget by it's index number.

char * query_get_text_no (int n)
 Return the text from the selected query.

QueryDataquery_get_querydata (GtkWidget *query)
 Get the query data for the passed query.

void * query_get_result (GtkWidget *query)
 Return the query result data.

GtkWidget * query_pane_init ()
 Initilise the query notebook.

void queries_init ()
 Initialise the query counter.

GtkWidget * result_pane_init ()
 Initilise the result notebook.

void results_display (void *result, int why, int position)
 Display the results in the result pane.

void query_import (void)
 Import a file into the current query.

void query_clear (void)
 Clear the current query.

int query_count ()
 Return the umber of queries.

GtkWidget * query_add (void)
 Add a new query and associated result page.

char * query_get_text (GtkWidget *query)
 Return text of listed query page.

void query_save (GtkWidget *qry)
 Save a query to disk.

void query_save_as (GtkWidget *qry)
 Save the current query to a file under a new name.

void query_save_to_file (GtkWidget *query, char *fn)
 Save the query to a specific file.

void query_set_name (int position, char *name)
 Set the name of the query notebook page.


Variables

int lastQuery
 The index of the last query entry.

int nbQueries
 Number of displayed queries.

GtkWidget * queryPopupClearItem
 Clear Query menu item.

GtkWidget * queryPopupCloseItem
 Close Query menu item.

GtkWidget * queryPopupImportItem
 Import Query menu item.

GtkWidget * queryPopupNewItem
 New Query menu item.

GtkWidget * queryPopupSaveItem
 Query Save menu item.

GtkWidget * queryPopupSaveAsItem
 Query Save As menu item.

GtkWidget * queryPopupSendItem
 Send Query menu item.

guint queryNotebookPageChangeHandler
 Reference to the query notebook page change handler.


Detailed Description

Interface to query display module.

Author:
Lionel ULMER , Darryl Luff

Definition in file queries.h.


Function Documentation

void do_export_dialog GtkWidget *    widget,
gpointer    data
 

Run the export dialog.

Parameters:
widget  The sending widget.
data  Unused.

Definition at line 444 of file queries.c.

References result_export(), and update_button_sensitivity().

GtkWidget* query_add void   
 

Add a new query and associated result page.

Returns:
The scrolling view containing the new query text widget.

Definition at line 664 of file queries.c.

References _a_buf::b_dat, _a_buf::b_len, buf_free(), buf_new(), lastQuery, nbQueries, notebook_selection_callback(), on_query_button_press_event(), querydata_new(), queryNotebookPageChangeHandler, results_display(), status_push(), and update_button_sensitivity().

Referenced by gui_add_query(), on_queryLoad_activate(), and on_queryNew_activate().

int query_close  
 

Close the current query.

Returns:
The number of queries remaining.

Definition at line 746 of file queries.c.

References query_delete_at_position(), and status_pop().

Referenced by on_queryClose_activate().

int query_count  
 

Return the umber of queries.

Returns:
The number of queries.

Definition at line 902 of file queries.c.

References nbQueries.

Referenced by gui_get_query_count().

int query_delete_at_position int    position
 

Delete the selected query.

The position index is zero-based.

Parameters:
position  The index of the query to delete.
Returns:
The number of queries remaining.

Definition at line 257 of file queries.c.

References db_conn::DBclear_result, gui_get_connection(), nbQueries, and query_get_no().

Referenced by gui_delete_all_queries(), and query_close().

GtkWidget* query_get_current  
 

Returns:
The current query text widget.

Definition at line 760 of file queries.c.

Referenced by export_dialog_create(), export_dialog_show(), gui_get_result_columns(), gui_get_result_rows(), gui_load_query_from_file(), gui_send_query(), gui_set_query_text(), on_delete_query_activate(), on_insert_query_activate(), on_queryImportDlgOkBtn_clicked(), on_querySaveDlgOkBtn_clicked(), on_select_query_activate(), on_update_query_activate(), query_clear(), query_get_current_result(), and query_save().

char* query_get_current_name  
 

Returns:
The query name.

Definition at line 811 of file queries.c.

Referenced by export_dialog_create(), export_dialog_show(), query_save_dialog_create(), and result_export().

void* query_get_current_result void   
 

Return the query text widget selected by 'n'.

'n' is zero-based.

Returns:
The result object from the current query.

Definition at line 436 of file queries.c.

References query_get_current(), and query_get_result().

Referenced by gui_get_result_field().

GtkWidget* query_get_no int    n
 

Retrieve a query widget by it's index number.

'n' is zero-based.

Parameters:
n  The index of the entry to return.
Returns:
The selected query text widget.

Definition at line 781 of file queries.c.

Referenced by query_delete_at_position(), and query_get_text_no().

QueryData* query_get_querydata GtkWidget *    query
 

Get the query data for the passed query.

Parameters:
query  The query to access.
Returns:
The QueryData pointer.

Definition at line 829 of file queries.c.

References querydata_new().

Referenced by on_querySaveDlgOkBtn_clicked(), query_save(), and query_save_dialog_create().

void* query_get_result GtkWidget *    query
 

Return the query result data.

Parameters:
query  The query of interest.
Returns:
A pointer to the result data.

Definition at line 840 of file queries.c.

Referenced by export_html_dialog_show(), gui_get_result_columns(), gui_get_result_rows(), and query_get_current_result().

char* query_get_text GtkWidget *    query
 

Return text of listed query page.

Parameters:
query  The query widget.
Returns:
A copy of the text. This must be freed with g_free when finished.

Definition at line 629 of file queries.c.

Referenced by query_get_text_no().

char* query_get_text_no int    n
 

Return the text from the selected query.

Parameters:
n  The query to retrieve.
Returns:
The query text.

Definition at line 801 of file queries.c.

References query_get_no(), and query_get_text().

Referenced by ws_save_file().

GtkWidget* query_pane_init  
 

Initilise the query notebook.

Returns:
The query notebook widget.

Definition at line 860 of file queries.c.

References notebook_selection_callback(), and queryNotebookPageChangeHandler.

Referenced by init_top_hpane().

void query_save GtkWidget *    qry
 

Save a query to disk.

Parameters:
qry  The query to save. If NULL, the current query is saved.

Definition at line 909 of file queries.c.

References _queryData::filename, query_get_current(), query_get_querydata(), query_save_as(), and query_save_to_file().

Referenced by on_querySave_activate().

void query_set_name int    position,
char *    name
 

Set the name of the query notebook page.

If name is NULL or an empty string, the call is ignored. Otherwise, the name is set as specified.

Parameters:
position  The query index number. Zero-based.
name  The new name.

Definition at line 109 of file queries.c.

Referenced by gui_set_query_name().

GtkWidget* result_pane_init  
 

Initilise the result notebook.

Returns:
The container widget holding the pane.

Definition at line 880 of file queries.c.

Referenced by init_mainvpane().

void results_display void *    result,
int    why,
int    position
 

Display the results in the result pane.

Parameters:
result  Depends on 'why' param. For good queries, points to the database result structure. For QUERY_ERROR, is an error message.
why  Why are the results being displayed? Can be:
  • QUERY_FAKE A new label is set as the current page result widget.
  • QUERY_SWITCH The result notepad is switched to the appropriate page.
  • QUERY_ERROR A new label is set as the current page result widget.
  • Otherwise, the result widget is set to a CList containing the query results inside a scrolled window.
Parameters:
position  The result notebook page number to set the result on. If < 0, a new page is appended.

Definition at line 312 of file queries.c.

References db_conn::DBget_field_name, db_conn::DBget_field_number, db_conn::DBget_field_value, db_conn::DBget_query_status, db_conn::DBget_record_number, gui_get_connection(), MAXCOLWID, notebook_page_count(), on_result_button_press_event(), status_pop(), and status_push().

Referenced by gui_send_query(), notebook_selection_callback(), and query_add().


Generated on Sun May 9 19:19:25 2004 for GtkSQL by doxygen1.2.18