Getting a List of Categories for Use in a Plugin?

The get_categories() function is what you’re looking for.

Update: Thanks for the clarifications. Sounds like you’re doing the same thing as this question, ie. creating a new taxonomy for attachments. (I’m not sure they get these categories automatically, maybe someone else can clarify.) I haven’t played with that functionality yet, but does that other post sound like what you’re looking for?