From f3432c10bd694344f7e1f82ed8cd793358f1a400 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 21 Jun 2024 05:55:02 +0200 Subject: IMP: protect other computers which doesnt support EPM layout (AMD64) IMP: Add LTE builtin and NetworkDevice of type LTE. UPDATE: Also updated ReadMe. Signed-off-by: Amlal El Mahrouss --- Comm/newstd.hxx | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 4 deletions(-) (limited to 'Comm') diff --git a/Comm/newstd.hxx b/Comm/newstd.hxx index 9bf690cd..57ffc756 100644 --- a/Comm/newstd.hxx +++ b/Comm/newstd.hxx @@ -14,16 +14,81 @@ #endif // __KERNEL__ class NUser; /// @brief User application class. -class NCallback; /// @brief User callback class. +class NWindow; /// @brief Window class. +class NWindowAlert; #define IMPORT_CXX extern "C++" #define IMPORT_C extern "C" /** -@brief a class which helps the user do application I/O. +@brief Class which exposes the app I/O. */ -class NUser +class NUser final { public: + /// THOSE REQUIRES PERMISSIONS FROM THE USER. /// -}; \ No newline at end of file + static void Poweroff(); + static void Reboot(); + + /// THOSE REQUIRES PERMISSIONS FROM THE USER. /// + + static bool IsWokeup(); + static void Terminate(); + + /// THOSE DOESNT REQUIRE PERMISSIONS FROM THE USER. /// + + static bool Exit(int code); + static void* New(long long sz); + static void Delete(void* ptr); + + /// THOSE MAY REQUIRE PERMISSIONS FROM THE USER. /// + + static int Open(const char* path); + static void Close(int fd); + static void Execute(const char* command); + static void* Read(const char* forkName, int fd); + static void* Write(const char* forkName, int fd); +}; + +typedef void(*NWindowCallback)(NWindow*); + +/** +@brief Class which exposes the app UI API. +*/ +class NWindowAlert +{ +public: + virtual NWindowAlert* Alert(const char* message, const char* title) = 0; + virtual NWindowAlert* Prompt(const char* message, const char* title) = 0; + + virtual NWindowAlert* Collect(const char* resultBuf, long resultBufSz) = 0; + +public: + bool fAsyncOperationMode; + NWindowCallback fAsyncOnComplete; + +}; + +class NWindow +{ +public: + virtual NWindow* New(const char* pageName) = 0; + virtual NWindow* Ref(NWindow* pagee) = 0; + + virtual NWindow* Button(const char* text, NWindowCallback onClick = nullptr, + NWindowCallback onDblClick = nullptr) = 0; + + virtual NWindow* Checkbox(const char* text, NWindowCallback onSelect = nullptr, + NWindowCallback onUnselect = nullptr) = 0; + + virtual NWindow* Radio(const char* text, NWindowCallback onSelect = nullptr, + NWindowCallback onUnselect = nullptr) = 0; + + virtual NWindow* Link(const char* where, const char* textIfAny = "", NWindowCallback onClick = nullptr, + NWindowCallback onHover = nullptr) = 0; + +public: + bool fEnabled; + +}; -- cgit v1.2.3