data

package
v0.0.0-...-ac41919 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	// contains filtered or unexported fields
}

func (*Item) Append

func (i *Item) Append(item *Item)

Append places the provided item in the tail position of the visitor's children list.

func (*Item) Collapsed

func (i *Item) Collapsed() bool

Collapsed returns the item "collapsed" flag value.

func (*Item) Demote

func (i *Item) Demote()

func (*Item) Depth

func (i *Item) Depth() int

Depth returns the tree depth of the item relative to the workspace root. If the item is not in the workspace root, -1 is returned.

func (*Item) Detach

func (i *Item) Detach()

Detach detaches the item from its parent and siblings.

func (*Item) DisplayedChildren

func (i *Item) DisplayedChildren() []*Item

DisplayedChildren returns a flattened list of non-collapsed child items.

func (*Item) Head

func (i *Item) Head() *Item

func (*Item) MarshalXML

func (i *Item) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Item) MoveAbove

func (i *Item) MoveAbove(target *Item)

MoveAbove moves item above the target.

func (*Item) MoveBelow

func (i *Item) MoveBelow(target *Item)

MoveBelow moves item below the target.

func (*Item) MoveDown

func (i *Item) MoveDown()

MoveDown places item after its next sibling. If the next sibling is nil, this method does nothing.

func (*Item) MoveUp

func (i *Item) MoveUp()

MoveUp places item before its previous sibling. If the prevoius sibling is nil, this method does nothing.

func (*Item) Next

func (i *Item) Next() *Item

Next returns the next sibling item.

func (*Item) NextRow

func (i *Item) NextRow() *Item

NextRow return the item on next outline row, taking the "collapsed" state into consideration.

func (*Item) Parent

func (i *Item) Parent() *Item

func (*Item) Prepend

func (i *Item) Prepend(item *Item)

Prepend places the provided item in the head position of the visitor's children list.

func (*Item) Prev

func (i *Item) Prev() *Item

Prev returns the previous sibling item.

func (*Item) PrevRow

func (i *Item) PrevRow() *Item

PrevRow return the item on previous outline row, taking the "collapsed" state into consideration.

func (*Item) Promote

func (i *Item) Promote()

func (*Item) RealRoot

func (i *Item) RealRoot() *Item

RealRoot returns the root of the tree the item belongs to.

func (*Item) SetCollapsed

func (i *Item) SetCollapsed(value, recursive bool)

SetCollapsed set the item "collapsed" flag value. If recursive is true it walks through the child items as well.

func (*Item) SetStatus

func (i *Item) SetStatus(s Status)

SetStatus toggles the item "done" flag value and marks the item as dirty.

func (*Item) SetTitle

func (i *Item) SetTitle(val string)

SetTitle updates the item title value and marks the item as dirty.

func (*Item) Status

func (i *Item) Status() Status

Status returns the item status.

func (*Item) Tail

func (i *Item) Tail() *Item

func (*Item) Title

func (i *Item) Title() string

Title returns the item title.

func (*Item) ToDoStats

func (item *Item) ToDoStats() (int, int)

ToDoStats returns the number of children in statuses "Done" or "Canceled" and the number of children in statuses other than "None".

func (*Item) UnmarshalXML

func (i *Item) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Status

type Status int
const (
	StatusNone Status = iota
	StatusToDo
	StatusDone
	StatusCanceled
	StatusWaiting
	StatusScheduled
)

func ParseStatus

func ParseStatus(s string) (Status, error)

func (Status) String

func (s Status) String() string

type Workspace

type Workspace struct {
	// contains filtered or unexported fields
}

func LoadWorkspace

func LoadWorkspace(directory string) (*Workspace, error)

func NewWorkspace

func NewWorkspace(directory, rootTitle string) *Workspace

func (*Workspace) Cursor

func (w *Workspace) Cursor() *Item

func (*Workspace) MarshalXML

func (w *Workspace) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Workspace) NewItem

func (w *Workspace) NewItem(title string) *Item

NewItem returns a new item not attached to any list.

func (*Workspace) Root

func (w *Workspace) Root() *Item

func (*Workspace) Save

func (w *Workspace) Save() error

func (*Workspace) SetCursor

func (w *Workspace) SetCursor(item *Item)

func (*Workspace) SetRoot

func (w *Workspace) SetRoot(item *Item)

func (*Workspace) UnmarshalXML

func (w *Workspace) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*Workspace) ZoomOut

func (w *Workspace) ZoomOut()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL