1 ;;; mmcooked.el --- MIME entity implementation for binary buffer
3 ;; Copyright (C) 1998,1999 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: MIME, multimedia, mail, news
8 ;; This file is part of FLIM (Faithful Library about Internet Message).
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (mm-define-backend cooked (buffer))
31 (mm-define-method entity-cooked-p ((entity cooked)) t)
33 (mm-define-method write-entity-content ((entity cooked) filename)
35 (set-buffer (mime-buffer-entity-buffer-internal entity))
36 (let ((encoding (or (mime-entity-encoding entity) "7bit")))
37 (if (member encoding '("7bit" "8bit" "binary"))
38 (write-region (mime-buffer-entity-body-start-internal entity)
39 (mime-buffer-entity-body-end-internal entity) filename)
40 (mime-write-decoded-region
41 (mime-buffer-entity-body-start-internal entity)
42 (mime-buffer-entity-body-end-internal entity)
46 (mm-define-method write-entity ((entity cooked) filename)
48 (set-buffer (mime-buffer-entity-buffer-internal entity))
49 (write-region (mime-buffer-entity-header-start-internal entity)
50 (mime-buffer-entity-body-end-internal entity)
54 (mm-define-method write-entity-body ((entity cooked) filename)
56 (set-buffer (mime-buffer-entity-buffer-internal entity))
57 (write-region (mime-buffer-entity-body-start-internal entity)
58 (mime-buffer-entity-body-end-internal entity)
62 (luna-define-method mime-insert-header ((entity mime-cooked-entity)
63 &optional invisible-fields
65 (let (default-mime-charset)
66 (funcall (car (luna-class-find-functions
67 (luna-find-class 'mime-buffer-entity)
69 entity invisible-fields visible-fields)
72 (mm-define-method insert-text-content ((entity cooked))
73 (let ((str (mime-entity-content entity)))
75 (if (member (mime-entity-encoding entity)
76 '(nil "7bit" "8bit" "binary"))
78 (decode-mime-charset-string str
79 (or (mime-content-type-parameter
80 (mime-entity-content-type entity)
92 ;;; mmcooked.el ends here