-
Notifications
You must be signed in to change notification settings - Fork 87
/
frontend.go
48 lines (38 loc) · 1.31 KB
/
frontend.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2016 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.
package backend
import "github.com/limetext/text"
// The Frontend interface defines the API
// for functionality that is frontend specific.
type Frontend interface {
// Probe the frontend for the currently
// visible region of the given view.
VisibleRegion(*View) text.Region
// Make the frontend show the specified region of the
// given view.
Show(*View, text.Region)
// Sets the status message shown in the status bar
StatusMessage(string)
// Displays an error message to the user
ErrorMessage(string)
// Displays a message dialog to the user
MessageDialog(string)
// Displays an ok / cancel dialog to the user.
// "okname" if provided will be used as the text
// instead of "Ok" for the ok button.
// Returns true when ok was pressed, and false when
// cancel was pressed.
OkCancelDialog(msg string, okname string) bool
// Displays file dialog, returns the selected files.
// folder is the path file dialog will show.
Prompt(title, folder string, flags int) []string
}
const (
// Prompt save as dialog
PROMPT_SAVE_AS = 1 << iota
// User should only be able to select folders
PROMPT_ONLY_FOLDER
// User can select multiple files
PROMPT_SELECT_MULTIPLE
)