~didrocks/ubuntuone-client/dont-suffer-zg-crash

« back to all changes in this revision

Viewing changes to nautilus/ubuntuone-nautilus.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2010-06-23 23:08:15 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20100623230815-4m3ugh10u9x9xzw5
Tags: upstream-1.3.2
ImportĀ upstreamĀ versionĀ 1.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ubuntuone-nautilus.c - Nautilus extensions for Ubuntu One
 
3
 *
 
4
 * Authors: Tim Cole <tim.cole@canonical.com>
 
5
 *          Rodney Dawes <rodney.dawes@canonical.com>
 
6
 *          Rodrigo Moya <rodrigo.moya@canonical.com>
 
7
 *
 
8
 * Copyright 2009-2010 Canonical Ltd.
 
9
 *
 
10
 * This program is free software: you can redistribute it and/or modify it
 
11
 * under the terms of the GNU General Public License version 3, as published
 
12
 * by the Free Software Foundation.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful, but
 
15
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
16
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
17
 * PURPOSE.  See the GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License along
 
20
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef __UBUNTUONE_NAUTILUS_H__
 
25
#define __UBUNTUONE_NAUTILUS_H__
 
26
 
 
27
#include <dbus/dbus-glib.h>
 
28
#include <libsyncdaemon/syncdaemon-daemon.h>
 
29
 
 
30
#define UBUNTUONE_TYPE_NAUTILUS  (ubuntuone_nautilus_get_type ())
 
31
#define UBUNTUONE_NAUTILUS(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))
 
32
 
 
33
/* Magical struct for passing data in callbacks */
 
34
typedef struct _CBData CBData;
 
35
 
 
36
typedef struct {
 
37
        GObject parent_slot;
 
38
 
 
39
        SyncdaemonDaemon * syncdaemon;
 
40
 
 
41
        DBusGConnection * bus;
 
42
        DBusGProxy * u1_status;
 
43
        DBusGProxy * u1_shares;
 
44
        DBusGProxy * u1_folders;
 
45
 
 
46
        /* Are we connected? */
 
47
        gboolean connected;
 
48
 
 
49
        /* The managed directory root */
 
50
        gchar * managed;
 
51
 
 
52
        /* Avoid calling get_rootdir and get_folders lots of times */
 
53
        gboolean gotroot;
 
54
        gboolean gotudfs;
 
55
        gboolean gotpubs;
 
56
 
 
57
        /* Lists of ul/dl/shares for setting emblems */
 
58
        GHashTable * uploads;
 
59
        GHashTable * downloads;
 
60
        GHashTable * shares;
 
61
 
 
62
        /* Lists of public files and user defined folders */
 
63
        GHashTable * public;
 
64
        GHashTable * udfs;
 
65
  
 
66
        /* Lists of sync/unsync'd files */
 
67
        GHashTable * updated;
 
68
        GHashTable * needsupdating;
 
69
 
 
70
        /* List of files that are observed for changes */
 
71
        GHashTable * observed;
 
72
 
 
73
        /* Extra data we need to free on finalization */
 
74
        CBData * cb_data;
 
75
} UbuntuOneNautilus;
 
76
 
 
77
typedef struct {
 
78
        GObjectClass parent_slot;
 
79
} UbuntuOneNautilusClass;
 
80
 
 
81
struct _CBData {
 
82
        UbuntuOneNautilus * uon;
 
83
        gchar * path;
 
84
        GtkWidget * parent;
 
85
 
 
86
        /* Share dialog widgets */
 
87
        GtkWidget * user_picker;
 
88
        GtkWidget * name_entry;
 
89
        GtkWidget * allow_mods;
 
90
 
 
91
        /* Whether to make a file public or private */
 
92
        gboolean make_public;
 
93
};
 
94
 
 
95
GType ubuntuone_nautilus_get_type (void);
 
96
 
 
97
/* Utility functions */
 
98
gboolean ubuntuone_is_storagefs (UbuntuOneNautilus * uon,
 
99
                                 const char * path,
 
100
                                 gboolean * is_root);
 
101
 
 
102
void     ubuntuone_show_error_dialog (UbuntuOneNautilus *uon, const gchar *title, const gchar *error_message, ...);
 
103
 
 
104
#endif