diff --git a/application.go b/application.go index b8f9322..a7367b0 100644 --- a/application.go +++ b/application.go @@ -3,6 +3,7 @@ package nasin import "log" import "image" import "strings" +import "net/url" import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/nasin/internal/registrar" @@ -15,6 +16,20 @@ type Application interface { Init () error } +// ApplicationURLOpener is an application that can open a URL. +type ApplicationURLOpener interface { + Application + + // OpenURL opens a new window with the contents of the given URL. If the + // given URL is unsupported, it returns an error (for example, an image + // viewer is not expected to open a text file). If the URL scheme is + // empty, file:// is assumed. + // + // Applications should support the file:// scheme at the very least, and + // should also support others like http:// and https:// if possible. + OpenURL (*url.URL) error +} + // ApplicationDescription describes the name and type of an application. type ApplicationDescription struct { // The name of the application.