/* browser-content.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from browser-content.vala, do not modify */

/*
  This file is part of Dconf Editor

  Dconf Editor 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.

  Dconf Editor 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 Dconf Editor.  If not, see <https://www.gnu.org/licenses/>.
*/

#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_BROWSER_CONTENT (browser_content_get_type ())
#define BROWSER_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BROWSER_CONTENT, BrowserContent))
#define IS_BROWSER_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BROWSER_CONTENT))
#define BROWSER_CONTENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_BROWSER_CONTENT, BrowserContentIface))

typedef struct _BrowserContent BrowserContent;
typedef struct _BrowserContentIface BrowserContentIface;

#define TYPE_ADAPTATIVE_WIDGET (adaptative_widget_get_type ())
#define ADAPTATIVE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADAPTATIVE_WIDGET, AdaptativeWidget))
#define IS_ADAPTATIVE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADAPTATIVE_WIDGET))
#define ADAPTATIVE_WIDGET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_ADAPTATIVE_WIDGET, AdaptativeWidgetIface))

typedef struct _AdaptativeWidget AdaptativeWidget;
typedef struct _AdaptativeWidgetIface AdaptativeWidgetIface;
typedef enum  {
	ADAPTATIVE_WIDGET_WINDOW_SIZE_START_SIZE,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_USUAL_SIZE,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_QUITE_THIN,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_VERT,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_HZTL,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_BOTH,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_EXTRA_THIN,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_EXTRA_FLAT
} AdaptativeWidgetWindowSize;

#define ADAPTATIVE_WIDGET_TYPE_WINDOW_SIZE (adaptative_widget_window_size_get_type ())
typedef enum  {
	VIEW_TYPE_OBJECT,
	VIEW_TYPE_FOLDER,
	VIEW_TYPE_SEARCH,
	VIEW_TYPE_CONFIG
} ViewType;

#define TYPE_VIEW_TYPE (view_type_get_type ())

struct _AdaptativeWidgetIface {
	GTypeInterface parent_iface;
	void (*set_window_size) (AdaptativeWidget* self, AdaptativeWidgetWindowSize new_size);
};

struct _BrowserContentIface {
	GTypeInterface parent_iface;
	void (*prepare_folder_view) (BrowserContent* self, GListStore* key_model, gboolean is_ancestor);
	void (*prepare_object_view) (BrowserContent* self, const gchar* full_name, guint16 context_id, GVariant* properties, gboolean is_parent);
	void (*set_path) (BrowserContent* self, ViewType type, const gchar* path);
	gchar* (*get_selected_row_name) (BrowserContent* self);
	void (*select_row_named) (BrowserContent* self, const gchar* selected, guint16 last_context_id, gboolean grab_focus_if_needed);
	void (*select_first_row) (BrowserContent* self);
	void (*row_grab_focus) (BrowserContent* self);
	gboolean (*toggle_row_popover) (BrowserContent* self);
	void (*discard_row_popover) (BrowserContent* self);
	void (*invalidate_popovers) (BrowserContent* self);
	gboolean (*check_reload_folder) (BrowserContent* self, GVariant* fresh_key_model);
	gboolean (*check_reload_object) (BrowserContent* self, guint properties_hash);
	gboolean (*handle_copy_text) (BrowserContent* self, gchar** copy_text);
	gboolean (*handle_alt_copy_text) (BrowserContent* self, gchar** copy_text);
	gboolean (*next_match) (BrowserContent* self);
	gboolean (*previous_match) (BrowserContent* self);
	gboolean (*return_pressed) (BrowserContent* self);
	ViewType (*get_current_view) (BrowserContent* self);
	void (*set_current_view) (BrowserContent* self, ViewType value);
};

VALA_EXTERN GType adaptative_widget_window_size_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType adaptative_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AdaptativeWidget, g_object_unref)
VALA_EXTERN GType view_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType browser_content_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void browser_content_prepare_folder_view (BrowserContent* self,
                                          GListStore* key_model,
                                          gboolean is_ancestor);
VALA_EXTERN void browser_content_prepare_object_view (BrowserContent* self,
                                          const gchar* full_name,
                                          guint16 context_id,
                                          GVariant* properties,
                                          gboolean is_parent);
VALA_EXTERN void browser_content_set_path (BrowserContent* self,
                               ViewType type,
                               const gchar* path);
VALA_EXTERN gchar* browser_content_get_selected_row_name (BrowserContent* self);
VALA_EXTERN void browser_content_select_row_named (BrowserContent* self,
                                       const gchar* selected,
                                       guint16 last_context_id,
                                       gboolean grab_focus_if_needed);
VALA_EXTERN void browser_content_select_first_row (BrowserContent* self);
VALA_EXTERN void browser_content_row_grab_focus (BrowserContent* self);
VALA_EXTERN gboolean browser_content_toggle_row_popover (BrowserContent* self);
VALA_EXTERN void browser_content_discard_row_popover (BrowserContent* self);
VALA_EXTERN void browser_content_invalidate_popovers (BrowserContent* self);
VALA_EXTERN gboolean browser_content_check_reload_folder (BrowserContent* self,
                                              GVariant* fresh_key_model);
VALA_EXTERN gboolean browser_content_check_reload_object (BrowserContent* self,
                                              guint properties_hash);
VALA_EXTERN gboolean browser_content_handle_copy_text (BrowserContent* self,
                                           gchar** copy_text);
VALA_EXTERN gboolean browser_content_handle_alt_copy_text (BrowserContent* self,
                                               gchar** copy_text);
VALA_EXTERN gboolean browser_content_next_match (BrowserContent* self);
VALA_EXTERN gboolean browser_content_previous_match (BrowserContent* self);
VALA_EXTERN gboolean browser_content_return_pressed (BrowserContent* self);
VALA_EXTERN ViewType browser_content_get_current_view (BrowserContent* self);
VALA_EXTERN void browser_content_set_current_view (BrowserContent* self,
                                       ViewType value);
static GType browser_content_get_type_once (void);

void
browser_content_prepare_folder_view (BrowserContent* self,
                                     GListStore* key_model,
                                     gboolean is_ancestor)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->prepare_folder_view) {
		_iface_->prepare_folder_view (self, key_model, is_ancestor);
	}
}

void
browser_content_prepare_object_view (BrowserContent* self,
                                     const gchar* full_name,
                                     guint16 context_id,
                                     GVariant* properties,
                                     gboolean is_parent)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->prepare_object_view) {
		_iface_->prepare_object_view (self, full_name, context_id, properties, is_parent);
	}
}

void
browser_content_set_path (BrowserContent* self,
                          ViewType type,
                          const gchar* path)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->set_path) {
		_iface_->set_path (self, type, path);
	}
}

gchar*
browser_content_get_selected_row_name (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->get_selected_row_name) {
		return _iface_->get_selected_row_name (self);
	}
	return NULL;
}

void
browser_content_select_row_named (BrowserContent* self,
                                  const gchar* selected,
                                  guint16 last_context_id,
                                  gboolean grab_focus_if_needed)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->select_row_named) {
		_iface_->select_row_named (self, selected, last_context_id, grab_focus_if_needed);
	}
}

void
browser_content_select_first_row (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->select_first_row) {
		_iface_->select_first_row (self);
	}
}

void
browser_content_row_grab_focus (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->row_grab_focus) {
		_iface_->row_grab_focus (self);
	}
}

gboolean
browser_content_toggle_row_popover (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->toggle_row_popover) {
		return _iface_->toggle_row_popover (self);
	}
	return FALSE;
}

void
browser_content_discard_row_popover (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->discard_row_popover) {
		_iface_->discard_row_popover (self);
	}
}

void
browser_content_invalidate_popovers (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->invalidate_popovers) {
		_iface_->invalidate_popovers (self);
	}
}

gboolean
browser_content_check_reload_folder (BrowserContent* self,
                                     GVariant* fresh_key_model)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->check_reload_folder) {
		return _iface_->check_reload_folder (self, fresh_key_model);
	}
	return FALSE;
}

gboolean
browser_content_check_reload_object (BrowserContent* self,
                                     guint properties_hash)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->check_reload_object) {
		return _iface_->check_reload_object (self, properties_hash);
	}
	return FALSE;
}

gboolean
browser_content_handle_copy_text (BrowserContent* self,
                                  gchar** copy_text)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->handle_copy_text) {
		return _iface_->handle_copy_text (self, copy_text);
	}
	return FALSE;
}

gboolean
browser_content_handle_alt_copy_text (BrowserContent* self,
                                      gchar** copy_text)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->handle_alt_copy_text) {
		return _iface_->handle_alt_copy_text (self, copy_text);
	}
	return FALSE;
}

gboolean
browser_content_next_match (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->next_match) {
		return _iface_->next_match (self);
	}
	return FALSE;
}

gboolean
browser_content_previous_match (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->previous_match) {
		return _iface_->previous_match (self);
	}
	return FALSE;
}

gboolean
browser_content_return_pressed (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->return_pressed) {
		return _iface_->return_pressed (self);
	}
	return FALSE;
}

ViewType
browser_content_get_current_view (BrowserContent* self)
{
	BrowserContentIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->get_current_view) {
		return _iface_->get_current_view (self);
	}
	return 0;
}

void
browser_content_set_current_view (BrowserContent* self,
                                  ViewType value)
{
	BrowserContentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BROWSER_CONTENT_GET_INTERFACE (self);
	if (_iface_->set_current_view) {
		_iface_->set_current_view (self, value);
	}
}

static void
browser_content_default_init (BrowserContentIface * iface,
                              gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_enum ("current-view", "current-view", "current-view", TYPE_VIEW_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
}

static GType
browser_content_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BrowserContentIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) browser_content_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType browser_content_type_id;
	browser_content_type_id = g_type_register_static (G_TYPE_INTERFACE, "BrowserContent", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (browser_content_type_id, gtk_widget_get_type ());
	g_type_interface_add_prerequisite (browser_content_type_id, TYPE_ADAPTATIVE_WIDGET);
	return browser_content_type_id;
}

GType
browser_content_get_type (void)
{
	static volatile gsize browser_content_type_id__once = 0;
	if (g_once_init_enter (&browser_content_type_id__once)) {
		GType browser_content_type_id;
		browser_content_type_id = browser_content_get_type_once ();
		g_once_init_leave (&browser_content_type_id__once, browser_content_type_id);
	}
	return browser_content_type_id__once;
}

