Eneboo - Documentación para desarrolladores
src/kugar/mpagecollection.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002              mpagecollection.h  -  Kugar report page collection
00003              -------------------
00004    begin     : Fri Aug 20 1999
00005    copyright : (C) 1999 by Mutiny Bay Software
00006    email     : info@mutinybaysoftware.com
00007 ***************************************************************************/
00008 
00009 #ifndef MPAGECOLLECTION_H
00010 #define MPAGECOLLECTION_H
00011 
00012 #include <qobject.h>
00013 #include <qptrlist.h>
00014 #include <qpicture.h>
00015 #include <qsize.h>
00016 
00022 class MPageCollection: public QObject
00023 {
00024 
00025 public:
00026 
00030   MPageCollection(QObject *parent = 0);
00031 
00035   MPageCollection(const MPageCollection &mPageCollection);
00036 
00040   MPageCollection operator=(const MPageCollection &mPageCollection);
00041 
00045   virtual ~ MPageCollection();
00046 
00047 private:
00048 
00052   QPtrList<QPicture> *pages;
00053 
00057   QSize dimensions;
00058 
00062   int size;
00063 
00067   int orientation;
00068 
00072   bool printToPos_;
00073 
00077   int topMargin;
00078   int leftMargin;
00079   int bottomMargin;
00080   int rightMargin;
00081 
00082 public:
00083 
00087   void clear();
00088 
00092   void appendPage();
00093 
00098   QPicture *getCurrentPage() const;
00099 
00104   QPicture *getFirstPage();
00105 
00110   QPicture *getPreviousPage();
00111 
00116   QPicture *getNextPage();
00117 
00122   QPicture *getLastPage();
00123 
00128   QPicture *getPageAt(uint i);
00129 
00133   int getCurrentIndex() const;
00134 
00138   void setCurrentPage(int idx);
00139 
00143   void setPageSize(int s);
00144 
00148   void setPageOrientation(int o);
00149 
00153   void setPageDimensions(QSize dim);
00154 
00158   int pageSize() const;
00159 
00163   int pageOrientation() const;
00164 
00168   QSize pageDimensions() const;
00169 
00173   int pageCount() const;
00174 
00178   bool printToPos() const;
00179 
00183   void setPrintToPos(bool ptp);
00184 
00188   void setPageMargins(int top, int left, int bottom, int right);
00189 
00193   void pageMargins(int *top, int *left, int *bottom, int *right) const;
00194 
00195 private:
00196 
00202   void copy(const MPageCollection *mPageCollection);
00203 };
00204 
00208 inline QPicture *MPageCollection::getCurrentPage() const
00209 {
00210   return pages->current();
00211 }
00212 
00216 inline QPicture *MPageCollection::getFirstPage()
00217 {
00218   return pages->first();
00219 }
00220 
00224 inline QPicture *MPageCollection::getNextPage()
00225 {
00226   return pages->next();
00227 }
00228 
00232 inline QPicture *MPageCollection::getPreviousPage()
00233 {
00234   return pages->prev();
00235 }
00236 
00240 inline QPicture *MPageCollection::getLastPage()
00241 {
00242   return pages->last();
00243 }
00244 
00248 inline QPicture *MPageCollection::getPageAt(uint i)
00249 {
00250   return pages->at(i);
00251 }
00252 
00254 inline void MPageCollection::setCurrentPage(int idx)
00255 {
00256   pages->at(idx);
00257 }
00258 
00260 inline int MPageCollection::getCurrentIndex() const
00261 {
00262   return pages->at();
00263 }
00264 
00266 inline void MPageCollection::setPageSize(int s)
00267 {
00268   size = s;
00269 }
00270 
00272 inline void MPageCollection::setPageOrientation(int o)
00273 {
00274   orientation = o;
00275 }
00276 
00278 inline void MPageCollection::setPageDimensions(QSize dim)
00279 {
00280   dimensions = dim;
00281 }
00282 
00284 inline int MPageCollection::pageSize() const
00285 {
00286   return size;
00287 }
00288 
00290 inline int MPageCollection::pageOrientation() const
00291 {
00292   return orientation;
00293 }
00294 
00296 inline QSize MPageCollection::pageDimensions() const
00297 {
00298   return dimensions;
00299 }
00300 
00302 inline int MPageCollection::pageCount() const
00303 {
00304   return pages->count();
00305 }
00306 
00307 inline bool MPageCollection::printToPos() const
00308 {
00309   return printToPos_;
00310 }
00311 
00312 inline void MPageCollection::setPrintToPos(bool ptp)
00313 {
00314   printToPos_ = ptp;
00315 }
00316 
00317 inline void MPageCollection::setPageMargins(int top, int left, int bottom, int right)
00318 {
00319   topMargin = top;
00320   leftMargin = left;
00321   bottomMargin = bottom;
00322   rightMargin = right;
00323 }
00324 
00325 inline void MPageCollection::pageMargins(int *top, int *left, int *bottom, int *right) const
00326 {
00327   *top = topMargin;
00328   *left = leftMargin;
00329   *bottom = bottomMargin;
00330   *right = rightMargin;
00331 }
00332 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'