// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class PlacesSidebar : Gtk.ScrolledWindow {

		public PlacesSidebar (IntPtr raw) : base(raw) {}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_places_sidebar_new();
		static d_gtk_places_sidebar_new gtk_places_sidebar_new = FuncLoader.LoadFunction<d_gtk_places_sidebar_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_new"));

		public PlacesSidebar () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (PlacesSidebar)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_places_sidebar_new();
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_places_sidebar_get_location(IntPtr raw);
		static d_gtk_places_sidebar_get_location gtk_places_sidebar_get_location = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_location>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_location"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_location(IntPtr raw, IntPtr location);
		static d_gtk_places_sidebar_set_location gtk_places_sidebar_set_location = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_location>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_location"));

		[GLib.Property ("location")]
		public GLib.IFile Location {
			get  {
				IntPtr raw_ret = gtk_places_sidebar_get_location(Handle);
				GLib.IFile ret = GLib.FileAdapter.GetObject (raw_ret, false);
				return ret;
			}
			set  {
				gtk_places_sidebar_set_location(Handle, value == null ? IntPtr.Zero : ((value is GLib.Object) ? (value as GLib.Object).Handle : (value as GLib.FileAdapter).Handle));
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_places_sidebar_get_open_flags(IntPtr raw);
		static d_gtk_places_sidebar_get_open_flags gtk_places_sidebar_get_open_flags = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_open_flags>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_open_flags"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_open_flags(IntPtr raw, int flags);
		static d_gtk_places_sidebar_set_open_flags gtk_places_sidebar_set_open_flags = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_open_flags>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_open_flags"));

		[GLib.Property ("open-flags")]
		public Gtk.PlacesOpenFlags OpenFlags {
			get  {
				int raw_ret = gtk_places_sidebar_get_open_flags(Handle);
				Gtk.PlacesOpenFlags ret = (Gtk.PlacesOpenFlags) raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_open_flags(Handle, (int) value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_recent(IntPtr raw);
		static d_gtk_places_sidebar_get_show_recent gtk_places_sidebar_get_show_recent = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_recent>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_recent"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_recent(IntPtr raw, bool show_recent);
		static d_gtk_places_sidebar_set_show_recent gtk_places_sidebar_set_show_recent = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_recent>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_recent"));

		[GLib.Property ("show-recent")]
		public bool ShowRecent {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_recent(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_recent(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_desktop(IntPtr raw);
		static d_gtk_places_sidebar_get_show_desktop gtk_places_sidebar_get_show_desktop = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_desktop>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_desktop"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_desktop(IntPtr raw, bool show_desktop);
		static d_gtk_places_sidebar_set_show_desktop gtk_places_sidebar_set_show_desktop = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_desktop>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_desktop"));

		[GLib.Property ("show-desktop")]
		public bool ShowDesktop {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_desktop(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_desktop(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_connect_to_server(IntPtr raw);
		static d_gtk_places_sidebar_get_show_connect_to_server gtk_places_sidebar_get_show_connect_to_server = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_connect_to_server>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_connect_to_server"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_connect_to_server(IntPtr raw, bool show_connect_to_server);
		static d_gtk_places_sidebar_set_show_connect_to_server gtk_places_sidebar_set_show_connect_to_server = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_connect_to_server>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_connect_to_server"));

		[Obsolete]
		[GLib.Property ("show-connect-to-server")]
		public bool ShowConnectToServer {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_connect_to_server(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_connect_to_server(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_enter_location(IntPtr raw);
		static d_gtk_places_sidebar_get_show_enter_location gtk_places_sidebar_get_show_enter_location = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_enter_location>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_enter_location"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_enter_location(IntPtr raw, bool show_enter_location);
		static d_gtk_places_sidebar_set_show_enter_location gtk_places_sidebar_set_show_enter_location = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_enter_location>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_enter_location"));

		[GLib.Property ("show-enter-location")]
		public bool ShowEnterLocation {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_enter_location(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_enter_location(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_local_only(IntPtr raw);
		static d_gtk_places_sidebar_get_local_only gtk_places_sidebar_get_local_only = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_local_only>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_local_only"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_local_only(IntPtr raw, bool local_only);
		static d_gtk_places_sidebar_set_local_only gtk_places_sidebar_set_local_only = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_local_only>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_local_only"));

		[GLib.Property ("local-only")]
		public bool LocalOnly {
			get  {
				bool raw_ret = gtk_places_sidebar_get_local_only(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_local_only(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_trash(IntPtr raw);
		static d_gtk_places_sidebar_get_show_trash gtk_places_sidebar_get_show_trash = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_trash>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_trash"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_trash(IntPtr raw, bool show_trash);
		static d_gtk_places_sidebar_set_show_trash gtk_places_sidebar_set_show_trash = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_trash>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_trash"));

		[GLib.Property ("show-trash")]
		public bool ShowTrash {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_trash(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_trash(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_places_sidebar_get_show_other_locations(IntPtr raw);
		static d_gtk_places_sidebar_get_show_other_locations gtk_places_sidebar_get_show_other_locations = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_show_other_locations>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_show_other_locations"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_show_other_locations(IntPtr raw, bool show_other_locations);
		static d_gtk_places_sidebar_set_show_other_locations gtk_places_sidebar_set_show_other_locations = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_show_other_locations>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_show_other_locations"));

		[GLib.Property ("show-other-locations")]
		public bool ShowOtherLocations {
			get  {
				bool raw_ret = gtk_places_sidebar_get_show_other_locations(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_places_sidebar_set_show_other_locations(Handle, value);
			}
		}

		[GLib.Property ("populate-all")]
		public bool PopulateAll {
			get {
				GLib.Value val = GetProperty ("populate-all");
				bool ret = (bool) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("populate-all", val);
				val.Dispose ();
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void DragPerformDropSignalDelegate (IntPtr inst, IntPtr arg0, IntPtr arg1, int arg2, IntPtr gch);

		static void DragPerformDropSignalCallback (IntPtr inst, IntPtr arg0, IntPtr arg1, int arg2, IntPtr gch)
		{
			Gtk.DragPerformDropArgs args = new Gtk.DragPerformDropArgs ();
			try {
				GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
				if (sig == null)
					throw new Exception("Unknown signal GC handle received " + gch);

				args.Args = new object[3];
				args.Args[0] = GLib.FileAdapter.GetObject (arg0, false);
				if (arg1 == IntPtr.Zero)
					args.Args[1] = null;
				else {
					args.Args[1] = new GLib.List(arg1);
				}
				args.Args[2] = (Gdk.DragAction) arg2;
				Gtk.DragPerformDropHandler handler = (Gtk.DragPerformDropHandler) sig.Handler;
				handler (GLib.Object.GetObject (inst), args);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.Signal("drag-perform-drop")]
		public event Gtk.DragPerformDropHandler DragPerformDrop {
			add {
				this.AddSignalHandler ("drag-perform-drop", value, new DragPerformDropSignalDelegate(DragPerformDropSignalCallback));
			}
			remove {
				this.RemoveSignalHandler ("drag-perform-drop", value);
			}
		}

		[GLib.Signal("show-enter-location")]
		public event System.EventHandler ShowEnteredLocation {
			add {
				this.AddSignalHandler ("show-enter-location", value);
			}
			remove {
				this.RemoveSignalHandler ("show-enter-location", value);
			}
		}

		[GLib.Signal("mount")]
		public event Gtk.MountHandler Mount {
			add {
				this.AddSignalHandler ("mount", value, typeof (Gtk.MountArgs));
			}
			remove {
				this.RemoveSignalHandler ("mount", value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int DragActionRequestedSignalDelegate (IntPtr inst, IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr gch);

		static int DragActionRequestedSignalCallback (IntPtr inst, IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr gch)
		{
			Gtk.DragActionRequestedArgs args = new Gtk.DragActionRequestedArgs ();
			try {
				GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;
				if (sig == null)
					throw new Exception("Unknown signal GC handle received " + gch);

				args.Args = new object[3];
				args.Args[0] = GLib.Object.GetObject(arg0) as Gdk.DragContext;
				args.Args[1] = GLib.FileAdapter.GetObject (arg1, false);
				if (arg2 == IntPtr.Zero)
					args.Args[2] = null;
				else {
					args.Args[2] = new GLib.List(arg2);
				}
				Gtk.DragActionRequestedHandler handler = (Gtk.DragActionRequestedHandler) sig.Handler;
				handler (GLib.Object.GetObject (inst), args);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}

			try {
				return (int) ((Gdk.DragAction) args.RetVal);
			} catch (Exception) {
				Exception ex = new Exception ("args.RetVal or 'out' property unset or set to incorrect type in Gtk.DragActionRequestedHandler callback");
				GLib.ExceptionManager.RaiseUnhandledException (ex, true);
				// NOTREACHED: above call doesn't return.
				throw ex;
			}
		}

		[GLib.Signal("drag-action-requested")]
		public event Gtk.DragActionRequestedHandler DragActionRequested {
			add {
				this.AddSignalHandler ("drag-action-requested", value, new DragActionRequestedSignalDelegate(DragActionRequestedSignalCallback));
			}
			remove {
				this.RemoveSignalHandler ("drag-action-requested", value);
			}
		}

		[GLib.Signal("drag-action-ask")]
		public event Gtk.DragActionAskHandler DragActionAsk {
			add {
				this.AddSignalHandler ("drag-action-ask", value, typeof (Gtk.DragActionAskArgs));
			}
			remove {
				this.RemoveSignalHandler ("drag-action-ask", value);
			}
		}

		[GLib.Signal("unmount")]
		public event Gtk.UnmountHandler Unmount {
			add {
				this.AddSignalHandler ("unmount", value, typeof (Gtk.UnmountArgs));
			}
			remove {
				this.RemoveSignalHandler ("unmount", value);
			}
		}

		[GLib.Signal("populate-popup")]
		public event Gtk.PopulatePopupHandler PopulatePopup {
			add {
				this.AddSignalHandler ("populate-popup", value, typeof (Gtk.PopulatePopupArgs));
			}
			remove {
				this.RemoveSignalHandler ("populate-popup", value);
			}
		}

		[GLib.Signal("show-other-locations-with-flags")]
		public event Gtk.ShowOtherLocationsWithFlagsHandler ShowOtherLocationsWithFlags {
			add {
				this.AddSignalHandler ("show-other-locations-with-flags", value, typeof (Gtk.ShowOtherLocationsWithFlagsArgs));
			}
			remove {
				this.RemoveSignalHandler ("show-other-locations-with-flags", value);
			}
		}

		[GLib.Signal("show-connect-to-server")]
		public event System.EventHandler ShowedConnectToServer {
			add {
				this.AddSignalHandler ("show-connect-to-server", value);
			}
			remove {
				this.RemoveSignalHandler ("show-connect-to-server", value);
			}
		}

		[GLib.Signal("show-other-locations")]
		public event System.EventHandler ShowedOtherLocations {
			add {
				this.AddSignalHandler ("show-other-locations", value);
			}
			remove {
				this.RemoveSignalHandler ("show-other-locations", value);
			}
		}

		[GLib.Signal("show-error-message")]
		public event Gtk.ShowErrorMessageHandler ShowErrorMessage {
			add {
				this.AddSignalHandler ("show-error-message", value, typeof (Gtk.ShowErrorMessageArgs));
			}
			remove {
				this.RemoveSignalHandler ("show-error-message", value);
			}
		}

		[GLib.Signal("open-location")]
		public event Gtk.OpenLocationHandler OpenLocation {
			add {
				this.AddSignalHandler ("open-location", value, typeof (Gtk.OpenLocationArgs));
			}
			remove {
				this.RemoveSignalHandler ("open-location", value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_add_shortcut(IntPtr raw, IntPtr location);
		static d_gtk_places_sidebar_add_shortcut gtk_places_sidebar_add_shortcut = FuncLoader.LoadFunction<d_gtk_places_sidebar_add_shortcut>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_add_shortcut"));

		public void AddShortcut(GLib.IFile location) {
			gtk_places_sidebar_add_shortcut(Handle, location == null ? IntPtr.Zero : ((location is GLib.Object) ? (location as GLib.Object).Handle : (location as GLib.FileAdapter).Handle));
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_places_sidebar_get_nth_bookmark(IntPtr raw, int n);
		static d_gtk_places_sidebar_get_nth_bookmark gtk_places_sidebar_get_nth_bookmark = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_nth_bookmark>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_nth_bookmark"));

		public GLib.IFile GetNthBookmark(int n) {
			IntPtr raw_ret = gtk_places_sidebar_get_nth_bookmark(Handle, n);
			GLib.IFile ret = GLib.FileAdapter.GetObject (raw_ret, false);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_places_sidebar_get_type();
		static d_gtk_places_sidebar_get_type gtk_places_sidebar_get_type = FuncLoader.LoadFunction<d_gtk_places_sidebar_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_get_type"));

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_places_sidebar_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_places_sidebar_list_shortcuts(IntPtr raw);
		static d_gtk_places_sidebar_list_shortcuts gtk_places_sidebar_list_shortcuts = FuncLoader.LoadFunction<d_gtk_places_sidebar_list_shortcuts>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_list_shortcuts"));

		public GLib.IFile[] ListShortcuts() {
			IntPtr raw_ret = gtk_places_sidebar_list_shortcuts(Handle);
			GLib.IFile[] ret = GLib.Marshaller.SListPtrToArray<GLib.IFile, GLib.IFile> (raw_ret, true, true);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_remove_shortcut(IntPtr raw, IntPtr location);
		static d_gtk_places_sidebar_remove_shortcut gtk_places_sidebar_remove_shortcut = FuncLoader.LoadFunction<d_gtk_places_sidebar_remove_shortcut>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_remove_shortcut"));

		public void RemoveShortcut(GLib.IFile location) {
			gtk_places_sidebar_remove_shortcut(Handle, location == null ? IntPtr.Zero : ((location is GLib.Object) ? (location as GLib.Object).Handle : (location as GLib.FileAdapter).Handle));
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_places_sidebar_set_drop_targets_visible(IntPtr raw, bool visible, IntPtr context);
		static d_gtk_places_sidebar_set_drop_targets_visible gtk_places_sidebar_set_drop_targets_visible = FuncLoader.LoadFunction<d_gtk_places_sidebar_set_drop_targets_visible>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_places_sidebar_set_drop_targets_visible"));

		public void SetDropTargetsVisible(bool visible, Gdk.DragContext context) {
			gtk_places_sidebar_set_drop_targets_visible(Handle, visible, context == null ? IntPtr.Zero : context.Handle);
		}

#endregion
	}
}
