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

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 User struct {
	Path     dbus.ObjectPath
	DestName string
	core     *dbus.Object

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

	Uid            *dbusPropertyUserUid
	UserName       *dbusPropertyUserUserName
	RealName       *dbusPropertyUserRealName
	AccountType    *dbusPropertyUserAccountType
	HomeDirectory  *dbusPropertyUserHomeDirectory
	Shell          *dbusPropertyUserShell
	Email          *dbusPropertyUserEmail
	Language       *dbusPropertyUserLanguage
	XSession       *dbusPropertyUserXSession
	Location       *dbusPropertyUserLocation
	LoginFrequency *dbusPropertyUserLoginFrequency
	LoginTime      *dbusPropertyUserLoginTime
	LoginHistory   *dbusPropertyUserLoginHistory
	IconFile       *dbusPropertyUserIconFile
	Locked         *dbusPropertyUserLocked
	PasswordMode   *dbusPropertyUserPasswordMode
	PasswordHint   *dbusPropertyUserPasswordHint
	AutomaticLogin *dbusPropertyUserAutomaticLogin
	SystemAccount  *dbusPropertyUserSystemAccount
	LocalAccount   *dbusPropertyUserLocalAccount
}

func (obj *User) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *User) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyUser(obj *User) {
	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='org.freedesktop.Accounts.User',sender='" + obj.DestName + "',member='PropertiesChanged'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.Accounts.User',sender='" + obj.DestName + "',member='Changed'")

	obj.Uid.Reset()
	obj.UserName.Reset()
	obj.RealName.Reset()
	obj.AccountType.Reset()
	obj.HomeDirectory.Reset()
	obj.Shell.Reset()
	obj.Email.Reset()
	obj.Language.Reset()
	obj.XSession.Reset()
	obj.Location.Reset()
	obj.LoginFrequency.Reset()
	obj.LoginTime.Reset()
	obj.LoginHistory.Reset()
	obj.IconFile.Reset()
	obj.Locked.Reset()
	obj.PasswordMode.Reset()
	obj.PasswordHint.Reset()
	obj.AutomaticLogin.Reset()
	obj.SystemAccount.Reset()
	obj.LocalAccount.Reset()
}

func (obj *User) SetUserName(name string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetUserName", 0, name).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetRealName(name string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetRealName", 0, name).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetEmail(email string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetEmail", 0, email).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetLanguage(language string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetLanguage", 0, language).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetXSession(x_session string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetXSession", 0, x_session).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetLocation(location string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetLocation", 0, location).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetHomeDirectory(homedir string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetHomeDirectory", 0, homedir).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetShell(shell string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetShell", 0, shell).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetIconFile(filename string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetIconFile", 0, filename).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetLocked(locked bool) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetLocked", 0, locked).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetAccountType(accountType int32) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetAccountType", 0, accountType).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetPasswordMode(mode int32) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetPasswordMode", 0, mode).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetPassword(password string, hint string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetPassword", 0, password, hint).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetPasswordHint(hint string) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetPasswordHint", 0, hint).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) SetAutomaticLogin(enabled bool) (_err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.SetAutomaticLogin", 0, enabled).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) GetPasswordExpirationPolicy() (expiration_time int64, last_change_time int64, min_days_between_changes int64, max_days_between_changes int64, days_to_warn int64, days_after_expiration_until_lock int64, _err error) {
	_err = obj.core.Call("org.freedesktop.Accounts.User.GetPasswordExpirationPolicy", 0).Store(&expiration_time, &last_change_time, &min_days_between_changes, &max_days_between_changes, &days_to_warn, &days_after_expiration_until_lock)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *User) ConnectChanged(callback func()) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "org.freedesktop.Accounts.User.Changed" || 0 != len(v.Body) {
				continue
			}

			callback()
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

type dbusPropertyUserUid struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserUid) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Uid is not writable")
}

func (this *dbusPropertyUserUid) Get() uint64 {
	v, _ := this.GetValue()
	return v.(uint64)
}
func (this *dbusPropertyUserUid) GetValue() (interface{} /*uint64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Uid").Store(&r)
	if err == nil && r.Signature().String() == "t" {
		return r.Value().(uint64), nil
	}
	return *new(uint64), err
}
func (this *dbusPropertyUserUid) GetType() reflect.Type {
	return reflect.TypeOf((*uint64)(nil)).Elem()
}

type dbusPropertyUserUserName struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserUserName) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.UserName is not writable")
}

func (this *dbusPropertyUserUserName) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserUserName) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "UserName").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserUserName) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserRealName struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserRealName) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.RealName is not writable")
}

func (this *dbusPropertyUserRealName) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserRealName) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "RealName").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserRealName) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserAccountType struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserAccountType) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.AccountType is not writable")
}

func (this *dbusPropertyUserAccountType) Get() int32 {
	v, _ := this.GetValue()
	return v.(int32)
}
func (this *dbusPropertyUserAccountType) GetValue() (interface{} /*int32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "AccountType").Store(&r)
	if err == nil && r.Signature().String() == "i" {
		return r.Value().(int32), nil
	}
	return *new(int32), err
}
func (this *dbusPropertyUserAccountType) GetType() reflect.Type {
	return reflect.TypeOf((*int32)(nil)).Elem()
}

type dbusPropertyUserHomeDirectory struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserHomeDirectory) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.HomeDirectory is not writable")
}

func (this *dbusPropertyUserHomeDirectory) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserHomeDirectory) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "HomeDirectory").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserHomeDirectory) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserShell struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserShell) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Shell is not writable")
}

func (this *dbusPropertyUserShell) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserShell) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Shell").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserShell) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserEmail struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserEmail) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Email is not writable")
}

func (this *dbusPropertyUserEmail) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserEmail) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Email").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserEmail) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserLanguage struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLanguage) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Language is not writable")
}

func (this *dbusPropertyUserLanguage) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserLanguage) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Language").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserLanguage) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserXSession struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserXSession) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.XSession is not writable")
}

func (this *dbusPropertyUserXSession) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserXSession) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "XSession").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserXSession) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserLocation struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLocation) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Location is not writable")
}

func (this *dbusPropertyUserLocation) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserLocation) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Location").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserLocation) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserLoginFrequency struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLoginFrequency) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.LoginFrequency is not writable")
}

func (this *dbusPropertyUserLoginFrequency) Get() uint64 {
	v, _ := this.GetValue()
	return v.(uint64)
}
func (this *dbusPropertyUserLoginFrequency) GetValue() (interface{} /*uint64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "LoginFrequency").Store(&r)
	if err == nil && r.Signature().String() == "t" {
		return r.Value().(uint64), nil
	}
	return *new(uint64), err
}
func (this *dbusPropertyUserLoginFrequency) GetType() reflect.Type {
	return reflect.TypeOf((*uint64)(nil)).Elem()
}

type dbusPropertyUserLoginTime struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLoginTime) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.LoginTime is not writable")
}

func (this *dbusPropertyUserLoginTime) Get() int64 {
	v, _ := this.GetValue()
	return v.(int64)
}
func (this *dbusPropertyUserLoginTime) GetValue() (interface{} /*int64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "LoginTime").Store(&r)
	if err == nil && r.Signature().String() == "x" {
		return r.Value().(int64), nil
	}
	return *new(int64), err
}
func (this *dbusPropertyUserLoginTime) GetType() reflect.Type {
	return reflect.TypeOf((*int64)(nil)).Elem()
}

type dbusPropertyUserLoginHistory struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLoginHistory) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.LoginHistory is not writable")
}

func (this *dbusPropertyUserLoginHistory) Get() [][]interface{} {
	v, _ := this.GetValue()
	return v.([][]interface{})
}
func (this *dbusPropertyUserLoginHistory) GetValue() (interface{} /*[][]interface {}*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "LoginHistory").Store(&r)
	if err == nil && r.Signature().String() == "a(xxa{sv})" {
		return r.Value().([][]interface{}), nil
	}
	return *new([][]interface{}), err
}
func (this *dbusPropertyUserLoginHistory) GetType() reflect.Type {
	return reflect.TypeOf((*[][]interface{})(nil)).Elem()
}

type dbusPropertyUserIconFile struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserIconFile) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.IconFile is not writable")
}

func (this *dbusPropertyUserIconFile) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserIconFile) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "IconFile").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserIconFile) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserLocked struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLocked) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.Locked is not writable")
}

func (this *dbusPropertyUserLocked) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyUserLocked) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "Locked").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyUserLocked) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyUserPasswordMode struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserPasswordMode) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.PasswordMode is not writable")
}

func (this *dbusPropertyUserPasswordMode) Get() int32 {
	v, _ := this.GetValue()
	return v.(int32)
}
func (this *dbusPropertyUserPasswordMode) GetValue() (interface{} /*int32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "PasswordMode").Store(&r)
	if err == nil && r.Signature().String() == "i" {
		return r.Value().(int32), nil
	}
	return *new(int32), err
}
func (this *dbusPropertyUserPasswordMode) GetType() reflect.Type {
	return reflect.TypeOf((*int32)(nil)).Elem()
}

type dbusPropertyUserPasswordHint struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserPasswordHint) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.PasswordHint is not writable")
}

func (this *dbusPropertyUserPasswordHint) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyUserPasswordHint) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "PasswordHint").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyUserPasswordHint) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyUserAutomaticLogin struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserAutomaticLogin) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.AutomaticLogin is not writable")
}

func (this *dbusPropertyUserAutomaticLogin) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyUserAutomaticLogin) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "AutomaticLogin").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyUserAutomaticLogin) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyUserSystemAccount struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserSystemAccount) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.SystemAccount is not writable")
}

func (this *dbusPropertyUserSystemAccount) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyUserSystemAccount) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "SystemAccount").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyUserSystemAccount) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyUserLocalAccount struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyUserLocalAccount) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.Accounts.User.LocalAccount is not writable")
}

func (this *dbusPropertyUserLocalAccount) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyUserLocalAccount) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.Accounts.User", "LocalAccount").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyUserLocalAccount) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

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

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

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

	obj.Uid = &dbusPropertyUserUid{&property.BaseObserver{}, core}
	obj.UserName = &dbusPropertyUserUserName{&property.BaseObserver{}, core}
	obj.RealName = &dbusPropertyUserRealName{&property.BaseObserver{}, core}
	obj.AccountType = &dbusPropertyUserAccountType{&property.BaseObserver{}, core}
	obj.HomeDirectory = &dbusPropertyUserHomeDirectory{&property.BaseObserver{}, core}
	obj.Shell = &dbusPropertyUserShell{&property.BaseObserver{}, core}
	obj.Email = &dbusPropertyUserEmail{&property.BaseObserver{}, core}
	obj.Language = &dbusPropertyUserLanguage{&property.BaseObserver{}, core}
	obj.XSession = &dbusPropertyUserXSession{&property.BaseObserver{}, core}
	obj.Location = &dbusPropertyUserLocation{&property.BaseObserver{}, core}
	obj.LoginFrequency = &dbusPropertyUserLoginFrequency{&property.BaseObserver{}, core}
	obj.LoginTime = &dbusPropertyUserLoginTime{&property.BaseObserver{}, core}
	obj.LoginHistory = &dbusPropertyUserLoginHistory{&property.BaseObserver{}, core}
	obj.IconFile = &dbusPropertyUserIconFile{&property.BaseObserver{}, core}
	obj.Locked = &dbusPropertyUserLocked{&property.BaseObserver{}, core}
	obj.PasswordMode = &dbusPropertyUserPasswordMode{&property.BaseObserver{}, core}
	obj.PasswordHint = &dbusPropertyUserPasswordHint{&property.BaseObserver{}, core}
	obj.AutomaticLogin = &dbusPropertyUserAutomaticLogin{&property.BaseObserver{}, core}
	obj.SystemAccount = &dbusPropertyUserSystemAccount{&property.BaseObserver{}, core}
	obj.LocalAccount = &dbusPropertyUserLocalAccount{&property.BaseObserver{}, core}

	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.freedesktop.DBus.Properties',sender='" + destName + "',member='PropertiesChanged'")
	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.freedesktop.Accounts.User',sender='" + destName + "',member='PropertiesChanged'")
	sigChan := obj._createSignalChan()
	go func() {
		typeString := reflect.TypeOf("")
		typeKeyValues := reflect.TypeOf(map[string]dbus.Variant{})
		typeArrayValues := reflect.TypeOf([]string{})
		for v := range sigChan {
			if v.Name == "org.freedesktop.DBus.Properties.PropertiesChanged" &&
				len(v.Body) == 3 &&
				reflect.TypeOf(v.Body[0]) == typeString &&
				reflect.TypeOf(v.Body[1]) == typeKeyValues &&
				reflect.TypeOf(v.Body[2]) == typeArrayValues &&
				v.Body[0].(string) == "org.freedesktop.Accounts.User" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "Uid" {
						obj.Uid.Notify()

					} else if key == "UserName" {
						obj.UserName.Notify()

					} else if key == "RealName" {
						obj.RealName.Notify()

					} else if key == "AccountType" {
						obj.AccountType.Notify()

					} else if key == "HomeDirectory" {
						obj.HomeDirectory.Notify()

					} else if key == "Shell" {
						obj.Shell.Notify()

					} else if key == "Email" {
						obj.Email.Notify()

					} else if key == "Language" {
						obj.Language.Notify()

					} else if key == "XSession" {
						obj.XSession.Notify()

					} else if key == "Location" {
						obj.Location.Notify()

					} else if key == "LoginFrequency" {
						obj.LoginFrequency.Notify()

					} else if key == "LoginTime" {
						obj.LoginTime.Notify()

					} else if key == "LoginHistory" {
						obj.LoginHistory.Notify()

					} else if key == "IconFile" {
						obj.IconFile.Notify()

					} else if key == "Locked" {
						obj.Locked.Notify()

					} else if key == "PasswordMode" {
						obj.PasswordMode.Notify()

					} else if key == "PasswordHint" {
						obj.PasswordHint.Notify()

					} else if key == "AutomaticLogin" {
						obj.AutomaticLogin.Notify()

					} else if key == "SystemAccount" {
						obj.SystemAccount.Notify()

					} else if key == "LocalAccount" {
						obj.LocalAccount.Notify()
					}
				}
			} else if v.Name == "org.freedesktop.Accounts.User.PropertiesChanged" && len(v.Body) == 1 && reflect.TypeOf(v.Body[0]) == typeKeyValues {
				for key, _ := range v.Body[0].(map[string]dbus.Variant) {
					if false {
					} else if key == "Uid" {
						obj.Uid.Notify()

					} else if key == "UserName" {
						obj.UserName.Notify()

					} else if key == "RealName" {
						obj.RealName.Notify()

					} else if key == "AccountType" {
						obj.AccountType.Notify()

					} else if key == "HomeDirectory" {
						obj.HomeDirectory.Notify()

					} else if key == "Shell" {
						obj.Shell.Notify()

					} else if key == "Email" {
						obj.Email.Notify()

					} else if key == "Language" {
						obj.Language.Notify()

					} else if key == "XSession" {
						obj.XSession.Notify()

					} else if key == "Location" {
						obj.Location.Notify()

					} else if key == "LoginFrequency" {
						obj.LoginFrequency.Notify()

					} else if key == "LoginTime" {
						obj.LoginTime.Notify()

					} else if key == "LoginHistory" {
						obj.LoginHistory.Notify()

					} else if key == "IconFile" {
						obj.IconFile.Notify()

					} else if key == "Locked" {
						obj.Locked.Notify()

					} else if key == "PasswordMode" {
						obj.PasswordMode.Notify()

					} else if key == "PasswordHint" {
						obj.PasswordHint.Notify()

					} else if key == "AutomaticLogin" {
						obj.AutomaticLogin.Notify()

					} else if key == "SystemAccount" {
						obj.SystemAccount.Notify()

					} else if key == "LocalAccount" {
						obj.LocalAccount.Notify()
					}
				}
			}
		}
	}()

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.Accounts.User',sender='" + obj.DestName + "',member='Changed'")

	runtime.SetFinalizer(obj, func(_obj *User) { DestroyUser(_obj) })
	return obj, nil
}
