Contained WithinFind More DocumentationFeatured Support Resources | PDF로 이 문서 다운로드 (738 KB)
Part III Optional IntegrationChapters 6 through 10 describe how to perform the following optional integration tasks:
Chapter 6, Integrating with the Workspace Manager, "Integrating with the Workspace Manager" Chapter 7, Common Desktop Environment Motif Widgets, "Common Desktop Environment Motif Widgets" Chapter 8, Invoking Actions from Applications, "Invoking Actions from Applications" Chapter 9, Accessing the Data-Typing Database, "Accessing the Data-Typing Database" Chapter 10, Integrating with Calendar, "Integrating with Calendar" Chapter 6 Integrating with the Workspace ManagerThe Workspace Manager provides the means for an application to manage its windows within the desktop's multiple workspace environment. An application can perform four major tasks by communicating with the Workspace Manager:
Normally, Session Manager will get your application main window into the right workspace without your intervention. However, if your application has multiple top-level windows, you should use the Workspace Manager API to figure out where your windows are and save this data as part of your session state. See Chapter 4, Integrating with Session Manager for details on saving application-related information between sessions. Communicating with the Workspace ManagerAn application communicates with the Workspace Manager by using functions provided by the desktop. These functions allow you to quickly and easily perform a variety of tasks associated with workspace management. The following is a list of these functions:
Segments of code from two demo programs (occupy.c and wsinfo.c) illustrate the use of these functions. Listings for occupy.c, wsinfo.c, and makefiles for several brands of workstations are in the directory /usr/dt/examples/dtwsm. See the applicable man page for more information on each function. Placing an Application Window in WorkspacesAn application can place its windows in any or all of the existing workspaces. DtWsmOccupyAllWorkspaces() places the windows in all currently defined workspaces, while DtWsmSetWorkspacesOccupied() places the windows in all workspaces named in a list that is passed to the function. To Place an Application Window in All Workspaces
Use DtWsmOccupyAllWorkspaces(). In occupy.c, the callback allWsCB() for the Occupy All Workspaces push button calls this function. DtWsmOccupyAllWorkspaces (XtDisplay(toplevel),
XtWindow(toplevel));
where: See the DtWsmOccupyAllWorkspaces() man page for more information on this function. To Place an Application Window in Specified Workspaces
Use DtWsmSetWorkspacesOccupied(). In occupy.c, the callback setCB() for the Set Occupancy push button calls this function. DtWsmSetWorkSpacesOccupied XtDisplay(toplevel),
XtWindow(toplevel), paWsSet, numSet);
where: See the DtWsmSetWorkspacesOccupied() man page for more information on this function. Identifying Workspaces Containing the Application WindowsThe function DtWsmGetWorkspacesOccupied() returns a list of the workspaces in which a specified application window resides. In occupy.c, the procedure ShowWorkspaceOccupancy() calls this function. Based on the results of this call, ShowWorkspaceOccupancy() changes the appearance of the toggle buttons that represent the workspaces. A check mark appears on every toggle button in whose workspace the application window resides. To Identify Workspaces That Contain the Application Window
Use DtWsmGetWorkspacesOccupied(). rval = DtWsmGetWorkspacesOccupied(XtDisplay(toplevel)
XtWindow(toplevel), &paWsIn, &numWsIn);
where: After this call, loops are set up to compare the list of workspaces (found in the procedure SetUpWorkspaceButtons() by DtWsmGetWorkspaceList()) with the list of workspaces in which the application window was found to reside. The toggle button resource XmNset is set to True for each toggle button that represents a workspace in which the application window resides. Preventing Application Movement Among WorkspacesThe function DtWsmRemoveWorkspaceFunctions() prevents an application from:
DtWsmRemoveWorkspaceFunctions() does this by making that portion of the desktop Workspace Manager (dtwm) window menu inactive. The application should call DtWsmRemoveWorkspaceFunctions() before its top-level window is mapped because dtwm only checks workspace information at the time it manages the application's top-level window. If you need to call DtWsmRemoveWorkspaceFunctions() after the application's top-level window is managed, then you must first call the Xlib function XWithdrawWindow(), call DtWsmRemoveWorkspaceFunctions,() and then call XMapWindow() to remap the top-level window. To Prevent Movement to Another WorkspaceDtWsmRemoveWorkspaceFunctions(XtDisplay(toplevel),
XtWindow(toplevel));
where:
Monitoring Workspace ChangesYou can monitor workspace changes by using either or both of the following functions: DtWsmAddCurrentWorkspaceCallback() registers an application callback to be called whenever the Workspace Manager is switched to a new workspace. See the DtWsmAddCurrentWorkspaceCallback(3) man page for more information. DtWsmWorkspaceModifiedCallback() registers an application callback to be called whenever a workspace is added, deleted, or changed. See the DtWsmWorkspaceModifiedCallback(3) man page for more information. To Monitor Workspace Switching
Use DtWsmAddCurrentWorkspaceCallback(). In the demo program wsinfo.c, this function is called after the top-level widget is realized. DtWsmAddCurrentWorkspaceCallback (toplevel, wschangecb, NULL); where To Monitor Other Workspace Changes
Use DtWsmWorkspaceModifiedCallback(). DtWsmWorkspaceModifiedCallback toplevel, wschangecb, NULL); where: Chapter 7 Common Desktop Environment Motif WidgetsThe Common Desktop Environment provides Motif 2.1 libraries (with bug fixes) and enhancements. In addition, the Common Desktop Environment provides four custom widgets you can use to provide certain OPEN LOOKTM and Microsoft® Windows functionality. This chapter describes these Motif custom widgets. The widget library, libDtWidget, contains four widgets that combine or enhance functionality of existing Motif 2.1 widgets:
These widgets provide common functionality across all Common Desktop Environment applications. None of these widgets support subclassing. The Custom Widgets library depends directly on the following libraries:
Menu Button Widget (DtMenuButton)Use the DtMenuButton widget to provide menu-cascading functionality outside of a menu pane. DtMenuButton widget is a command widget that complements the menu cascading functionality of an XmCascadeButton widget. As a complement to XmCascadeButton widget, it can only be instantiated outside a MenuBar, Pulldown, or Popup (use XmCascadeButton widget inside a MenuPane.)Figure 7-1 shows examples of a DtMenuButton widget. Figure 7-1 Examples of menu button widget (DtMenuButton)
Library and Header FilesThe DtMenuButton widget is in the libDtWidget library. The header file is Dt/MenuButton.h. Demo ProgramA demo containing an example of the DtMenuButton widget is in /usr/dt/examples/dtwidget/controls.c. Convenience FunctionsDtCreateMenuButton() is a convenience function that creates a Common Desktop Environment widget. DtMenuButton widget is a subclass of XmLabel class. Visually, DtMenuButton widget has a label string and a menu glyph. The menu glyph always appears on the right end of the widget and, by default, is a downward pointing arrow. DtMenuButton widget has an implicitly created submenu attached to it. The submenu is a pop-up menu and has this DtMenuButton widget as its parent. The name of the implicitly created submenu is obtained by prefixing submenu_ to the name of this DtMenuButton widget. You can obtain the widget ID of the submenu by setting an XtGetValues on DtNsubMenuId resource of this DtMenuButton widget. The implicitly created submenu must not be destroyed by the user of this widget. The submenu can be popped up by pressing the menu post button (see XmNmenuPost resource of XmRowColumn) anywhere on the DtMenuButton widget or by pressing the Motif Cancel key (usually Escape). ClassesDtMenuButtonWidget inherits behavior and resources from Core, XmPrimitive, and XmLabel classes. The class pointer is dtMenuButtonWidgetClass. The class name is DtMenuButtonWidget. DtMenuButtonWidget does not support subclassing. ResourcesDtMenuButtonWidget provides the following resources. Table 7-1 shows the class, type, default, and access for these resources.
See the DtMenuButtonWidget(3X) man page for more information. The codes in the access column show if you can:
Callback StructuresThe callback structure follows and is described in Table 7-2. typedef struct {
int reason;
XEvent *event;
} XmAnyCallbackStruct;
Table 7-2 DtMenuButtonWidget Callback Structures
Example of DtMenuButton WidgetThe following example shows how to create and use a DtMenuButton widget. You can find this code as part of the controls.c demo in the /usr/dt/examples/dtwidget directory. /*
* Example code for DtMenuButton
*/
#include Dt/DtMenuButton.h
/* MenuButton custom glyph */
#define menu_glyph_width 16
#define menu_glyph_height 16
static unsigned char menu_glyph_bits[] = {
0xe0, 0x03, 0x98, 0x0f, 0x84, 0x1f, 0x82, 0x3f, 0x82, 0x3f, 0x81,
0x7f, 0x81, 0x7f, 0xff, 0x7f, 0xff, 0x40, 0xff, 0x40, 0xfe, 0x20, 0xfe,
0x20, 0xfc, 0x10, 0xf8, 0x0c, 0xe0, 0x03, 0x00, 0x00};
static void CreateMenuButtons(Widget parent) {
Widget menuButton, submenu, titleLabel, button;
Pixmap cascadePixmap;
Pixel fg, bg;
Cardinal depth;
XmString labelString;
Arg args[20];
int i, n;
/* Create title label */
labelString = XmStringCreateLocalized("MenuButton Widget");
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
titleLabel = XmCreateLabel(parent, "title", args, n);
XtManageChild(titleLabel);
XmStringFree(labelString);
/*
* Create a MenuButton.
* Add push buttons to the built-in popup menu.
*/
labelString = XmStringCreateLocalized("Action"); n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
menuButton = DtCreateMenuButton(parent, "menuButton1", args, n);
XtManageChild(menuButton);
XmStringFree(labelString);
XtVaGetValues(menuButton, DtNsubMenuId, &submenu, NULL);
button = XmCreatePushButton(submenu, "Push", NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, "Pull", NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, "Turn", NULL, 0);
XtManageChild(button);
/*
* Create a MenuButton.
* Replace the built-in popup menu with a tear-off menu.
* Add a custom pixmap in the colors of the MenuButton.
*/
labelString = XmStringCreateLocalized("Movement");
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
menuButton = DtCreateMenuButton(parent, "menuButton1", args, n);
XtManageChild(menuButton);
XmStringFree(labelString);
/* Create a tear-off menu */
n = 0;
XtSetArg(args[0], XmNtearOffModel, XmTEAR_OFF_ENABLED); n++;
submenu = XmCreatePopupMenu(menuButton, "submenu", args, n);
button = XmCreatePushButton(submenu, "Run", NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, "Jump", NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, "Stop", NULL, 0);
XtManageChild(button);
XtVaSetValues(menuButton, DtNsubMenuId, submenu, NULL);
/* Create a pixmap using the menu button's colors and depth */
XtVaGetValues(menuButton,
XmNforeground, &fg,
XmNbackground, &bg,
XmNdepth, &depth,
NULL);
cascadePixmap = XCreatePixmapFromBitmapData(XtDisplay
(menuButton),DefaultRootWindow(XtDisplay
(menuButton)),
(char*)menu_glyph_bits,
menu_glyph_width, menu_glyph_height,
fg, bg, depth);
XtVaSetValues(menuButton, DtNcascadePixmap, cascadePixmap,
NULL);
}
Text Editor Widget (DtEditor)The Common Desktop Environment text editing system consists of two components:
Although the OSF/Motif text widget also provides a programmatic interface, applications that use the system-wide uniform editor should use the DtEditor(3) widget. The Common Desktop Environment Text Editor and Mailer use the editor widget. Use this widget in the following circumstances:
This section describes the text editor widget, DtEditor(3). The Editor Widget library provides support for creating and editing text files. It enables applications running in the desktop environment to have a consistent method of editing text data. The DtEditor(3) widget consists of a scrolled edit window for text, an optional status line, and dialogs for finding and changing text, spell checking, and specifying formatting options. The text editor widget includes a set of convenience functions for programmatically controlling the widget. Library and Header FilesThe DtEditor widget is in the libDtWidget library. The header file is Dt/Editor.h. Demo ProgramA demo containing an example of the DtEditor widget is in /usr/dt/examples/dtwidget/editor.c. ClassesWidget subclassing is not supported for the DtEditor widget class. DtEditor inherits behavior and resources from Core, Composite, Constraints, XmManager, and XmForm classes. The class name for the editor widget is DtEditorWidget. The class pointer is dtEditorWidgetClass. Convenience FunctionsThe DtEditor convenience functions are described in the following tables. Life Cycle FunctionsThe DtEditor life cycle functions are described in Table 7-3. Table 7-3 DtEditor Life Cycle Functions
Input/Output FunctionsThe DtEditor input/output functions are described in Table 7-4. Table 7-4 DtEditor Input/Output Functions
Selection FunctionsThe DtEditor selection functions are described in Table 7-5. Table 7-5 DtEditor Selection Functions
Format FunctionsThe DtEditor format functions are described inTable 7-6. Table 7-6 DtEditor Format Functions
Find and Change FunctionsThe DtEditor find and change functions are described in Table 7-7. Table 7-7 DtEditArea Find and Change Functions
Auxiliary FunctionsThe DtEditor auxiliary functions are described in Table 7-8. Table 7-8 DtEditor Auxiliary Functions
ResourcesThe DtEditor widget provides the following set of resources.
The status line also includes a Motif XmTextField(3X) widget for displaying messages supplied by an application. This field is a convenient place for an application to display status and feedback about the document being edited. The ID of the text field is retrieved using DtEditorGetMessageTextFieldID(3). A message is displayed by setting the XmNvalue or XmNvalueWcs resource of this widget. If the text field is not needed, you can unmanage it by calling XtUnmanageWidget(3X) with its ID.
Table 7-9 lists the class, type, default, and access for each resource. You can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or class in an .Xdefaults file, remove the DtN or DtC prefix and use the remaining letters. To specify one of the defined values for a resource in an .Xdefaults file, remove the Dt prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column show if you can:
See the DtEditor(3) man page for more information. Table 7-9 DtEditor Resources
Inherited ResourcesDtEditor inherits behavior and resources from the following superclasses:
Refer to the appropriate man page for more information. Localization ResourcesThe following list describes a set of widget resources that are designed for localization of the DtEditor widget and its dialog boxes. Default values for these resources depend on the locale.
Table 7-10 lists the class, type, default, and access for each of the localization resources. The codes in the access column show if you can:
See the DtEditor(3) man page for more information. Table 7-10 DtEditor Localization Resources
Callback FunctionsThe DtEditor widget supports three callback functions:
If you want to present help information about the editor widget and its dialog boxes, set the XmNhelpCallback resource and use the reason field passed as part of DtEditorHelpCallbackStruct to set the contents of the Help dialog box. A pointer to the following structure is passed to XmNHelpCallback. The callback structure and is described in Table 7-11. typedef struct {
int reason;
XEvent *event;
} DtEditorHelpCallbackStruct;
Table 7-11 DtEditorHelp Callback Structure
Use the DtNtextSelectCallback and DtNtextDeselectCallback resources when you want to enable and disable menu items and commands depending on whether text is selected. DtNtextSelectCallback specifies a function that is called whenever some text is selected in the edit window. DtNtextDeselectCallback specifies a function that is called whenever no text is selected within the edit window. The reasons sent by the callbacks are DtEDITOR_TEXT_SELECT and DtEDITOR_TEXT_DESELECT. Chapter 8 Invoking Actions from ApplicationsIf your application manages an extensible collection of data types, there is a strong likelihood that it should be directly involved with action invocation. This chapter explains how you can invoke an action from an application. Included is an example program that shows you how to invoke an action. For more information on actions and how you create them, see Chapter 9, Accessing the Data-Typing Database, in this manual, and the following chapters in the Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide. Mechanisms for Invoking Actions from an ApplicationThe action invocation API exported by the Desktop Services library is one mechanism available to your application to cause another application to be invoked or to perform an operation. Other mechanisms include:
Each of these mechanisms has benefits and limitations, so you must evaluate your specific situation to determine which is most appropriate. The advantages of using the action invocation API include:
The disadvantage of using the action invocation API is that it is only an invocation mechanism that has limited return value capabilities and has no capabilities for a dialog with the invoked action handler. If these features are required, fork/exec/pipes can be used. However, within CDE, ToolTalk is the preferred cross process communications mechanism due to its generalized client/server paradigm. Returning to invocation, suppose your application manages data files in several different formats (text and graphics) and needs to provide a way for the user to edit and display these files. To implement this feature without using actions, you would probably use one of the following mechanisms:
To implement this feature using actions, you only have to invoke the Open action on the buffer or on the data file. The action invocation API will use the action database to determine the appropriate message to send or command to invoke as well as handle all details, such as creating and cleaning up temporary files and catching necessary signals. Types of ActionsThe action application program interface (API) works with any type of action. Types of actions in the desktop include:
See "Introduction to Actions and Data Types" in the Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide for more information. Action Invocation APIThe action invocation API is exported from the Desktop Services library and provides functions to accomplish a number of tasks, such as:
Related InformationFor detailed information about action commands, functions, and data formats, see the following man pages:
actions.c Example ProgramThis section describes a simple example program, actions.c. A complete listing of actions.c is at the end of this chapter. Loading the Database of Actions and Data TypesBefore your application can invoke an action, it must initialize the Desktop Services library (which contains the action invocation API) and load the database of action and data-type definitions. To Initialize the Desktop Services Library
DtInitialize() ExampleThe following code segment shows how the example program actions.c uses DtInitialize(). To Load the Actions and Data-Typing Database if (DtInitialize(XtDisplay(shell), shell,
argv[0],ApplicationClass)==False) {
/* DtInitialize() has already logged an appropriate error msg */
exit(-1);
}
Use the DtDbLoad() function to load the actions and data-typing database. DtDbLoad(void) DtDbLoad() reads in the action and data-typing database. This function determines the set of directories that are to be searched for database files (the database search path) and loads the *.dt files found into the database. The directory search path is based on the value of the DTDATABASESEARCHPATH environment variable and internal defaults. To Request Notification of Reload EventsIf you use DtDbLoad() in a long-lived application, it must dynamically reload the database whenever it is modified.
Callback_proc cleans up any cached database information your application is holding and then invokes DtDbLoad(). Client_data may be used to pass additional client information to the callback routine. Checking the Actions DatabaseYour application accesses the database if it needs to display the icon or label for an action. Also before invoking an action, your application can check that it exists. An action is identified in the database by the action name: ACTION action_name
{
...
}
For example, the action definition for the Calculator looks like this: ACTION Dtcalc
{
LABEL Calculator
ICON Dtcalc
ARG_COUNT 0
TYPE COMMAND
WINDOW_TYPE NO_STDIO
EXEC_STRING /usr/dt/bin/dtcalc
DESCRIPTION The Calculator (Dtcalc) action runs the \
desktop Calculator application.
}
The action name for the Calculator action is Dtcalc. When an executable file has a file name that matches an action name in the existing database, that file is an action file--a representation for the underlying action. The information about the icon and label for that file are stored in the database. To Determine Whether a Specified Action Definition ExistsUse the DtActionExists() function to determine whether a specified action definition exists. DtActionExists(*name) DtActionExists() checks whether the specified name corresponds to the name of an action in the database. The function returns True if name corresponds to an action name, or False if no action with that name is found. To Obtain the Icon Image Information for a Specified ActionUse the DtActionIcon() function to obtain the icon image information. DtActionIcon(char *action_name) An action definition specifies the icon image used to represent the action in the definition's ICON field: ACTION action_name
{
ICON icon_image_base_name
...
}
DtActionIcon() returns a character string containing the value of the icon image field. If the action definition does not contain an icon field, the function returns the value of the default action icon image, Dtactn. You then need to determine the location of the icon, and the size you want to use. Icons can exist in four sizes and are available in bitmap or pixmap form. For example, you can find the base name of the icon file from the action definition for the Calculator. You then use the base name coupled with the information given in Table 8-1 and knowledge of the location of all the icons to find the specific icon file you want. The icon name for the calculator action is Dtcalc, but that is not the entire file name. Icon file names are based on the size of the icon. Table 8-1 shows the sizes and file-naming conventions for the desktop icons. Table 8-1 Icon Sizes and File Names
Note - See "Creating Icons for the Desktop" in the Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide for more information about the desktop icon files. For bitmaps, there is an additional file that is used as a mask, and its extension ends with _m.bm. Thus, there can be a total of three files for each size icon. Here are the icon files for the calculator: Dtcalc.t.bm Dtcalc.t.pm Dtcalc.t_m.bm Dtcalc.m.bm Dtcalc.m.pm Dtcalc.m_m.bm Dtcalc.l.bm Dtcalc.l.pm Dtcalc.l_m.bm Note - There are no small icons (Dtcalc.s.bm, Dtcalc.s.pm, Dtcalc.s_m.bm) for the Calculator. DtActionIcon() returns only a base name; for the Calculator it is Dtcalc. You must choose the type (pixmap or bitmap) and size (tiny, small, medium, or large) and append the applicable extension to the base name. In addition, you must know where the file resides. To Get the Localized Label for an ActionUse the DtActionLabel() function to get the localized label for an action. char *DtActionLabel(char *actionName) An action definition may include a label. The label is defined using the label_text field: ACTION action_name {
LABEL label_text
...
}
This label is used in graphical components (such as File Manager and the Application Manager) to label the action's icon. If an action definition does not include a label_text field, the action_name is used. The value of label_text string should be used by all interface components to identify the action to the end user. The DtActionLabel() function returns the value of the label_text field in the action definition of the action named actionName. If the label_text field does not exist, the function returns the actionName. Invoking ActionsAfter your application has initialized the Desktop Services Library it can then invoke an action. To Invoke an ActionUse theDtActionInvoke function to invoke an action. DtActionInvoke (widget, action, args, argCount, termOpts, execHost,, contexDir, useIndicator,statusUpdateCb, client_data) DtActionInvoke() searches the action database for an entry that matches the specified action name, and accepts arguments of the class, type, and count provided. Remember that your application must initialize and load the database before invoking an action. Listing for actions.c/*
* (c) Copyright 1993, 1994 Hewlett-Packard Company
* (c) Copyright 1993, 1994 International Business Machines Corp.
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
* (c) Copyright 1993, 1994 Novell, Inc.
*/
#include <Xm/XmAll.h>
#include <Dt/Dt.h>
#include <Dt/Action.h>
#define ApplicationClass "Dtaction"
static Widget shell;
static XtAppContext appContext;
static Widget actionText;
static Widget fileText;
static void CreateWidgets(Widget);
static void InvokeActionCb(Widget, XtPointer, XtPointer);
static void InvokeAction(char*, char*);
static void DbReloadProc(XtPointer);
void main(int argc, char **argv)
{
Arg args[20];
int n=0;
int numArgs = 0;
shell = XtAppInitialize(&appContext , ApplicationClass, NULL, 0,
&argc, argv, NULL, args, n);
CreateWidgets(shell);
if (DtInitialize(XtDisplay(shell), shell, argv[0],
ApplicationClass)==False) {
/* DtInitialize() has already logged an appropriate error msg */
exit(-1);
}
/* Load the filetype/action databases */
DtDbLoad();
/* Notice changes to the database without needing to restart application
*/
DtDbReloadNotify(DbReloadProc, NULL);
XtRealizeWidget(shell);
XmProcessTraversal(actionText, XmTRAVERSE_CURRENT);
XtAppMainLoop(appContext);
}
static void CreateWidgets(Widget shell)
{
Widget messageBox, workArea, w;
Arg args[20];
int n;
XmString labelString;
labelString = XmStringCreateLocalized("Invoke");
n = 0;
XtSetArg(args[n], XmNdialogType, XmDIALOG_TEMPLATE); n++;
XtSetArg(args[n], XmNokLabelString, labelString); n++;
messageBox = XmCreateMessageBox(shell, "messageBox", args, n);
XtManageChild(messageBox);
XmStringFree(labelString);
XtAddCallback(messageBox, XmNokCallback, InvokeActionCb, NULL);
n = 0;
XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
XtSetArg(args[n], XmNnumColumns, 2); n++;
XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END); n++;
workArea = XmCreateWorkArea(messageBox, "workArea", args, n);
XtManageChild(workArea);
labelString = XmStringCreateLocalized("Invoke Action:");
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
w = XmCreateLabel(workArea, "actionLabel", args, n);
XtManageChild(w);
XmStringFree(labelString);
labelString = XmStringCreateLocalized("On File:");
n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++;
w = XmCreateLabel(workArea, "fileLabel", args, n);
XtManageChild(w);
XmStringFree(labelString);
n = 0;
XtSetArg(args[n], XmNcolumns, 12); n++;
actionText = XmCreateTextField(workArea, "actionText", args, n);
XtManageChild(actionText);
n = 0;
XtSetArg(args[n], XmNcolumns, 12); n++;
fileText = XmCreateTextField(workArea, "fileText", args, n);
XtManageChild(fileText);
}
static void DbReloadProc(XtPointer cd)
{
/* Pick up any dynamic changes to the database files */
DtDbLoad();
}
static void InvokeActionCb(Widget w, XtPointer cd, XtPointer cb)
{
char *action;
char *file;
action = XmTextFieldGetString(actionText);
if (action == NULL) return;
if (strlen(action) == 0) {
XtFree(action);
return;
}
file = XmTextFieldGetString(fileText);
InvokeAction(action, file);
XtFree(action);
XtFree(file);
XmTextFieldSetString(actionText, "");
XmTextFieldSetString(fileText, "");
XmProcessTraversal(actionText, XmTRAVERSE_CURRENT);
}
static void InvokeAction(char *action, char *file)
{
DtActionArg *ap = NULL;
int nap = 0;
DtActionInvocationID actionId;
/* If a file was specified, build the file argument list */
printf("%s(%s)\n",action,file);
if (file != NULL && strlen(file) != 0) {
ap = (DtActionArg*) XtCalloc(1, sizeof(DtActionArg));
ap[0].argClass = DtACTION_FILE;
ap[0].u.file.name = file;
nap = 1;
}
/* Invoke the specified action */
actionId = DtActionInvoke(shell,action,ap,nap,
NULL,NULL,NULL,True,NULL,NULL);
}
Chapter 9 Accessing the Data-Typing DatabaseThis chapter describes the data-typing functions and how to use the data-typing database. SummaryData typing provides an extension to the attributes of files and data beyond what is provided by the traditional UNIX file systems. These extensions consist of attributes, such as icon names, descriptions, and actions, that can be performed on files and data. This information is stored in name/value pairs in the DATA_ATTRIBUTES table (or database). The desktop uses a certain set of DATA_ATTRIBUTES, described in the following paragraphs. The DATA_ATTRIBUTES table is extendable for future and application-specific growth, although extending this table is not recommended because other applications may not check the additions. Data is matched with a specific file or data entry in a DATA_CRITERIA table. The DATA_CRITERIA table entries are sorted in decreasing order from most specific to least specific. For example, /usr/lib/lib* is more specific than /usr/* and would, therefore, appear first. When a request to type a file or data is made, the table is checked in sequence to find the best match using the information provided either from the file or from the data. When an information and entry match is found, DATA_ATTRIBUTES_NAME is used to find the proper DATA_ATTRIBUTES entry. If you want your application to present data objects (either files or data buffers) to the user in a manner consistent with the desktop, use the DtDts* API to determine how to display the data object by calling the DtDtsDataTypeToAttributeValue() function for the ICON attribute. Library and Header FilesTo use data typing, you need to link to the libDtSvc library. Actions are usually loaded with the data-typing information. Actions require links to the libXm and libX11 libraries. The header files are Dt/Dts.h and Dt/Dt.h. Demo ProgramA demo program containing an example of how to use the data-typing database is in /usr/dt/examples/dtdts/datatypes/datatyping.c. Data Criteria and Data AttributesData typing consists of two parts:
The attributes of data criteria, in alphabetical order, are:
Table 9-1 describes the data criteria in the order in which you are most likely to use them. Table 9-1 Data Criteria in Order of Most Likely Use
Some of the more common attributes of data types, in alphabetical order, are:
Table 9-2 describes the data attributes in the order in which you are most likely to use them. Table 9-2 Data Attributes in Order of Most Likely Use
The IS_TEXT field differs from the text attribute of the MIME_TYPE field, which is the MIME content type, as described in the referenced MIME_ RFC. The MIME content type determines whether the data consists of textual characters or byte values. If the data consists of textual characters, and the data is labeled as text/*, the IS_TEXT field determines whether it is appropriate for the data to be presented to users in textual form. Table 9-3 shows some examples of IS_TEXT usage with different MIME_TYPE attributes. Table 9-3 IS_TEXT Attribute Examples
See the dtdtsfile(4) man page for more information about data-type attributes. Data-Typing FunctionsTo look up an attribute for a data object, you must first determine the type of the object and then ask for the appropriate attribute value for that type. The functions that you can use to query the database for data information are shown in Table 9-4. Each of these functions has a man page in section (3). Refer to the appropriate man page for more information. Table 9-4 Data-Typing Database Query Functions
You can type data and retrieve attributes in one of three ways: simple, intermediate, or advanced. Simple Data TypingThe simplest way to type data is to use the following functions:
When you use these functions, a file is typed and a single attribute, or the entire list, is retrieved. System calls are made, data is typed, and the attribute is retrieved. These functions call the intermediate data-typing functions.
Buffers are assumed to have a mode that matches regular files that have read/write permissions. See "Advanced Data Typing" to type read-only buffers. Intermediate Data TypingWhen you type data and retrieve attributes, the data-typing part of the process is the most expensive in terms of performance. You can type data in a second way that improves performance by separating the data-typing and attribute-retrieval functions. Use the following functions for intermediate data typing:
Use these functions if your application queries for more than a single attribute value. When you use these functions, an object is typed and then that type is used to retrieve one or more attributes from the attribute list. Using the intermediate data-typing functions is the recommended way to type data and retrieve attributes. These functions call the advanced data-typing functions and make the same assumptions about buffers as the simpler data typing. Advanced Data TypingAdvanced data typing separates system calls, data typing, and attribute retrieval even further. Advanced data typing is more complicated to code because it uses data from existing system calls, which are initialized in advance and are not included as part of the data-typing function. Use the following function for advanced data typing: DtDtsDataToDataType() To type a read-only buffer, a stat structure should be passed that has the st_mode field set to S_IFREG | S_IROTH | S_IRGRP | S_IRUSR. Data Types That Are Actions (DtDtsDataTypeIsAction)For every action in a database a synthetic data type is generated when a database is loaded that allows actions to be typed. These data types may have two additional attributes:
Registering Objects as Drop ZonesIf your application defines data types, follow these steps to ensure that it provides all the drag and drop behavior that you intend:
If your application displays icons for data objects, you may choose to support those icons as drop zones. If so, you need to query the MOVE_TO_ACTION, COPY_TO_ACTION, or LINK_TO_ACTION attributes to determine the drop behavior for those data objects. Objects should support drop operations only if the corresponding attribute value is not NULL. If all three attributes have NULL values, the object should not be registered as a drop site. Whenever you set at least one of these attributes for an object with a defined data type, your application registers that object as a drop zone. When a user drags an object to a drop zone, your application determines which gesture (that is, which drag operation) was used to make the drop. Based on the drag operation and the drop zone's data type, the application retrieves a drop attribute from the data-typing database. It then calls DtActionInvoke, using the following two rules to determine its parameters:
The File Manager, along with its directory and folder objects, exemplifies how the desktop uses the move, copy, and link drop attributes. A user can drag and drop objects (files) to directory folders. File Manager defines MOVE_TO_ACTION, COPY_TO_ACTION, and LINK_TO_ACTION actions for folder objects. These actions perform the appropriate file system move, copy, and link system functions. See /usr/dt/appconfig/types/C/dtfile.dt for an example of how to define the MOVE_TO_ACTION, COPY_TO_ACTION, and LINK_TO_ACTION attributes. See Chapter 5, Integrating with Drag and Drop for information about how to use drag and drop. Example of Using the Data-Typing DatabaseThis section contains example code of how to use data typing. You can find this example code in /usr/dt/examples/dtdts/datatyping.c. The example code displays the data type, icon name, and supported actions for each file passed to it. You can then use the dtaction client to run a supported action on the file. The usage for datatyping is: datatyping file1 [file2 ...]
#include <Xm/Form.h>
#include <Xm/Text.h>
#include <Dt/Dts.h>
#define ApplicationClass "DtDatatyping"
static Widget text;
static void DisplayTypeInfo(int, char**);
int main(int argc, char **argv)
{
XtAppContext appContext;
Widget toplevel, form;
Arg args[20];
int n;
toplevel = XtAppInitialize(&appContext, ApplicationClass,
NULL, 0,
argc, argv, NULL, NULL, 0);
if (argc == 1) {
printf("%s: No files specified.\n", argv[0]);
exit(1);
}
form = XmCreateForm(toplevel, "form", NULL, 0);
XtManageChild(form);
n = 0;
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
XtSetArg(args[n], XmNeditable, False); n++;
XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
XtSetArg(args[n], XmNrows, 25); n++;
XtSetArg(args[n], XmNcolumns, 90); n++;
text = XmCreateScrolledText(form, "text", args, n);
XtManageChild(text);
XtRealizeWidget(toplevel);
if (DtAppInitialize(appContext, XtDisplay(toplevel), toplevel, argv[0],
ApplicationClass) == False) {
printf("%s: Couldn't initialize Dt\n", argv[0]);
exit(1);
}
DtDbLoad();
DisplayTypeInfo(argc, argv);
XtAppMainLoop(appContext);
}
static void DisplayTypeInfo(int argc, char **argv)
{
char *file;
char *datatype;
char *icon;
char *actions;
char str[100];
int i;
sprintf(str, "%-30s\t%-10s\t%-8s\t%-20s\n",
"File",
"DataType",
"Icon",
"Actions");
XmTextInsert(text, XmTextGetLastPosition(text), str);
sprintf(str, "%-30s\t%-10s\t%-8s\t%-20s\n",
"-------------------",
"--------",
"----",
"-------");
XmTextInsert(text, XmTextGetLastPosition(text), str);
for(i=1; i < argc; i++) {
char *file = argv[i];
/* find out the Dts data type */
datatype = DtDtsFileToDataType(file);
if(datatype) {
/* find the icon attribute for the data type */
icon = DtDtsDataTypeToAttributeValue(datatype,
DtDTS_DA_ICON, file);
}
/* Directly find the action attribute for a file */
actions = DtDtsFileToAttributeValue(file,
DtDTS_DA_ACTION_LIST);
sprintf(str, "%-30s\t%-10s\t%-8s\t%s\n",
file,
datatype?datatype:"unknown",
icon?icon:"unknown",
actions?actions:"unknown");
XmTextInsert(text, XmTextGetLastPosition(text), str);
/* Free the space allocated by Dts */
DtDtsFreeAttributeValue(icon);
DtDtsFreeAttributeValue(actions);
DtDtsFreeDataType(datatype);
}
Chapter 10 Integrating with CalendarThe Calendar application program interface (API) provides a programmatic way to access and manage calendar data in a networked environment. The API supports inserting, deleting, and modifying of entries as well as browse and find capabilities. It also supports calendar administration functions. The Calendar API is an implementation of the X.400 Application Programming Interface Association's (XAPIA) Calendaring and Scheduling API (CSA API). CSA API defines a set of high-level functions so that applications that are calendar enabled can access the varied features of the calendaring and scheduling service. For more information about the latest XAPIA Specification, contact the X.400 API Association, 800 El Camino Real, Mountain View, California 94043. This chapter describes the Calendar API in these sections: Library and Header FilesTo use the Calendar API, you need to link with the libcsa library. The header file is csa/csa.h. Demo ProgramA demo program containing an example of how to use the Calendar API is in /usr/dt/examples/dtcalendar. Using the Calendar APIHow to Integrate with CalendarThe Calendar API provides a way to access and manage calendar data in a networked environment. Overview of the CSA APIThe CSA interface enables a common interface to a calendaring and scheduling service. For each CSA implementation, the view and capabilities presented by CSA must be mapped to the view and capabilities of the underlying calendaring service. The interface is designed to be independent of the actual calendaring and scheduling implementation. The interface is also designed to be independent of the operating system and underlying hardware used by the calendaring service. The number of function calls provided is minimal. A single set of functions manage multiple types of calendar entries. C Naming ConventionsThe identifier for an element of the C interface is derived from the generic name of the element and its associated data type, as specified in Table 10-1 . The generic name is prefixed with the character string in the second column of the table; alphabetic characters are converted to the case in the third column. Table 10-1 Derivation of C Naming Conventions
Elements with the prefix CSAP (any case) are reserved for internal proprietary use by implementors of the CSA service. They are not intended for direct use by programs written using the CSA interface. The prefixes CSA_XS_, CSA_X_ (in either uppercase or lowercase), and csa_x are reserved for extensions of the interface by vendors or groups. The specification defines these interface extensions as extensions to the base set of functions. For constant data values, an additional string is usually appended to CSA_ to indicate the data structure or function for the constant data value. Functional ArchitectureThis section describes the functional architecture of services supporting the CSA API. It provides an abstract implementation model, an abstract data model, and a functional overview. Implementation ModelThe abstract implementation model is provided as a reference aid to help you understand the scope of the CSA API. The CSA interface is defined between a calendar-enabled application and a calendaring service. All functions in this interface are designed to be independent of the calendaring service; however, the API does allow protocol-specific extensions to the common functions to be invoked through the use of extensions. See "Extensions" for more information. The relationship of the CSA interface to a calendar-enabled application and the calendar service is shown in Figure 10-1. Figure 10-1 Positioning of the Calendaring and Scheduling API
The model of the CSA interface can be divided into three components: administration, calendar management, and entry management. These components are shown in Figure 10-2. Figure 10-2 Components of the Calendaring and Scheduling API
Access to the calendaring service is established through a calendaring session. The session provides for a valid connection to the calendaring service and assists in ensuring the integrity of the calendaring information maintained by the service. A calendar-enabled application logs on to an individual calendar within the calendaring service to establish a valid session or connection. The session is terminated by the calendar-enabled application logging off from the calendar. The calendaring service maintains one or more calendars. The calendar service provides some level of administration support for these calendars. A calendar-enabled application might access a list of the calendars maintained by a particular calendar service. In addition, the calendar service might provide support for archive and restore of calendar information into some implementation-specific, persistent format. Where a calendar service provides support for maintaining more than one calendar, support functions are defined for creating and deleting calendars. In addition, functions are provided to support administering the characteristics of the calendar. The majority of the functions within the CSA interface manage individual calendar entries. Calendar entries may be either events, to dos, or memos. Entries can be added, deleted, updated, and read from a particular calendar. A calendar-enabled application can also add reminders to calendar entries. Data ModelThe CSA interface is an access method to a conceptual back-end store of calendaring information that is maintained by a calendaring service. A common data model is helpful in visualizing the components of the calendaring information maintained by a calendaring service. Calendar EntitiesThe data model is based on the concept of a calendar entity. The calendar is represented by a named collection of administrative calendar attributes and calendar entries. A calendar is owned by an individual user. The user could represent a person, a group of people, or a resource. The calendar attributes are a set of named values that may represent common, implementation-specific, or application-specific administrative characteristics about the calendar. For example, time zone, name, owner, and access rights to the calendar can be specified in individual calendar attributes. The calendar entries are the primary components of a calendar. The three classes of calendar entries follow:
Calendar entries are represented by a uniquely named collection of entry attributes. The entry attributes are a set of named values that represent common, implementation-specific, or application-specific characteristics of the calendar entry. For example, an event might contain a start and end date and time, a description, and a subtype. A to do might contain the date it was created, the due date, a priority, and a status. A memo might contain the date it was created and a text content or description. The calendar attributes and entry attributes consist of a name, type, and value tuple. Common attributes defined by the specification can be extended. Implementations can define implementation-specific attributes. In addition, some implementations may provide the capability for applications to define application-specific attributes. The CDE implementation supports application-defined attributes. Access RightsThe accessibility of a calendar to an individual user can be controlled by the access rights given that user. Access rights are paired with a calendar user. CSA allows a user to be an individual, group, or resource. The CDE implementation only supports individual users. The access rights are maintained in an access list. The access list is a particular calendar attribute. The access rights are individually controlled and can be accumulated to define a range of accessibility of a user to a calendar and its entries. The access rights can also be specified in terms of the following access roles:
The owner role enables the user to do anything to the calendar or calendar entries that the owner of the calendar can do, including deleting the calendar; viewing, inserting, and changing calendar attributes; adding and deleting calendar entries; and viewing, inserting, and changing entry attributes. The organizer role enables the user to delete the entry or view and change entry attributes of those calendar entries for which the user is specified as the organizer. The organizer defaults to the calendar user who created the entry. The sponsor role enables the user to delete the entry or view and change entry attributes for those calendar entries for which the user is specified as the sponsor. The sponsor is the calendar user who effectively owns the calendar entry. In addition to these roles, an access right can be set to limit access to free time searches; view, insert, or change calendar attributes; or view, insert or change entries, depending on whether they are classified as public, confidential, or private. The entry classification acts as a secondary filter on accessibility. Functional OverviewThe CSA interface supports three principle types of tasks:
AdministrationMost of the CSA function calls occur within a calendar session. The calendar session is a logical connection between the calendar-enabled application and a particular calendar maintained by the calendaring service. A session is established with a call to the csa_logon() function and terminated with a call to the csa_logoff() function. The context of the session is represented by a session handle. This handle provides a token in each of the CSA functions to distinguish one calendar session from another. The csa_logon() function also authenticates the user to the calendaring service and sets session attributes. Currently, there is no support for sharing calendar sessions among applications. The csa_list_calendars() function is used to list the names of the calendars managed by a particular calendar service. The csa_query_configuration() function is used to list information about the current calendar service configuration. This information can include the character set, line terminator characters for text strings, default service name, default authorization user identifier for the specified calendar service, an indicator of whether a password is needed to authenticate the user identifier, an indicator of whether the common extensions for user interface dialogs is supported, and the CSA specification supported by the implementation. The CSA implementation provides support for managing the memory for calendar objects and attributes that are returned by the service. The csa_free() function is used to free up this memory after it is no longer needed. It is the responsibility of the application to free up the memory allocated and managed by the calendar service. Calendar ManagementThe CSA interface provides several calendar management functions. The CDE implementation supports multiple calendars per calendar service; the calendar-enabled application can add or delete calendars. The csa_delete_calendar() function is used to delete calendars. The csa_add_calendar() function is used to add new calendars to the service. The application can also list, read, and update calendar attributes using the csa_list_calendar_attributes(), csa_read_calendar_attributes(), and csa_update_calendar_attributes() functions. The application can register callback functions for receiving notification of a calendar logon, calendar deletion, update of calendar attributes, addition of a new calendar entry, deletion of a calendar entry, and update of a calendar entry. The callback function is only registered for the duration of the calendar session. In any case, this information may be invaluable for some calendar administration applications. Entry ManagementThe CSA interface has a robust set of functions for managing calendar entries. The context of a calendar entry in a calendar session is maintained by the entry handle. This handle provides a token in the CSA functions to distinguish one calendar entry from another. The entry handle is returned by the csa_add_entry() and csa_list_entries() functions. The entry handle is valid for the duration of the calendar session or until the entry is deleted or updated. The entry handle becomes invalid when it is freed by a call to csa_free(). The csa_add_entry() function is used to add new entries to a calendar. The csa_delete_entry() function is used to delete an entry in a calendar. The csa_list_entries() function is used to enumerate the calendar entries that match a particular set of entry attribute criteria. The csa_read_entry_attributes() function is used to get either all or a set of entry attribute values associated with a particular calendar entry. To add an entry to a calendar, a calendar-enabled application must first establish a session with the calendaring service using the csa_logon() function. Then the application invokes the csa_add_entry() function to specify the new entry. The calendar-enabled application is responsible for composing the attributes used in the csa_add_entry() function. The session is terminated using the csa_logoff() function. The entry attributes in an individual calendar entry can be enumerated with the csa_list_entry_attributes() function. The values of one or more attributes can be read with the csa_read_entry_attributes() function. Individual entry attributes can be modified with the csa_update_entry_attributes() function. Memory allocated by the CSA implementation for retrieved calendar information is released by passing the associated memory pointers to the csa_free() function. Some calendar entries are associated with a recurring activity. The csa_list_entry_sequence() function can be used to enumerate the other recurring calendar entries. This function returns a list of entry handles for the recurring entries. The CDE calendar server provides support for alarms or reminders to be associated with calendar entries. Reminders can take the form of audio reminders from the terminal speaker, flashing reminders presented on the terminal screen, mail reminders sent to the calendar user, or pop-up reminders presented on the terminal screen. The calendar service manages the reminders, but it is the responsibility of the calendar application to retrieve the reminder information and act on it. The csa_read_next_reminder() function is used to read the information about the next scheduled type of reminder. ExtensionsThe major data structures and functions defined in the CSA specification can be extended methodically through extensions. Extensions are used to add additional fields to data structures and additional parameters to a function call. A standard generic data structure has been defined for these extensions. It consists of an item code, identifying the extension; an item data, holding the length of extension data or the data itself; an item reference, pointing to where the extension value is stored or NULL if there is no related item storage; and flags for the extension. Extensions that are additional parameters to a function call may be input or output. That is, the extension may be passed as input parameters from the application to the CSA service or passed as output parameters from CSA service to the application. If an extension is an input parameter, the application allocates memory for the extension structure and any other structures associated with the extension. If an extension is an output parameter, the CSA service allocates the storage for the extension result, if necessary. In this case, the application must free the allocated storage with a csa_free() call. If an extension that is not supported is requested, CSA_E_UNSUPPORTED_FUNCTION_EXT is returned. About the CDE ImplementationThe CDE implementation of the CSA API consists of a library which provides access to the CDE calendar server. ONC RPC is used for communication between the library and the server. The calendar server in the CDE implementation is a version 5 server which supports calendar protocol versions 2 to 5 and data versions 3 and 4. Calendar protocol versions 2 to 4 and data version 3 are for backward compatibility to OpenWindows Calendar Manager. Calendar protocol version 5 and data version 4 support the CSA interface and data extensibility. Table 10-2 Server Version/Data Version Supported
Access models supportedTwo access models are supported by the calendar API. The access model specified in the XAPIA CSA specification is supported for data version 4 only. The OpenWindows Calendar Manager access model is supported for data versions 1 to 3. In the OpenWindows Calendar Manager access model, the accessibility of a calendar is controlled by an access list which specifies who has what access rights. Three access rights are defined: CSA_X_DT_BROWSE_ACCESS (user can list and read calendar entries), CSA_X_DT_INSERT_ACCESS (user can insert calendar entries), and CSA_X_DT_DELETE_ACCESS (user can delete calendar entries). Since the calendar API allows access to calendars of all versions, the programmer should interpret the access rights contained in an access list using the correct access model depending on the data version. When a calendar is created, unless an access list is specified during creation, the default access list consists of one entry with "world" as the user name; the associated access right is "browse public entries." The user name "world" is a special name which means all users. By default, a user with the same user name as the owner of the calendar
can access the calendar with full owner's access from any machine. To have
stricter access control, names of the form "owner-user-name@host"
can be added to the access list of the calendar. When such an entry is added
to the access list, the corresponding access right has to be Data StructuresTable 10-3 lists the CSA data structures. See the relevant man page for complete information. Table 10-3 CSA Data Structures
Calendar AttributesTable 10-4 lists the calendar attributes supported in the CDE implementation. See the relevant man page for more information. The list of calendar attributes is extensible through the extended naming convention. Table 10-4 CSA Calendar Attributes
*specified when the calendar is created and read-only afterwards **CDE only The following Calendar attributes are not supported: CSA_CAL_ATTR_COUNTRY CSA_CAL_ATTR_LANGUAGE CSA_CAL_ATTR_WORK_SCHEDULE The following descriptions provide additional information about some of the calendar attributes listed in Table 10-4.
The followings are CDE-defined calendar attributes:
Entry AttributesTable 10-5 lists the entry attributes supported in the CDE implementation. See the relevant man page for more information. The list of entry attributes is extensible through the extended naming convention. Table 10-5 CSA Entry Attributes
* CDE only ** This attribute can be specified and modified for data version 1 to 3, but is read-only for data version 4; for data version 4, the value is derived from the entry attribute CSA_ENTRY_ATTR_RECURRENCE_RULE ***Specified when the entry is added to the calendar and read-only afterwards The following Entry attributes are not supported: CSA_ENTRY_ATTR_ATTENDEE_LIST CSA_ENTRY_ATTR_EXCEPTION_RULE CSA_ENTRY_ATTR_RECURRING_DATES CSA_ENTRY_ATTR_SEQUENCE_NUMBER The following descriptions provide additional information about some of the entry attributes listed in Table 10-5.
CSA_X_DT_STATUS_ACTIVE CSA_X_DT_STATUS_DELETE_PENDING CSA_X_DT_STATUS_ADD_PENDING CSA_X_DT_STATUS_COMMITTED CSA_X_DT_STATUS_CANCELLED
CSA_X_DT_TYPE_OTHER CDE Entry AttributesThe following are CDE-defined entry attributes:
CSA_X_DT_REPEAT_ONETIME CSA_X_DT_REPEAT_DAILY CSA_X_DT_REPEAT_WEEKLY CSA_X_DT_REPEAT_BIWEEKLY CSA_X_DT_REPEAT_MONTHLY_BY_WEEKDAY CSA_X_DT_REPEAT_MONTHLY_BY_DATE CSA_X_DT_REPEAT_YEARLY CSA_X_DT_REPEAT_EVERY_NDAY CSA_X_DT_REPEAT_EVERY_NWEEK CSA_X_DT_REPEAT_EVERY_NMONTH CSA_X_DT_REPEAT_MON_TO_FRI CSA_X_DT_REPEAT_MONWEDFRI CSA_X_DT_REPEAT_TUETHUR CSA_X_DT_REPEAT_WEEKDAYCOMBO CSA_X_DT_REPEAT_OTHER CSA_X_DT_REPEAT_OTHER_WEEKLY CSA_X_DT_REPEAT_OTHER_MONTHLY CSA_X_DT_REPEAT_OTHER_YEARLY
Entry Attributes for Recurrence InformationFor data versions 1 to 3, the following entry attributes are used to specify recurrence information for an entry. They are all read/write attributes. CSA_X_DT_ENTRY_ATTR_REPEAT_TYPE CSA_X_DT_ENTRY_ATTR_REPEAT_TIMES CSA_X_DT_ENTRY_ATTR_REPEAT_INTERVAL CSA_X_DT_ENTRY_ATTR_REPEAT_OCCURRENCE_NUM CSA_X_DT_ENTRY_ATTR_SEQUENCE_END_DATE For data version 4, entry attributes CSA_ENTRY_ATTR_RECURRENCE_RULE and CSA_ENTRY_ATTR_EXCEPTION_DATES are used to specify recurrence information of a calendar entry. Information in the CSA_ENTRY_ATTR_RECURRENCE_RULE attribute can be queried using the following attributes: CSA_X_DT_ENTRY_ATTR_REPEAT_TYPE CSA_X_DT_ENTRY_ATTR_REPEAT_TIMES CSA_X_DT_ENTRY_ATTR_REPEAT_INTERVAL CSA_X_DT_ENTRY_ATTR_REPEAT_OCCURRENCE_NUM CSA_X_DT_ENTRY_ATTR_SEQUENCE_END_DATE These computed attributes are read-only for data version 4. Supported Values by Data Version
CSA_X_DT_STATUS_ACTIVE CSA_X_DT_STATUS_DELETE_PENDING CSA_X_DT_STATUS_ADD_PENDING CSA_X_DT_STATUS_COMMITTED CSA_X_DT_STATUS_CANCELLED Data version 4 supports all status values: CSA_STATUS_ACCEPTED CSA_STATUS_NEEDS_ACTION CSA_STATUS_SENT CSA_STATUS_TENTATIVE CSA_STATUS_CONFIRMED CSA_STATUS_REJECTED CSA_STATUS_COMPLETED CSA_STATUS_DELEGATED CSA_X_DT_STATUS_ACTIVE CSA_X_DT_STATUS_DELETE_PENDING CSA_X_DT_STATUS_ADD_PENDING CSA_X_DT_STATUS_COMMITTED CSA_X_DT_STATUS_CANCELLED
CSA_SUBTYPE_APPOINTMENT CSA_SUBTYPE_HOLIDAY Data version 4 supports all defined values as well as the following application-defined values: CSA_SUBTYPE_APPOINTMENT CSA_SUBTYPE_CLASS CSA_SUBTYPE_HOLIDAY CSA_SUBTYPE_MEETING CSA_SUBTYPE_MISCELLANEOUS CSA_SUBTYPE_PHONE_CALL CSA_SUBTYPE_SICK_DAY CSA_SUBTYPE_SPECIAL_OCCASION CSA_SUBTYPE_TRAVEL CSA_SUBTYPE_VACATION
CSA_TYPE_EVENT CSA_TYPE_TODO CSA_X_DT_TYPE_OTHER Data version 4 supports all defined values: CSA_TYPE_EVENT CSA_TYPE_TODO CSA_TYPE_MEMO CSA_X_DT_TYPE_OTHER Note - Only some combinations of type and subtype values--listed below--are supported in data version 1 to 3. Combinations supported in data version 1: CSA_TYPE_EVENT with subtype CSA_SUBTYPE_APPOINTMENT CSA_X_DT_TYPE_OTHER with no subtype value Combinations supported in data versions 2 and 3: CSA_TYPE_EVENT with subtype CSA_SUBTYPE_APPOINTMENT CSA_TYPE_EVENT with subtype CSA_SUBTYPE_HOLIDAY CSA_TYPE_TODO with no subtype value CSA_X_DT_TYPE_OTHER with no subtype value
CSA_X_DT_REPEAT_ONETIME CSA_X_DT_REPEAT_DAILY CSA_X_DT_REPEAT_WEEKLY CSA_X_DT_REPEAT_BIWEEKLY CSA_X_DT_REPEAT_MONTHLY_BY_DATE CSA_X_DT_REPEAT_YEARLY Values supported in data version 3: CSA_X_DT_REPEAT_ONETIME CSA_X_DT_REPEAT_DAILY CSA_X_DT_REPEAT_WEEKLY CSA_X_DT_REPEAT_BIWEEKLY CSA_X_DT_REPEAT_MONTHLY_BY_WEEKDAY CSA_X_DT_REPEAT_MONTHLY_BY_DATE CSA_X_DT_REPEAT_YEARLY CSA_X_DT_REPEAT_EVERY_NDAY CSA_X_DT_REPEAT_EVERY_NWEEK CSA_X_DT_REPEAT_EVERY_NMONTH CSA_X_DT_REPEAT_MON_TO_FRI CSA_X_DT_REPEAT_MONWEDFRI CSA_X_DT_REPEAT_TUETHUR CSA_X_DT_REPEAT_WEEKDAYCOMBO CSA_X_DT_REPEAT_OTHER For data version 4, this is a read-only attribute and the value is derived from the entry attribute CSA_ENTRY_ATTR_RECURRENCE_RULE. General Information About FunctionsThe following general information applies to all functions:
Note - All data except textual description passed in the library must be in ASCII format; the library supports single-byte as well as multibyte character strings.
Function Extensions Supported
Administration FunctionsThis section contains descriptions for the administration functions supported in the CDE implementation; a function prototype and a list of possible return codes are included for each function. See the relevant man page for more information.
CSA_return_code csa_free(CSA_buffer memory ); Return Codes for csa_free: CSA_SUCCESS CSA_E_INVALID_MEMORY
CSA_return_code csa_list_calendars(CSA_service_reference calendar_service, CSA_uint32 *number_names, CSA_calendar_user **calendar_names, CSA_extension *list_calendars_extensions); A host name where the server runs should be passed in calendar_server. Return Codes for csa_list_calendars: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_NOT_SUPPORTED CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_logon( CSA_service_reference calendar_service, CSA_calendar_user *user, CSA_string password, CSA_string character_set, CSA_string required_csa_version, CSA_session_handle *session, CSA_extension *logon_extensions); The following arguments are not used: calendar_service, password, character_set, and required_csa_version. The calendar_address field of the CSA_calendar_user structure pointed to by user specifies the calendar to log on to. The format is calendar@location where calendar is the name of the calendar and location is the host name where the calendar is stored. Return Codes for csa_logon: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_CALENDAR_NOT_EXIST CSA_E_INSUFFICIENT_MEMORY CSA_E_NO_AUTHORITY CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE CSA_X_DT_E_BACKING_STORE_PROBLEM
CSA_return_code csa_logoff( CSA_session_handle session, CSA-extension *logoff_extensions); Return Codes for csa_logoff: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE
CSA_return_code csa_query_configuration( CSA_session_handle session, CSA_enum item, CSA_buffer *reference, CSA_extension *query_configuration_extensions); The following items are not supported by this implementation of CDE: CSA_CONFIG_CHARACTER_SET CSA_CONFIG_LINE_TERM CSA_CONFIG_VER_IMPLEM Return Codes for csa_query_configuration: CSA_SUCCESS CSA_E_INVALID_ENUM CSA_E_INVALID_PARAMETER CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_UNSUPPORTED_ENUM CSA_E_UNSUPPORTED_FUNCTION_EXT Calendar Management FunctionsThis section contains descriptions for the calendar management functions supported in the CDE implementation; a function prototype and a list of possible return codes are included for each function. See the relevant man page for more information.
CSA_return_code csa_add_calendar( CSA_session_handle session, CSA_calendar_user *user, CSA_uint32 number_attributes, CSA_attribute *calendar_attributes, CSA_extension *add_calendar_extensions); The first argument, session, is ignored. The calendar_address field of the CSA_calendar_user structure pointed to by user specifies the name and the location of the calendar to be created. The format is calendar@location where calendar is the name of the calendar and location is the host name where the calendar is to be stored; for example, my_calendar@my_host. Return Codes for csa_add_calendar: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_CALENDAR_EXISTS CSA_E_NO_AUTHORITY CSA_E_READONLY CSA_E_INVALID_ATTRIBUTE CSA_E_INVALID_ATTRIBUTE_VALUE CSA_E_UNSUPPORTED_ATTRIBUTE CSA_E_INVALID_DATE_TIME CSA_E_DISK_FULL CSA_X_DT_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_call_callbacks( CSA_session_handle session, CSA_flags reason, CSA_extension *call_callbacks_extensions); Return Codes for csa_call_callbacks: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INVALID_FLAG CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_X_DT_E_MT_UNSAFE
CSA_return_code csa_delete_calendar( CSA_session_handle session, csa_extension *delete_calendar_extensions); Return Codes for csa_delete_calendar: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_NOT_SUPPORTED CSA_E_NO_AUTHORITY CSA_X_DT_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_list_calendar_attributes( CSA_session_handle session, CSA_uint32 *number_names, CSA_attribute_reference **calendar_attributes_names, CSA_extension *list_calendar_attributes_extensions); Return Codes for csa_list_calendar_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_NOT_SUPPORTED CSA_E_NO_AUTHORITY CSA_X_DT_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_read_calendar_attributes( CSA_session_handle session, CSA_uint32 number_names, CSA_attribute_reference *attribute_names, CSA_uint32 *number_attributes, CSA_attribute **calendar_attributes, CSA_extension *read_calendar_attributes_extensions); Return Codes for csa_read_calendar_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_register_callback( CSA_session_handle session, CSA_flags reason, CSA_callback callback, CSA_buffer client_data, CSA_extension *register_callback_extensions); Return Codes for csa_register_callback: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_FLAG CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_unregister_callback( CSA_session_handle session, CSA_flags reason, CSA_callback callback, CSA_buffer client_data, CSA_extension *unregister_callback_extensions); Return Codes for csa_unregister_callback: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_FLAG CSA_E_CALLBACK_NOT_REGISTERED CSA_E_FAILURE
CSA_return_code csa_update_calendar_attributes( CSA_session_handle session, CSA_uint32 number_attributes, CSA_attribute *calendar_attributes, CSA_extension *update_calendar_attributes_extensions); Return Codes for csa_update_calendar_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_NO_AUTHORITY CSA_E_INVALID_ATTRIBUTE_VALUE CSA_E_INVALID_ATTRIBUTE CSA_E_UNSUPPORTED_ATTRIBUTE CSA_E_READONLY CSA_E_INVALID_DATE_TIME CSA_E_DISK_FULL CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE Entry Management FunctionsThis section contains descriptions for the entry management functions supported in the CDE implementation; a function prototype and a list of possible return codes are included for each function. See the relevant man page for more information.
CSA_return_code csa_add_entry( CSA_session_handle session, CSA_uint32 number_attributes, CSA_attribute *entry_attributes, CSA_entry_handle *entry, CSA_extension *add_entry_extensions); Return Codes for csa_add_entry: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_NO_AUTHORITY CSA_E_READONLY CSA_E_UNSUPPORTED_ATTRIBUTE CSA_E_INVALID_ATTRIBUTE CSA_E_INVALID_ATTRIBUTE_VALUE CSA_E_INVALID_DATE_TIME CSA_E_INVALID_RULE CSA_E_DISK_FULL CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE Minimum set of attributes to be specified when adding an entry: For data version 1-3: Must specify: CSA_ENTRY_ATTR_START_DATE CSA_ENTRY_ATTR_TYPE Default will be set if these are not specified: CSA_ENTRY_ATTR_CLASSIFICATION (CSA_CLASS_PUBLIC)
CSA_ENTRY_ATTR_STATUS (CSA_X_DT_STATUS_ACTIVE)
CSA_ENTRY_ATTR_SUBTYPE (CSA_SUBTYPE_APPOINTMENT for type
CSA_TYPE_EVENT;
this attribute is not supported for type
CSA_TYPE_TODO)
CSA_ENTRY_ATTR_SUMMARY (NULL string)
CSA_X_ENTRY_ATTR_REPEAT_TYPE (CSA_X_REPEAT_ONETIME)
CSA_X_ENTRY_ATTR_SHOWTIME (1 => true)
For data version 4: Must specify: CSA_ENTRY_ATTR_START_DATE CSA_ENTRY_ATTR_TYPE Default will be set if these are not specified: CSA_ENTRY_ATTR_CLASSIFICATION
(CSA_CLASS_PUBLIC)
CSA_ENTRY_ATTR_STATUS (CSA_X_STATUS_ACTIVE)
CSA_ENTRY_ATTR_SUBTYPE (CSA_SUBTYPE_APPOINTMENT for type
CSA_TYPE_EVENT)
CSA_ENTRY_ATTR_SUMMARY (NULL string)
CSA_X_ENTRY_ATTR_SHOWTIME (1 =>true)
CSA_return_code csa_delete_entry( CSA_session_handle session, CSA_entry_handle entry, CSA_enum delete_scope, CSA_extension *delete_entry_extensions); Return Codes for csa_delete_entry: CSA_SUCCESS CSA_E_INVALID_ENUM CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_ENTRY_HANDLE CSA_E_NO_AUTHORITY CSA_X_DT_E_ENTRY_NOT_FOUND CSA_E_DISK_FULL CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_list_entries( CSA_session_handle session, CSA_uint32 number_attributes, CSA_attribute *entry_attributes, CSA_enum *list_operators, CSA_uint32 *number_entries, CSA_entry_handle **entries, CSA_extension *list_entries_extensions); Note the following about the operators specified in list_operators: Only the operators CSA_MATCH_ANY and CSA_MATCH_EQUAL_TO are supported for the attribute value types CSA_VALUE_REMINDER, CSA_VALUE_CALENDAR_USER, and CSA_VALUE_DATE_TIME_RANGE. Only the operators CSA_MATCH_ANY, CSA_MATCH_EQUAL_TO, CSA_MATCH_NOT_EQUAL_TO, and CSA_MATCH_CONTAIN are supported for the attribute value type CSA_VALUE_STRING. The operator CSA_MATCH_CONTAIN only applies to CSA_VALUE_STRING type of attributes. Matching of attributes with the value types CSA_VALUE_OPAQUE_DATA, CSA_VALUE_ACCESS_LIST, CSA_VALUE_ATTENDEE_LIST, and CSA_VALUE_DATE_TIME_LIST are not supported. The only exception is the attribute CSA_ENTRY_ATTR_REFERENCE_IDENTIFIER. The operator CSA_MATCH_EQUAL_TO is supported for this attribute. Return Codes for csa_list_entries: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_NO_AUTHORITY CSA_E_INVALID_ATTRIBUTE_VALUE CSA_E_INVALID_DATE_TIME CSA_E_INVALID_ENUM CSA_E_UNSUPPORTED_ENUM CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_list_entry_attributes( CSA_session_handle session, CSA_entry_handle entry, CSA_uint32 *number_names, CSA_attribute_reference **entry_attribute_names, CSA_extension *list_entry_attributes_extensions); Return Codes for csa_list_entry_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_ENTRY_HANDLE CSA_X_E_ENTRY_NOT_FOUND CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_list_entry_sequence( CSA_session_handle session, CSA_entry_handle entry, CSA_date_time_range time_range, CSA_uint32 *number_entries, CSA_entry_handle **entry_list, CSA_extension *list_entry_sequences_extensions); CSA_E_INVALID_PARAMETER is returned if the specified entry is a one-time entry. Return Codes for csa_list_entry_sequence: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_ENTRY_HANDLE CSA_E_INVALID_DATE_TIME CSA_X_E_ENTRY_NOT_FOUND CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_read_entry_attributes( CSA_session_handle session, CSA_entry_handle entry, CSA_uint32 number_names, CSA_attribute_reference *attribute_names, CSA_uint32 *number_attributes, CSA_attribute **entry_attributes, CSA_extension *read_entry_attributes_extensions); Return Codes for csa_read_entry_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_ENTRY_HANDLE CSA_X_E_ENTRY_NOT_FOUND CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_read_next_reminder( CSA_session_handle session, CSA_uint32 number_names, CSA_attribute_reference *reminder_names, CSA_date_time given_time, CSA_uint32 *number_reminders, CSA_reminder_reference **reminder_references, CSA_extension *read_next_reminder_extensions); Return Codes for csa_read_next_reminder: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_DATE_TIME CSA_E_NO_AUTHORITY CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
CSA_return_code csa_update_entry_attributes( CSA_session_handle session, CSA_entry_handle entry, CSA_enum update_scope, CSA_boolean update_propagation, CSA_uint32 number_attributes, CSA_attribute *entry_attributes, CSA_entry_handle *new_entry, CSA_extension *update_entry_attributes_extensions); Update propagation is not supported; the update_propagation argument should be set to CSA_FALSE. Return Codes for csa_update_entry_attributes: CSA_SUCCESS CSA_E_INVALID_PARAMETER CSA_E_UNSUPPORTED_FUNCTION_EXT CSA_E_INSUFFICIENT_MEMORY CSA_E_INVALID_SESSION_HANDLE CSA_E_INVALID_ENTRY_HANDLE CSA_E_NO_AUTHORITY CSA_E_READONLY CSA_E_INVALID_ENUM CSA_E_UNSUPPORTED_ATTRIBUTE CSA_E_INVALID_ATTRIBUTE CSA_E_INVALID_ATTRIBUTE_VALUE CSA_E_INVALID_DATE_TIME CSA_E_INVALID_RULE CSA_E_DISK_FULL CSA_X_E_BACKING_STORE_PROBLEM CSA_X_DT_E_INVALID_SERVER_LOCATION CSA_X_DT_E_SERVICE_NOT_REGISTERED CSA_X_DT_E_SERVER_TIMEOUT CSA_E_FAILURE CSA_E_SERVICE_UNAVAILABLE
csa_add_event csa_add_memo csa_add_todo csa_free_time_search csa_look_up csa_restore csa_save Code ExamplesListing and Printing CalendarsExample 10-1 Listing and Printing Calendars Supported by Server
Adding a CalendarExample 10-2 Adding a Calendar Named "activity" to Host "host1"
Logging on to a CalendarExample 10-3 Logging on to a Calendar
Terminating a Calendar SessionExample 10-4 Terminating a Calendar Session
Deleting a CalendarExample 10-5 Deleting a Calendar
Adding a Calendar EntryExample 10-6 Adding a Calendar Entry
Looking Up Entries in a CalendarExample 10-7 Looking up Calendar Entries; Reading Attribute Values
Updating a Calendar EntryExample 10-8 Changing End Time of Returned Appointments: One Hour Later
Registering Callback and Keep Reminders
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||