Version bump (0.2-3)
[cl-launcher] / src / cl-utils.h
1 /*
2  *  Camera Launcher for Maemo.
3  *  Copyright (C) 2010 Roman Moravcik
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifndef CL_UTILS_H
21 #define CL_UTILS_H
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30
31 #include <glib.h>
32 #include <glib/gi18n-lib.h>
33
34 #include <gtk/gtk.h>
35 #include <hildon/hildon.h>
36
37 #define CAMERA_APPLICATION_DESKTOP_FILE "camera-ui.desktop"
38 #define FLASHLIGHT_APPLET_DESKTOP_FILE "flashlight-applet-launcher.desktop"
39
40 #define GCONF_CL_LAUNCHER "/apps/maemo/cl-launcher"
41 #define CL_LAUNCHER_DESKTOP_DATADIR "/usr/share/applications/hildon"
42
43 typedef enum {
44         CL_LAUNCHER_ACTION_RUN_PREFERED_APPLICATION = 0,
45         CL_LAUNCHER_ACTION_SHOW_SELECTOR_POPUP,
46         CL_LAUNCHER_ACTION_DO_NOTHING,
47         CL_LAUNCHER_ACTION_LAST
48 } CLLauncherAction;
49
50 enum {
51         SELECTOR_COLUMN_NAME = 0,
52         SELECTOR_COLUMN_ICON,
53         SELECTOR_COLUMN_FILENAME,
54         SELECTOR_COLUMN_OSSO_SERVICE,
55         SELECTOR_COLUMN_EXEC,
56         NUM_COLS
57 };
58
59 typedef struct {
60         gchar *icon;
61         gchar *name;
62         gchar *osso_service;
63         gchar *exec;
64 } DesktopFileInfo;
65
66 gboolean get_application_list (GtkListStore *store);
67 gboolean get_application_list_from_list (GtkListStore *store, const GSList *list);
68
69 DesktopFileInfo *get_desktop_file_info (const gchar *desktop_file);
70
71 #endif /* CL_UTILS_H */