Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtmail / dtmail / IndexedOptionMenu.h
1 /* $XConsortium: IndexedOptionMenu.h /main/2 1996/10/02 11:47:36 mgreess $ */
2
3 #ifndef _INDEXED_OPTION_MENU
4 #define _INDEXED_OPTION_MENU
5
6 /*
7  *+SNOTICE
8  *
9  *      $:$
10  *
11  *      RESTRICTED CONFIDENTIAL INFORMATION:
12  *      
13  *      The information in this document is subject to special
14  *      restrictions in a confidential disclosure agreement between
15  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
16  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
17  *      Sun's specific written approval.  This document and all copies
18  *      and derivative works thereof must be returned or destroyed at
19  *      Sun's request.
20  *
21  *      Copyright 1994 Sun Microsystems, Inc.  All rights reserved.
22  *
23  *+ENOTICE
24  */
25 /*
26  *                   Common Desktop Environment
27  *
28  *   (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
29  *   (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
30  *   (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
31  *   (c) Copyright 1993, 1994, 1995 Novell, Inc.
32  *   (c) Copyright 1995 Digital Equipment Corp.
33  *   (c) Copyright 1995 Fujitsu Limited
34  *   (c) Copyright 1995 Hitachi, Ltd.
35  *                                                                   
36  *
37  *                     RESTRICTED RIGHTS LEGEND                              
38  *
39  *Use, duplication, or disclosure by the U.S. Government is subject to
40  *restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
41  *Technical Data and Computer Software clause in DFARS 252.227-7013.  Rights
42  *for non-DOD U.S. Government Departments and Agencies are as set forth in
43  *FAR 52.227-19(c)(1,2).
44
45  *Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
46  *International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A. 
47  *Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
48  *Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
49  *Digital Equipment Corp., 111 Powdermill Road, Maynard, MA 01754, U.S.A.
50  *Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
51  *Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
52  */
53
54
55 #include <string.h>
56 #include <ctype.h>
57 #include "UIComponent.h"
58
59 class IndexedOptionMenu : public UIComponent
60 {
61 public:
62
63     IndexedOptionMenu ( Widget, int, char**, void** );
64     IndexedOptionMenu ( Widget, int, char**, void**, Widget* );
65     ~IndexedOptionMenu (void);
66
67     void        addMenuButtonCallback(char*, XtCallbackProc, XtPointer);
68     int         getIndexSpec();
69     char        *getStringSpec();
70     void        *getDataSpec();
71     void        setSpec(int);
72     void        setSpec(const char*);
73     void        setSpec(void*);
74
75 private:
76     int         dataToIndex(void*);
77     int         stringToIndex(const char*);
78
79     int         _nmenu_items;
80     char        **_strings;
81     void        **_data;
82     Widget      *_buttons;
83 };
84
85 #endif // _INDEXED_OPTION_MENU