// Code generated by "./generator com.deepin.daemon.grub2"; DO NOT EDIT.

// Copyright: 2018 - 2022 UnionTech Software Technology Co., Ltd.
//
// License-Identifier: GPL-3.0-or-later
package grub2

import "github.com/godbus/dbus"

import "github.com/linuxdeepin/go-lib/dbusutil/proxy"
import "unsafe"

type Grub2 interface {
	grub2 // interface com.deepin.daemon.Grub2
	proxy.Object
}

type objectGrub2 struct {
	interfaceGrub2 // interface com.deepin.daemon.Grub2
	proxy.ImplObject
}

func NewGrub2(conn *dbus.Conn) Grub2 {
	obj := new(objectGrub2)
	obj.ImplObject.Init_(conn, "com.deepin.daemon.Grub2", "/com/deepin/daemon/Grub2")
	return obj
}

type grub2 interface {
	GoGetAvailableGfxmodes(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
	GetAvailableGfxmodes(flags dbus.Flags) ([]string, error)
	GoGetSimpleEntryTitles(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
	GetSimpleEntryTitles(flags dbus.Flags) ([]string, error)
	GoPrepareGfxmodeDetect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
	PrepareGfxmodeDetect(flags dbus.Flags) error
	GoReset(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
	Reset(flags dbus.Flags) error
	GoSetDefaultEntry(flags dbus.Flags, ch chan *dbus.Call, entry string) *dbus.Call
	SetDefaultEntry(flags dbus.Flags, entry string) error
	GoSetEnableTheme(flags dbus.Flags, ch chan *dbus.Call, enabled bool) *dbus.Call
	SetEnableTheme(flags dbus.Flags, enabled bool) error
	GoSetGfxmode(flags dbus.Flags, ch chan *dbus.Call, gfxmode string) *dbus.Call
	SetGfxmode(flags dbus.Flags, gfxmode string) error
	GoSetTimeout(flags dbus.Flags, ch chan *dbus.Call, timeout uint32) *dbus.Call
	SetTimeout(flags dbus.Flags, timeout uint32) error
	ThemeFile() proxy.PropString
	DefaultEntry() proxy.PropString
	EnableTheme() proxy.PropBool
	Gfxmode() proxy.PropString
	Timeout() proxy.PropUint32
	Updating() proxy.PropBool
}

type interfaceGrub2 struct{}

func (v *interfaceGrub2) GetObject_() *proxy.ImplObject {
	return (*proxy.ImplObject)(unsafe.Pointer(v))
}

func (*interfaceGrub2) GetInterfaceName_() string {
	return "com.deepin.daemon.Grub2"
}

// method GetAvailableGfxmodes

func (v *interfaceGrub2) GoGetAvailableGfxmodes(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".GetAvailableGfxmodes", flags, ch)
}

func (*interfaceGrub2) StoreGetAvailableGfxmodes(call *dbus.Call) (gfxModes []string, err error) {
	err = call.Store(&gfxModes)
	return
}

func (v *interfaceGrub2) GetAvailableGfxmodes(flags dbus.Flags) ([]string, error) {
	return v.StoreGetAvailableGfxmodes(
		<-v.GoGetAvailableGfxmodes(flags, make(chan *dbus.Call, 1)).Done)
}

// method GetSimpleEntryTitles

func (v *interfaceGrub2) GoGetSimpleEntryTitles(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".GetSimpleEntryTitles", flags, ch)
}

func (*interfaceGrub2) StoreGetSimpleEntryTitles(call *dbus.Call) (titles []string, err error) {
	err = call.Store(&titles)
	return
}

func (v *interfaceGrub2) GetSimpleEntryTitles(flags dbus.Flags) ([]string, error) {
	return v.StoreGetSimpleEntryTitles(
		<-v.GoGetSimpleEntryTitles(flags, make(chan *dbus.Call, 1)).Done)
}

// method PrepareGfxmodeDetect

func (v *interfaceGrub2) GoPrepareGfxmodeDetect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".PrepareGfxmodeDetect", flags, ch)
}

func (v *interfaceGrub2) PrepareGfxmodeDetect(flags dbus.Flags) error {
	return (<-v.GoPrepareGfxmodeDetect(flags, make(chan *dbus.Call, 1)).Done).Err
}

// method Reset

func (v *interfaceGrub2) GoReset(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".Reset", flags, ch)
}

func (v *interfaceGrub2) Reset(flags dbus.Flags) error {
	return (<-v.GoReset(flags, make(chan *dbus.Call, 1)).Done).Err
}

// method SetDefaultEntry

func (v *interfaceGrub2) GoSetDefaultEntry(flags dbus.Flags, ch chan *dbus.Call, entry string) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SetDefaultEntry", flags, ch, entry)
}

func (v *interfaceGrub2) SetDefaultEntry(flags dbus.Flags, entry string) error {
	return (<-v.GoSetDefaultEntry(flags, make(chan *dbus.Call, 1), entry).Done).Err
}

// method SetEnableTheme

func (v *interfaceGrub2) GoSetEnableTheme(flags dbus.Flags, ch chan *dbus.Call, enabled bool) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SetEnableTheme", flags, ch, enabled)
}

func (v *interfaceGrub2) SetEnableTheme(flags dbus.Flags, enabled bool) error {
	return (<-v.GoSetEnableTheme(flags, make(chan *dbus.Call, 1), enabled).Done).Err
}

// method SetGfxmode

func (v *interfaceGrub2) GoSetGfxmode(flags dbus.Flags, ch chan *dbus.Call, gfxmode string) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SetGfxmode", flags, ch, gfxmode)
}

func (v *interfaceGrub2) SetGfxmode(flags dbus.Flags, gfxmode string) error {
	return (<-v.GoSetGfxmode(flags, make(chan *dbus.Call, 1), gfxmode).Done).Err
}

// method SetTimeout

func (v *interfaceGrub2) GoSetTimeout(flags dbus.Flags, ch chan *dbus.Call, timeout uint32) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SetTimeout", flags, ch, timeout)
}

func (v *interfaceGrub2) SetTimeout(flags dbus.Flags, timeout uint32) error {
	return (<-v.GoSetTimeout(flags, make(chan *dbus.Call, 1), timeout).Done).Err
}

// property ThemeFile s

func (v *interfaceGrub2) ThemeFile() proxy.PropString {
	return &proxy.ImplPropString{
		Impl: v,
		Name: "ThemeFile",
	}
}

// property DefaultEntry s

func (v *interfaceGrub2) DefaultEntry() proxy.PropString {
	return &proxy.ImplPropString{
		Impl: v,
		Name: "DefaultEntry",
	}
}

// property EnableTheme b

func (v *interfaceGrub2) EnableTheme() proxy.PropBool {
	return &proxy.ImplPropBool{
		Impl: v,
		Name: "EnableTheme",
	}
}

// property Gfxmode s

func (v *interfaceGrub2) Gfxmode() proxy.PropString {
	return &proxy.ImplPropString{
		Impl: v,
		Name: "Gfxmode",
	}
}

// property Timeout u

func (v *interfaceGrub2) Timeout() proxy.PropUint32 {
	return &proxy.ImplPropUint32{
		Impl: v,
		Name: "Timeout",
	}
}

// property Updating b

func (v *interfaceGrub2) Updating() proxy.PropBool {
	return &proxy.ImplPropBool{
		Impl: v,
		Name: "Updating",
	}
}

type Fstart interface {
	fstart // interface com.deepin.daemon.Grub2.Fstart
	proxy.Object
}

type objectFstart struct {
	interfaceFstart // interface com.deepin.daemon.Grub2.Fstart
	proxy.ImplObject
}

func NewFstart(conn *dbus.Conn) Fstart {
	obj := new(objectFstart)
	obj.ImplObject.Init_(conn, "com.deepin.daemon.Grub2", "/com/deepin/daemon/Grub2/Fstart")
	return obj
}

type fstart interface {
	GoSkipGrub(flags dbus.Flags, ch chan *dbus.Call, enabled bool) *dbus.Call
	SkipGrub(flags dbus.Flags, enabled bool) error
	IsSkipGrub() proxy.PropBool
}

type interfaceFstart struct{}

func (v *interfaceFstart) GetObject_() *proxy.ImplObject {
	return (*proxy.ImplObject)(unsafe.Pointer(v))
}

func (*interfaceFstart) GetInterfaceName_() string {
	return "com.deepin.daemon.Grub2.Fstart"
}

// method SkipGrub

func (v *interfaceFstart) GoSkipGrub(flags dbus.Flags, ch chan *dbus.Call, enabled bool) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SkipGrub", flags, ch, enabled)
}

func (v *interfaceFstart) SkipGrub(flags dbus.Flags, enabled bool) error {
	return (<-v.GoSkipGrub(flags, make(chan *dbus.Call, 1), enabled).Done).Err
}

// property IsSkipGrub b

func (v *interfaceFstart) IsSkipGrub() proxy.PropBool {
	return &proxy.ImplPropBool{
		Impl: v,
		Name: "IsSkipGrub",
	}
}
