Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

mpagecollection.cpp

/***************************************************************************
              mpagecollection.cpp  -  Kugar report page collection
              -------------------
    begin     : Fri Aug 20 1999                                           
    copyright : (C) 1999 by Mutiny Bay Software                         
    email     : info@mutinybaysoftware.com                                     
 ***************************************************************************/

#include "mpagecollection.h"
#include "mreportengine.h"

/** Constructor */
00013 MPageCollection::MPageCollection ():QObject ()
{
  // Set page list to AutoDelete
  pages.setAutoDelete (true);

  // Set the metrics
  size = MReportEngine::Letter;
  orientation = MReportEngine::Portrait;
  dimensions.setWidth (0);
  dimensions.setHeight (0);
}

/** Copy constructor */
00026 MPageCollection::MPageCollection (const MPageCollection & mPageCollection)
{                                               /*: QObject((QObject &) mPageCollection) */
  copy (&mPageCollection);
}

/** Assignment operator */
00032 MPageCollection MPageCollection::operator= (const MPageCollection & mPageCollection)
{
  if (&mPageCollection == this)
      return *this;

  // Copy the derived class's data
  copy (&mPageCollection);

  // Copy the base class's data
  //((QObject &) *this) = mPageCollection;

  return *this;
}

/** Destructor */
00047 MPageCollection::~MPageCollection ()
{
  pages.clear ();
}

/** Clears the page collection */
void
00054 MPageCollection::clear ()
{
  pages.clear ();
}

/** Appends a new page to the page collection */
void
00061 MPageCollection::appendPage ()
{
  pages.append (new QPicture ());
}

/** Gets the current page in the page collection,
  * the current page may be null
  */
QPicture *
00070 MPageCollection::getCurrentPage ()
{
  return pages.current ();
}

/** Gets the first page in the page collection,
  * returns NULL if the list is empty
  */
QPicture *
00079 MPageCollection::getFirstPage ()
{
  return pages.first ();
}

/** Gets the next page in the page collection,
  * returns NULL if the end of the list has been reached
  */
QPicture *
00088 MPageCollection::getNextPage ()
{
  return pages.next ();
}

/** Get the previous page in the page collection,
  * returns NULL if the beginning of the list has been reached
  */
QPicture *
00097 MPageCollection::getPreviousPage ()
{
  return pages.prev ();
}

/** Gets the last page in the page collection,
  * returns NULL if the list is empty
  */
QPicture *
00106 MPageCollection::getLastPage ()
{
  return pages.last ();
}

/** Get the index of the current page */
int
00113 MPageCollection::getCurrentIndex ()
{
  return pages.at ();
}

/** Set the current page to page at idx */
void
00120 MPageCollection::setCurrentPage (int idx)
{
  pages.at (idx);
}

/** Sets the page size */
void
00127 MPageCollection::setPageSize (int s)
{
  size = s;
}

/** Sets the page orientation */
void
00134 MPageCollection::setPageOrientation (int o)
{
  orientation = o;
}

/** Sets the page dimensions  */
void
00141 MPageCollection::setPageDimensions (QSize dim)
{
  dimensions = dim;
}

/** Returns the page size */
int
00148 MPageCollection::pageSize ()
{
  return size;
}

/** Returns the page orientation */
int
00155 MPageCollection::pageOrientation ()
{
  return orientation;
}

/** Returns the page dimensions  */
00161 QSize MPageCollection::pageDimensions ()
{
  return dimensions;
}

/** Returns the number of pages in the page collection */
int
00168 MPageCollection::pageCount ()
{
  return pages.count ();
}

/** Copies member data from one object to another.
  Used by the copy constructor and assignment operator */
void
00176 MPageCollection::copy (const MPageCollection * mPageCollection)
{
  // Copy the page collection
  pages = mPageCollection->pages;

  // Copy the page metrics
  dimensions = mPageCollection->dimensions;
  size = mPageCollection->size;
  orientation = mPageCollection->orientation;
}

Generated by  Doxygen 1.6.0   Back to index