Documentation
¶
Index ¶
Constants ¶
View Source
const ( BaseDest = "org.snippetexpander.daemon" BasePath = "/org/snippetexpander/daemon" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBusService ¶
type DBusService interface {
// Ping daemon for expected response.
Ping(expected string) (string, error)
// Stop daemon.
Stop() error
// GetAutostartStatus to see whether it is turned on.
GetAutostartStatus() (bool, error)
// UpdateAutostart to turn it on or off.
UpdateAutostart(on bool) error
// GetAutoexpandStatus to see whether it is turned on.
GetAutoexpandStatus() (bool, error)
// UpdateAutoexpand to turn it on or off.
UpdateAutoexpand(on bool) error
// AddSnippet to database.
AddSnippet(abbreviation string, body string) (*snippet.Snippet, error)
// UpdateSnippetWithID in database.
UpdateSnippetWithID(id uuid.UUID, snippet *snippet.Snippet) error
// GetSnippets from database.
GetSnippets(search string, orderByLastUsed bool) ([]*snippet.Snippet, error)
// GetSnippetWithAbbreviation for a given abbreviation.
GetSnippetWithAbbreviation(abbreviation string) (*snippet.Snippet, error)
// GetSnippetWithID for a given ID.
GetSnippetWithID(id string) (*snippet.Snippet, error)
// RemoveSnippet from database.
RemoveSnippet(abbreviation string) (bool, error)
// SyncSnippets in database with options to handle clashes.
SyncSnippets(snippets []*snippet.Snippet, options SyncOptions) (SyncResult, error)
// ExpandAbbreviation returns the body with expanded placeholders as well as the cursor offset.
ExpandAbbreviation(abbreviation string, skipLastUsed bool) (ExpandAbbreviationResult, error)
// CopySnippet asks the daemon to copy an expanded snippet into the pasteboard.
CopySnippet(abbreviation string, skipLastUsed bool) error
// PasteSnippet asks the daemon to copy and paste a snippet after a number of milliseconds.
PasteSnippet(abbreviation string, useShiftKey bool, delay int64) error
// GetSetting gets a setting for a given key.
GetSetting(key string) (string, error)
// SaveSetting saves a setting for the given key and value, empty value returns setting to its default.
SaveSetting(key string, value string) error
}
type Snippet ¶
func FromSnippet ¶
FromSnippet converts a snippet.Snippet to a dbusservice.Snippet.
type SyncOptions ¶
type SyncOptions struct {
Update bool
}
Click to show internal directories.
Click to hide internal directories.