~ubuntu-branches/ubuntu/trusty/pcmanfm/trusty-proposed

« back to all changes in this revision

Viewing changes to src/mime-type/mime-action.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Lee
  • Date: 2008-09-26 10:19:20 UTC
  • mfrom: (4.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080926101920-cfldybkmwgwrtv9u
Tags: 0.5-3
* Correct spellings,  03_correct_spelling.dpatch (Closes:498794) 
* Code in some files are taken from other projects, added these
  informations into copyright file. (Closes:499678)
* Applied 04_defaut_terminal.dpatch to support x-terminal-emulator
  alternative. (Closes:497494) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      mime-action.h
 
3
 *
 
4
 *      Copyright 2007 PCMan <pcman.tw@gmail.com>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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,
 
19
 *      MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#ifndef _MIME_ACTION_H_INCLUDED_
 
23
#define _MIME_ACTION_H_INCLUDED_
 
24
 
 
25
#include <glib.h>
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
/*
 
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.
 
33
 */
 
34
char** mime_type_get_actions( const char* type );
 
35
 
 
36
/*
 
37
 * Add an applications used to open this mime-type
 
38
 * desktop_id is the name of *.desktop file.
 
39
 *
 
40
 * custom_desktop: used to store name of the newly created user-custom desktop file, can be NULL.
 
41
 */
 
42
void mime_type_add_action( const char* type, const char* desktop_id, char** custom_desktop );
 
43
 
 
44
/*
 
45
 * Check if an applications currently set to open this mime-type
 
46
 * desktop_id is the name of *.desktop file.
 
47
 */
 
48
gboolean mime_type_has_action( const char* type, const char* desktop_id );
 
49
 
 
50
/*
 
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.
 
55
 */
 
56
char* mime_type_get_default_action( const char* type );
 
57
 
 
58
/*
 
59
 *  Set default applications used to open this mime-type
 
60
 *  desktop_id is the name of *.desktop file.
 
61
 */
 
62
void mime_type_set_default_action( const char* type, const char* desktop_id );
 
63
 
 
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 );
 
66
 
 
67
G_END_DECLS
 
68
 
 
69
#endif