wavelength 1.0.0
Loading...
Searching...
No Matches
uitextentryinvalidmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5#include "msg/message.h"
6#include "os/mem.h"
7#include "os/prnstream.h"
8#include "ui/uitextentry.h"
9
17
26public:
33 ~UITextEntryInvalidMsg() override = default;
34
44 UITextEntryInvalidMsg(char ch, bool bEndOfField, UITextEntry *pEntry)
45 : mChar(ch), mEndOfField(bEndOfField), mEntry(pEntry) {
46 }
47
54 void *operator new(size_t nSize) {
55 return PoolMemAlloc(static_cast<int>(nSize), "UITextEntryInvalidMsg", 0);
56 }
57
63 void operator delete(void *pBlock) {
64 PoolMemFree(pBlock);
65 }
66
74 Message *Clone() override {
75 return new UITextEntryInvalidMsg(*this);
76 }
77
85 int Type() override {
87 }
88
96 const char *GetName() const override {
97 return "UITextEntryInvalidMsg";
98 }
99
107 void PrintExtra(PrnStream &stream) const override;
108
111 return mEntry;
112 }
113
115 int GetEndOfField() const {
116 return mEndOfField;
117 }
118
119private:
120 char mChar;
121 int mEndOfField;
122 UITextEntry *mEntry;
123};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
int Type() override
Report this message's registered identity.
Definition uitextentryinvalidmsg.h:85
Message * Clone() override
Produce a heap copy of this message.
Definition uitextentryinvalidmsg.h:74
int GetEndOfField() const
Definition uitextentryinvalidmsg.h:115
UITextEntryInvalidMsg(char ch, bool bEndOfField, UITextEntry *pEntry)
Construct the message.
Definition uitextentryinvalidmsg.h:44
void PrintExtra(PrnStream &stream) const override
Write the character and whether the text was full.
UITextEntry * GetEntry() const
Definition uitextentryinvalidmsg.h:110
const char * GetName() const override
Report this message's class name.
Definition uitextentryinvalidmsg.h:96
~UITextEntryInvalidMsg() override=default
Destroy the object.
Field the player types text into from a USB keyboard or the on-screen keyboard.
Definition uitextentry.h:27
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
int g_nUITextEntryInvalidMsgType
Identity that UITextEntryInvalidMsg::Type() reports.