Does a framework allow you to abstract generic code - but not in a complete way (Ex: Abstract a network connection - but not what you actually do with the data), and does not solve any particular common requirement whereas a toolkit has solutions to generic problems(Ex: Dialog box widget)?
Real world Example: Prototype is a "framework", but Dojo is a "toolkit".
So my question is, what is the criteria to call something a framework vs calling it a toolkit?
Quoting Martin Folwer in his article on Inversion of Control:
So in short, the big difference is that your code calls a library while a framework calls your code.
Framework enforces some design pattern on the developer and give some tools for code generation. This sits well with my first sentence, as it generates code in a certain style/pattern.
Library gives you functionality for you to use as you wish. Like the stdio functions of C, Console of C#, The "built in" functions of PHP etc
You can regard a library as a kind of API
In my book, a framework provides a structure and encourages or requires that it be used in a certain way. This can be good if the developer wants to do things the framework's way, since it's easier for many thing to be automatic, but it can be bad if the developer wants to deviate from the framework's intent.
A toolkit, on the other hand, provides various tools that can be used together or separately. It's more flexible but requires more effort on the programmer's behalf.