Oligomer molecules: first-principles investigation of the optical properties and application to luminescent devices