I'm at a "trusted" place, and don't
want to enter unlock
password/pattern all the time
I'm at an "untrusted" place and want
my phone to be password/pattern
is there any way to use some kind of a shortcut/app which would quickly switch the way the screen gets locked? for example (when my screen is unlocked) - I press an icon and the lock type changes from using just a regular unlock method to password/pattern unlock method and vice versa.
edit: added a new answer below on what I now use to accomplish this (using android2.3.7)
From what I've read, Tasker should be able to do this. You can turn on or off the screen lock mechanism based upon whatever criteria you want, including the value of a variable. You can also change the value of a variable via a widget. Combine the two and it should work.
Caveat Lector: I've researched Tasker, I've read about what it can and can't do, but I've never tried it (yet). So take this as speculation.
I am fairly certain this can't be done under 2.2. Even if you backup the lockscreen data, do a factory reset, and restore the data, only the lockscreen "type" is restored and not the actual pattern or password. It's designed not to be altered except by the Settings app.
As mentioned earlier, Tasker can handle this sort of thing. You can set up a toggle button as you described by following these directions. I have something similar set up so that it doesn't ask for my security PIN when I'm connected to my home network. If I'm away from home, I do have to enter my PIN. It's quite handy. The only downside to using this is that you'll lose the sliding unlock function when your keyguard is disabled. When you hit your unlock button your screen will come on without any slider. It's only a concern if you think you'll accidentally hit the unlock button in your pocket. Personally, I can't get the touch screen to do anything against my clothes anyways.