4 * $TOG: MsgScrollingList.hh /main/12 1998/10/22 19:56:25 mgreess $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
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
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
21 #ifndef MSGSCROLLINGLIST_H
22 #define MSGSCROLLINGLIST_H
26 #endif /* DEAD_WOOD */
27 #include "MsgHndArray.hh"
29 #include "ScrollingList.h"
30 #include "UIComponent.h"
31 #include "XmStrCollector.h"
32 #include "XtArgCollector.h"
35 //#include "UndeleteMessageFromListDialog.h"
38 #include <X11/Intrinsic.h>
39 #include <X11/Xatom.h>
44 /* MSGLIST_* msgid 200 -299
46 #define MSGLIST_SELMV 200
47 #define MSGLIST_SELCP 201
48 #define MSGLIST_NORC 202
49 #define MSGLIST_NOBOX 203
50 #define MSGLIST_NOOPEN 204
51 #define MSGLIST_MSGMV 205
52 #define MSGLIST_MSGSMV 206
53 #define MSGLIST_MSGCP 207
54 #define MSGLIST_MSGSCP 208
55 #define MSGLIST_NOSEL 209
56 #define MSGLIST_RAISE 210
57 #define MSGLIST_EXIT 211
58 #define MSGLIST_OKBUT 212
59 #define MSGLIST_DLGTTL 213
62 class MsgScrollingList : public ScrollingList {
66 MsgScrollingList ( RoamMenuWindow *, Widget, char * );
70 int selected_item_position() { return _selected_item_position; }
71 RoamMenuWindow *parent() { return _parent; }
74 void addChooseCommand( ChooseCmd * );
75 void addDeleteCommand( DeleteCmd * );
76 #endif /* DEAD_WOOD */
77 void select_next_item();
78 void select_prev_item();
80 DtMailMessageHandle msgno(int index);
81 MsgStruct* get_message_struct(int index);
83 DtMailMessageHandle current_msg_handle();
84 int position(DtMailMessageHandle msgno);
86 int position(MsgStruct* a_msg_struct);
87 #endif /* DEAD_WOOD */
89 virtual const char *const className() {return ("MsgScrollingList");}
90 virtual void insertMsg(DtMailMessageHandle);
91 virtual void insertDeletedMsg(DtMailMessageHandle);
92 virtual void deleteSelected(Boolean silent = TRUE);
94 int copySelected(DtMailEnv &, char *, int delete_after_copy, int silent);
95 void items( XmString [], int );
98 void appendMsg(DtMailMessageHandle msg_hndl, int sess_num);
100 void appendMsg(DtMailMessageHandle msgno);
102 DtMailMessageHandle lastMsg();
103 #endif /* DEAD_WOOD */
107 void updateListItems(int current,
108 Boolean renumber_only = TRUE,
109 MsgHndArray *selected = NULL);
110 DtMailBoolean senderIsToHeaderWhenMailFromMe(void);
111 void checkDisplayProp(void);
113 XmString formatHeader(DtMailHeaderLine & retrieved,
115 DtMailBoolean has_attachments,
116 DtMailBoolean new_msg);
118 void visibleItems(int n_vis)
120 XtVaSetValues(_w, XmNvisibleItemCount, n_vis, NULL);
123 int visibleItems(void)
126 XtVaGetValues(_w, XmNvisibleItemCount, &n_vis, NULL);
130 Widget get_scrolling_list();
131 MsgHndArray *selected();
132 DtMailBoolean show_with_attachments(DtMailMessageHandle);
133 DtMailBoolean show_with_attachments(DtMail::Message * msg);
135 void display_message( DtMailEnv &, DtMailMessageHandle );
136 void display_and_select_message(DtMailEnv &, DtMailMessageHandle );
138 // Select all of the messages in the list and display the last one.
139 void select_all_and_display_last(DtMailEnv &);
142 // Select all of the messages in the array[] of DtMailMessageHandle.
143 // 'array' is NULL terminated list.
145 void select_all_and_display_last(DtMailEnv &,
146 DtMailMessageHandle *array,
147 unsigned int elements);
149 void display_no_message();
150 void scroll_to_bottom();
151 void scroll_to_position( int );
152 virtual void extended_selection( DtMailEnv &, int );
153 int get_selected_item();
154 int get_displayed_item();
155 int get_num_new_messages() { return num_new_messages; }
156 int get_num_deleted_messages() { return num_deleted_messages; }
158 int resetIndexNums(void);
159 int resetSessionNums(void);
161 void layoutLabels(Widget, Widget, Widget, Widget);
162 int get_num_messages() { return _msgs->length(); }
163 MsgHndArray *get_deleted_messages() { return _deleted_messages; }
164 MsgHndArray *get_messages() { return _msgs; }
165 void sort_messages();
167 void viewInSeparateWindow(DtMailEnv &);
170 void undelete_messages(MsgHndArray *);
171 void undelete_last_deleted();
172 void display_message_summary();
174 void display_message_selected();
175 #endif /* DEAD_WOOD */
176 void display_message(DtMailEnv &, int a_position);
178 int load_headers(DtMailEnv &);
179 void load_headers(DtMailEnv &, DtMailMessageHandle last);
180 void do_list_vis_adjustment();
182 // Save these to adjust as msg numbers changed ON/OFF.
189 virtual void defaultAction( Widget, XtPointer, XmListCallbackStruct * );
190 static void extendedSelectionCallback( Widget, XtPointer, XmListCallbackStruct * );
192 DtMailHeaderRequest _header_info;
195 Widget _msgsPopupMenu;
196 MenuBar *_menuPopupMsgs;
200 Image *_attach_image;
201 Image *_letter_image;
202 #endif /* DEAD_WOOD */
203 RoamMenuWindow *_parent;
206 int _selected_item_position;
207 int _displayed_item_position;
208 int session_message_number;
210 int num_new_messages;
211 int num_deleted_messages;
212 MsgHndArray *_deleted_messages;
214 DtMailBoolean _numbered;
215 Boolean _selection_on;
218 // Collect the arguments to SetValues in load_headers
219 // This prevents multiple redisplays of the XmList widget
220 XtArgCollector *_xtarg_collector;
222 // Collect the XmString items in load_headers
223 XmStrCollector *_xmstr_collector;
225 // Save the XmString that was allocated so that we can
226 // free it later. It would probably be better to add this
227 // to the XtArgCollector class, but since it's only one
228 // item it's easier to do it this way.
229 XmString _selected_items;