FreeRDP
Loading...
Searching...
No Matches
SdlConnectionDialogWrapper Class Reference

Public Types

enum  MsgType {
  MSG_NONE , MSG_INFO , MSG_WARN , MSG_ERROR ,
  MSG_DISCARD
}
 

Public Member Functions

 SdlConnectionDialogWrapper ()
 
 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 (SdlConnectionDialogWrapper::MsgType type, const std::string &msg)
 
void show (bool visible=true)
 
void handleShow ()
 

Detailed Description

Definition at line 35 of file sdl_connection_dialog_wrapper.hpp.

Member Enumeration Documentation

◆ MsgType

enum SdlConnectionDialogWrapper::MsgType

Definition at line 38 of file sdl_connection_dialog_wrapper.hpp.

39 {
40 MSG_NONE,
41 MSG_INFO,
42 MSG_WARN,
43 MSG_ERROR,
44 MSG_DISCARD
45 };

Constructor & Destructor Documentation

◆ SdlConnectionDialogWrapper()

SdlConnectionDialogWrapper::SdlConnectionDialogWrapper ( )
default

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.

Member Function Documentation

◆ create()

void SdlConnectionDialogWrapper::create ( rdpContext *  context)

Definition at line 31 of file sdl_connection_dialog_wrapper.cpp.

32{
33 _connection_dialog = std::make_unique<SDLConnectionDialog>(context);
34}

◆ destroy()

void SdlConnectionDialogWrapper::destroy ( )

Definition at line 36 of file sdl_connection_dialog_wrapper.cpp.

37{
38 _connection_dialog.reset();
39}

◆ handleEvent()

bool SdlConnectionDialogWrapper::handleEvent ( const SDL_Event &  event)

Definition at line 57 of file sdl_connection_dialog_wrapper.cpp.

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

◆ handleShow()

void SdlConnectionDialogWrapper::handleShow ( )

Definition at line 149 of file sdl_connection_dialog_wrapper.cpp.

150{
151 std::unique_lock lock(_mux);
152 while (!_queue.empty())
153 {
154 auto arg = _queue.front();
155 _queue.pop();
156
157 if (!_connection_dialog)
158 continue;
159
160 if (arg.hasTitle())
161 {
162 _connection_dialog->setTitle(arg.title().c_str());
163 }
164
165 if (arg.hasType() && arg.hasMessage())
166 {
167 switch (arg.type())
168 {
169 case SdlConnectionDialogWrapper::MSG_INFO:
170 _connection_dialog->showInfo(arg.message().c_str());
171 break;
172 case SdlConnectionDialogWrapper::MSG_WARN:
173 _connection_dialog->showWarn(arg.message().c_str());
174 break;
175 case SdlConnectionDialogWrapper::MSG_ERROR:
176 _connection_dialog->showError(arg.message().c_str());
177 break;
178 default:
179 break;
180 }
181 }
182
183 if (arg.hasVisibility())
184 {
185 if (arg.visible())
186 _connection_dialog->show();
187 else
188 _connection_dialog->hide();
189 }
190 }
191}

◆ isRunning()

bool SdlConnectionDialogWrapper::isRunning ( ) const

Definition at line 41 of file sdl_connection_dialog_wrapper.cpp.

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

◆ isVisible()

bool SdlConnectionDialogWrapper::isVisible ( ) const

Definition at line 49 of file sdl_connection_dialog_wrapper.cpp.

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

◆ setTitle()

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

Definition at line 94 of file sdl_connection_dialog_wrapper.cpp.

95{
96 push({ title });
97}

◆ show() [1/2]

void SdlConnectionDialogWrapper::show ( bool  visible = true)

Definition at line 144 of file sdl_connection_dialog_wrapper.cpp.

145{
146 push({ visible });
147}

◆ show() [2/2]

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

Definition at line 138 of file sdl_connection_dialog_wrapper.cpp.

140{
141 push({ type, msg, true });
142}

◆ showError()

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

Definition at line 133 of file sdl_connection_dialog_wrapper.cpp.

134{
135 show(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(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(MSG_WARN, info);
123}

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