Fix typo in license headers
[oweals/cde.git] / cde / programs / dtmail / include / DtMail / PropUi.hh
1 /* $TOG: PropUi.hh /main/9 1998/02/17 13:45:35 mgreess $ */
2 /*
3  *+SNOTICE
4  *
5  *      RESTRICTED CONFIDENTIAL INFORMATION:
6  *      
7  *      The information in this document is subject to special
8  *      restrictions in a confidential disclosure agreement bertween
9  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
10  *      document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
11  *      Sun's specific written approval.  This documment and all copies
12  *      and derivative works thereof must be returned or destroyed at
13  *      Sun's request.
14  *
15  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
16  *
17  *+ENOTICE
18  */
19
20 #include "PropSource.hh"
21
22 #ifndef _PROPUI_HH
23 #define _PROPUI_HH
24
25 // This class is the 'glue' between the mail back end and the Props GUI as 
26 // generated by dtbuilder
27
28
29 // defines the type of item one wishes to create
30 typedef enum {
31   _ANTICHECKBOX_ITEM,
32   _CHECKBOX_ITEM,
33   _TEXTFIELD_ITEM,
34   _LIST_ITEM,
35   _SPINBOX_ITEM,
36   _SCALE_ITEM,
37   _INDEXED_OPTIONMENU_ITEM
38   } PROP_UI_ITEM_TYPE;
39
40 // defines the possible sources for props variables
41 typedef enum { 
42   _FROM_MAILRC,
43   _FROM_XRDB,
44    _FROM_FILE
45   } PROP_SOURCES;
46
47 // CLASS PropUiItem
48 // Base class for Prop sheet item glue list elements
49 ///////////////////////////////////////////////////////////
50 class PropUiItem {
51
52 public:
53   typedef char* (*PropUiCallback)(PropUiItem*, void*);
54   
55   PropUiItem(
56         Widget w,
57         int source,
58         char *search_key,
59         PropUiCallback validator = NULL,
60         void * validator_data = NULL);
61   virtual ~PropUiItem();
62   
63   Widget        getWidget(){ return prop_widget; };
64   virtual char  * uiValueIsValid();
65   virtual void   writeFromUiToSource() = 0;
66   virtual void   writeFromSourceToUi() = 0;
67   Boolean        getDirtyBit(){ return dirty_bit; };
68   void           setDirtyBit(Boolean db) { dirty_bit = db; };
69   char          *getKey(){ return key; };
70   PropSource    *getPropSource(){ return prop_source; };
71
72 protected:
73
74   Boolean        dirty_bit;
75   PropSource    *prop_source;
76
77 private:
78
79   Widget         prop_widget;
80   char          *key;
81   PropUiCallback _uiValueValidator;
82   void          *_uiValueValidatorData;
83
84 };
85
86 #endif