More working tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / IRedirectSupport.cs
blobe63d49b4a2dc655265d3d70db102e566e9aaf079
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 the site root directory (<c>Context.ApplicationPath + "/"</c>).
27 /// </summary>
28 void RedirectToSiteRoot();
30 /// <summary>
31 /// Redirects to the specified url
32 /// </summary>
33 /// <param name="url">An relative or absolute URL to redirect the client to</param>
34 void RedirectToUrl(string url);
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 /// <param name="endProcess">if set to <c>true</c>, sends the redirect and
40 /// kills the current request process.</param>
41 void RedirectToUrl(string url, bool endProcess);
42 /// <summary>
43 /// Redirects to the specified url
44 /// </summary>
45 /// <param name="url">An relative or absolute URL to redirect the client to</param>
46 /// <param name="queryStringParameters">The querystring entries</param>
47 void RedirectToUrl(string url, IDictionary queryStringParameters);
48 /// <summary>
49 /// Redirects to the specified url
50 /// </summary>
51 /// <param name="url">An relative or absolute URL to redirect the client to</param>
52 /// <param name="queryStringParameters">The querystring entries</param>
53 void RedirectToUrl(string url, NameValueCollection queryStringParameters);
54 /// <summary>
55 /// Redirects to the specified url
56 /// </summary>
57 /// <param name="url">An relative or absolute URL to redirect the client to</param>
58 /// <param name="queryStringParameters">The querystring entries</param>
59 void RedirectToUrl(string url, params string[] queryStringParameters);
60 /// <summary>
61 /// Redirects to the specified url
62 /// </summary>
63 /// <param name="url">An relative or absolute URL to redirect the client to</param>
64 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
65 void RedirectToUrl(string url, object queryStringAnonymousDictionary);
68 /// <summary>
69 /// Redirects to another controller's action.
70 /// </summary>
71 /// <param name="controller">The controller name to be redirected to.</param>
72 /// <param name="action">The desired action on the target controller.</param>
73 void Redirect(string controller, string action);
74 /// <summary>
75 /// Redirects to another controller's action with the specified parameters.
76 /// </summary>
77 /// <param name="controller">The controller name to be redirected to.</param>
78 /// <param name="action">The desired action on the target controller.</param>
79 /// <param name="queryStringParameters">The querystring entries</param>
80 void Redirect(string controller, string action, NameValueCollection queryStringParameters);
81 /// <summary>
82 /// Redirects to another controller's action with the specified parameters.
83 /// </summary>
84 /// <param name="controller">The controller name to be redirected to.</param>
85 /// <param name="action">The desired action on the target controller.</param>
86 /// <param name="queryStringParameters">The querystring entries</param>
87 void Redirect(string controller, string action, IDictionary queryStringParameters);
88 /// <summary>
89 /// Redirects to another controller's action with the specified parameters.
90 /// </summary>
91 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
92 /// <param name="controller">The controller name to be redirected to.</param>
93 /// <param name="action">The desired action on the target controller.</param>
94 void Redirect(string controller, string action, object queryStringAnonymousDictionary);
95 /// <summary>
96 /// Redirects to another controller's action in a different area.
97 /// </summary>
98 /// <param name="area">The area the target controller belongs to.</param>
99 /// <param name="controller">The controller name to be redirected to.</param>
100 /// <param name="action">The desired action on the target controller.</param>
101 void Redirect(string area, string controller, string action);
102 /// <summary>
103 /// Redirects to another controller's action in a different area with the specified parameters.
104 /// </summary>
105 /// <param name="area">The area the target controller belongs to.</param>
106 /// <param name="controller">The controller name to be redirected to.</param>
107 /// <param name="action">The desired action on the target controller.</param>
108 /// <param name="queryStringParameters">The querystring entries</param>
109 void Redirect(string area, string controller, string action, IDictionary queryStringParameters);
110 /// <summary>
111 /// Redirects to another controller's action in a different area with the specified parameters.
112 /// </summary>
113 /// <param name="area">The area the target controller belongs to.</param>
114 /// <param name="controller">The controller name to be redirected to.</param>
115 /// <param name="action">The desired action on the target controller.</param>
116 /// <param name="queryStringParameters">The querystring entries</param>
117 void Redirect(string area, string controller, string action, NameValueCollection queryStringParameters);
118 /// <summary>
119 /// Redirects to another controller's action in a different area with the specified parameters.
120 /// </summary>
121 /// <param name="area">The area the target controller belongs to.</param>
122 /// <param name="controller">The controller name to be redirected to.</param>
123 /// <param name="action">The desired action on the target controller.</param>
124 /// <param name="queryStringAnonymousDictionary">The querystring entries as an anonymous dictionary</param>
125 void Redirect(string area, string controller, string action, object queryStringAnonymousDictionary);
128 /// <summary>
129 /// Tries to resolve the target redirect url by using the routing rules registered.
130 /// </summary>
131 /// <param name="useCurrentRouteParams">if set to <c>true</c> the current request matching route rules will be used.</param>
132 /// <param name="controller">The controller name to be redirected to.</param>
133 /// <param name="action">The desired action on the target controller.</param>
134 void RedirectUsingRoute(string controller, string action, bool useCurrentRouteParams);
135 /// <summary>
136 /// Tries to resolve the target redirect url by using the routing rules registered.
137 /// </summary>
138 /// <param name="useCurrentRouteParams">if set to <c>true</c> the current request matching route rules will be used.</param>
139 /// <param name="area">The area the target controller belongs to.</param>
140 /// <param name="controller">The controller name to be redirected to.</param>
141 /// <param name="action">The desired action on the target controller.</param>
142 void RedirectUsingRoute(string area, string controller, string action, bool useCurrentRouteParams);
143 /// <summary>
144 /// Tries to resolve the target redirect url by using the routing rules registered.
145 /// </summary>
146 /// <param name="action">The desired action on the target controller.</param>
147 /// <param name="controller">The controller name to be redirected to.</param>
148 /// <param name="routeParameters">The routing rule parameters.</param>
149 void RedirectUsingRoute(string controller, string action, IDictionary routeParameters);
150 /// <summary>
151 /// Tries to resolve the target redirect url by using the routing rules registered.
152 /// </summary>
153 /// <param name="action">The desired action on the target controller.</param>
154 /// <param name="controller">The controller name to be redirected to.</param>
155 /// <param name="routeParameters">The routing rule parameters.</param>
156 void RedirectUsingRoute(string controller, string action, object routeParameters);
157 /// <summary>
158 /// Tries to resolve the target redirect url by using the routing rules registered.
159 /// </summary>
160 /// <param name="area">The area the target controller belongs to.</param>
161 /// <param name="action">The desired action on the target controller.</param>
162 /// <param name="controller">The controller name to be redirected to.</param>
163 /// <param name="routeParameters">The routing rule parameters.</param>
164 void RedirectUsingRoute(string area, string controller, string action, IDictionary routeParameters);
165 /// <summary>
166 /// Tries to resolve the target redirect url by using the routing rules registered.
167 /// </summary>
168 /// <param name="area">The area the target controller belongs to.</param>
169 /// <param name="action">The desired action on the target controller.</param>
170 /// <param name="controller">The controller name to be redirected to.</param>
171 /// <param name="routeParameters">The routing rule parameters.</param>
172 void RedirectUsingRoute(string area, string controller, string action, object routeParameters);