Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::Password Class Referencefinal

Protected single-line editor with numeric metadata and constant-mask frame data. The draft and snapshots are immutable PasswordValue identities. Frames do not borrow, decrypt or call application services. PASSWORD reveals grapheme count; NO_ECHO measures one cell and fixes the caret at its origin. Input-event and opted-in clipboard buffers are external plaintext; owned clipboard payload bytes are wiped before release. More...

#include <password.hpp>

Inheritance diagram for portals::Password:
portals::Passwordportals::Password portals::SizedWidget portals::Widget portals::LayoutItem

Public Member Functions

 Password (PasswordOptions options={}, SizePolicy policy=DEFAULT_EDITOR_POLICY)
 Construct an unbound empty presentation.
std::expected< CellSize, TreeError > measure (CellSize available) override
std::expected< void, TreeError > arrange (CellRect local) override
std::expected< void, TreeError > paint (PaintContext &context) override
std::size_t cursor () const noexcept
std::size_t anchor () const noexcept
bool dirty () const noexcept
ComputedStyle styleDefaults () const override
Public Member Functions inherited from portals::SizedWidget
 SizedWidget (SizePolicy policy={})
 Own the supplied policies; checked by layout.
SizePolicy sizePolicy () const override
 Copy current policy without borrowing storage.
Public Member Functions inherited from portals::Widget
virtual ~Widget ()=default
 Destroy on UI after the last active tree borrow.
virtual void mount ()
 Called exactly once after attachment; exceptions are reported.
virtual void unmount ()
 Called once before destruction, children first; cleanup continues on exceptions.
virtual bool styleReadOnly () const noexcept
 Read actual view-only state during style staging; false by default.
const std::shared_ptr< const StyleSnapshot > & computedStyle () const noexcept
 Inspect the last atomically installed theme inside tree.read/frame.
std::uint64_t styleRevision () const noexcept
Public Member Functions inherited from portals::LayoutItem
virtual ~LayoutItem ()=default
 Destroy with the implementing widget.

Friends

class PasswordBinding
class ManagedScene
struct ui::detail::RefAccess

Detailed Description

Protected single-line editor with numeric metadata and constant-mask frame data. The draft and snapshots are immutable PasswordValue identities. Frames do not borrow, decrypt or call application services. PASSWORD reveals grapheme count; NO_ECHO measures one cell and fixes the caret at its origin. Input-event and opted-in clipboard buffers are external plaintext; owned clipboard payload bytes are wiped before release.

Constructor & Destructor Documentation

◆ Password()

portals::Password::Password ( PasswordOptions options = {},
SizePolicy policy = DEFAULT_EDITOR_POLICY )
explicit

Construct an unbound empty presentation.

Parameters
optionsOwning checked presentation/security policy; invalid settings throw invalid_argument.
policyOwning layout size policy.
Exceptions
std::bad_allocOn public placeholder or initial mask allocation.

Member Function Documentation

◆ anchor()

std::size_t portals::Password::anchor ( ) const
noexcept
Returns
Fixed selection endpoint as a UTF-8 byte boundary.

◆ arrange()

std::expected< void, TreeError > portals::Password::arrange ( CellRect local)
overridevirtual
Parameters
localParent-relative rectangle whose extent is retained.
Returns
Success or INVALID_GEOMETRY; scrolling uses numeric grapheme metadata only.

Reimplemented from portals::Widget.

◆ cursor()

std::size_t portals::Password::cursor ( ) const
noexcept
Returns
Active selection endpoint as a UTF-8 byte boundary, without plaintext access.

◆ dirty()

bool portals::Password::dirty ( ) const
noexcept
Returns
Whether a protected draft awaits publication/cancellation.

◆ measure()

std::expected< CellSize, TreeError > portals::Password::measure ( CellSize available)
overridevirtual
Parameters
availableOffered extent, unused for intrinsic measurement.
Returns
Mask/placeholder width plus caret, or one in NO_ECHO; checked geometry error on overflow.

Reimplemented from portals::Widget.

◆ paint()

std::expected< void, TreeError > portals::Password::paint ( PaintContext & context)
overridevirtual
Parameters
contextSynchronous command sink borrowed for this frame only.
Returns
Original sink failure; commands contain only public placeholder or constant mask bytes.

Reimplemented from portals::Widget.

◆ styleDefaults()

ComputedStyle portals::Password::styleDefaults ( ) const
overridevirtual
Returns
Manual control, selection and caret appearance beneath theme declarations.

Reimplemented from portals::Widget.


The documentation for this class was generated from the following file: