001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.contrib.table.model;
016    
017    /**
018     * An interface defining the management of the table's paging state.
019     * 
020     * @author mindbridge
021     */
022    public interface ITablePagingState
023    {
024    
025        /**
026         * Method getPageSize provides the size of a page in a number of records.
027         * This value may be meaningless if the model uses a different method for
028         * pagination.
029         * 
030         * @return int the current page size
031         */
032        int getPageSize();
033    
034        /**
035         * Method setPageSize updates the size of a page in a number of records.
036         * This value may be meaningless if the model uses a different method for
037         * pagination.
038         * 
039         * @param nPageSize
040         *            the new page size
041         */
042        void setPageSize(int nPageSize);
043    
044        /**
045         * Gets the currently selected page. The page number is counted from 0.
046         * 
047         * @return int the current active page
048         */
049        int getCurrentPage();
050    
051        /**
052         * Sets the newly selected page. The page number is counted from 0.
053         * 
054         * @param nPage
055         *            the new active page
056         */
057        void setCurrentPage(int nPage);
058    }