summaryrefslogtreecommitdiff
path: root/plugins/filebrowser/pluma-file-browser-widget.h
blob: b0f5f69966487b355fec3230a0ebe3582d9f9b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
 * pluma-file-browser-widget.h - Pluma plugin providing easy file access
 * from the sidepanel
 *
 * Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
 * Copyright (C) 2012-2021 MATE Developers
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef __PLUMA_FILE_BROWSER_WIDGET_H__
#define __PLUMA_FILE_BROWSER_WIDGET_H__

#include <gtk/gtk.h>
#include "pluma-file-browser-store.h"
#include "pluma-file-bookmarks-store.h"
#include "pluma-file-browser-view.h"

G_BEGIN_DECLS
#define PLUMA_TYPE_FILE_BROWSER_WIDGET			(pluma_file_browser_widget_get_type ())
#define PLUMA_FILE_BROWSER_WIDGET(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget))
#define PLUMA_FILE_BROWSER_WIDGET_CONST(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget const))
#define PLUMA_FILE_BROWSER_WIDGET_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass))
#define PLUMA_IS_FILE_BROWSER_WIDGET(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET))
#define PLUMA_IS_FILE_BROWSER_WIDGET_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET))
#define PLUMA_FILE_BROWSER_WIDGET_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass))

typedef struct _PlumaFileBrowserWidget        PlumaFileBrowserWidget;
typedef struct _PlumaFileBrowserWidgetClass   PlumaFileBrowserWidgetClass;
typedef struct _PlumaFileBrowserWidgetPrivate PlumaFileBrowserWidgetPrivate;

typedef
gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj,
					      PlumaFileBrowserStore *
					      model, GtkTreeIter * iter,
					      gpointer user_data);

struct _PlumaFileBrowserWidget
{
	GtkBox parent;

	PlumaFileBrowserWidgetPrivate *priv;
};

struct _PlumaFileBrowserWidgetClass
{
	GtkBoxClass parent_class;

	/* Signals */
	void (*uri_activated)        (PlumaFileBrowserWidget * widget,
			              gchar const *uri);
	void (*error)                (PlumaFileBrowserWidget * widget,
	                              guint code,
		                      gchar const *message);
	gboolean (*confirm_delete)   (PlumaFileBrowserWidget * widget,
	                              PlumaFileBrowserStore * model,
	                              GList *list);
	gboolean (*confirm_no_trash) (PlumaFileBrowserWidget * widget,
	                              GList *list);
};

GType pluma_file_browser_widget_get_type            (void) G_GNUC_CONST;
void _pluma_file_browser_widget_register_type       (GTypeModule * module);

GtkWidget *pluma_file_browser_widget_new            (const gchar *data_dir);

void pluma_file_browser_widget_show_bookmarks       (PlumaFileBrowserWidget * obj);
void pluma_file_browser_widget_show_files           (PlumaFileBrowserWidget * obj);

void pluma_file_browser_widget_set_root             (PlumaFileBrowserWidget * obj,
                                                     gchar const *root,
                                                     gboolean virtual_root);
void
pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget * obj,
						     gchar const *root,
						     gchar const *virtual_root);

gboolean
pluma_file_browser_widget_get_selected_directory    (PlumaFileBrowserWidget * obj,
                                                     GtkTreeIter * iter);

PlumaFileBrowserStore *
pluma_file_browser_widget_get_browser_store         (PlumaFileBrowserWidget * obj);
PlumaFileBookmarksStore *
pluma_file_browser_widget_get_bookmarks_store       (PlumaFileBrowserWidget * obj);
PlumaFileBrowserView *
pluma_file_browser_widget_get_browser_view          (PlumaFileBrowserWidget * obj);
GtkWidget *
pluma_file_browser_widget_get_filter_entry          (PlumaFileBrowserWidget * obj);

GtkUIManager *
pluma_file_browser_widget_get_ui_manager            (PlumaFileBrowserWidget * obj);

gulong pluma_file_browser_widget_add_filter         (PlumaFileBrowserWidget * obj,
                                                     PlumaFileBrowserWidgetFilterFunc func,
                                                     gpointer user_data,
                                                     GDestroyNotify notify);
void pluma_file_browser_widget_remove_filter        (PlumaFileBrowserWidget * obj,
                                                     gulong id);
void pluma_file_browser_widget_set_filter_pattern   (PlumaFileBrowserWidget * obj,
                                                     gchar const *pattern);

void pluma_file_browser_widget_refresh		    (PlumaFileBrowserWidget * obj);
void pluma_file_browser_widget_history_back	    (PlumaFileBrowserWidget * obj);
void pluma_file_browser_widget_history_forward	    (PlumaFileBrowserWidget * obj);

G_END_DECLS
#endif /* __PLUMA_FILE_BROWSER_WIDGET_H__ */

// ex:ts=8:noet: