dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / ViewMsgDialog.h
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: ViewMsgDialog.h /main/5 1998/01/28 18:36:00 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 #ifndef VIEWMSGDIALOG_H
44 #define VIEWMSGDIALOG_H
45
46 #include <DtMail/DtMail.hh>
47 #include "DialogShell.h"
48 #include "Editor.hh"
49 #include "Dialog.h"
50 #include "AttachArea.h"
51 #include "DtMailEditor.hh"
52 #include "MenuWindow.h"
53 #include "MenuBar.h"
54 #include "DtMailGenDialog.hh"
55 #include "NoOpCmd.h"
56 #include "QuitCmd.h"
57 #include "UndoCmd.h"
58 #include "IconifyCmd.h"
59 #include "CmdList.h"
60 #include "RoamCmds.h"
61 #include <DtMail/DtMailError.hh>
62
63
64 // Forward declarations
65
66 class Cmd;
67 class RoamMenuWindow;
68
69
70 class ViewMsgDialog : public DialogShell, public AbstractEditorParent {
71
72   public:
73     
74     ViewMsgDialog(RoamMenuWindow*, WidgetClass wc=xmDialogShellWidgetClass);
75     virtual ~ViewMsgDialog();
76     
77     virtual void initialize();
78     virtual void quit();
79
80     virtual const char *const className () { return "ViewMsg"; }
81     void propsChanged(void);
82
83 // Accessors
84     
85
86 //  AttachArea  *attachArea(){ return _attach; }
87     DtMailMessageHandle msgno() { return _msgno; }
88     RoamMenuWindow *parent() { return _parent; };        
89     void attachmentFeedback(Boolean);   
90
91 // Mutators
92     void msgno( DtMailMessageHandle msg_num ) { _msgno=msg_num; }
93     void append(const char *, const unsigned long);
94     void text(const char *, const unsigned long);
95     
96     void popped_down();
97     void popped_up();
98     
99 // SR - Added methods below
100
101     void raise();
102     DtMailEditor* get_editor();
103
104     DtMailGenDialog *genDialog() { return _genDialog; }
105
106     void    auto_show_cursor_off();
107     void    auto_show_cursor_restore();
108     void    set_to_top();
109
110   // SR - Text-selection callbacks.
111
112     virtual void text_selected();
113     virtual void text_unselected();
114
115     void        attachment_selected();
116     void        all_attachments_deselected();
117     void        all_attachments_selected();
118     void        selectAllAttachments();
119     void        add_att(char *) { ; }
120     void        add_att(char *, DtMailBuffer) { ; }
121     void        add_att(DtMailBuffer) { ; }
122
123     void        save_selected_attachment(char *);       
124
125     void        showAttachArea();
126     void        hideAttachArea();
127
128     void        activate_default_attach_menu();
129     void        deactivate_default_attach_menu();
130
131     void        addAttachmentActions(
132                                     char **,
133                                     int
134                 );
135     void        removeAttachmentActions();
136     void        invokeAttachmentAction(int);            
137
138     virtual void manage();
139
140     static void save_attachment_callback( void *, char *);    
141
142   protected:
143
144     void createMenuPanes();
145     Widget createWorkArea( Widget );  
146   
147     void        construct_edit_menu();
148     void        construct_attachment_menu();
149     void        construct_attachment_popup(void);
150     void        construct_text_popup(void);
151     void  construct_help_menu();
152
153   private:
154
155     RoamMenuWindow *_parent;    
156     Widget _workArea;
157     Widget _main;
158
159     MenuBar *_menuBar;
160     DtMailGenDialog *_genDialog;
161
162     Cmd*  _edit_copy;
163     Cmd*  _edit_select_all;
164
165     // Attachment
166     Widget   _attachmentMenu;
167     CmdList *_attachmentActionsList;
168     CmdList *_attachmentMenuList;
169     CmdList *_attachmentPopupMenuList;
170     CmdList *_textPopupMenuList;
171     Cmd*  _attach_save_as;
172     Cmd*  _attach_select_all;
173
174     // Help Menu
175     Cmd *_overview;
176     Cmd *_tasks;
177     Cmd *_reference;
178     Cmd *_on_item;
179     Cmd *_using_help;
180     Cmd *_about_mailer;
181
182     Widget _text;
183     DtMailEditor *my_editor;
184     DtMailMessageHandle _msgno;
185 };
186
187 #endif