go-toast

Send toast notifications in Windows
Log | Files | Refs | README | LICENSE

constants.go (3153B)


      1 package toast
      2 
      3 import "errors"
      4 
      5 var (
      6 	ErrorInvalidAudio    error = errors.New("toast: invalid audio")
      7 	ErrorInvalidDuration       = errors.New("toast: invalid duration")
      8 )
      9 
     10 // toastAudio identifies audio that Windows can play.
     11 type toastAudio = string
     12 
     13 const (
     14 	Default        toastAudio = "ms-winsoundevent:Notification.Default"
     15 	IM             toastAudio = "ms-winsoundevent:Notification.IM"
     16 	Mail           toastAudio = "ms-winsoundevent:Notification.Mail"
     17 	Reminder       toastAudio = "ms-winsoundevent:Notification.Reminder"
     18 	SMS            toastAudio = "ms-winsoundevent:Notification.SMS"
     19 	LoopingAlarm   toastAudio = "ms-winsoundevent:Notification.Looping.Alarm"
     20 	LoopingAlarm2  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm2"
     21 	LoopingAlarm3  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm3"
     22 	LoopingAlarm4  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm4"
     23 	LoopingAlarm5  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm5"
     24 	LoopingAlarm6  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm6"
     25 	LoopingAlarm7  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm7"
     26 	LoopingAlarm8  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm8"
     27 	LoopingAlarm9  toastAudio = "ms-winsoundevent:Notification.Looping.Alarm9"
     28 	LoopingAlarm10 toastAudio = "ms-winsoundevent:Notification.Looping.Alarm10"
     29 	LoopingCall    toastAudio = "ms-winsoundevent:Notification.Looping.Call"
     30 	LoopingCall2   toastAudio = "ms-winsoundevent:Notification.Looping.Call2"
     31 	LoopingCall3   toastAudio = "ms-winsoundevent:Notification.Looping.Call3"
     32 	LoopingCall4   toastAudio = "ms-winsoundevent:Notification.Looping.Call4"
     33 	LoopingCall5   toastAudio = "ms-winsoundevent:Notification.Looping.Call5"
     34 	LoopingCall6   toastAudio = "ms-winsoundevent:Notification.Looping.Call6"
     35 	LoopingCall7   toastAudio = "ms-winsoundevent:Notification.Looping.Call7"
     36 	LoopingCall8   toastAudio = "ms-winsoundevent:Notification.Looping.Call8"
     37 	LoopingCall9   toastAudio = "ms-winsoundevent:Notification.Looping.Call9"
     38 	LoopingCall10  toastAudio = "ms-winsoundevent:Notification.Looping.Call10"
     39 	Silent         toastAudio = "silent"
     40 )
     41 
     42 // toastduration identifies toast duration for audio playback.
     43 type toastDuration = string
     44 
     45 const (
     46 	Short toastDuration = "short"
     47 	Long  toastDuration = "long"
     48 )
     49 
     50 // ActivationType identifies the method that Windows Runtime will use to handle
     51 // notification interactions.
     52 //
     53 // See https://learn.microsoft.com/en-us/dotnet/api/microsoft.toolkit.uwp.notifications.toastactivationtype
     54 type ActivationType = string
     55 
     56 const (
     57 	// Protocol is for launching third-party applications using a protocol uri, like https or mailto.
     58 	Protocol ActivationType = "protocol"
     59 	// Foreground is for launching your foreground application. This is required to enable the activation
     60 	// callback. There is a third option: Background, however for Desktop applications Foreground and
     61 	// Background behave identically.
     62 	//
     63 	// See https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast-desktop-cpp-wrl#foreground-vs-background-activation
     64 	Foreground ActivationType = "foreground"
     65 )