To answer the original question: Applications can detect via D-Bus when they stop charging. Canola would have to implement this special behavior however. Alternatively it should be possible with the package dbus-scripts (IIRC) to kill (or put to sleep) canola when charging stops and start (or resume) canola again when charging starts.