How to get ListItem object

This thread
http://forum.kodi.tv/showthread.php?tid=250936
details additional functionality enabling addons to set details into a listitem.
But how does an addon get the listitem in the first place?

PHP Code:
# get active window
    
wid xbmcgui.getCurrentWindowId()
    
win xbmcgui.Window(wid)
    
# get focused control
   
cid win.getFocusId() 

Now what? How do I get from the control id. to the actual listitem?
TIA for any clues.