1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
;
20 /// Represents a page of a bigger set
23 /// Indexes are zero based.
25 public interface IPaginatedPage
: IEnumerable
28 /// The index this page represents
30 int CurrentIndex { get; }
33 /// The last index available on the set
35 int LastIndex { get; }
38 /// The next index (from this page)
40 int NextIndex { get; }
43 /// The previous index (from this page)
45 int PreviousIndex { get; }
50 int FirstIndex { get; }
53 /// The first element (index + 1)
55 int FirstItem { get; }
58 /// The last element in the page (count)
63 /// The count of all elements on the set
65 int TotalItems { get; }
68 /// Gets the size of the page.
70 /// <value>The size of the page.</value>
74 /// Returns true if a previous page
75 /// is accessible from this page
77 bool HasPrevious { get; }
80 /// Returns true if a next page is
81 /// accessible from this page
86 /// Returns true if a first page
89 bool HasFirst { get; }
92 /// Returns true if a last page
98 /// Checks whether the specified page exists.
99 /// Useful for Google-like pagination.
101 bool HasPage(int pageNumber
);