Documentation ¶
Overview ¶
Package GoGmail is a mail checker applet for Cairo-Dock.
Index ¶
Constants ¶
const ( NoDisplay = "no" QuickInfo = "quickinfo" EmblemSmall = "small emblem" EmblemLarge = "large emblem" )
Renderers.
const ( MailClientLocation = iota // Open mail client as location, with cdglobal.CmdOpen. MailClientProgram // Open mail client as command. MailClientMonitor // Open mail client as command and monitor it. )
Mail client action settings.
const ( ActionNone = iota ActionOpenClient ActionShowMails ActionCheckMail ActionRegister )
List of actions defined in this applet. Actions order in this list must match the order in defineActions. The reference in shortkey declaration must also match.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Applet ¶
type Applet struct { cdtype.AppBase // Applet base and dock connection. // contains filtered or unexported fields }
Applet defines a dock applet.
type Email ¶
type Email struct { Title string `xml:"title"` Summary string `xml:"summary"` Modified string `xml:"modified"` Issued string `xml:"issued"` AuthorName string `xml:"author>name"` AuthorEmail string `xml:"author>email"` }
Email is a single email data. Disabled fields are just examples of what is supposed to be parsed if you want to use them.
type Feed ¶
type Feed struct { Title string `xml:"title"` Tagline string `xml:"tagline"` Total int `xml:"fullcount"` //~ Link string `xml:"href,attr"` //~ Modified string `xml:"modified"` Mail []*Email `xml:"entry"` // Display fields. New int Plural bool MailsNew []*Email // contains filtered or unexported fields }
Feed contains Gmail inbox data. Some fields are disabled because they are unused. They could be enabled simply by uncommenting them.
func (*Feed) Check ¶
func (feed *Feed) Check()
Check callback for poller mail checking. Launch the check mail action. Check for new mails and launch the result callback with the mails count delta (change since last check).
func (*Feed) IsValid ¶
IsValid return true is user informations were provided. Only tells if login and password were submitted, not if they are valid.
type Mailbox ¶
type Mailbox interface { // Timer management. Check() // Mail management. IsValid() bool Count() (nbInbox int) Clear() LoadLogin(filepath string) SaveLogin(login string) }
Mailbox is a mail client interface.
type RenderedNone ¶
type RenderedNone struct{}
RenderedNone is a stub. Used for the none choice and as a fallback for SVG renderer if it failed to load its data.
func NewRenderedNone ¶
func NewRenderedNone() *RenderedNone
NewRenderedNone create a new null renderer.
type RenderedQuick ¶
type RenderedQuick struct { cdtype.RenderSimple // Controler to the Cairo-Dock icon. // contains filtered or unexported fields }
RenderedQuick displays mail count on the icon QuickInfo.
func NewRenderedQuick ¶
func NewRenderedQuick(app cdtype.RenderSimple) *RenderedQuick
NewRenderedQuick create a new text renderer for quick-info.
type RenderedSVG ¶
type RenderedSVG struct { cdtype.RenderSimple // Controler to the Cairo-Dock icon. // contains filtered or unexported fields }
RenderedSVG displays mail count in a hacked svg icon. The icon is rewritten with the new value on every change. In case of file loading problem, a new RenderedNone will be returned, so a valid renderer will always be provided.
type RendererMail ¶
RendererMail is a display interface to show inbox mail count on the icon.
func NewRenderedSVG ¶
func NewRenderedSVG(app cdtype.RenderSimple, typ string) (RendererMail, error)
NewRenderedSVG create a new SVG image renderer.