dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / RoamCmds.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: RoamCmds.h /main/14 1999/07/13 08:42:16 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 SEARCHCMD_H
44 #define SEARCHCMD_H
45
46 #include <Dt/Action.h>
47
48 #include <DtMail/DtMail.hh>
49 #include <DtMail/DtVirtArray.hh>
50
51 #include "Cmd.h"
52 #include "NoUndoCmd.h"
53 #include "InterruptibleCmd.h"
54 #include "RoamInterruptibleCmd.hh"
55 #include "SelectFileCmd.h"
56 #include "DtMailWDM.hh"
57 #include "Editor.hh"
58 #include "DtMailGenDialog.hh"
59 #include "MotifCmds.h"
60
61 #include <assert.h>
62
63 /* ROCMD_*      msgid 300 - 399
64  */
65 #define ROCMD_EMPTY   300
66 #define ROCMD_MV      301
67
68 class SendMsgDialog;
69 class PopupWindow;
70 class RoamMenuWindow;
71 class ViewMsgDialog;
72 class SendMsgDialog;
73 class UndelFromListDialog;
74
75 //class VacationPopup;
76
77 class RoamCmd : public NoUndoCmd {
78   protected:
79     
80     RoamMenuWindow *_menuwindow;
81     
82   public:
83     //  virtual void doit();   
84     RoamCmd( char *, char *, int, RoamMenuWindow * );
85     //  virtual const char *const className () { return "SaveCmd"; }
86 };
87
88 class OpenMsgCmd : public RoamCmd {
89 public:
90   virtual void doit();
91   OpenMsgCmd(char *, char *, int, RoamMenuWindow *);
92   virtual const char *const className() { return "OpenMsgCmd"; }
93 };
94
95 #ifdef DEAD_WOOD
96 class SaveCmd : public RoamCmd {
97   public:
98     virtual void doit();   
99     SaveCmd( char *, char *, int, RoamMenuWindow * );
100     virtual const char *const className () { return "SaveCmd"; }
101 };
102 #endif /* DEAD_WOOD */
103
104
105 class UnifiedSelectFileCmd : public SelectFileCmd {
106   private:
107     static void unifiedFileSelectedCB(void *client_data, char *selection);
108     static void unifiedFileCanceledCB(void *client_data, char *selection);
109     void        unifiedFileSelected(char *selection);
110
111     static char         *_unified_file;
112     static char         *_unified_directory;
113     static int          _unified_hidden;
114     static int          _unify_selection;
115     static int          _is_initialized;
116
117     FileCallback        _select_file_callback;
118     void                *_select_file_client_data;
119
120   protected:
121     DtMailGenDialog     *_genDialog;
122     void                updateUnifiedData();
123
124   public:
125     UnifiedSelectFileCmd(
126                         char *name, char *label,
127                         char *title, char *ok_label, int active,
128                         FileCallback select_callback, void *client_data,
129                         Widget parent);
130     ~UnifiedSelectFileCmd();
131
132     virtual const char *const
133                         className() { return "UnifiedSelectFileCmd"; }
134     virtual void        doit();
135 };
136
137
138 class UnifiedSelectMailboxCmd : public SelectFileCmd {
139   private:
140     static void unifiedMailboxSearchProc(Widget w, XtPointer sd);
141     static void unifiedMailboxSelectedCB(void *client_data, char *selection);
142     static void unifiedMailboxCanceledCB(void *client_data, char *selection);
143
144     static char *_unified_file;
145     static char *_unified_directory;
146     static int  _unified_hidden;
147     static int  _unify_selection;
148     static int  _is_initialized;
149
150     DtMailBoolean       _only_show_mailboxes;
151     FileCallback        _select_file_callback;
152     void                *_select_file_client_data;
153
154   protected:
155     DtMailGenDialog     *_genDialog;
156
157     void                updateUnifiedData();
158     void                unifiedMailboxSelected(
159                                 FileCallback    cb,
160                                 void            *client_data,
161                                 char            *selection);
162
163   public:
164
165     UnifiedSelectMailboxCmd(
166                         char *name, char *label,
167                         char *title, char *ok_label, int active,
168                         FileCallback select_callback, void *client_data,
169                         Widget parent,
170                         DtMailBoolean only_show_mailboxes = DTM_FALSE);
171     ~UnifiedSelectMailboxCmd();
172
173     virtual const char *const
174                         className() { return "UnifiedSelectMailboxCmd"; }
175     virtual void        doit();
176 };
177
178
179 class MoveCopyCmd : public UnifiedSelectMailboxCmd {
180   private:
181
182     static void fileSelectedCallback2 ( Widget, XtPointer, XtPointer );
183     static void setDefaultButtonCB ( Widget, XtPointer, XtPointer );
184
185   protected:
186
187     FileCallback _copy_callback;
188     RoamMenuWindow * _menuwindow;
189     Widget _file_list;
190     Widget _file_text;
191
192     Widget _copy_button;
193     Widget _default_button;
194     Widget _move_button;
195
196   public:
197
198     MoveCopyCmd(
199                 char *,
200                 char *,
201                 int,
202                 FileCallback,
203                 FileCallback,
204                 RoamMenuWindow *,
205                 Widget,
206                 DtMailBoolean);
207     ~MoveCopyCmd ();
208     Widget getCopyButton() { return _copy_button; }
209     Widget getMoveButton() { return _move_button; }
210     void setDefault( Widget );
211
212     virtual const char *const className () { return "MoveCopyCmd"; }
213     virtual void doit();
214 };
215
216
217 class CopyCmd : public RoamCmd {
218   protected:
219     MoveCopyCmd *_move_copy_cmd;
220   public:
221     virtual void doit();
222     CopyCmd( char *, char *, int, RoamMenuWindow *, MoveCopyCmd * );
223     ~CopyCmd ();
224     virtual const char *const className () { return "CopyCmd"; }
225 };
226
227
228 class MoveCmd : public RoamCmd {
229   protected:
230     MoveCopyCmd *_move_copy_cmd;
231   public:
232     virtual void doit();
233     MoveCmd( char *, char *, int, RoamMenuWindow *, MoveCopyCmd * );
234     ~MoveCmd ();
235     virtual const char *const className () { return "MoveCmd"; }
236 };
237
238
239 class NextCmd : public RoamCmd {
240   public:
241     virtual void doit();   
242     NextCmd( char *, char *, int, RoamMenuWindow * );
243     virtual const char *const className () { return "NextCmd"; }
244 };
245
246
247 class PrevCmd : public RoamCmd {
248   public:
249     virtual void doit();   
250     PrevCmd( char *, char *, int, RoamMenuWindow * );
251     virtual const char *const className () { return "PrevCmd"; }
252 };
253
254
255 #ifdef DEAD_WOOD
256 class MessagesCmd : public RoamCmd {
257   public:
258     virtual void doit();   
259     MessagesCmd( char *, char *, int, RoamMenuWindow * );
260     virtual const char *const className () { return "MessagesCmd"; }
261 };
262 #endif /* DEAD_WOOD */
263
264
265
266 class ChooseCmd : public NoUndoCmd {
267   protected:
268     
269     class RoamMenuWindow *_menuwindow;
270     DtMailMessageHandle  _msgno;
271     
272     
273   public:
274     virtual void doit();   
275     ChooseCmd( char *, char *, int, RoamMenuWindow * );
276     virtual const char *const className () { return "ChooseCmd"; }
277     DtMailMessageHandle    msgno() { return _msgno; }
278     void    msgno( DtMailMessageHandle msgno) { _msgno=msgno; }
279 };
280
281 #ifdef DEAD_WOOD
282 class ClearCmd : public NoUndoCmd {
283   protected:
284     
285     class RoamMenuWindow        *parent;
286   public:
287     virtual void doit();   
288     ClearCmd( char *, char *, int, RoamMenuWindow * );
289     virtual const char *const className () { return "ClearCmd"; }
290 };
291
292
293 class SearchCmd : public InterruptibleCmd {
294     
295   protected:
296     
297     RoamMenuWindow *_menuwindow;
298     char                *_criteria;
299     long                _msgs_fetched;
300     int h_index;
301     virtual void doit();   
302     virtual void undoit(); 
303     
304   public:
305     SearchCmd ( char *, char *, int, RoamMenuWindow * );
306     virtual void execute();    
307     virtual void execute ( TaskDoneCallback, void * );
308     void        set_criteria( char *criteria ) { _criteria=criteria; };
309     virtual void updateMessage ( char * );
310     virtual const char *const className () { return "SearchCmd"; }
311 };
312 #endif /* DEAD_WOOD */
313
314
315 class CheckForNewMailCmd : public NoUndoCmd {
316   protected:
317     
318     class RoamMenuWindow *_menuwindow;
319
320   public:
321     virtual void doit();   
322     CheckForNewMailCmd( char *, char *, int, RoamMenuWindow * );
323     virtual const char *const className () { return "CheckForNewMailCmd"; }
324 };
325
326
327 // Used for opening a container.
328
329 class OpenContainerCmd : public RoamInterruptibleCmd {
330
331   protected:
332     RoamMenuWindow      *_menuWindow;
333     
334     virtual     void    doit();
335     virtual     void    undoit();
336     virtual     void    post_dialog();
337     virtual     void    unpost_dialog();
338     virtual void check_if_done();
339     
340   public:
341
342     // Need this to be public coz RMW's callback function needs it.
343     // Its a boolean_t because that's what the back-end uses and
344     // passes.  The back-end doesn't want to know anything about 
345     // Boolean which is a Motif/Xt concept.  Instead of casting to
346     // to and from Boolean<->boolean_t, might as well set it to be 
347     // boolean_t and avoid the casting mess.  No?
348
349     DtMailBoolean               _open_create_flag;
350     DtMailBoolean               _open_lock_flag;
351
352     OpenContainerCmd(char *, char *, int, RoamMenuWindow *);
353     virtual void execute();
354     virtual void execute(RoamTaskDoneCallback, void *);
355     void   set_create_lock_flags(DtMailBoolean, DtMailBoolean);
356     virtual void updateMessage ( char * );
357     virtual const char *const className () { return "ShowStatusCmd"; }
358 };
359
360 class OpenInboxCmd : public Cmd {
361   private:
362
363     RoamMenuWindow *_menuWindow;
364         
365   protected:
366     virtual     void    doit();
367     virtual     void    undoit();
368
369   public:
370     OpenInboxCmd(char*, char *, int, RoamMenuWindow *);
371     
372 };
373
374 // Used for converting containers from rfc<->???.
375
376 typedef int (*ConversionStatusCB) (int, int, void *);
377
378 class ConvertContainerCmd : public RoamInterruptibleCmd {
379     
380   protected:
381     
382     RoamMenuWindow      *_menuWindow;
383     DtMailWDM           *_dialog;
384     char                *_criteria;
385     ConversionStatusCB  _conv_cb;
386     char                *_src;
387     char                *_dest;
388     int                 _num_converted;
389     int                 _num_to_be_converted;
390
391     virtual void doit();   
392     virtual void undoit(); 
393     virtual     void    post_dialog();
394     virtual     void    unpost_dialog();
395     virtual void check_if_done();
396
397   public:
398     ConvertContainerCmd ( char *, char *, int, RoamMenuWindow *);
399     virtual void execute();    
400     virtual void execute(RoamTaskDoneCallback, void *);
401     
402     virtual void updateDialog ( char * );
403     virtual void updateAnimation();
404     virtual const char *const className () { return "ConvertContainerCmd"; }
405
406     void        set_data(char *, char *, ConversionStatusCB);
407     void        set_convert_data(int, int);
408     int         get_num_converted();
409     char *      get_destination_name();
410 };
411
412
413 // Other commands
414
415 class SelectAllCmd : public Cmd {
416   protected:
417  
418     class RoamMenuWindow *_menuwindow;
419  
420   public:
421     virtual void doit();
422     virtual void undoit();
423  
424     SelectAllCmd(char *, char *, int, RoamMenuWindow * );
425     virtual const char *const className() { return "SelectAllCmd"; }
426 };  
427
428 class DeleteCmd : public Cmd {
429   protected:
430     
431     class RoamMenuWindow *_menuwindow;
432     DtMailMessageHandle  _msgno;
433     
434     
435   public:
436     virtual void doit();   
437     virtual void undoit();   
438     DeleteCmd( char *, char *, int, RoamMenuWindow * );
439     virtual const char *const className () { return "DeleteCmd"; }
440     DtMailMessageHandle    msgno() { return _msgno; }
441     void    msgno( DtMailMessageHandle msgno) { _msgno=msgno; }
442 };
443
444 class DestroyCmd : public Cmd {
445     RoamMenuWindow      *_menuwindow;
446
447   public:
448     virtual void doit();
449     virtual void undoit();
450
451     DestroyCmd(char *, char *, int active, RoamMenuWindow *);
452     virtual const char *const className() { return "DestroyCmd"; }
453 };
454
455 typedef enum { DTM_NONE, DTM_MOVE, DTM_COPY, DTM_OPEN } ContainerOp;
456
457 class ContainerMenuCmd : public RoamCmd {
458   protected:
459     char *_container_name;
460     ContainerOp _operation;
461
462   public:
463     virtual void doit();
464     ContainerMenuCmd( char *, char *, int, RoamMenuWindow *, ContainerOp);
465     virtual ~ContainerMenuCmd();
466     char *containerName(void) { return(_container_name); }
467     void changeContainer( char * container_name ) 
468                                 { _container_name = container_name; }
469     virtual const char *const className() { return "ContainerMenuCmd"; }
470 };
471
472 class MoveToInboxCmd : public RoamCmd {
473   public:
474     virtual void doit();
475     MoveToInboxCmd( char *, char *, int, RoamMenuWindow * );
476     virtual ~MoveToInboxCmd();
477     virtual const char *const className () { return "MoveToInboxCmd"; }
478 };
479
480 class CopyToInboxCmd : public RoamCmd {
481   public:
482     virtual void doit();
483     CopyToInboxCmd( char *, char *, int, RoamMenuWindow * );
484     virtual ~CopyToInboxCmd();
485     virtual const char *const className () { return "CopyToInboxCmd"; }
486 };
487
488
489 class DoUndeleteCmd : public Cmd {
490   protected:
491     class UndelFromListDialog *_undelDialog;
492   public:
493     virtual void doit();
494     virtual void undoit();
495     DoUndeleteCmd(char *, char *, int, UndelFromListDialog * );
496     virtual ~DoUndeleteCmd();
497     virtual const char *const className () { return "DoUndeleteCmd";}
498 };
499
500 class CloseUndelCmd : public Cmd {
501   protected:
502     class UndelFromListDialog *_undelDialog;
503   public:
504     virtual void doit();
505     virtual void undoit();
506     CloseUndelCmd(char *, char *, int, UndelFromListDialog *);
507     virtual ~CloseUndelCmd();
508     virtual const char *const className () { return "CloseUndelCmd";}
509 };
510
511
512 class UndeleteCmd : public ChooseCmd {
513     
514   public:
515     virtual void doit();   
516     UndeleteCmd( char *, char *, int, RoamMenuWindow *, Boolean );
517     ~UndeleteCmd();
518     UndelFromListDialog *dialog() { return _undelFromList; }
519     virtual const char *const className () { return "UndeleteCmd"; }
520   protected:
521     void        *_clientData; // Data provided by caller
522     UndelFromListDialog *_undelFromList;
523   private:
524     int _num_deleted;   // number of deleted messages
525     Boolean _fromList;
526 };
527
528
529 class PrintCmd : public ChooseCmd {
530   public:
531     virtual void doit();   
532     PrintCmd( char *, char *, int, int silent, RoamMenuWindow * );
533     virtual const char *const className () { return "PrintCmd"; }
534     void printit(int);
535   protected:
536     RoamMenuWindow *_parent;
537   private:
538     struct tmp_file {
539         char                    *file;
540         DtActionInvocationID    id;
541     };
542     DtVirtArray<struct tmp_file *>      _tmp_files;
543     int                                 _silent;
544
545     int  _register_tmp_file(const char *, DtActionInvocationID);
546     void _unregister_tmp_file(DtActionInvocationID);
547     static void actioncb(DtActionInvocationID,XtPointer,DtActionArg *,int,int);
548     static void printjobcb(Widget,XtPointer,XtPointer);
549 }; 
550
551 #ifdef DEAD_WOOD
552 class PopupCmd : public NoUndoCmd {
553   private:
554     RoamMenuWindow *parent;
555     PopupWindow *(RoamMenuWindow::* pmpopup) ( void );
556   public:
557     virtual void doit();   
558     PopupCmd( char *, char *, int, PopupWindow * (RoamMenuWindow::*) (void), RoamMenuWindow * );
559     virtual const char *const className () { return "PopupCmd"; }
560 };
561 #endif /* DEAD_WOOD */
562
563 class OnItemCmd : public NoUndoCmd {
564   private:
565     UIComponent *_parent;
566   public:
567     virtual void doit();
568     OnItemCmd( char *, char *, int, UIComponent * );
569     virtual const char *const className () { return "OnItemCmd"; }
570 };
571
572 class OnAppCmd : public NoUndoCmd {
573   private:
574     UIComponent *_parent;
575   public:
576     virtual void doit();
577     OnAppCmd( char *, char *, int, UIComponent * );
578     virtual const char *const className () { return "OnAppCmd"; }
579 };
580
581 class TasksCmd : public NoUndoCmd {
582   private:
583     UIComponent *_parent;
584   public:
585     virtual void doit();
586     TasksCmd( char *, char *, int, UIComponent * );
587     virtual const char *const className () { return "TasksCmd"; }
588 };
589
590 class ReferenceCmd : public NoUndoCmd {
591   private:
592     UIComponent *_parent;
593   public:
594     virtual void doit();
595     ReferenceCmd( char *, char *, int, UIComponent * );
596     virtual const char *const className () { return "ReferenceCmd"; }
597 };
598
599 class UsingHelpCmd : public NoUndoCmd {
600   private:
601     UIComponent *_parent;
602   public:
603     virtual void doit();
604     UsingHelpCmd( char *, char *, int, UIComponent * );
605     virtual const char *const className () { return "UsingHelpCmd"; }
606 };
607
608 class RelNoteCmd : public NoUndoCmd {
609   private:
610     DtMailGenDialog     *_genDialog;
611     UIComponent         *_parent;
612
613   public:
614     virtual void doit();
615     RelNoteCmd( char *, char *, int, UIComponent * );
616     virtual const char *const className () { return "RelNoteCmd"; }
617     ~RelNoteCmd();
618 };
619
620 class FindCmd : public RoamCmd {
621   public:
622     virtual void doit();   
623     FindCmd( char *, char *, int, RoamMenuWindow * );
624     virtual const char *const className () { return "FindCmd"; }
625 };
626
627
628 #ifdef DEAD_WOOD
629 class StartCmd : public Cmd {
630   private:
631     //  VacationPopup   *parent;
632     int parent;
633   public:
634     virtual void doit();   
635     virtual void undoit();   
636     //  StartCmd( char *, char *, int, VacationPopup * );
637     StartCmd( char *, char *, int );
638     virtual const char *const className () { return "StartCmd"; }
639 };
640
641 class ChangeCmd : public Cmd {
642   public:
643     virtual void doit();   
644     virtual void undoit();   
645     ChangeCmd( char *, char *, int );
646     virtual const char *const className () { return "ChangeCmd"; }
647 };
648
649 class StopCmd : public Cmd {
650   private:
651     RoamMenuWindow *parent;
652   public:
653     virtual void doit();   
654     virtual void undoit();   
655     StopCmd( char *, char *, int, RoamMenuWindow * );
656     virtual const char *const className () { return "StopCmd"; }
657 };
658 #endif /* DEAD_WOOD */
659
660 class SendCmd : public NoUndoCmd {
661   private:
662     SendMsgDialog       *_parent;
663     int _default_trans;
664   public:
665     virtual void doit();
666     SendCmd( char *, char *, int, SendMsgDialog *, int );
667     virtual const char *const className () { return "SendCmd"; }
668 };
669
670 class SaveAsTextCmd : public UnifiedSelectFileCmd {
671   private:
672     RoamMenuWindow      *_roam_menu_window;
673     Editor              *_text_editor;
674
675     static void fileCB(void * client_data, char * selection);
676     void saveText(const char * filename);
677     void writeTextFromScrolledList(int fd);
678     static void writeText(XtPointer, char*);
679
680   public:
681     virtual void doit();
682     SaveAsTextCmd(
683                 char *, char *, char * title, int, Editor *,
684                 RoamMenuWindow *, Widget);
685     SaveAsTextCmd(
686                 char *, char *, char * title, int, Editor *,
687                 void *, Widget);
688     virtual const char *const className() { return "SaveAsTextCmd"; }
689 };
690
691 class SaveAttachCmd : public UnifiedSelectFileCmd {
692   private:
693     AbstractEditorParent *_parent;
694     XmString _name;
695     static void updateCallback( Widget, XtPointer, XtPointer);
696
697   public:
698     virtual void doit();   
699     SaveAttachCmd(char *, char *, char *, int, FileCallback, RoamMenuWindow *, Widget);
700     SaveAttachCmd(char *, char *, char *, int, FileCallback, ViewMsgDialog *, Widget);
701     SaveAttachCmd(char *, char *, char *, int, FileCallback, SendMsgDialog *, Widget);
702     ~SaveAttachCmd() {};
703     virtual const char *const className () { return "SaveAttachCmd"; }
704 };
705
706 class DeleteAttachCmd : public Cmd {
707   private:
708     SendMsgDialog *_parent;
709
710   protected:
711     
712     virtual void doit();   
713     virtual void undoit(); 
714
715   public:
716     
717     DeleteAttachCmd ( char *, char *, int, SendMsgDialog *);
718     virtual const char *const className () { return "AttachDeleteCmd"; }
719 };
720
721 class UndeleteAttachCmd : public Cmd {
722   private:
723     SendMsgDialog *_parent;
724
725   protected:
726     
727     virtual void doit();   
728     virtual void undoit(); 
729
730   public:
731     
732     UndeleteAttachCmd ( char *, char *, int, SendMsgDialog *);
733
734     virtual const char *const className () { return "AttachUndeleteCmd"; }
735 };
736
737 class RenameAttachCmd : public Cmd {
738     
739 private:
740
741     SendMsgDialog *_parent;
742     void cancel( XtPointer );   // Called when the Cancel button is pressed
743     static void cancelCallback( Widget, XtPointer, XtPointer );
744     void ok( XtPointer );       // Called when the OK button is pressed
745     static void okCallback( Widget, XtPointer, XtPointer );
746
747   protected:
748     
749     virtual void doit();   
750     virtual void undoit(); 
751
752   public:
753     
754     RenameAttachCmd ( char *, char *, int, SendMsgDialog * );
755
756     virtual const char *const className () { return "RenameAttachCmd"; }
757 };
758
759 class AttachmentActionCmd : public Cmd {
760
761   private:
762         AbstractEditorParent  *_parent;
763         int             _index;
764
765   protected:
766     
767     virtual void doit();   
768     virtual void undoit(); 
769
770   public:
771     
772     AttachmentActionCmd( char *, char *, RoamMenuWindow *, int);
773     AttachmentActionCmd( char *, char *, ViewMsgDialog *, int);
774     AttachmentActionCmd( char *, char *, SendMsgDialog *, int);
775
776     virtual const char *const className () { return "AttachmentActionCmd"; }
777 };
778
779         
780 class SelectAllAttachsCmd : public Cmd {
781     
782 private:
783     AbstractEditorParent  *_parent;
784
785   protected:
786     
787     virtual void doit();   
788     virtual void undoit(); 
789
790   public:
791     
792     SelectAllAttachsCmd ( char *, char *, RoamMenuWindow *);
793     SelectAllAttachsCmd ( char *, char *, ViewMsgDialog *);
794     SelectAllAttachsCmd ( char *, char *, SendMsgDialog *);
795
796     virtual const char *const className () { return "SelectAllAttachsCmd"; }
797 };
798
799
800 // Its critical that children of ToggleButtonCmd not have a 
801 // const className() method.
802 //
803
804 class ShowAttachPaneCmd : public ToggleButtonCmd {
805     
806 private:
807     AbstractEditorParent  *_parent;
808
809   protected:
810     
811     virtual void doit();   
812     virtual void undoit(); 
813
814   public:
815     
816     ShowAttachPaneCmd (char *, char *, AbstractEditorParent *);
817
818 };
819
820 class AbbrevHeadersCmd : public ToggleButtonCmd {
821     
822 private:
823     RoamMenuWindow *_parent;
824
825   protected:
826     
827     virtual void doit();   
828     virtual void undoit(); 
829
830   public:
831     
832     AbbrevHeadersCmd (char *, char *, RoamMenuWindow *);
833 };
834
835 // Close button applies only to SMD
836
837 class CloseCmd : public NoUndoCmd {
838   private:
839         SendMsgDialog *_compose_dialog;
840   public:
841         Widget menubar_w;
842
843         virtual void doit();
844         CloseCmd( char *, char *, int, Widget, SendMsgDialog * );
845         virtual const char *const className () { return "CloseCmd"; }
846 };
847
848 class EditUndoCmd : public NoUndoCmd {
849   private:
850     Editor *editor;
851   public:
852         virtual void doit();
853         EditUndoCmd( char *, char *, int, AbstractEditorParent * );
854         virtual const char *const className () { return "EditUndoCmd"; }
855 };
856
857 //      CDEM_DtWidgetEditor *editor;
858 //      XmTextEditor *editor;
859
860 class EditCutCmd : public NoUndoCmd {
861   private:
862     Editor *editor;
863     SendMsgDialog *_compose_dialog;
864   public:
865     virtual void doit();
866     EditCutCmd( char *, char *, int, AbstractEditorParent * );
867     virtual const char *const className () { return "EditCutCmd"; }
868 };
869
870 //      CDEM_DtWidgetEditor *editor;
871 //      XmTextEditor *editor;
872
873 class EditCopyCmd : public NoUndoCmd {
874   private:
875     Editor *editor;     
876     SendMsgDialog *_compose_dialog;
877   public:
878     virtual void doit();
879     EditCopyCmd( char *, char *, int, AbstractEditorParent * );
880     virtual const char *const className () { return "EditCopyCmd"; }
881 };
882
883 //      CDEM_DtWidgetEditor *editor;
884 //      XmTextEditor *editor;
885
886 class EditPasteCmd : public NoUndoCmd {
887   private:
888     Editor *editor;
889   public:
890     virtual void doit();
891     EditPasteCmd( char *, char *, int, AbstractEditorParent * );
892     virtual const char *const className () { return "EditPasteCmd"; }
893 };
894
895 //      CDEM_DtWidgetEditor *editor;
896 //      XmTextEditor *editor;
897
898 class EditPasteSpecialCmd : public NoUndoCmd {
899   private:
900     Editor *editor;
901     Editor::InsertFormat insert_format;
902   public:
903     virtual void doit();
904     EditPasteSpecialCmd( char *, char *, int, AbstractEditorParent *, Editor::InsertFormat );
905     virtual const char *const className () { return "EditPasteSpecialCmd"; }
906 };
907
908
909 //      CDEM_DtWidgetEditor *editor;
910 //      XmTextEditor *editor;
911
912 class EditClearCmd : public NoUndoCmd {
913   private:
914     Editor *editor;
915   public:
916     virtual void doit();
917     EditClearCmd( char *, char *, int, AbstractEditorParent * );
918     virtual const char *const className () { return "EditClearCmd"; }
919 };
920
921 //      CDEM_DtWidgetEditor *editor;
922 //      XmTextEditor *editor;
923
924 class EditDeleteCmd : public NoUndoCmd {
925   private:
926     Editor *editor;
927   public:
928     virtual void doit();
929     EditDeleteCmd( char *, char *, int, AbstractEditorParent * );
930     virtual const char *const className () { return "EditDeleteCmd"; }
931 };
932
933 //      XmTextEditor *editor;
934
935 class EditSelectAllCmd : public NoUndoCmd {
936   private:
937     Editor *editor;
938   public:
939     virtual void doit();
940     EditSelectAllCmd( char *, char *, int, AbstractEditorParent * );
941     virtual const char *const className () { return "EditSelectAllCmd"; }
942 };
943
944 //      CDEM_DtWidgetEditor *editor;
945 //      XmTextEditor *editor;
946
947 class WordWrapCmd : public ToggleButtonCmd {
948   private:
949     Editor *editor;
950     Boolean cur_setting;
951   public:
952     virtual void doit();
953     virtual void undoit() {};
954     WordWrapCmd( char *, char *, int, AbstractEditorParent * );
955     Boolean wordWrap();
956 };
957
958 //      CDEM_DtWidgetEditor *editor;
959 //      XmTextEditor *editor;
960
961 class FindChangeCmd : public NoUndoCmd {
962   private:
963     Editor *editor;
964   public:
965     virtual void doit();
966     FindChangeCmd( char *, char *, int, AbstractEditorParent * );
967     virtual const char *const className () { return "FindChangeCmd"; }
968 };
969
970 class SpellCmd : public NoUndoCmd {
971   private:
972     Editor *editor;
973   public:
974     virtual void doit();
975     SpellCmd( char *, char *, int, AbstractEditorParent * );
976     virtual const char *const className () { return "SpellCmd"; }
977 };
978
979 class AliasCmd : public NoUndoCmd {
980   private:
981     Widget _header;
982     char   *_alias;
983   public:
984     virtual void doit();
985     AliasCmd(char *, char *, int, Widget);
986     virtual ~AliasCmd();
987     virtual const char *const className () { return "AliasCmd"; }
988 };
989
990 class OtherAliasesCmd : public NoUndoCmd {
991   private:
992     Widget _header;
993   public:
994     virtual void doit();
995     OtherAliasesCmd(char *, char *, int);
996     virtual ~OtherAliasesCmd();
997     virtual const char *const className () { return "OtherAliasesCmd"; }
998 };
999
1000 class FormatCmd : public NoUndoCmd {
1001   private:
1002     Editor *editor;
1003   public:
1004     virtual void doit();
1005     FormatCmd( char *, char *, int, AbstractEditorParent * );
1006     virtual const char *const className () { return "FormatCmd"; }
1007 };
1008
1009 // Applicable only to SMD
1010
1011 class LogMsgCmd : public ToggleButtonCmd {
1012   private:
1013     SendMsgDialog * _send;
1014
1015   public:
1016         virtual void doit();
1017         virtual void undoit() {};
1018         LogMsgCmd( char *, char *, int, SendMsgDialog *);
1019     int LogMsg(void) { return ((ToggleButtonCmd *)this)->getButtonState(); }
1020 };
1021
1022 class VacationCmd : public Cmd {
1023   private:
1024     char *_forwardFile;
1025     char *_backupSuffix;
1026     char *_subject;
1027     const void  *_body;
1028     DtMail::Message *_msg;
1029     Boolean _priorVacationRunning;
1030     DtMailGenDialog *_dialog;
1031
1032
1033   public:
1034     
1035     VacationCmd(char *, char *);
1036     ~VacationCmd();
1037
1038     virtual void doit();
1039     virtual void undoit() {};
1040
1041     int         startVacation(char *, char*);
1042     void        stopVacation();
1043
1044     int         handleMessageFile(char *, char *);
1045     int         handleForwardFile();
1046     Boolean     priorVacationRunning();
1047
1048     int         backupFile(char *);
1049     int         recoverForwardFile(char *);
1050
1051     char *      subject();
1052     char *      body();
1053
1054     void        parseVacationMessage();
1055     void        setGenDialog(DtMailGenDialog *dialog) { _dialog = dialog; }
1056 };
1057
1058 #endif
1059