Git init
[platform/core/uifw/e17.git] / src / bin / e_fm_shared_types.h.in
1 #ifndef E_FM_SHARED_TYPES
2 #define E_FM_SHARED_TYPES
3
4 #include <Eina.h>
5 #include <Ecore.h>
6
7 #if @EEZE_MOUNT_CONFIG@
8 # include <Eeze.h>
9 # include <Eeze_Disk.h>
10 #endif
11 #if @DBUS_MOUNT_CONFIG@
12 # include <E_DBus.h>
13 #endif
14
15 # define E_DEVICE_TYPE_STORAGE 1
16 # define E_DEVICE_TYPE_VOLUME  2
17 typedef struct _E_Storage E_Storage;
18 typedef struct _E_Volume  E_Volume;
19 typedef struct _E_Fm2_Mount  E_Fm2_Mount;
20
21 typedef enum
22 {
23    EFM_MODE_USING_RASTER_MOUNT,
24    EFM_MODE_USING_HAL_MOUNT,
25    EFM_MODE_USING_UDISKS_MOUNT,
26    EFM_MODE_USING_EEZE_MOUNT
27 } Efm_Mode;
28
29 typedef enum
30 {
31   E_VOLUME_OP_TYPE_NONE,
32   E_VOLUME_OP_TYPE_MOUNT,
33   E_VOLUME_OP_TYPE_UNMOUNT,
34   E_VOLUME_OP_TYPE_EJECT
35 } E_Volume_Op_Type;
36
37 struct _E_Storage
38 {
39    int type;
40    const char *udi; /* with eeze, this is actually the syspath */
41    const char *drive_type;
42
43    const char *model, *vendor, *serial;
44
45    Eina_Bool removable;
46    Eina_Bool media_available;
47    Eina_Bool system_internal;
48    unsigned long long media_size;
49
50    Eina_Bool requires_eject;
51    Eina_Bool hotpluggable;
52    Eina_Bool media_check_enabled;
53
54    struct 
55      {
56         const char *drive, *volume;
57      } icon;
58
59    Eina_List *volumes;
60
61    Eina_Bool validated : 1;
62    Eina_Bool trackable : 1;
63 #if @EEZE_MOUNT_CONFIG@
64    Eeze_Disk *disk;
65 #endif
66    const char *bus;
67 };
68
69 struct _E_Volume
70 {
71    int type;
72    const char *udi, *uuid;
73    const char *label, *icon, *fstype;
74    unsigned long long size;
75
76    Eina_Bool partition;
77    int partition_number;
78    const char *partition_label;
79    Eina_Bool mounted;
80    const char *mount_point;
81
82    const char *parent;
83    E_Storage *storage;
84    Eina_List *mounts;
85
86    Eina_Bool validated : 1;
87
88    Eina_Bool auto_unmount : 1;                  // unmount, when last associated fm window closed
89    Eina_Bool first_time;                    // volume discovery in init sequence
90    Ecore_Timer *guard;                 // operation guard timer
91    E_Volume_Op_Type optype;
92    Efm_Mode efm_mode;
93
94    Eina_Bool encrypted;
95    Eina_Bool unlocked;
96    
97 #if @DBUS_MOUNT_CONFIG@
98    DBusPendingCall *op;                // d-bus call handle
99    void *prop_handler;
100 #endif
101 };
102
103 struct _E_Fm2_Mount
104 {
105    const char *udi;
106    const char *mount_point;
107
108    Ecore_Cb mount_ok;
109    Ecore_Cb mount_fail;
110    Ecore_Cb unmount_ok;
111    Ecore_Cb unmount_fail;
112    void *data;
113
114    E_Volume *volume;
115
116    Eina_Bool mounted : 1;
117 };
118
119 #endif