Category User Interface
[UI Utilities]


Detailed Description

Category User Interface.

The category user interface provides useful functions for applications that use categories. Currently this library supplies two functions: alp_cat_edit, which allows users to create, delete, and rename categories, and alp_cat_categorize, which displays a dialog that allows users to recategorize a specified record.

In Palm OS, the Category Manager provided both the user interface and programmatic functions for manipulating categories. In ALP, the user interface is separate from the functions that manipulate categories directly. These functions are described in the Category Manager Data Model documentation.

To access these functions, you need to link with the libalp_catui.so shared library and include <alp/catui.h>.


Data Structures

struct  _AlpCatModelCreateType

Defines

#define ALP_CAT_COMBO_BOX_WIDTH   "alp-cat-combo-box-width"

Typedefs

typedef _AlpCatModelCreateType AlpCatModelCreateType

Enumerations

enum  { alpCatColumnRowMode, alpCatColumnCategoryID, alpCatColumnName, alpCatNumColumns }
enum  AlpCatUIModeType {
  alpCatEndRowMode = 0, alpCatCategoryRowMode, alpCatAllRowMode, alpCatUnfiledRowMode,
  alpCatEditRowMode, alpCatSeparatorRowMode, alpCatFirstAppRowMode = 16
}

Functions

alp_status_t alp_cat_categorize (GtkWindow *parent, char *recordDescription, AlpDmlH catH, AlpLuid recordID, bool allowMultiple, bool allowEditing)
alp_status_t alp_cat_categorize_by_popup (GtkWidget *widget, AlpDmlH catH, AlpLuid recordID, bool allowMultiple, bool allowEditing, AlpLuid *catChosen)
alp_status_t alp_cat_combo_box_set_active (GtkComboBox *comboBox, int32_t rowMode, AlpLuid categoryID)
alp_status_t alp_cat_combo_box_set_model (GtkComboBox *comboBox, AlpDmlH catH, AlpCatModelCreateType *modelCreateArray, bool includeReadOnlyCategories, bool createRenderer)
alp_status_t alp_cat_edit (GtkWindow *parent, AlpDmlH catH)


Define Documentation

#define ALP_CAT_COMBO_BOX_WIDTH   "alp-cat-combo-box-width"
 


Typedef Documentation

typedef struct _AlpCatModelCreateType AlpCatModelCreateType
 

Structure used to define a row in the combo box model created by alp_cat_combo_box_set_model


Enumeration Type Documentation

anonymous enum
 

Model column definitions

Enumerator:
alpCatColumnRowMode  The row mode for this row
alpCatColumnCategoryID  The category ID of the row if the row mode is alpCatCategoryRowMode
alpCatColumnName  The displayed name of the row
alpCatNumColumns  The number of columns in the model

enum AlpCatUIModeType
 

Row definitions for the model create array

Enumerator:
alpCatEndRowMode  Marker for last row in array. You can also just use 0
alpCatCategoryRowMode  Category row mode. In the model, this row is expanded into multiple rows, each row containing an actual category
alpCatAllRowMode  All row mode
alpCatUnfiledRowMode  Unfiled row mode
alpCatEditRowMode  Edit row mode. This row becomes "Edit Categories..."
alpCatSeparatorRowMode  Separator row mode. This row becomes a separator
alpCatFirstAppRowMode  First row mode that is available for app-defined noneditable modes


Function Documentation

alp_status_t alp_cat_categorize GtkWindow *  parent,
char *  recordDescription,
AlpDmlH  catH,
AlpLuid  recordID,
bool  allowMultiple,
bool  allowEditing
 

Displays a dialog that allows the user to choose the category for the specified record in the specified database.

Parameters:
[in] parent The parent window to which the dialog is added
[in] recordDescription A string describing the record displayed in the dialog
[in] catH The database containing the record to be categorized
[in] recordID The id of the record to be recategorized
[in] allowMultiple Set to true if the application supports multiple categories per record
[in] allowEditing Set to true if you want the user to be able to edit the categories in the dialog
Returns:
alp_status_t

alp_status_t alp_cat_categorize_by_popup GtkWidget *  widget,
AlpDmlH  catH,
AlpLuid  recordID,
bool  allowMultiple,
bool  allowEditing,
AlpLuid catChosen
 

Displays a popup menu that allows the user to choose the category for the specified record in the specified database.

Parameters:
[in] widget The widget to put the popup on
[in] catH The database containing the record to be categorized
[in] recordID The id of the record to be recategorized. If 0 then only category chosen is returned.
[in] allowMultiple Set to true if the application supports multiple categories per record (currently unsupported)
[in] allowEditing Set to true if you want the user to be able to edit the categories in the dialog
[out] catChosen The category chosen. -1 is unfiled. 0 is nothing chosen.
Returns:
alp_status_t

alp_status_t alp_cat_combo_box_set_active GtkComboBox *  comboBox,
int32_t  rowMode,
AlpLuid  categoryID
 

Sets the active row of the specified combo box to the row having the specified mode and the specified category ID

This function works on combo boxes that have been populated using the alp_cat_combo_box_set_model function.

Parameters:
[in] comboBox The combo box that receives the new model.
[in] rowMode The mode of the row to be made active
[in] categoryID The category ID of the row to be made active if rowMode is alpCatCategoryRowMode
Returns:
ALP_STATUS_CATMGR_DML_NOT_FOUND if the categoryID or rowMode doesn't exist in the comboBox model store

alp_status_t alp_cat_combo_box_set_model GtkComboBox *  comboBox,
AlpDmlH  catH,
AlpCatModelCreateType modelCreateArray,
bool  includeReadOnlyCategories,
bool  createRenderer
 

Creates a GtkListStore and attaches it to the specifed combo box. The list store contains a list of options that correspond to the specification in the model create array. This function can be used to refresh the list in the combo box also. Just be sure that createRenderer is set to false if you use it this way. This function does not set the active element.

You can use this function to set up a combo box without populating it with category entries. Just set the catH parameter to NULL and make sure your create array does not have a alpCatCategoryRowMode in it.

Parameters:
[in] comboBox The combo box that receives the new model.
[in] catH The handle of the database from which the categories are determined
[in] modelCreateArray An array of AlpCatModelCreateType that determines the combo box list If this parameter is NULL, sets up a default setting of [All, categories, Unfiled, separator, Edit Categories...]
[in] includeReadOnlyCategories Set to false if you want to omit read only categories from list
[in] createRenderer Set to true if the function should create the cell renderer for the combo box
Returns:
alp_status_t ALP_STATUS_CATMGR_DML_BAD_PARAM if any of the parameters are bad
Remarks:
This function automatically truncates the names so they fit in a width of 100 pixels. If you do not want to truncate the names or you want to truncate to a different pixel width, you can use g_object_set_data to set the ALP_CAT_COMBO_BOX_WIDTH association. If you set the pointer to GINT_TO_POINTER(1), no truncation will occur. If you set the pointer to any larger value, the names will be truncated to that number of pixels.

alp_status_t alp_cat_edit GtkWindow *  parent,
AlpDmlH  catH
 

Displays a dialog that allows the user to edit the categories of the specified database. The user can create, delete, or rename categories.

Parameters:
[in] parent The parent window to which the dialog is added
[in] catH The handle of the database to edit
Returns:
alp_status_t


Generated on Wed Jul 30 07:06:41 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.