FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
SdlConnectionDialogWrapper Class Reference

#include <sdl_connection_dialog_wrapper.hpp>

Public Member Functions

 SdlConnectionDialogWrapper (const SdlConnectionDialogWrapper &other)=delete
 
 SdlConnectionDialogWrapper (SdlConnectionDialogWrapper &&other)=delete
 
SdlConnectionDialogWrapperoperator= (const SdlConnectionDialogWrapper &other)=delete
 
SdlConnectionDialogWrapperoperator= (SdlConnectionDialogWrapper &&other)=delete
 
void create (rdpContext *context)
 
void destroy ()
 
bool isRunning () const
 
bool isVisible () const
 
bool handleEvent (const SDL_Event &event)
 
void setTitle (WINPR_FORMAT_ARG const char *fmt,...)
 
void setTitle (const std::string &title)
 
void showInfo (WINPR_FORMAT_ARG const char *fmt,...)
 
void showInfo (const std::string &info)
 
void showWarn (WINPR_FORMAT_ARG const char *fmt,...)
 
void showWarn (const std::string &info)
 
void showError (WINPR_FORMAT_ARG const char *fmt,...)
 
void showError (const std::string &error)
 
void show (SDLConnectionDialog::MsgType type, const std::string &msg)
 
void show (bool visible=true)
 
void handleShow ()
 

Detailed Description

FreeRDP: A Remote Desktop Protocol Implementation SDL Client helper dialogs

Copyright 2025 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2025 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 31 of file sdl_connection_dialog_wrapper.hpp.

Member Function Documentation

◆ create()

void SdlConnectionDialogWrapper::create ( rdpContext *  context)

FreeRDP: A Remote Desktop Protocol Implementation SDL Client helper dialogs

Copyright 2025 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2025 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 25 of file sdl_connection_dialog_wrapper.cpp.

26{
27 std::unique_lock lock(_mux);
28 _connection_dialog = std::make_unique<SDLConnectionDialog>(context);
29 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
30}

◆ destroy()

void SdlConnectionDialogWrapper::destroy ( )

Definition at line 32 of file sdl_connection_dialog_wrapper.cpp.

33{
34 std::unique_lock lock(_mux);
35 _connection_dialog.reset();
36 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
37}

◆ handleEvent()

bool SdlConnectionDialogWrapper::handleEvent ( const SDL_Event &  event)

Definition at line 55 of file sdl_connection_dialog_wrapper.cpp.

56{
57 std::unique_lock lock(_mux);
58 if (!_connection_dialog)
59 return false;
60 return _connection_dialog->handle(event);
61}

◆ handleShow()

void SdlConnectionDialogWrapper::handleShow ( )

Definition at line 154 of file sdl_connection_dialog_wrapper.cpp.

155{
156 std::unique_lock lock(_mux);
157 if (!_connection_dialog)
158 return;
159
160 _connection_dialog->setTitle(_title.c_str());
161 if (!_visible)
162 {
163 _connection_dialog->hide();
164 return;
165 }
166
167 switch (_type)
168 {
169 case SDLConnectionDialog::MSG_INFO:
170 _connection_dialog->showInfo(_message.c_str());
171 break;
172 case SDLConnectionDialog::MSG_WARN:
173 _connection_dialog->showWarn(_message.c_str());
174 break;
175 case SDLConnectionDialog::MSG_ERROR:
176 _connection_dialog->showError(_message.c_str());
177 break;
178 default:
179 break;
180 }
181
182 _connection_dialog->show();
183}

◆ isRunning()

bool SdlConnectionDialogWrapper::isRunning ( ) const

Definition at line 39 of file sdl_connection_dialog_wrapper.cpp.

40{
41 std::unique_lock lock(_mux);
42 if (!_connection_dialog)
43 return false;
44 return _connection_dialog->running();
45}

◆ isVisible()

bool SdlConnectionDialogWrapper::isVisible ( ) const

Definition at line 47 of file sdl_connection_dialog_wrapper.cpp.

48{
49 std::unique_lock lock(_mux);
50 if (!_connection_dialog)
51 return false;
52 return _connection_dialog->visible();
53}

◆ setTitle()

void SdlConnectionDialogWrapper::setTitle ( const std::string &  title)

Definition at line 92 of file sdl_connection_dialog_wrapper.cpp.

93{
94 std::unique_lock lock(_mux);
95 _title = title;
96 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
97}

◆ show() [1/2]

void SdlConnectionDialogWrapper::show ( bool  visible = true)

Definition at line 147 of file sdl_connection_dialog_wrapper.cpp.

148{
149 std::unique_lock lock(_mux);
150 _visible = visible;
151 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
152}

◆ show() [2/2]

void SdlConnectionDialogWrapper::show ( SDLConnectionDialog::MsgType  type,
const std::string &  msg 
)

Definition at line 138 of file sdl_connection_dialog_wrapper.cpp.

139{
140 std::unique_lock lock(_mux);
141 _message = msg;
142 _type = type;
143 _visible = true;
144 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
145}

◆ showError()

void SdlConnectionDialogWrapper::showError ( const std::string &  error)

Definition at line 133 of file sdl_connection_dialog_wrapper.cpp.

134{
135 show(SDLConnectionDialog::MSG_ERROR, error);
136}

◆ showInfo()

void SdlConnectionDialogWrapper::showInfo ( const std::string &  info)

Definition at line 107 of file sdl_connection_dialog_wrapper.cpp.

108{
109 show(SDLConnectionDialog::MSG_INFO, info);
110}

◆ showWarn()

void SdlConnectionDialogWrapper::showWarn ( const std::string &  info)

Definition at line 120 of file sdl_connection_dialog_wrapper.cpp.

121{
122 show(SDLConnectionDialog::MSG_WARN, info);
123}

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