Numworks Epsilon  1.4.1
Graphing Calculator Operating System
TextField::ContentView Class Reference

#include <text_field.h>

Inheritance diagram for TextField::ContentView:
TextInput::ContentView View

Public Member Functions

 ContentView (char *textBuffer, char *draftTextBuffer, size_t textBufferSize, KDText::FontSize size, float horizontalAlignment=0.0f, float verticalAlignment=0.5f, KDColor textColor=KDColorBlack, KDColor=KDColorWhite)
 
void setDraftTextBuffer (char *draftTextBuffer)
 
void drawRect (KDContext *ctx, KDRect rect) const override
 
bool isEditing () const
 
const char * text () const override
 
size_t editedTextLength () const override
 
char * textBuffer ()
 
char * draftTextBuffer ()
 
int bufferSize ()
 
void setText (const char *text)
 
void setAlignment (float horizontalAlignment, float verticalAlignment)
 
void setEditing (bool isEditing, bool reinitDraftBuffer)
 
void reinitDraftTextBuffer ()
 
bool insertTextAtLocation (const char *text, int location) override
 
KDSize minimalSizeForOptimalDisplay () const override
 
bool removeChar () override
 
bool removeEndOfLine () override
 
- Public Member Functions inherited from TextInput::ContentView
 ContentView (KDText::FontSize size, KDColor textColor, KDColor backgroundColor)
 
void setBackgroundColor (KDColor backgroundColor)
 
KDColor backgroundColor () const
 
void setTextColor (KDColor textColor)
 
size_t cursorLocation () const
 
void setCursorLocation (int cursorLocation)
 
KDRect cursorRect ()
 
- Public Member Functions inherited from View
 View ()
 
virtual ~View ()
 
 View (const View &other)=delete
 
 View (View &&other)=delete
 
Viewoperator= (const View &other)=delete
 
Viewoperator= (View &&other)=delete
 
void resetSuperview ()
 
void setSize (KDSize size)
 
void setFrame (KDRect frame)
 
KDPoint pointFromPointInView (View *view, KDPoint point)
 
KDRect bounds () const
 
Viewsubview (int index)
 

Static Public Attributes

static constexpr int k_maxBufferSize = 152
 

Additional Inherited Members

- Protected Member Functions inherited from TextInput::ContentView
void reloadRectFromCursorPosition (size_t index, bool lineBreak=false)
 
- Protected Member Functions inherited from View
void markRectAsDirty (KDRect rect)
 
- Protected Attributes inherited from TextInput::ContentView
TextCursorView m_cursorView
 
KDText::FontSize m_fontSize
 
KDColor m_textColor
 
KDColor m_backgroundColor
 
size_t m_cursorIndex
 
- Protected Attributes inherited from View
KDRect m_frame
 

Detailed Description

Definition at line 29 of file text_field.h.

Constructor & Destructor Documentation

◆ ContentView()

TextField::ContentView::ContentView ( char *  textBuffer,
char *  draftTextBuffer,
size_t  textBufferSize,
KDText::FontSize  size,
float  horizontalAlignment = 0.0f,
float  verticalAlignment = 0.5f,
KDColor  textColor = KDColorBlack,
KDColor  backgroundColor = KDColorWhite 
)

Definition at line 8 of file text_field.cpp.

Member Function Documentation

◆ bufferSize()

int TextField::ContentView::bufferSize ( )
inline

Definition at line 39 of file text_field.h.

◆ draftTextBuffer()

char* TextField::ContentView::draftTextBuffer ( )
inline

Definition at line 38 of file text_field.h.

◆ drawRect()

void TextField::ContentView::drawRect ( KDContext ctx,
KDRect  rect 
) const
overridevirtual

Reimplemented from View.

Definition at line 25 of file text_field.cpp.

◆ editedTextLength()

size_t TextField::ContentView::editedTextLength ( ) const
overridevirtual

Implements TextInput::ContentView.

Definition at line 41 of file text_field.cpp.

◆ insertTextAtLocation()

bool TextField::ContentView::insertTextAtLocation ( const char *  text,
int  location 
)
overridevirtual

Implements TextInput::ContentView.

Definition at line 81 of file text_field.cpp.

◆ isEditing()

bool TextField::ContentView::isEditing ( ) const
inline

Definition at line 34 of file text_field.h.

◆ minimalSizeForOptimalDisplay()

KDSize TextField::ContentView::minimalSizeForOptimalDisplay ( ) const
overridevirtual

Reimplemented from View.

Definition at line 105 of file text_field.cpp.

◆ reinitDraftTextBuffer()

void TextField::ContentView::reinitDraftTextBuffer ( )

Definition at line 75 of file text_field.cpp.

◆ removeChar()

bool TextField::ContentView::removeChar ( )
overridevirtual

Implements TextInput::ContentView.

Definition at line 113 of file text_field.cpp.

◆ removeEndOfLine()

bool TextField::ContentView::removeEndOfLine ( )
overridevirtual

Implements TextInput::ContentView.

Definition at line 133 of file text_field.cpp.

◆ setAlignment()

void TextField::ContentView::setAlignment ( float  horizontalAlignment,
float  verticalAlignment 
)

Definition at line 57 of file text_field.cpp.

◆ setDraftTextBuffer()

void TextField::ContentView::setDraftTextBuffer ( char *  draftTextBuffer)

Definition at line 21 of file text_field.cpp.

◆ setEditing()

void TextField::ContentView::setEditing ( bool  isEditing,
bool  reinitDraftBuffer 
)

Definition at line 63 of file text_field.cpp.

◆ setText()

void TextField::ContentView::setText ( const char *  text)

Definition at line 45 of file text_field.cpp.

◆ text()

const char * TextField::ContentView::text ( ) const
overridevirtual

Implements TextInput::ContentView.

Definition at line 34 of file text_field.cpp.

◆ textBuffer()

char* TextField::ContentView::textBuffer ( )
inline

Definition at line 37 of file text_field.h.

Member Data Documentation

◆ k_maxBufferSize

constexpr int TextField::ContentView::k_maxBufferSize = 152
static

Definition at line 56 of file text_field.h.


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