foobar2000 SDK  2015-01-14
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 502 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 505 of file shared.h.

505 : m_initialized(false) {initialize(p_wnd);}
void initialize(HWND p_wnd)
Initializes the scope with specified window handle.
Definition: shared.h:517
bool m_initialized
Definition: shared.h:545
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 507 of file shared.h.

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

Definition at line 508 of file shared.h.

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

Definition at line 540 of file shared.h.

540 {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 512 of file shared.h.

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

Definition at line 528 of file shared.h.

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

Initializes the scope with specified window handle.

Definition at line 517 of file shared.h.

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

Definition at line 541 of file shared.h.

541 {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 514 of file shared.h.

void SHARED_EXPORT ModalDialog_PokeExisting()

Field Documentation

t_modal_dialog_entry modal_dialog_scope::m_entry
private

Definition at line 543 of file shared.h.

bool modal_dialog_scope::m_initialized
private

Definition at line 545 of file shared.h.


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