Quantum waveguide theory for mesoscopic structures.