/*This file is automatically generated by pkg.deepin.io/dbus-generator. Don't edit it*/
package keybinding

import "pkg.deepin.io/lib/dbus"
import "pkg.deepin.io/lib/dbus/property"
import "reflect"
import "sync"
import "runtime"
import "fmt"
import "errors"

/*prevent compile error*/
var _ = fmt.Println
var _ = runtime.SetFinalizer
var _ = sync.NewCond
var _ = reflect.TypeOf
var _ = property.BaseObserver{}

type Mediakey struct {
	Path     dbus.ObjectPath
	DestName string
	core     *dbus.Object

	signals       map[<-chan *dbus.Signal]struct{}
	signalsLocker sync.Mutex
}

func (obj *Mediakey) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Mediakey) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyMediakey(obj *Mediakey) {
	obj.signalsLocker.Lock()
	defer obj.signalsLocker.Unlock()
	if obj.signals == nil {
		return
	}
	for ch, _ := range obj.signals {
		getBus().DetachSignal(ch)
	}
	obj.signals = nil

	runtime.SetFinalizer(obj, nil)

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.DBus.Properties',sender='" + obj.DestName + "',member='PropertiesChanged'")
	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PropertiesChanged'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioMute'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioUp'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioDown'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='BrightnessUp'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='BrightnessDown'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='KbdBrightnessUp'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='KbdBrightnessDown'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='CapsLockOn'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='CapsLockOff'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='NumLockOn'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='NumLockOff'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='SwitchMonitors'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadOn'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadOff'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadToggle'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerOff'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerSleep'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerSuspend'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='SwitchLayout'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPlay'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPause'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioStop'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPrevious'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioNext'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioRewind'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioForward'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioRepeat'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchEmail'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchBrowser'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchCalculator'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='Eject'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioMedia'")

}

func (obj *Mediakey) ConnectAudioMute(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioMute" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioUp(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioUp" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioDown(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioDown" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectBrightnessUp(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.BrightnessUp" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectBrightnessDown(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.BrightnessDown" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectKbdBrightnessUp(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.KbdBrightnessUp" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectKbdBrightnessDown(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.KbdBrightnessDown" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectCapsLockOn(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.CapsLockOn" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectCapsLockOff(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.CapsLockOff" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectNumLockOn(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.NumLockOn" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectNumLockOff(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.NumLockOff" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectSwitchMonitors(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.SwitchMonitors" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectTouchpadOn(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.TouchpadOn" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectTouchpadOff(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.TouchpadOff" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectTouchpadToggle(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.TouchpadToggle" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectPowerOff(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.PowerOff" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectPowerSleep(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.PowerSleep" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectPowerSuspend(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.PowerSuspend" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectSwitchLayout(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.SwitchLayout" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioPlay(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioPlay" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioPause(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioPause" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioStop(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioStop" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioPrevious(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioPrevious" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioNext(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioNext" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioRewind(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioRewind" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioForward(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioForward" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioRepeat(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioRepeat" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectLaunchEmail(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.LaunchEmail" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectLaunchBrowser(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.LaunchBrowser" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectLaunchCalculator(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.LaunchCalculator" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectEject(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.Eject" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func (obj *Mediakey) ConnectAudioMedia(callback func(arg0 bool)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "com.deepin.daemon.Keybinding.Mediakey.AudioMedia" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*bool)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(bool))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

func NewMediakey(destName string, path dbus.ObjectPath) (*Mediakey, error) {
	if !path.IsValid() {
		return nil, errors.New("The path of '" + string(path) + "' is invalid.")
	}

	core := getBus().Object(destName, path)

	obj := &Mediakey{Path: path, DestName: destName, core: core, signals: make(map[<-chan *dbus.Signal]struct{})}

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioMute'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioUp'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioDown'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='BrightnessUp'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='BrightnessDown'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='KbdBrightnessUp'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='KbdBrightnessDown'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='CapsLockOn'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='CapsLockOff'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='NumLockOn'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='NumLockOff'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='SwitchMonitors'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadOn'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadOff'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='TouchpadToggle'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerOff'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerSleep'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='PowerSuspend'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='SwitchLayout'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPlay'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPause'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioStop'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioPrevious'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioNext'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioRewind'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioForward'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioRepeat'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchEmail'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchBrowser'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='LaunchCalculator'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='Eject'")

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='com.deepin.daemon.Keybinding.Mediakey',sender='" + obj.DestName + "',member='AudioMedia'")

	runtime.SetFinalizer(obj, func(_obj *Mediakey) { DestroyMediakey(_obj) })
	return obj, nil
}
