foobar2000 SDK  2015-08-03
popup_message.h
Go to the documentation of this file.
1 
5 
6 class NOVTABLE popup_message : public service_base {
7 public:
8  enum t_icon {icon_information, icon_error, icon_query};
15  virtual void show_ex(const char * p_msg,unsigned p_msg_length,const char * p_title,unsigned p_title_length,t_icon p_icon = icon_information) = 0;
16 
21  inline void show(const char * p_msg,const char * p_title,t_icon p_icon = icon_information) {show_ex(p_msg,~0,p_title,~0,p_icon);}
22 
24  static void g_show_ex(const char * p_msg,unsigned p_msg_length,const char * p_title,unsigned p_title_length,t_icon p_icon = icon_information);
26  static inline void g_show(const char * p_msg,const char * p_title,t_icon p_icon = icon_information) {g_show_ex(p_msg,~0,p_title,~0,p_icon);}
27 
28  static void g_complain(const char * what);
29  static void g_complain(const char * p_whatFailed, const std::exception & p_exception);
30  static void g_complain(const char * p_whatFailed, const char * msg);
31 
32  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(popup_message);
33 };
34 
35 #define EXCEPTION_TO_POPUP_MESSAGE(CODE,LABEL) try { CODE; } catch(std::exception const & e) {popup_message::g_complain(LABEL,e);}
36 
38 class NOVTABLE popup_message_v2 : public service_base {
39  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(popup_message_v2);
40 public:
41  virtual void show(HWND parent, const char * msg, t_size msg_length, const char * title, t_size title_length) = 0;
42  void show(HWND parent, const char * msg, const char * title) {show(parent, msg, ~0, title, ~0);}
43 
44  static void g_show(HWND parent, const char * msg, const char * title = "Information");
45  static void g_complain(HWND parent, const char * whatFailed, const char * msg);
46  static void g_complain(HWND parent, const char * whatFailed, const std::exception & e);
47 };
void show(const char *p_msg, const char *p_title, t_icon p_icon=icon_information)
Activates the popup dialog; returns immediately (the dialog remains visible); helper function built a...
Definition: popup_message.h:21
void show(HWND parent, const char *msg, const char *title)
Definition: popup_message.h:42
size_t t_size
Definition: int_types.h:48
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
static void g_show(const char *p_msg, const char *p_title, t_icon p_icon=icon_information)
Static helper function instantiating the service and activating the message dialog. See show() for description of parameters.
Definition: popup_message.h:26
std::exception exception
Definition: primitives.h:193
This interface allows you to show generic nonmodal noninteractive dialog with a text message...
Definition: popup_message.h:6