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 34 of file sdl_connection_dialog_wrapper.hpp.

Member Enumeration Documentation

◆ MsgType

enum SdlConnectionDialogWrapper::MsgType

Definition at line 37 of file sdl_connection_dialog_wrapper.hpp.

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

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 29 of file sdl_connection_dialog_wrapper.cpp.

30{
31 std::unique_lock lock(_mux);
32 _connection_dialog = std::make_unique<SDLConnectionDialog>(context);
33 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
34}

◆ destroy()

void SdlConnectionDialogWrapper::destroy ( )

Definition at line 36 of file sdl_connection_dialog_wrapper.cpp.

37{
38 std::unique_lock lock(_mux);
39 _connection_dialog.reset();
40 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
41}

◆ handleEvent()

bool SdlConnectionDialogWrapper::handleEvent ( const SDL_Event &  event)

Definition at line 59 of file sdl_connection_dialog_wrapper.cpp.

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

◆ handleShow()

void SdlConnectionDialogWrapper::handleShow ( )

Definition at line 159 of file sdl_connection_dialog_wrapper.cpp.

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

◆ isRunning()

bool SdlConnectionDialogWrapper::isRunning ( ) const

Definition at line 43 of file sdl_connection_dialog_wrapper.cpp.

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

◆ isVisible()

bool SdlConnectionDialogWrapper::isVisible ( ) const

Definition at line 51 of file sdl_connection_dialog_wrapper.cpp.

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

◆ setTitle()

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

Definition at line 96 of file sdl_connection_dialog_wrapper.cpp.

97{
98 std::unique_lock lock(_mux);
99 _title = title;
100 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
101}

◆ show() [1/2]

void SdlConnectionDialogWrapper::show ( bool  visible = true)

Definition at line 152 of file sdl_connection_dialog_wrapper.cpp.

153{
154 std::unique_lock lock(_mux);
155 _visible = visible;
156 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
157}

◆ show() [2/2]

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

Definition at line 142 of file sdl_connection_dialog_wrapper.cpp.

144{
145 std::unique_lock lock(_mux);
146 _message = msg;
147 _type = type;
148 _visible = true;
149 sdl_push_user_event(SDL_EVENT_USER_UPDATE_CONNECT_DIALOG);
150}

◆ showError()

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

Definition at line 137 of file sdl_connection_dialog_wrapper.cpp.

138{
139 show(MSG_ERROR, error);
140}

◆ showInfo()

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

Definition at line 111 of file sdl_connection_dialog_wrapper.cpp.

112{
113 show(MSG_INFO, info);
114}

◆ showWarn()

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

Definition at line 124 of file sdl_connection_dialog_wrapper.cpp.

125{
126 show(MSG_WARN, info);
127}

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