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

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

func (obj *Search) NewSearchWithStrDict(arg0 map[string]string) (arg1 string, arg2 bool, _err error) {
	_err = obj.core.Call("com.deepin.daemon.Search.NewSearchWithStrDict", 0, arg0).Store(&arg1, &arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Search) NewSearchWithStrList(arg0 []string) (arg1 string, arg2 bool, _err error) {
	_err = obj.core.Call("com.deepin.daemon.Search.NewSearchWithStrList", 0, arg0).Store(&arg1, &arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Search) SearchStartWithString(arg0 string, arg1 string) (arg2 []string, _err error) {
	_err = obj.core.Call("com.deepin.daemon.Search.SearchStartWithString", 0, arg0, arg1).Store(&arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Search) SearchString(arg0 string, arg1 string) (arg2 []string, _err error) {
	_err = obj.core.Call("com.deepin.daemon.Search.SearchString", 0, arg0, arg1).Store(&arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

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

	obj := &Search{Path: path, DestName: destName, core: core}

	return obj, nil
}
