// Code generated by "./generator ./system/org.lingmo.grub2/"; DO NOT EDIT.

// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
package grub2

import (
	"unsafe"

	"github.com/godbus/dbus/v5"
	"github.com/LingmoOS/golang-github-lingmo-go-lib/dbusutil/proxy"
)

type Grub2 interface {
	grub2 // interface org.lingmo.Grub2
	proxy.Object
}

type objectGrub2 struct {
	interfaceGrub2 // interface org.lingmo.Grub2
	proxy.ImplObject
}

func NewGrub2(conn *dbus.Conn) Grub2 {
	obj := new(objectGrub2)
	obj.ImplObject.Init_(conn, "org.lingmo.Grub2", "/org/lingmo/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 "org.lingmo.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",
	}
}
