-fpermissive to allow GCC to compile old C++
[oweals/cde.git] / cde / programs / dtmail / dtmail / DtMailEditor.hh
1 /*
2  *+SNOTICE
3  *
4  *      $TOG: DtMailEditor.hh /main/5 1997/06/06 12:45:31 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 #ifndef DTMAILEDITOR_H
22 #define DTMAILEDITOR_H
23
24 #include <Xm/Xm.h>
25 #include "Editor.hh"
26 #include "AttachArea.h"
27
28
29 class DtMailEditor : public UIComponent {
30
31   public:       
32
33     DtMailEditor(
34                 Widget,
35                 AbstractEditorParent *
36                 );
37     virtual ~DtMailEditor();
38
39     void        initialize();
40     AbstractEditorParent *owner(); 
41     
42     Editor      *textEditor();
43     AttachArea  *attachArea();
44
45     Widget      container();
46
47     void        showAttachArea();
48     void        hideAttachArea();
49     void        manageAttachArea();
50     void        unmanageAttachArea();
51     void        setMsgHnd( DtMail::Message *);
52     static void attachTransferCallback(Widget, XtPointer, XtPointer );
53     void        attachDropRegister();
54     void        attachDropEnable();
55     void        attachDropDisable();
56     static void attachConvertCallback(Widget, XtPointer, XtPointer);
57     static void attachDragFinishCallback(Widget, XtPointer, XtPointer);
58     void        attachDragStart(Widget, XEvent *);
59     void        attachDragMotionHandler(Widget, XEvent *);
60     //void      attachDragSetup();
61     void        setEditable(Boolean);
62     Boolean     editable() { return _editable; }
63     Boolean     doingDrag() { return _doingDrag; }
64     void        setDoingDrag(Boolean doingDrag) { _doingDrag = doingDrag; }
65     void        setDragX(int n) { _dragX = n; }
66     void        setDragY(int n) { _dragY = n; }
67     int         dragX() { return _dragX; }
68     int         dragY() { return _dragY; }
69
70         // Routines to null terminate buffer.
71     void needBuf(char **, unsigned long *, unsigned long len);
72     void stripCRLF(char **, const char * buf, const unsigned long len);
73
74   private:
75
76     DtMail::Message *_msgHandle;
77     Editor      *_myTextEditor;
78     AttachArea  *_myAttachArea;
79     Widget      _container;
80     Widget      _separator;
81
82     Boolean     _editable;
83     Boolean     _showAttachArea;
84     Boolean     _doingDrag;
85     int         _dragX;
86     int         _dragY;
87
88         // Can be RMW or VMD or SMD
89     AbstractEditorParent *_myOwner;     
90
91 };
92
93 #endif // DTMAILEDITOR_HH