foobar2000 SDK  2015-01-14
Public Member Functions | Static Public Member Functions
ui_drop_item_callbackabstract

#include <ui.h>

+ Inheritance diagram for ui_drop_item_callback:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (ui_drop_item_callback)
 
virtual bool is_accepted_type (interface IDataObject *pDataObject, DWORD *p_effect)=0
 
virtual bool on_drop (interface IDataObject *pDataObject)=0
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Static Public Member Functions

static bool g_is_accepted_type (interface IDataObject *pDataObject, DWORD *p_effect)
 
static bool g_on_drop (interface IDataObject *pDataObject)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Service called from the UI when some object is dropped into the UI. Usable for modifying drag&drop behaviors such as adding custom handlers for object types other than supported media files.
Implement where needed; use ui_drop_item_callback_factory_t<> template to register, e.g. static ui_drop_item_callback_factory_t<myclass> g_myclass_factory.

Definition at line 86 of file ui.h.

Member Function Documentation

ui_drop_item_callback::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( ui_drop_item_callback  )
bool ui_drop_item_callback::g_is_accepted_type ( interface IDataObject pDataObject,
DWORD *  p_effect 
)
static

Static helper, calls all existing implementations appropriately. See is_accepted_type().

Definition at line 13 of file ui.cpp.

14 {
17  if (e.first(ptr)) do {
18  if (ptr->is_accepted_type(pDataObject,p_effect)) return true;
19  } while(e.next(ptr));
20  return false;
21 }
bool first(service_ptr_t< t_query > &p_out)
Definition: service.h:581
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
bool ui_drop_item_callback::g_on_drop ( interface IDataObject pDataObject)
static

Static helper, calls all existing implementations appropriately. See on_drop().

Definition at line 3 of file ui.cpp.

4 {
7  if (e.first(ptr)) do {
8  if (ptr->on_drop(pDataObject)) return true;
9  } while(e.next(ptr));
10  return false;
11 }
bool first(service_ptr_t< t_query > &p_out)
Definition: service.h:581
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
virtual bool ui_drop_item_callback::is_accepted_type ( interface IDataObject pDataObject,
DWORD *  p_effect 
)
pure virtual

Tests whether specified object type is supported by this ui_drop_item_callback implementation. Returns true and sets p_effect when it's supported; returns false otherwise.
See IDropTarget::DragEnter() documentation for more information about p_effect values.

virtual bool ui_drop_item_callback::on_drop ( interface IDataObject pDataObject)
pure virtual

Called when an object was dropped; returns true if the object was processed and false if not.


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