foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
modal_dialog_scope

#include <shared.h>

Public Member Functions

 modal_dialog_scope (HWND p_wnd) throw ()
 
 modal_dialog_scope () throw ()
 
 ~modal_dialog_scope () throw ()
 
void deinitialize () throw ()
 
void initialize (HWND p_wnd) throw ()
 

Static Public Member Functions

static bool can_create () throw ()
 
static void poke_existing () throw ()
 

Private Member Functions

 modal_dialog_scope (const modal_dialog_scope &p_scope)
 
const modal_dialog_scopeoperator= (const modal_dialog_scope &)
 

Private Attributes

t_modal_dialog_entry m_entry
 
bool m_initialized
 

Detailed Description

The purpose of modal_dialog_scope is to help to avoid the modal dialog recursion problem. Current toplevel modal dialog handle is stored globally, so when creation of a new modal dialog is blocked, it can be activated to indicate the reason for the task being blocked.

Definition at line 504 of file shared.h.

Constructor & Destructor Documentation

modal_dialog_scope::modal_dialog_scope ( HWND  p_wnd)
throw (
)
inline

This constructor initializes the modal dialog scope with specified dialog handle.

Definition at line 507 of file shared.h.

507 : m_initialized(false) {initialize(p_wnd);}
void initialize(HWND p_wnd)
Initializes the scope with specified window handle.
Definition: shared.h:519
bool m_initialized
Definition: shared.h:547
modal_dialog_scope::modal_dialog_scope ( )
throw (
)
inline

This constructor leaves the scope uninitialized (you can call initialize() later with your window handle).

Definition at line 509 of file shared.h.

509 : m_initialized(false) {}
bool m_initialized
Definition: shared.h:547
modal_dialog_scope::~modal_dialog_scope ( )
throw (
)
inline

Definition at line 510 of file shared.h.

510 {deinitialize();}
void deinitialize()
Definition: shared.h:530
modal_dialog_scope::modal_dialog_scope ( const modal_dialog_scope p_scope)
inlineprivate

Definition at line 542 of file shared.h.

542 {assert(0);}

Member Function Documentation

static bool modal_dialog_scope::can_create ( )
throw (
)
inlinestatic

Returns whether creation of a new modal dialog is allowed (false when there's another one active).
NOTE: when calling context is already inside a modal dialog that you own, you should not be checking this before creating a new modal dialog.

Definition at line 514 of file shared.h.

514 {return ModalDialog_CanCreateNew();}
bool SHARED_EXPORT ModalDialog_CanCreateNew()
void modal_dialog_scope::deinitialize ( )
throw (
)
inline

Definition at line 530 of file shared.h.

531  {
532  if (m_initialized)
533  {
535  m_initialized = false;
536  }
537  }
void SHARED_EXPORT ModalDialog_Switch(t_modal_dialog_entry &p_entry)
t_modal_dialog_entry m_entry
Definition: shared.h:545
bool m_initialized
Definition: shared.h:547
void modal_dialog_scope::initialize ( HWND  p_wnd)
throw (
)
inline

Initializes the scope with specified window handle.

Definition at line 519 of file shared.h.

520  {
521  if (!m_initialized)
522  {
523  m_initialized = true;
524  m_entry.m_in_use = true;
525  m_entry.m_wnd_to_poke = p_wnd;
527  }
528  }
void SHARED_EXPORT ModalDialog_Switch(t_modal_dialog_entry &p_entry)
t_modal_dialog_entry m_entry
Definition: shared.h:545
bool m_initialized
Definition: shared.h:547
const modal_dialog_scope& modal_dialog_scope::operator= ( const modal_dialog_scope )
inlineprivate

Definition at line 543 of file shared.h.

543 {assert(0); return *this;}
static void modal_dialog_scope::poke_existing ( )
throw (
)
inlinestatic

Activates the top-level modal dialog existing, if one exists.

Definition at line 516 of file shared.h.

void SHARED_EXPORT ModalDialog_PokeExisting()

Field Documentation

t_modal_dialog_entry modal_dialog_scope::m_entry
private

Definition at line 545 of file shared.h.

bool modal_dialog_scope::m_initialized
private

Definition at line 547 of file shared.h.


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