4
* Copyright 2007 PCMan <pcman.tw@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
#ifndef _MIME_ACTION_H_INCLUDED_
23
#define _MIME_ACTION_H_INCLUDED_
30
* Get a list of applications supporting this mime-type
31
* The returned string array was newly allocated, and should be
32
* freed with g_strfreev() when no longer used.
34
char** mime_type_get_actions( const char* type );
37
* Add an applications used to open this mime-type
38
* desktop_id is the name of *.desktop file.
40
* custom_desktop: used to store name of the newly created user-custom desktop file, can be NULL.
42
void mime_type_add_action( const char* type, const char* desktop_id, char** custom_desktop );
45
* Check if an applications currently set to open this mime-type
46
* desktop_id is the name of *.desktop file.
48
gboolean mime_type_has_action( const char* type, const char* desktop_id );
51
* Get default applications used to open this mime-type
52
* The returned string was newly allocated, and should be
53
* freed when no longer used.
54
* If NULL is returned, that means default app is not set for this mime-type.
56
char* mime_type_get_default_action( const char* type );
59
* Set default applications used to open this mime-type
60
* desktop_id is the name of *.desktop file.
62
void mime_type_set_default_action( const char* type, const char* desktop_id );
64
/* Locate the file path of desktop file by desktop_id */
65
char* mime_type_locate_desktop_file( const char* dir, const char* desktop_id );