diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2015-08-17 08:33:42 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2015-08-20 17:32:49 -0300 |
commit | 9806d70e8ffa5786b7a41705c8b640ac2b3b6ac9 (patch) | |
tree | 84971975753ac7e0eec70aa99245832ab75c40fc /src/nautilus-view.h | |
parent | acf2f76b00fbac08bf348244688ca15b9bcddf73 (diff) | |
download | nautilus-9806d70e8ffa5786b7a41705c8b640ac2b3b6ac9.tar.gz |
view: add interface
Nautilus is in the proccess of receiving a places view,
based on GtkFileChooser's one.
To be able to handle that, an abstraction layer is needed
between NautilusFilesView and NautilusWindowSlot, so we factor
out the common data between views.
Add the NautilusView interface, and make NautilusFilesView a
NautilusView implementation. Because of the new way we handle
search on the view side, the search logic is rewritten to match
the new expected behavior.
https://bugzilla.gnome.org/show_bug.cgi?id=753871
Diffstat (limited to 'src/nautilus-view.h')
-rw-r--r-- | src/nautilus-view.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/nautilus-view.h b/src/nautilus-view.h new file mode 100644 index 000000000..5dd07161e --- /dev/null +++ b/src/nautilus-view.h @@ -0,0 +1,94 @@ +/* nautilus-view.h + * + * Copyright (C) 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com> + * + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef NAUTILUS_VIEW_H +#define NAUTILUS_VIEW_H + +#include <glib.h> +#include <gtk/gtk.h> + +#include <libnautilus-private/nautilus-query.h> + +G_BEGIN_DECLS + +#define NAUTILUS_TYPE_VIEW (nautilus_view_get_type ()) + +G_DECLARE_INTERFACE (NautilusView, nautilus_view, NAUTILUS, VIEW, GtkWidget) + +struct _NautilusViewInterface +{ + GTypeInterface parent; + + /* The icon that represents the view */ + GIcon* (*get_icon) (NautilusView *view); + + /* + * The widget that is displayed under the view menu. When set to NULL, the + * button gets insensitive. + */ + GtkWidget* (*get_view_widget) (NautilusView *view); + + /* Current location of the view */ + GFile* (*get_location) (NautilusView *view); + void (*set_location) (NautilusView *view, + GFile *location); + + /* Selection */ + GList* (*get_selection) (NautilusView *view); + void (*set_selection) (NautilusView *view, + GList *selection); + + /* Search */ + NautilusQuery* (*get_search_query) (NautilusView *view); + void (*set_search_query) (NautilusView *view, + NautilusQuery *query); + + /* Whether the current view is loading the location */ + gboolean (*is_loading) (NautilusView *view); + + /* Whether the current view is searching or not */ + gboolean (*is_searching) (NautilusView *view); +}; + +GIcon* nautilus_view_get_icon (NautilusView *view); + +GtkWidget* nautilus_view_get_view_widget (NautilusView *view); + +GFile* nautilus_view_get_location (NautilusView *view); + +void nautilus_view_set_location (NautilusView *view, + GFile *location); + +GList* nautilus_view_get_selection (NautilusView *view); + +void nautilus_view_set_selection (NautilusView *view, + GList *selection); + +NautilusQuery* nautilus_view_get_search_query (NautilusView *view); + +void nautilus_view_set_search_query (NautilusView *view, + NautilusQuery *query); + +gboolean nautilus_view_is_loading (NautilusView *view); + +gboolean nautilus_view_is_searching (NautilusView *view); + +G_END_DECLS + +#endif /* NAUTILUS_VIEW_H */ |