blob: ca0c2337250cf6ad8f961704b1ee7bf9ad642513 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
---
title: NP GetMIMEDescription
slug: Mozilla/Add-ons/Plugins/Reference/NP_GetMIMEDescription
translation_of: Archive/Plugins/Reference/NP_GetMIMEDescription
---
<p>NP_GetMIMEDescription 플러그인이 지원하는 MIME Type 목록을 리턴합니다. Unix (Linux) 와 MacOS 에서 동작합니다. Windows에서는 지원하는 mimetype을 dll 리소스 파일에 정의하여야합니다.</p>
<p>각각의 MIME type에 대한 서술은 세미콜론(;)으로 구분되어야 합니다.<br>
각각의 Mime type에 대한 서술은 Mime type, 확장목록 그리고 간략한 설명을 포함합니다.</p>
<h3 id="하나의_MIME_type_를_사용한_경우">하나의 MIME type 를 사용한 경우</h3>
<pre>// example inside http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/plugin.cpp
#define MIME_TYPE_DESCRIPTION "application/basic-plugin:bsp:Basic Example Plug-in for Mozilla"
const char* NP_GetMIMEDescription(void)
{
return(MIME_TYPES_DESCRIPTION);
}</pre>
<h3 id="둘의_MIME_type_를_사용한_경우">둘의 MIME type 를 사용한 경우</h3>
<pre>const char* NP_GetMIMEDescription(void)
{
return "application/basic-example-plugin:xmp1:Example 1;application/basic-example2-plugin:xmp2, xm2p:Example 2";
}</pre>
<h3 id="Gnome_Integration">Gnome Integration</h3>
<p>GNOME VFS (gnome-vfs-2.0)를 사용하는 경우라면, 아래 함수를 이용하여 MIME type description 을 얻을수 있습니다.</p>
<pre>#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <libgnomevfs/gnome-vfs-utils.h>
// const char* gnome_vfs_mime_get_description (const char *mime_type);
const char* desc = gnome_vfs_mime_get_description ("audio/ogg");</pre>
<p>If you use GNOME GIO (gio-2.0), you can get the MIME type description too.</p>
<pre>#include <gio/gio.h>
const char* desc = g_content_type_get_description("audio/ogg");</pre>
<h3 id="JavaScript">JavaScript</h3>
<p>아래 코드를 이용하여 웹 페이지 내에서, MIME Type에 대한 정보를 얻을 수 있습니다.</p>
<pre>var mimetype = navigator.mimeTypes['application/basic-example-plugin'];
if (mimetype) {
alert(mimetype.type + ':' + mimetype.suffixes + ':' + mimetype.description);
}
</pre>
|