Documentation
¶
Index ¶
- Constants
- type Container
- func (c *Container) AddFile(path string) error
- func (c *Container) AddFiles(paths []string)
- func (c *Container) AddPixbuf(pb *gdk.Pixbuf)
- func (c *Container) Enabled() bool
- func (c *Container) Files() []File
- func (c *Container) Reset()
- func (c *Container) SetEnabled(enabled bool)
- func (c *Container) SetMarginStart(margin int)
- type File
- type MessageUploader
- type Open
- type Progress
- type ProgressBar
- type ReusableReader
Constants ¶
const ( ThumbSize = 72 IconSize = 56 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { *gtk.Revealer Scroll *gtk.ScrolledWindow Box *gtk.Box // contains filtered or unexported fields }
func (*Container) SetEnabled ¶
func (*Container) SetMarginStart ¶
SetMarginStart sets the inner margin of the attachments carousel.
type File ¶
File represents a middle format that can be used to create a MessageAttachment.
func (*File) AsAttachment ¶
func (f *File) AsAttachment() cchat.MessageAttachment
AsAttachment turns File into a MessageAttachment. This method will always make a new MessageAttachment and will never return an old one.
The reason being MessageAttachment should never be reused, as it hides the fact that the io.Reader is reusable.
type MessageUploader ¶
func NewMessageUploader ¶
func NewMessageUploader(files []File) *MessageUploader
NewMessageUploader creates a new MessageUploader. It returns nil if there are no files.
type Open ¶
type Open = func() (io.ReadCloser, error)
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress wraps around a ReadCloser and implements a progress state for a reader.
func NewProgress ¶
NewProgress creates a new upload progress state.
type ProgressBar ¶
type ProgressBar struct { PBar *gtk.ProgressBar Name *gtk.Label }
func NewProgressBar ¶
func NewProgressBar(file File) *ProgressBar
type ReusableReader ¶
type ReusableReader struct {
// contains filtered or unexported fields
}
ReusableReader provides an API which allows a reader to be used multiple times. It is NOT thread-safe to use.
func NewReusableReader ¶
func NewReusableReader(open Open) *ReusableReader
NewReusableReader creates a new reader that is reusable after a read failure or a close. The given open() callback MUST be reproducible.