2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
26 * $TOG: Editor.hh /main/11 1998/02/03 10:28:56 mgreess $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
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
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
49 // Get all the Bento-related API and types (CMContainer, etc.)
51 #include <DtMail/DtMail.hh>
52 #include "UIComponent.h"
54 extern int use_XmTextEditor;
58 class Editor : public UIComponent {
64 virtual void initialize() = 0;
66 virtual void set_contents(
68 const unsigned long len
71 virtual void set_contents(const char * path) = 0;
73 virtual char * get_contents() = 0;
75 virtual void append_to_contents(
76 const char *new_contents,
77 const unsigned long len
80 virtual void append_to_contents(const char * path) = 0;
82 virtual void append_at_cursor(const char *path) = 0;
83 virtual void append_at_cursor(
85 const unsigned long len
89 IF_NONE, // No special format
90 IF_INDENTED, // Indented with indent_prefix
91 IF_BRACKETED // Bracketed
95 BF_NONE, // No bracketing
96 BF_INCLUDE, // As included message,
97 BF_FORWARD // As forwarded message
101 HF_NONE, // Do not insert headers in message body.
102 HF_FULL, // Insert all headers.
103 HF_ABBREV // Do not insert ignored headers.
106 virtual void append_newline_to_contents();
107 virtual DtMailBoolean set_message(
108 DtMail::Message * msg,
109 char ** status_string,
110 HeaderFormat header_format = HF_ABBREV,
111 InsertFormat format = IF_NONE,
112 BracketFormat brackets = BF_NONE);
114 virtual void set_attachment(
115 DtMail::BodyPart * body_part,
116 InsertFormat format = IF_NONE,
117 BracketFormat brackets = BF_NONE);
119 virtual void clear_contents() = 0;
120 virtual int no_text() = 0;
122 virtual Widget get_editor() = 0;
123 virtual Widget get_text_widget() = 0;
124 virtual Pixel get_text_foreground() = 0;
125 virtual Pixel get_text_background() = 0;
126 virtual Dimension get_text_width() = 0;
127 virtual XmFontList get_text_fontList() = 0;
129 virtual int get_columns() = 0;
130 virtual int get_rows() = 0;
131 virtual void set_columns(int ncolumns) = 0;
132 virtual void set_editable(Boolean value) = 0;
133 virtual void set_rows(int nrows) = 0;
134 virtual void update_display_from_props(void);
136 virtual void auto_show_cursor_off() = 0;
137 virtual void auto_show_cursor_restore() = 0;
139 virtual void set_to_top() = 0;
140 virtual void set_to_bottom() = 0;
142 virtual void find_change() = 0;
143 virtual void spell() = 0;
144 virtual void format() = 0;
145 virtual void set_word_wrap(Boolean value) = 0;
146 virtual void undo_edit() = 0;
147 virtual void cut_selection() = 0;
148 virtual void copy_selection() = 0;
149 virtual void paste_from_clipboard() = 0;
150 virtual void paste_special_from_clipboard(InsertFormat) = 0;
151 virtual void clear_selection() = 0;
152 virtual void delete_selection() = 0;
153 virtual void select_all() = 0;
155 virtual void disable_redisplay() = 0;
156 virtual void enable_redisplay() = 0;
160 class AbstractEditorParent {
162 Widget _attachmentPopupMenu;
163 Widget _textPopupMenu;
164 MenuBar *_menuPopupAtt;
165 MenuBar *_menuPopupText;
168 AbstractEditorParent();
169 virtual ~AbstractEditorParent();
171 virtual const char *const className()
172 { return "AbstractEditorParent"; }
174 virtual DtMailEditor * get_editor() = 0;
176 // Text/attachment (de)selection methods
178 virtual void text_selected() = 0;
179 virtual void text_unselected() = 0;
180 virtual void attachment_selected() = 0;
181 virtual void all_attachments_deselected() = 0;
182 virtual void all_attachments_selected() = 0;
183 virtual void add_att(char *) = 0;
184 virtual void add_att(char *, DtMailBuffer) = 0;
185 virtual void add_att(DtMailBuffer) = 0;
187 virtual void postAttachmentPopup(XEvent *event);
188 virtual void postTextPopup(XEvent *event);
190 virtual void addAttachmentActions(
194 virtual void invokeAttachmentAction(int) = 0;
195 virtual void removeAttachmentActions() = 0;
197 virtual void selectAllAttachments() = 0;
199 virtual void showAttachArea() = 0;
200 virtual void hideAttachArea() = 0;
202 virtual void attachmentFeedback(Boolean) = 0;