home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IPAGECURSOR_
- #define _IPAGECURSOR_
- /*******************************************************************************
- * FILE NAME: ipagecur.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Ipagecur - This class is used to iterate through all of the pages of a *
- * notebook. *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- * $Log: R:/IBMCLASS/IBASECTL/VCS/IPAGECUR.HPV $
- //
- // Rev 1.3 25 Oct 1992 17:05:50 nunn
- //changed library name to ICLUI
- //
- // Rev 1.2 25 Oct 1992 10:56:14 boezeman
- //Add documentation and converted file to skeleton.hpp format.
-
- Rev 1.1 05 Jun 1992 19:02:08 Ken Fichthorn
- First version of the class
- *******************************************************************************/
- // Forward declarations for other classes:
- class INoteBook;
- class IPage;
- class IPageCursor;
- #include <ipage.hpp>
- #include <inotebk.hpp>
-
- class IPageCursor {
- /*******************************************************************************
- * This class is used to iterate through all of the pages of a notebook. *
- * In addition, it provides methods to count from the current page to the next *
- * major tab, the next minor tab page, or to the end of the notebook. *
- * *
- * EXAMPLE: *
- * INoteBook *pnbkMyBook; *
- * IPage *ppageFirstPage; *
- * IPage *ppageSecondPage; *
- * IPage *ppage; *
- * pnbkMyBook = new INoteBook(ID_MYBOOK, this, *
- * IRectangle(IPoint(50,15), *
- * ISize(425,225))); *
- * ppageFirstPage = new IPage( pnbkMyBook, *
- * BKA_MAJOR | IC_DEFAULTPAGESTYLE); *
- * ppageSecondPage = new IPage( pnbkMyBook, *
- * BKA_MAJOR | IC_DEFAULTPAGESTYLE); *
- * *
- * ppgcurCursor = new IPageCursor( pnbkMyBook); *
- * ppgcurCursor->setCurrent( ppageFirstPage); *
- * ppage = ppgcurCursor->next(); *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is 1 way to construct instances of this class: |
- | 1. default |
- ------------------------------------------------------------------------------*/
- IPageCursor( INoteBook* pnbkBook);
- ~IPageCursor();
-
- /*----------------------------- SET/QUERY CURSOR OPERATIONS --------------------
- | setCurrent - Makes the cursor point at the specified page of the notebook.|
- | current - Returns the page that the cursor is pointing to. |
- ------------------------------------------------------------------------------*/
- void
- setCurrent( IPage* ppgCurrent);
- IPage*
- current() {return ppgClCurrent;};
-
- /*----------------------------- ITERATION OPERATIONS ---------------------------
- | first - Moves the cursor to the first page of the notebook and also returns |
- | a pointer to that page. |
- | next - Moves the cursor forward one page to the next page of the notebook |
- | and also returns a pointer to that page. |
- | prior - Moves the cursor backward one page to the previous page of the |
- | notebook and also returns a pointer to that page. |
- | last - Moves the cursor to the last page of the notebook and also returns |
- | a pointer to that page. |
- ------------------------------------------------------------------------------*/
- IPage*
- first();
- IPage*
- next();
- IPage*
- prior();
- IPage*
- last();
-
- /*----------------------------- PAGE COUNTING OPERATIONS -----------------------
- | count - Returns the total number of pages in the notebook. |
- | countToNextMajor - Returns the total number of pages, including the current |
- | page, to the next major tab page in the notebook. |
- | countToNextMinor - Returns the total number of pages, including the current |
- | page, to the next minor tab page in the notebook. |
- | countToEnd - Returns the total number of pages, including the current |
- | page, to the last page in the notebook. |
- ------------------------------------------------------------------------------*/
- long
- count() const,
- countToNextMajor() const,
- countToNextMinor() const,
- countToEnd() const;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- INoteBook *
- pnbkClNotebook;
- IPage *
- ppgClCurrent;
- };
-
- #endif