paragraph

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package paragraph contains models for paragraph elements and their components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compose

type Compose struct {
	RunItem
	CircleType        enumtype.ComposeCircleType
	CharSz            *int16
	ComposeType       enumtype.ComposeType
	ComposeText       string
	ComposeCharPrList *baseobject.ObjectList[*compose.ComposeCharPr]
}

func NewCompose

func NewCompose() *Compose

func (*Compose) AddCharPr

func (c *Compose) AddCharPr(charPr *compose.ComposeCharPr)

func (*Compose) Clone

func (c *Compose) Clone() baseobject.HWPXObject

func (*Compose) CopyFrom

func (c *Compose) CopyFrom(from *Compose)

func (*Compose) CreateComposeCharPrList

func (c *Compose) CreateComposeCharPrList()

func (*Compose) GetObjectType

func (c *Compose) GetObjectType() baseobject.ObjectType

type Ctrl

type Ctrl struct {
	RunItem
	ItemList []baseobject.HWPXObject
}

Ctrl represents a control container (hp:ctrl) that holds various document controls such as column definitions, fields, bookmarks, headers, and footers.

func NewCtrl

func NewCtrl() *Ctrl

NewCtrl creates a new empty Ctrl container.

func (*Ctrl) AddAutoNum

func (c *Ctrl) AddAutoNum(autoNum *ctrl.AutoNum)

AddAutoNum adds an automatic numbering control.

func (*Ctrl) AddBookmark

func (c *Ctrl) AddBookmark(bookmark *ctrl.Bookmark)

AddBookmark adds a bookmark control.

func (*Ctrl) AddColPr

func (c *Ctrl) AddColPr(colPr *ctrl.ColPr)

AddColPr adds a column properties control.

func (*Ctrl) AddCtrlItem

func (c *Ctrl) AddCtrlItem(item baseobject.HWPXObject)

AddCtrlItem appends a generic control item to the list.

func (*Ctrl) AddEndNote

func (c *Ctrl) AddEndNote(endNote *ctrl.EndNote)

AddEndNote adds an endnote control.

func (*Ctrl) AddFieldBegin

func (c *Ctrl) AddFieldBegin(fieldBegin *ctrl.FieldBegin)

AddFieldBegin adds a field start control.

func (*Ctrl) AddFieldEnd

func (c *Ctrl) AddFieldEnd(fieldEnd *ctrl.FieldEnd)

AddFieldEnd adds a field end control.

func (*Ctrl) AddFootNote

func (c *Ctrl) AddFootNote(footNote *ctrl.FootNote)

AddFootNote adds a footnote control.

func (*Ctrl) AddFooter

func (c *Ctrl) AddFooter(footer *ctrl.Footer)

AddFooter adds a footer control.

func (*Ctrl) AddHeader

func (c *Ctrl) AddHeader(header *ctrl.Header)

AddHeader adds a header control.

func (*Ctrl) AddHiddenComment

func (c *Ctrl) AddHiddenComment(hiddenComment *ctrl.HiddenComment)

AddHiddenComment adds a hidden comment control.

func (*Ctrl) AddIndexmark

func (c *Ctrl) AddIndexmark(indexmark *ctrl.Indexmark)

AddIndexmark adds an index mark control.

func (*Ctrl) AddNewAutoNum

func (c *Ctrl) AddNewAutoNum() *ctrl.AutoNum

AddNewAutoNum creates and adds a new AutoNum control.

func (*Ctrl) AddNewBookmark

func (c *Ctrl) AddNewBookmark() *ctrl.Bookmark

AddNewBookmark creates and adds a new Bookmark control.

func (*Ctrl) AddNewColPr

func (c *Ctrl) AddNewColPr() *ctrl.ColPr

AddNewColPr creates and adds a new ColPr control.

func (*Ctrl) AddNewEndNote

func (c *Ctrl) AddNewEndNote() *ctrl.EndNote

AddNewEndNote creates and adds a new EndNote control.

func (*Ctrl) AddNewFieldBegin

func (c *Ctrl) AddNewFieldBegin() *ctrl.FieldBegin

AddNewFieldBegin creates and adds a new FieldBegin control.

func (*Ctrl) AddNewFieldEnd

func (c *Ctrl) AddNewFieldEnd() *ctrl.FieldEnd

AddNewFieldEnd creates and adds a new FieldEnd control.

func (*Ctrl) AddNewFootNote

func (c *Ctrl) AddNewFootNote() *ctrl.FootNote

AddNewFootNote creates and adds a new FootNote control.

func (*Ctrl) AddNewFooter

func (c *Ctrl) AddNewFooter() *ctrl.Footer

AddNewFooter creates and adds a new Footer control.

func (*Ctrl) AddNewHeader

func (c *Ctrl) AddNewHeader() *ctrl.Header

AddNewHeader creates and adds a new Header control.

func (*Ctrl) AddNewHiddenComment

func (c *Ctrl) AddNewHiddenComment() *ctrl.HiddenComment

AddNewHiddenComment creates and adds a new HiddenComment control.

func (*Ctrl) AddNewIndexmark

func (c *Ctrl) AddNewIndexmark() *ctrl.Indexmark

AddNewIndexmark creates and adds a new Indexmark control.

func (*Ctrl) AddNewNewNum

func (c *Ctrl) AddNewNewNum() *ctrl.NewNum

AddNewNewNum creates and adds a new NewNum control.

func (*Ctrl) AddNewNum

func (c *Ctrl) AddNewNum(newNum *ctrl.NewNum)

AddNewNum adds a "new number" control.

func (*Ctrl) AddNewPageHiding

func (c *Ctrl) AddNewPageHiding() *ctrl.PageHiding

AddNewPageHiding creates and adds a new PageHiding control.

func (*Ctrl) AddNewPageNum

func (c *Ctrl) AddNewPageNum() *ctrl.PageNum

AddNewPageNum creates and adds a new PageNum control.

func (*Ctrl) AddNewPageNumCtrl

func (c *Ctrl) AddNewPageNumCtrl() *ctrl.PageNumCtrl

AddNewPageNumCtrl creates and adds a new PageNumCtrl control.

func (*Ctrl) AddPageHiding

func (c *Ctrl) AddPageHiding(pageHiding *ctrl.PageHiding)

AddPageHiding adds a page element hiding control.

func (*Ctrl) AddPageNum

func (c *Ctrl) AddPageNum(pageNum *ctrl.PageNum)

AddPageNum adds a page number control.

func (*Ctrl) AddPageNumCtrl

func (c *Ctrl) AddPageNumCtrl(pageNumCtrl *ctrl.PageNumCtrl)

AddPageNumCtrl adds a page number display control.

func (*Ctrl) Clone

func (c *Ctrl) Clone() baseobject.HWPXObject

Clone returns a deep copy of the Ctrl container.

func (*Ctrl) CopyFrom

func (c *Ctrl) CopyFrom(from *Ctrl)

CopyFrom copies all items from another Ctrl container.

func (*Ctrl) GetObjectType

func (c *Ctrl) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the control element.

type Dutmal

type Dutmal struct {
	RunItem
	PosType    enumtype.DutmalPosType
	SzRatio    *int
	Option     *int
	StyleIDRef string
	Align      enumtype.HorizontalAlign2
	MainText   *baseobject.HasOnlyText
	SubText    *baseobject.HasOnlyText
}

Dutmal represents a ruby text control (hp:dutmal), which places small characters above or below main text.

func NewDutmal

func NewDutmal() *Dutmal

NewDutmal creates a new Dutmal object.

func (*Dutmal) Clone

func (d *Dutmal) Clone() baseobject.HWPXObject

Clone returns a deep copy of the Dutmal object.

func (*Dutmal) CopyFrom

func (d *Dutmal) CopyFrom(from *Dutmal)

CopyFrom copies all data from another Dutmal object.

func (*Dutmal) CreateMainText

func (d *Dutmal) CreateMainText()

CreateMainText initializes the main text container.

func (*Dutmal) CreateSubText

func (d *Dutmal) CreateSubText()

CreateSubText initializes the ruby (sub) text container.

func (*Dutmal) GetObjectType

func (d *Dutmal) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the dutmal element.

type LineSeg

type LineSeg struct {
	Textpos    *int
	Vertpos    *int
	Vertsize   *int
	Textheight *int
	Baseline   *int
	Spacing    *int
	Horzpos    *int
	Horzsize   *int
	Flags      *int
}

LineSeg represents a line segment (hp:lineseg) within a paragraph, containing layout information such as position, size, and spacing.

func NewLineSeg

func NewLineSeg() *LineSeg

NewLineSeg creates a new LineSeg object.

func (*LineSeg) Clone

func (l *LineSeg) Clone() baseobject.HWPXObject

Clone returns a deep copy of the LineSeg.

func (*LineSeg) GetObjectType

func (l *LineSeg) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the line segment element.

type MarkpenBeginForRun

type MarkpenBeginForRun struct {
	RunItem
	BeginColor string
}

MarkpenBeginForRun represents a markpen start marker specifically designed to be placed directly within a run element.

func NewMarkpenBeginForRun

func NewMarkpenBeginForRun() *MarkpenBeginForRun

NewMarkpenBeginForRun creates a new MarkpenBeginForRun object.

func (*MarkpenBeginForRun) Clone

Clone returns a deep copy of the MarkpenBeginForRun object.

func (*MarkpenBeginForRun) GetObjectType

func (m *MarkpenBeginForRun) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the markpen element.

type Para

type Para struct {
	baseobject.SwitchableObject
	Id           string
	ParaPrIDRef  string
	StyleIDRef   string
	PageBreak    *bool
	ColumnBreak  *bool
	Merged       *bool
	ParaTcId     string
	Runs         []*Run
	LineSegArray *baseobject.ObjectList[*LineSeg]
}

Para represents a single paragraph (hp:p) in an HWPX document. It consists of a collection of runs (hp:run) and optional line segment information.

func NewPara

func NewPara() *Para

NewPara creates a new empty paragraph.

func (*Para) AddNewLineSeg

func (p *Para) AddNewLineSeg() *LineSeg

AddNewLineSeg creates and appends a new LineSeg to the paragraph.

func (*Para) AddNewRun

func (p *Para) AddNewRun() *Run

AddNewRun creates and appends a new Run to the paragraph.

func (*Para) AddRun

func (p *Para) AddRun(run *Run)

AddRun appends a run to the paragraph.

func (*Para) Clone

func (p *Para) Clone() baseobject.HWPXObject

func (*Para) CopyFrom

func (p *Para) CopyFrom(from *Para)

func (*Para) CountOfRun

func (p *Para) CountOfRun() int

CountOfRun returns the number of runs in the paragraph.

func (*Para) CreateLineSegArray

func (p *Para) CreateLineSegArray()

CreateLineSegArray initializes the LineSegArray.

func (*Para) GetObjectType

func (p *Para) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the paragraph element.

func (*Para) GetRun

func (p *Para) GetRun(index int) *Run

GetRun returns the run at the specified index.

type Run

type Run struct {
	baseobject.SwitchableObject
	CharPrIDRef string
	CharTcId    string
	SecPr       *secpr.SecPr
	RunItems    []baseobject.HWPXObject
}

Run represents a run of text (hp:run) within a paragraph. It shares common properties via CharPrIDRef and contains a list of run items such as text (hp:t), controls (hp:ctrl), or shapes.

func NewRun

func NewRun() *Run

NewRun creates a new empty Run.

func (*Run) AddArc

func (r *Run) AddArc(arc baseobject.HWPXObject)

AddArc adds an arc drawing object as a run item.

func (*Run) AddButton

func (r *Run) AddButton(btn baseobject.HWPXObject)

AddButton adds a form button object as a run item.

func (*Run) AddChart

func (r *Run) AddChart(chart baseobject.HWPXObject)

AddChart adds a chart object as a run item.

func (*Run) AddCheckButton

func (r *Run) AddCheckButton(checkBtn baseobject.HWPXObject)

AddCheckButton adds a form check button object as a run item.

func (*Run) AddComboBox

func (r *Run) AddComboBox(comboBox baseobject.HWPXObject)

AddComboBox adds a form combo box object as a run item.

func (*Run) AddCompose

func (r *Run) AddCompose(compose *Compose)

AddCompose adds a composite character object as a run item.

func (*Run) AddConnectLine

func (r *Run) AddConnectLine(connectLine baseobject.HWPXObject)

AddConnectLine adds a connector line object as a run item.

func (*Run) AddContainer

func (r *Run) AddContainer(container baseobject.HWPXObject)

AddContainer adds a container object as a run item.

func (*Run) AddCtrl

func (r *Run) AddCtrl(ctrl *Ctrl)

func (*Run) AddCurve

func (r *Run) AddCurve(curve baseobject.HWPXObject)

AddCurve adds a curve drawing object as a run item.

func (*Run) AddDutmal

func (r *Run) AddDutmal(dutmal *Dutmal)

AddDutmal adds a dutmal (ruby text) object as a run item.

func (*Run) AddEdit

func (r *Run) AddEdit(edit baseobject.HWPXObject)

AddEdit adds a form edit box object as a run item.

func (*Run) AddEllipse

func (r *Run) AddEllipse(ellipse baseobject.HWPXObject)

AddEllipse adds an ellipse drawing object as a run item.

func (*Run) AddEquation

func (r *Run) AddEquation(equation baseobject.HWPXObject)

AddEquation adds an equation object as a run item.

func (*Run) AddLine

func (r *Run) AddLine(line baseobject.HWPXObject)

AddLine adds a line drawing object as a run item.

func (*Run) AddListBox

func (r *Run) AddListBox(listBox baseobject.HWPXObject)

AddListBox adds a form list box object as a run item.

func (*Run) AddMarkpenBegin

func (r *Run) AddMarkpenBegin(markpenBegin *MarkpenBeginForRun)

AddMarkpenBegin adds a markpen start marker as a run item.

func (*Run) AddNewCtrl

func (r *Run) AddNewCtrl() *Ctrl

AddNewCtrl creates and appends a new Ctrl container to the run.

func (*Run) AddNewT

func (r *Run) AddNewT() *T

AddNewT creates and appends a new Text container (hp:t) to the run.

func (*Run) AddOLE

func (r *Run) AddOLE(ole baseobject.HWPXObject)

AddOLE adds an OLE object as a run item.

func (*Run) AddPicture

func (r *Run) AddPicture(pic baseobject.HWPXObject)

AddPicture adds a picture object as a run item.

func (*Run) AddPolygon

func (r *Run) AddPolygon(polygon baseobject.HWPXObject)

AddPolygon adds a polygon drawing object as a run item.

func (*Run) AddRadioButton

func (r *Run) AddRadioButton(radioBtn baseobject.HWPXObject)

AddRadioButton adds a form radio button object as a run item.

func (*Run) AddRectangle

func (r *Run) AddRectangle(rect baseobject.HWPXObject)

AddRectangle adds a rectangle drawing object as a run item.

func (*Run) AddRunItem

func (r *Run) AddRunItem(item baseobject.HWPXObject)

AddRunItem appends a generic run item to the run.

func (*Run) AddScrollBar

func (r *Run) AddScrollBar(scrollBar baseobject.HWPXObject)

AddScrollBar adds a form scroll bar object as a run item.

func (*Run) AddT

func (r *Run) AddT(t *T)

func (*Run) AddTable

func (r *Run) AddTable(table baseobject.HWPXObject)

AddTable adds a table object as a run item.

func (*Run) AddTextArt

func (r *Run) AddTextArt(textArt baseobject.HWPXObject)

AddTextArt adds a text art object as a run item.

func (*Run) AddVideo

func (r *Run) AddVideo(video baseobject.HWPXObject)

AddVideo adds a video object as a run item.

func (*Run) Clone

func (r *Run) Clone() baseobject.HWPXObject

Clone returns a deep copy of the Run.

func (*Run) CopyFrom

func (r *Run) CopyFrom(from *Run)

func (*Run) CreateSecPr

func (r *Run) CreateSecPr()

CreateSecPr initializes the section properties for this run.

func (*Run) GetObjectType

func (r *Run) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the run element.

type RunItem

type RunItem struct {
	baseobject.SwitchableObject
	ObjectType baseobject.ObjectType
}

RunItem is a base structure for all elements that can be placed within a run (hp:run). It includes support for switch elements and identifies the specific object type.

func (*RunItem) CopyFrom

func (r *RunItem) CopyFrom(from *RunItem)

CopyFrom copies the base properties from another RunItem.

func (*RunItem) GetObjectType

func (r *RunItem) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for this run item.

type T

type T struct {
	baseobject.SwitchableObject
	CharPrIDRef string
	Items       *baseobject.ObjectList[baseobject.TItem]
}

T represents a text container (hp:t) that holds plain text and text-related inline elements.

func NewT

func NewT() *T

NewT creates a new empty text container.

func (*T) AddDeleteBegin

func (tObj *T) AddDeleteBegin(deleteBegin *t.DeleteBegin)

AddDeleteBegin appends a track change delete start marker.

func (*T) AddDeleteEnd

func (tObj *T) AddDeleteEnd(deleteEnd *t.DeleteEnd)

AddDeleteEnd appends a track change delete end marker.

func (*T) AddFWSpace

func (tObj *T) AddFWSpace()

AddFWSpace appends a full-width space element.

func (*T) AddHyphen

func (tObj *T) AddHyphen()

AddHyphen appends a hyphen element.

func (*T) AddInsertBegin

func (tObj *T) AddInsertBegin(insertBegin *t.InsertBegin)

AddInsertBegin appends a track change insert start marker.

func (*T) AddInsertEnd

func (tObj *T) AddInsertEnd(insertEnd *t.InsertEnd)

AddInsertEnd appends a track change insert end marker.

func (*T) AddLineBreak

func (tObj *T) AddLineBreak()

AddLineBreak appends a line break element.

func (*T) AddMarkpenBegin

func (tObj *T) AddMarkpenBegin(markpenBegin *t.MarkpenBegin)

AddMarkpenBegin appends a markpen start marker.

func (*T) AddMarkpenEnd

func (tObj *T) AddMarkpenEnd()

AddMarkpenEnd appends a markpen end marker.

func (*T) AddNBSpace

func (tObj *T) AddNBSpace()

AddNBSpace appends a non-breaking space element.

func (*T) AddTab

func (tObj *T) AddTab(tab *t.Tab)

AddTab appends a tab character element.

func (*T) AddText

func (tObj *T) AddText(text string)

AddText appends a plain text string to the container.

func (*T) AddTitleMark

func (tObj *T) AddTitleMark(titleMark *t.TitleMark)

AddTitleMark appends a title mark element.

func (*T) Clone

func (tObj *T) Clone() baseobject.HWPXObject

Clone returns a deep copy of the T object.

func (*T) CopyFrom

func (tObj *T) CopyFrom(from *T)

CopyFrom copies all items and properties from another T object.

func (*T) GetObjectType

func (tObj *T) GetObjectType() baseobject.ObjectType

GetObjectType returns the type identifier for the text element.

func (*T) IsEmpty

func (tObj *T) IsEmpty() bool

IsEmpty returns true if the text container has no items.

func (*T) IsOnlyText

func (tObj *T) IsOnlyText() bool

IsOnlyText returns true if the container contains only a single plain text item.

func (*T) OnlyText

func (tObj *T) OnlyText() string

OnlyText returns the plain text content if the container is simple text only.

Directories

Path Synopsis
Package paraobject contains models for various objects that can be embedded in paragraphs, such as tables, pictures, and shapes.
Package paraobject contains models for various objects that can be embedded in paragraphs, such as tables, pictures, and shapes.
combobox
Package combobox contains models for selection elements like combo boxes and list boxes.
Package combobox contains models for selection elements like combo boxes and list boxes.
drawingobject
Package drawingobject provides base models for all drawing shapes like rectangles and lines.
Package drawingobject provides base models for all drawing shapes like rectangles and lines.
formobject
Package formobject contains base models for interactive form elements like buttons and edit boxes.
Package formobject contains base models for interactive form elements like buttons and edit boxes.
picture
Package picture contains models for image properties and drawing shapes.
Package picture contains models for image properties and drawing shapes.
picture/effects
Package effects contains models for visual effects like shadows and glows.
Package effects contains models for visual effects like shadows and glows.
shapeobject
Package shapeobject provides base models for all HWPX shape and control objects.
Package shapeobject provides base models for all HWPX shape and control objects.
table
Package table contains models for table-specific components like rows and cells.
Package table contains models for table-specific components like rows and cells.
Package secpr contains models for section properties, including page layout and notes.
Package secpr contains models for section properties, including page layout and notes.
notepr
Package notepr contains models for footnote and endnote properties.
Package notepr contains models for footnote and endnote properties.
pagepr
Package pagepr contains models for physical page properties like size and orientation.
Package pagepr contains models for physical page properties like size and orientation.
t

Jump to

Keyboard shortcuts

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