#ifndef __PROPS_H #define __PROPS_H /*------------------------------------------------------------------------- * Copyright (c) 2001-2005 Kenneth W. Sodemann (stuffle@mac.com) *------------------------------------------------------------------------- * prop_dlg * * Synopsis: * Properties Dlg and related functions. * * $Id: props.h,v 1.9 2005/02/12 03:18:27 stuffle 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * Free Software Foundation, Inc. * 59 Temple Place, Suite 330 * Boston, MA 02111-1307 USA * *------------------------------------------------------------------------- */ #include #include /* * Building keys for the preferences items: * BASE_KEY/SECTION_NAME/ITEM_NAME * * BASE_KEY is defined in defs.h */ /* general section */ #define GENERAL_SECTION "general" #define AUTO_REF_RATE "auto_refresh_rate" #define HTML_VIEWER "html_viewer" #define TEXT_VIEWER "text_viewer" #define SHOW_LOGIN "show_login_dlg" #define REMEMBER_WIN_SIZES "remember_window_sizes" /* Main Window section */ #define MAIN_WIN_SECTION "main_window" #define ASSIGNEE_STR "assignee" #define PROBLEM_TYPE_STR "problem_type" #define PRJ_NAME_STR "project_name" #define PR_DESCR_STR "problem_rpt_descr" #define PR_RPT_NUM_STR "problem_rpt_number" #define SEVERITY_STR "severity" #define STATUS_STR "status" #define SUBMISSION_DT_STR "submission_date" #define SUBMITTER_STR "submitter" #define INACTIVE_PRJ_STR "inactive_projects" #define ARCH_STR "archive_status" /* Sorting Section */ #define SORT_SECTION "sorting" #define ATTR_SORT "attributes" #define PRJ_SORT "projects" /* * Columns that the user can tell the system to display. */ typedef enum { ASSIGNEE_COL, PROBLEM_TYPE_COL, PRJ_NAME_COL, PR_DESCR_COL, PR_RPT_NUM_COL, SEVERITY_COL, STATUS_COL, SUBMISSION_DATE_COL, SUBMITTER_COL, ARCH_COL } DisplayColumn; /* * Orders in which attributes and projects can be sorted */ typedef enum { SORT_USER_DEF = 0, SORT_ALPHA, SORT_NEW_FIRST, SORT_OLD_FIRST } SortType; /*------------------------------------------------------------------------- * Function: * display_column_in_results * * Synopsis: * Determine if the stated column should be displayed on the screen. * * Inputs: * client : GConf client to use when getting the configuration * information. * col : Enumeration (see DislplayColumn) defining the column in * question. * * Outputs: * None. * * Return Value: * TRUE : Display the column * FALSE : Do not display the column *------------------------------------------------------------------------- */ gboolean display_column_in_results (GConfClient *client, DisplayColumn col); /*------------------------------------------------------------------------- * Function: * auto_refresh_rate * * Synopsis: * Return the auto_refresh_rate as defined in the properties. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The user defined auto refresh rate, in minutes. * *------------------------------------------------------------------------- */ gint auto_refresh_rate (GConfClient *client); /*------------------------------------------------------------------------- * Function: * html_viewer * * Synopsis: * Return the html viewer as defined in the properties. It is the * responsibility of the caller to g_free the returned string pointer. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * A pointer to the html viewer as defined by the user. * *------------------------------------------------------------------------- */ gchar *html_viewer (GConfClient *client); /*------------------------------------------------------------------------- * Function: * text_viewer * * Synopsis: * Return the text viewer as defined in the properties. It is the * responsibility of the caller to g_free the returned string pointer. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * A pointer to the text viewer as defined by the user. * *------------------------------------------------------------------------- */ gchar *text_viewer (GConfClient *client); /*------------------------------------------------------------------------- * Function: * show_login_dlg_on_startup * * Synopsis: * Return a boolean flag that states whether or not the user would * like the login dialog shown on startup instead of attempting to * log on to the default database. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The value of the flag (TRUE or FALSE) as defined by the user. * *------------------------------------------------------------------------- */ gboolean show_login_dlg_on_startup (GConfClient *client); /*------------------------------------------------------------------------- * Function: * remember_window_sizes * * Synopsis: * Return a boolean flag that states whether or not the user would * like the window sizes to be saved and reset. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The value of the flag (TRUE or FALSE) as defined by the user. * *------------------------------------------------------------------------- */ gboolean remember_window_sizes (GConfClient *client); /*------------------------------------------------------------------------- * Function: * show_inactive_projects_in_menu * * Synopsis: * Returns a boolean flag indicating whether or not the user wants * inactive projects to be displayed in the option menu on the main * window. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The value of the flag (TRUE or FALSE) as defined by the user. * *------------------------------------------------------------------------- */ gboolean show_inactive_projects_in_menu (GConfClient *client); /*------------------------------------------------------------------------- * Function: * attribute_sort_order * * Synopsis: * Return the sort order that the user currently has selected for * displaying attrbiutes in combo boxes. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The sort order to use for attributes. Default to SORT_USER_DEF * if the current sort order is undefined or has an invalid value. *------------------------------------------------------------------------- */ SortType attribute_sort_order (GConfClient *client); /*------------------------------------------------------------------------- * Function: * project_sort_order * * Synopsis: * Return the sort order that the user currently has selected for * displaying projects in combo boxes. * * Inputs: * client : GConf client to use when getting the configuration * information. * * Outputs: * None. * * Return Value: * The sort order to use for projects. Default to SORT_ALPHA * if the current sort order is undefined or has an invalid value. *------------------------------------------------------------------------- */ SortType project_sort_order (GConfClient *client); /*------------------------------------------------------------------------- * Function: * show_prop_dlg * * Synopsis: * Show the properties dialog box. The properties dialog is shown * modelessly. If the box is already being shown, just make sure it * is visable rather than showing it again. * * Inputs: * main_win : the main window of the application. * * Outputs: * None. * * Return Value: * None. *------------------------------------------------------------------------- */ void show_prop_dlg (GtkWidget *main_win); #endif