Add missing license headers on *.hh files and others
[oweals/cde.git] / cde / programs / dtmail / dtmail / DtMailGenDialog.hh
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  *+SNOTICE
25  *
26  *      $TOG: DtMailGenDialog.hh /main/7 1998/02/04 18:38:09 mgreess $
27  *
28  *      RESTRICTED CONFIDENTIAL INFORMATION:
29  *      
30  *      The information in this document is subject to special
31  *      restrictions in a confidential disclosure agreement between
32  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
33  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
34  *      Sun's specific written approval.  This document and all copies
35  *      and derivative works thereof must be returned or destroyed at
36  *      Sun's request.
37  *
38  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
39  *
40  *+ENOTICE
41  */
42
43 //////////////////////////////////////////////////////////
44 // DtMailGenDialog.hh: A generic dialog based on MessageBox
45 //////////////////////////////////////////////////////////
46 #ifndef DTMAILGENDIALOG_HH
47 #define DTMAILGENDIALOG_HH
48
49 #include <stdlib.h>
50 #include <Xm/TextF.h>
51 #include "UIComponent.h"
52 #include "DtMailDialogCallbackData.hh"
53
54 class DtMailGenDialog : public UIComponent {
55     
56   private:
57     int         _info_dialog;
58     Widget      _otherWidget;
59     Widget      _parentshell;
60
61     Widget      _textField;
62     int         _shroudText;
63     int         _maxTextlen;
64     char        *_clearText;
65
66     void cleanup ( Widget, DtMailDialogCallbackData* );
67
68   protected:
69
70     void forceUpdate( Widget );
71     
72     static void okCallback(Widget, XtPointer, XtPointer);
73     static void cancelCallback(Widget, XtPointer, XtPointer);
74     static void helpCallback(Widget, XtPointer, XtPointer);
75     static void otherCallback(Widget, XtPointer, XtPointer);
76
77     static void verifyCallback(Widget, XtPointer, XtPointer);
78     void        verify(XmTextVerifyPtr cbs);
79
80     void setDialog(char * title, char * text, unsigned char type);
81
82   public:
83     
84     DtMailGenDialog(char*,Widget, int style=XmDIALOG_PRIMARY_APPLICATION_MODAL);
85     ~DtMailGenDialog() { if (NULL != _clearText) free(_clearText); };
86     
87     char        *getTextFieldValue(void);
88
89     void        setToTextFieldDialog(char *, char *, int shroud = FALSE);
90     void        setToQuestionDialog(char *, char *);
91 #ifdef DEAD_WOOD
92     void        setToInfoDialog(char *, char *);
93 #endif /* DEAD_WOOD */
94     void        setToErrorDialog(char *, char *);
95     void        setToWarningDialog(char *, char *);
96     void        setToAboutDialog(void);
97
98     virtual Widget post (
99                          void *clientData      = NULL,
100                          DialogCallback ok     = NULL,
101                          DialogCallback cancel = NULL,
102                          DialogCallback other  = NULL,
103                          DialogCallback help   = NULL,
104                          char *helpId          = NULL);
105     virtual int    post_and_return(char *);
106     virtual int    post_and_return(char *, char *);
107     virtual int    post_and_return(char *, char *, char *);
108     virtual int    post_and_return(char *, char *, char *, char *);
109 };
110 #endif