Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / MonoRail / Castle.MonoRail.Framework / Helpers / IPaginatedPage.cs
blobc3e62be8b8c25810821a7d42d36fe1ad30b2911e
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.Helpers
17 using System.Collections;
19 /// <summary>
20 /// Represents a page of a bigger set
21 /// </summary>
22 /// <remarks>
23 /// Indexes are zero based.
24 /// </remarks>
25 public interface IPaginatedPage : IEnumerable
27 /// <summary>
28 /// The index this page represents
29 /// </summary>
30 int CurrentIndex { get; }
32 /// <summary>
33 /// The last index available on the set
34 /// </summary>
35 int LastIndex { get; }
37 /// <summary>
38 /// The next index (from this page)
39 /// </summary>
40 int NextIndex { get; }
42 /// <summary>
43 /// The previous index (from this page)
44 /// </summary>
45 int PreviousIndex { get; }
47 /// <summary>
48 /// The first index
49 /// </summary>
50 int FirstIndex { get; }
52 /// <summary>
53 /// The first element (index + 1)
54 /// </summary>
55 int FirstItem { get; }
57 /// <summary>
58 /// The last element in the page (count)
59 /// </summary>
60 int LastItem { get; }
62 /// <summary>
63 /// The count of all elements on the set
64 /// </summary>
65 int TotalItems { get; }
67 /// <summary>
68 /// Gets the size of the page.
69 /// </summary>
70 /// <value>The size of the page.</value>
71 int PageSize { get; }
73 /// <summary>
74 /// Returns true if a previous page
75 /// is accessible from this page
76 /// </summary>
77 bool HasPrevious { get; }
79 /// <summary>
80 /// Returns true if a next page is
81 /// accessible from this page
82 /// </summary>
83 bool HasNext { get; }
85 /// <summary>
86 /// Returns true if a first page
87 /// exists
88 /// </summary>
89 bool HasFirst { get; }
91 /// <summary>
92 /// Returns true if a last page
93 /// exists
94 /// </summary>
95 bool HasLast { get; }
97 /// <summary>
98 /// Checks whether the specified page exists.
99 /// Useful for Google-like pagination.
100 /// </summary>
101 bool HasPage(int pageNumber);