-fpermissive to allow GCC to compile old C++
[oweals/cde.git] / cde / programs / dtmail / dtmail / DtMailGenDialog.hh
1 /*
2  *+SNOTICE
3  *
4  *      $TOG: DtMailGenDialog.hh /main/7 1998/02/04 18:38:09 mgreess $
5  *
6  *      RESTRICTED CONFIDENTIAL INFORMATION:
7  *      
8  *      The information in this document is subject to special
9  *      restrictions in a confidential disclosure agreement between
10  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
11  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
12  *      Sun's specific written approval.  This document and all copies
13  *      and derivative works thereof must be returned or destroyed at
14  *      Sun's request.
15  *
16  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
17  *
18  *+ENOTICE
19  */
20
21 //////////////////////////////////////////////////////////
22 // DtMailGenDialog.hh: A generic dialog based on MessageBox
23 //////////////////////////////////////////////////////////
24 #ifndef DTMAILGENDIALOG_HH
25 #define DTMAILGENDIALOG_HH
26
27 #include <stdlib.h>
28 #include <Xm/TextF.h>
29 #include "UIComponent.h"
30 #include "DtMailDialogCallbackData.hh"
31
32 class DtMailGenDialog : public UIComponent {
33     
34   private:
35     int         _info_dialog;
36     Widget      _otherWidget;
37     Widget      _parentshell;
38
39     Widget      _textField;
40     int         _shroudText;
41     int         _maxTextlen;
42     char        *_clearText;
43
44     void cleanup ( Widget, DtMailDialogCallbackData* );
45
46   protected:
47
48     void forceUpdate( Widget );
49     
50     static void okCallback(Widget, XtPointer, XtPointer);
51     static void cancelCallback(Widget, XtPointer, XtPointer);
52     static void helpCallback(Widget, XtPointer, XtPointer);
53     static void otherCallback(Widget, XtPointer, XtPointer);
54
55     static void verifyCallback(Widget, XtPointer, XtPointer);
56     void        verify(XmTextVerifyPtr cbs);
57
58     void setDialog(char * title, char * text, unsigned char type);
59
60   public:
61     
62     DtMailGenDialog(char*,Widget, int style=XmDIALOG_PRIMARY_APPLICATION_MODAL);
63     ~DtMailGenDialog() { if (NULL != _clearText) free(_clearText); };
64     
65     char        *getTextFieldValue(void);
66
67     void        setToTextFieldDialog(char *, char *, int shroud = FALSE);
68     void        setToQuestionDialog(char *, char *);
69 #ifdef DEAD_WOOD
70     void        setToInfoDialog(char *, char *);
71 #endif /* DEAD_WOOD */
72     void        setToErrorDialog(char *, char *);
73     void        setToWarningDialog(char *, char *);
74     void        setToAboutDialog(void);
75
76     virtual Widget post (
77                          void *clientData      = NULL,
78                          DialogCallback ok     = NULL,
79                          DialogCallback cancel = NULL,
80                          DialogCallback other  = NULL,
81                          DialogCallback help   = NULL,
82                          char *helpId          = NULL);
83     virtual int    post_and_return(char *);
84     virtual int    post_and_return(char *, char *);
85     virtual int    post_and_return(char *, char *, char *);
86     virtual int    post_and_return(char *, char *, char *, char *);
87 };
88 #endif