@LuBaphomet
You have a couple of options here. One is using IK, constraints and parenting (haven't tried) or doing a math based rig. Here is a stab at it. It is all apcked in single mesh, you can check the graph for details. There are two sliders which do what you have been describing. Hope you can adapt it or transfer to your specifics.
slide_fun.c4d