> No, a restraining order is issued when someone is performing actions that, taken individually, are legal - recording a link between an SSID and a street address, knocking on an ex-girlfriends door to ask them to talk to you, photographing a child - but when carried out systematically, constitute a pattern of behaviour that is undesirable, and by virtue of the order becomes illegal.
The subset of restraining orders (sometimes called "protective" orders) you are thinking of are available when something illegal has been done, and relate to patterns of activity related to that illegal thing. For California, there are several kinds [0] of such orders:
(1) Domestic Violence Restraining Order: available if someone close to you in specific ways defined in law has abused you in specific ways defined in law as acts of domestic violence.
(2) Elder or Dependent Adult Abuse Restraining Order: available if you are elderly or disabled and have been a victim of certain kinds of abuse.
(3) Civil Harassment Restraining Order: available if you are being harassed or stalked, etc., by someone not close enough to be covered by a domestic violence restraining order.
(4) Workplace Violence Restraining Order: available to an employer to protect an employee that has been a victim of stalking, harassment, violence, or serious threats.
Now, yes, they sometimes cover acts which would not otherwise be illegal, but they actual require something illegal to have happened as their basis (a temporary restraining order can be issued on the claim that such a thing has occurred, and a permanent restraining order only after a hearing to determine that.)
[0] http://www.courts.ca.gov/1260.htm