In some embodiments, the invention relates to quinazoline and quinoline compounds of Formula I: (I) or a pharmaceutically acceptable salt thereof, or to pharmaceutical compositions comprising these compounds and to their use in therapy. In particular, in some embodiments, the present invention relates to quinazoline and quinoline compounds, pharmaceutical compositions thereof, and the use of the compounds and pharmaceutical compositions in the treatment of Brutons tyrosine kinase (BTK) mediated disorders.一些實施態樣中,本發明係關於式I之喹唑啉及喹啉化合物:或其醫藥上可接受之鹽,或包含這些化合物之醫藥組成物及彼等於醫療之用途。尤其,一些實施態樣中,本發明係關於喹唑啉及喹啉化合物、其醫藥組成物、及該化合物及醫藥組成物於治療布魯頓氏酪胺酸激酶(Bruton’s tyrosine kinase,BTK)媒介性失調之用途。