Make user callbacks more flexible with IInputCallback.

Change-Id: I716a971d62489d7b6890c7d6b1d91200a370df9e
Add logic to select type of new elements.

Change-Id: I21e798adaf426ca5a2f1999b3e7bcef783fb6fd8