Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IRedirectSupport.cs
blob7dbc03c55e2cf0d036cca3ce1fbcf94c86cdde58
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework
17 using System.Collections;
18 using System.Collections.Specialized;
20 /// <summary>
21 ///
22 /// </summary>
23 public interface IRedirectSupport
25 /// <summary>
26 /// Redirects to url using referrer.
27 /// </summary>
28 void RedirectToReferrer();
30 /// <summary>
31 /// Redirects to the site root directory (<c>Context.ApplicationPath + "/"</c>).
32 /// </summary>
33 void RedirectToSiteRoot();
35 /// <summary>
36 /// Redirects to the specified url
37 /// </summary>
38 /// <param name="url">An relative or absolute URL to redirect the client to</param>
39 void RedirectToUrl(string url);
40 /// <summary>
41 /// Redirects to the specified url
42 /// </summary>
43 /// <param name="url">An relative or absolute URL to redirect the client to</param>
44 /// <param name="endProcess">if set to <c>true</c>, sends the redirect and
45 /// kills the current request process.</param>
46 void RedirectToUrl(string url, bool endProcess);
47 /// <summary>
48 /// Redirects to the specified url
49 /// </summary>
50 /// <param name="url">An relative or absolute URL to redirect the client to</param>
51 /// <param name="queryStringParameters">The querystring entries</param>
52 void RedirectToUrl(string url, IDictionary queryStringParameters);
53 /// <summary>
54 /// Redirects to the specified url
55 /// </summary>
56 /// <param name="url">An relative or absolute URL to redirect the client to</param>
57 /// <param name="queryStringParameters">The querystring entries</param>
58 void RedirectToUrl(string url, NameValueCollection queryStringParameters);
59 /// <summary>
60 /// Redirects to the specified url
61 /// </summary>
62 /// <param name="url">An relative or absolute URL to redirect the client to</param>
63 /// <param name="queryStringParameters">The querystring entries</param>
64 void RedirectToUrl(string url, params string[] queryStringParameters);
65 /// <summary>
66 /// Redirects to the specified url
67 /// </summary>
68 /// <param name="url">An relative or absolute URL to redirect the client to</param>
69 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
70 void RedirectToUrl(string url, object queryStringAnonymousDictionary);
73 /// <summary>
74 /// Redirects to another controller's action.
75 /// </summary>
76 /// <param name="controller">The controller name to be redirected to.</param>
77 /// <param name="action">The desired action on the target controller.</param>
78 void Redirect(string controller, string action);
79 /// <summary>
80 /// Redirects to another controller's action with the specified parameters.
81 /// </summary>
82 /// <param name="controller">The controller name to be redirected to.</param>
83 /// <param name="action">The desired action on the target controller.</param>
84 /// <param name="queryStringParameters">The querystring entries</param>
85 void Redirect(string controller, string action, NameValueCollection queryStringParameters);
86 /// <summary>
87 /// Redirects to another controller's action with the specified parameters.
88 /// </summary>
89 /// <param name="controller">The controller name to be redirected to.</param>
90 /// <param name="action">The desired action on the target controller.</param>
91 /// <param name="queryStringParameters">The querystring entries</param>
92 void Redirect(string controller, string action, IDictionary queryStringParameters);
93 /// <summary>
94 /// Redirects to another controller's action with the specified parameters.
95 /// </summary>
96 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
97 /// <param name="controller">The controller name to be redirected to.</param>
98 /// <param name="action">The desired action on the target controller.</param>
99 void Redirect(string controller, string action, object queryStringAnonymousDictionary);
100 /// <summary>
101 /// Redirects to another controller's action in a different area.
102 /// </summary>
103 /// <param name="area">The area the target controller belongs to.</param>
104 /// <param name="controller">The controller name to be redirected to.</param>
105 /// <param name="action">The desired action on the target controller.</param>
106 void Redirect(string area, string controller, string action);
107 /// <summary>
108 /// Redirects to another controller's action in a different area with the specified parameters.
109 /// </summary>
110 /// <param name="area">The area the target controller belongs to.</param>
111 /// <param name="controller">The controller name to be redirected to.</param>
112 /// <param name="action">The desired action on the target controller.</param>
113 /// <param name="queryStringParameters">The querystring entries</param>
114 void Redirect(string area, string controller, string action, IDictionary queryStringParameters);
115 /// <summary>
116 /// Redirects to another controller's action in a different area with the specified parameters.
117 /// </summary>
118 /// <param name="area">The area the target controller belongs to.</param>
119 /// <param name="controller">The controller name to be redirected to.</param>
120 /// <param name="action">The desired action on the target controller.</param>
121 /// <param name="queryStringParameters">The querystring entries</param>
122 void Redirect(string area, string controller, string action, NameValueCollection queryStringParameters);
123 /// <summary>
124 /// Redirects to another controller's action in a different area with the specified parameters.
125 /// </summary>
126 /// <param name="area">The area the target controller belongs to.</param>
127 /// <param name="controller">The controller name to be redirected to.</param>
128 /// <param name="action">The desired action on the target controller.</param>
129 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
130 void Redirect(string area, string controller, string action, object queryStringAnonymousDictionary);
133 /// <summary>
134 /// Redirects using a named route.
135 /// The name must exists otherwise a <see cref="MonoRailException"/> will be thrown.
136 /// </summary>
137 /// <param name="routeName">Route name.</param>
138 void RedirectUsingNamedRoute(string routeName);
140 /// <summary>
141 /// Redirects using a named route.
142 /// The name must exists otherwise a <see cref="MonoRailException"/> will be thrown.
143 /// </summary>
144 /// <param name="routeName">Route name.</param>
145 /// <param name="routeParameters">The route parameters.</param>
146 void RedirectUsingNamedRoute(string routeName, object routeParameters);
148 /// <summary>
149 /// Redirects using a named route.
150 /// The name must exists otherwise a <see cref="MonoRailException"/> will be thrown.
151 /// </summary>
152 /// <param name="routeName">Route name.</param>
153 /// <param name="routeParameters">The route parameters.</param>
154 void RedirectUsingNamedRoute(string routeName, IDictionary routeParameters);
157 /// <summary>
158 /// Tries to resolve the target redirect url by using the routing rules registered.
159 /// </summary>
160 /// <param name="useCurrentRouteParams">if set to <c>true</c> the current request matching route rules will be used.</param>
161 /// <param name="controller">The controller name to be redirected to.</param>
162 /// <param name="action">The desired action on the target controller.</param>
163 void RedirectUsingRoute(string controller, string action, bool useCurrentRouteParams);
164 /// <summary>
165 /// Tries to resolve the target redirect url by using the routing rules registered.
166 /// </summary>
167 /// <param name="useCurrentRouteParams">if set to <c>true</c> the current request matching route rules will be used.</param>
168 /// <param name="area">The area the target controller belongs to.</param>
169 /// <param name="controller">The controller name to be redirected to.</param>
170 /// <param name="action">The desired action on the target controller.</param>
171 void RedirectUsingRoute(string area, string controller, string action, bool useCurrentRouteParams);
172 /// <summary>
173 /// Tries to resolve the target redirect url by using the routing rules registered.
174 /// </summary>
175 /// <param name="action">The desired action on the target controller.</param>
176 /// <param name="controller">The controller name to be redirected to.</param>
177 /// <param name="routeParameters">The routing rule parameters.</param>
178 void RedirectUsingRoute(string controller, string action, IDictionary routeParameters);
179 /// <summary>
180 /// Tries to resolve the target redirect url by using the routing rules registered.
181 /// </summary>
182 /// <param name="action">The desired action on the target controller.</param>
183 /// <param name="controller">The controller name to be redirected to.</param>
184 /// <param name="routeParameters">The routing rule parameters.</param>
185 void RedirectUsingRoute(string controller, string action, object routeParameters);
186 /// <summary>
187 /// Tries to resolve the target redirect url by using the routing rules registered.
188 /// </summary>
189 /// <param name="area">The area the target controller belongs to.</param>
190 /// <param name="action">The desired action on the target controller.</param>
191 /// <param name="controller">The controller name to be redirected to.</param>
192 /// <param name="routeParameters">The routing rule parameters.</param>
193 void RedirectUsingRoute(string area, string controller, string action, IDictionary routeParameters);
194 /// <summary>
195 /// Tries to resolve the target redirect url by using the routing rules registered.
196 /// </summary>
197 /// <param name="area">The area the target controller belongs to.</param>
198 /// <param name="action">The desired action on the target controller.</param>
199 /// <param name="controller">The controller name to be redirected to.</param>
200 /// <param name="routeParameters">The routing rule parameters.</param>
201 void RedirectUsingRoute(string area, string controller, string action, object routeParameters);