Guiliani  Version 2.5 revision 7293 (documentation build 13)
GUIBaseInputField.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUIBASEINPUTFIELD__H_
11#define GUIBASEINPUTFIELD__H_
12
13#include "GUICompositeObject.h"
14#include "GUIEditableText.h"
15#include "GUIEdit.h"
16#include "GUICommand.h"
17
18class CGUIValidator;
19
21
94{
95public:
107 CGUICompositeObject* const pkParent,
108 const eC_Value& vX, const eC_Value& vY,
109 const eC_Value& vWidth, const eC_Value& vHeight,
110 const eC_String &rkText,
112 const ObjectHandle_t &eID = NO_HANDLE);
113
122 CGUICompositeObject* const pkParent,
123 const CGUIRect &kRect,
124 const eC_String &rkText,
126 const ObjectHandle_t &eID = NO_HANDLE);
127
130
135
141
147 virtual eC_Bool SetValue(const CGUIValue& rkValue);
148
153 virtual void SetText(const eC_String& rkTextString);
154
160 eC_String GetText() const;
161
166
171 eC_String GetPassword() const;
172
177 void SetWidth(const eC_Value& vWidth);
178
183 void SetHeight(const eC_Value& vHeight);
184
194 void SetBorderWidths(eC_Value vLeftBorder, eC_Value vRightBorder, eC_Value vTopBorder, eC_Value vBottomBorder);
195
200 void SetBorderWidth(eC_Value vBorderWidth);
201
209 void GetBorderWidths(eC_Value& vLeft, eC_Value& vRight, eC_Value& vTop, eC_Value& vBottom) const;
210
212 eC_Value GetBorderWidthLeft() const;
213
215 eC_Value GetBorderWidthRight() const;
216
218 eC_Value GetBorderWidthTop() const;
219
221 eC_Value GetBorderWidthBottom() const;
222
227 void SetSelectedTextColor(eC_UInt uiCol) const;
228
233 eC_UInt GetSelectedTextColor() const;
234
238 void SetMaxLength(eC_Int iMaxLength);
239
241 eC_Int GetMaxLength() const;
242
249
256
261 void SetPasswordMode(eC_String& kPwdStr);
262
268
274
281 void SetValidator(CGUIValidator* pValidator);
282
287
295 void Validate();
296
300 void LoseFocus();
301
303 void GetFocus();
304
308 virtual eC_Bool DoDraw();
309
328 virtual eC_Bool DoKeyDown(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers);
329
330 virtual eC_Bool DoKeyUp(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers);
331
335 virtual void StartEditing();
336
347 eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
348
352
358
366
371
379
384
392
397
402 virtual void RemoveObject(CGUIObject* pkObject);
403
404#ifdef GUILIANI_STREAM_GUI
405 virtual void ReadFromStream();
406#endif
407
408#ifdef GUILIANI_WRITE_GUI
409 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
410#endif
411
412protected:
415
419
422
425
426private:
428 void Init(const eC_String& rkString, CGUIEdit::AcceptedChars_t eAcceptedChars);
429
433 void CopyAttributes(const CGUIBaseInputField& kSource);
434
435private:
437 CGUIValidator* m_pkValidator;
438};
439#endif
GUIKeyIdentifier_t
Platform independent key identifiers.
Definition: GUIEventTypeResource.h:205
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
Base class for text input controls.
Definition: GUIBaseInputField.h:94
CGUICommandPtr m_pkActionCmd
Definition: GUIBaseInputField.h:418
CGUIEdit::AcceptedChars_t GetAcceptedChars() const
CGUISubject m_kInputFinishedSubject
Subject informing observers whenever the input is finished.
Definition: GUIBaseInputField.h:424
void RemoveTextChangedObserver(CGUIObserver *pkObserver)
virtual void StartEditing()
eC_String GetPassword() const
eC_Value GetBorderWidthRight() const
CGUIBaseInputField(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_String &rkText, CGUIEdit::AcceptedChars_t eAcceptedChars=CGUIEdit::AC_ALL, const ObjectHandle_t &eID=NO_HANDLE)
virtual eC_Bool DoKeyDown(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
void SetLabel(CGUIEditableText *pkText)
void SetWidth(const eC_Value &vWidth)
void RemoveInputStartedObserver(CGUIObserver *pkObserver)
eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
eC_String GetText() const
CGUIBaseInputField & operator=(const CGUIBaseInputField &kSource)
virtual void RemoveObject(CGUIObject *pkObject)
eC_Value GetBorderWidthLeft() const
void SetBorderWidths(eC_Value vLeftBorder, eC_Value vRightBorder, eC_Value vTopBorder, eC_Value vBottomBorder)
void SetHeight(const eC_Value &vHeight)
void RemoveInputFinishedObserver(CGUIObserver *pkObserver)
eC_Value GetBorderWidthTop() const
void SetBorderWidth(eC_Value vBorderWidth)
void SetPasswordMode(eC_String &kPwdStr)
CGUIBaseInputField(CGUICompositeObject *const pkParent, const CGUIRect &kRect, const eC_String &rkText, CGUIEdit::AcceptedChars_t eAcceptedChars=CGUIEdit::AC_ALL, const ObjectHandle_t &eID=NO_HANDLE)
void GetBorderWidths(eC_Value &vLeft, eC_Value &vRight, eC_Value &vTop, eC_Value &vBottom) const
eC_Value GetBorderWidthBottom() const
eC_Int GetMaxLength() const
virtual void SetText(const eC_String &rkTextString)
virtual void ReadFromStream()
void SetActionCommand(CGUICommandPtr pkCommand)
void SetMaxLength(eC_Int iMaxLength)
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
CGUIEditableText * GetLabel()
virtual eC_Bool DoKeyUp(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
CGUIBaseInputField(const CGUIBaseInputField &kSource)
CGUISubject m_kInputStartedSubject
Subject informing observers whenever the input has started.
Definition: GUIBaseInputField.h:421
void SetAcceptedChars(CGUIEdit::AcceptedChars_t eAcceptedChars)
CGUIEdit * GetEdit() const
virtual eC_Bool DoDraw()
virtual eC_Bool SetValue(const CGUIValue &rkValue)
void SetSelectedTextColor(eC_UInt uiCol) const
CGUIEdit * m_pkEdit
The internal edit field.
Definition: GUIBaseInputField.h:414
CGUIValidator * GetValidator()
void SetValidator(CGUIValidator *pValidator)
eC_UInt GetSelectedTextColor() const
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
No-frills text input control, not to be used on its own.
Definition: GUIEdit.h:66
AcceptedChars_t
Sets of characters that are accepted as input in a CGUIEdit.
Definition: GUIEdit.h:70
@ AC_ALL
All characters.
Definition: GUIEdit.h:72
Specialization of CGUIText that allows for modification and selection of text.
Definition: GUIEditableText.h:61
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:79
Observer Base class for Observer-Design-Pattern within Guiliani.
Definition: GUIObserver.h:28
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Subject Base class for Observer-Design-Pattern within Guiliani.
Definition: GUISubject.h:34
Interface for validators that provide checking and changing of user input.
Definition: GUIValidator.h:25
CGUIValue stores a single value in one specific type.
Definition: GUIValue.h:25
void AddInputFinishedObserver(CGUIObserver *pkObserver)
void AddInputStartedObserver(CGUIObserver *pkObserver)
void AddTextChangedObserver(CGUIObserver *pkObserver)