What you're looking for doesn't probably work the way you want.
With Gmail you have 3 options.
1. Use the browser. Nothing is stored on your hard drive.
2. Use IMAP protocol. This is the best for use with mail. It will sync up between your Mail app and the Gmail server. This means if you delete a message in Mail it will also delete it on the server. If you delete a message on the server (via gmail.com) it will also get deleted when you next sync Mail app (get mail button).
3. POP3 protocol which will download a copy of everything to your Mail app and anything you do in mail app will only affect whats in Mail app. This means if you delete a message on the server it will still exist in Mail app and if you delete a message on Mail app it will still exist on the server.
Both options download at least a cache of your messages into Mail app. The only difference is whether or not your changes are pushed back to the server.
If you are familiar with how Mobile Me works then the IMAP protocol isn't much different.
The main reason I see people using POP3 is to create a local backup of their mail or because the service doesn't provide IMAP support.
Here are instructions from Google
http://mail.google.com/support/bin/answer.py?answer=81379 and some tips
http://mail.google.com/support/bin/answer.py?answer=78892#
I personally use IMAP on my work PC, my home PC, my Macbook, and my iPhone along with Gmail. It works great for me.