Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSCanvasItemList_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSCanvasItemList_p.h
00003  -------------------
00004  begin                : 07/10/2011
00005  copyright            : (C) 2003-2011 by InfoSiAL S.L.
00006  email                : mail@infosial.com
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; version 2 of the License.               *
00012  ***************************************************************************/
00013 /***************************************************************************
00014  Este  programa es software libre. Puede redistribuirlo y/o modificarlo
00015  bajo  los  trminos  de  la  Licencia  Pblica General de GNU   en  su
00016  versin 2, publicada  por  la  Free  Software Foundation.
00017  ***************************************************************************/
00018 
00019 #ifndef AQSCANVASITEMLIST_P_H_
00020 #define AQSCANVASITEMLIST_P_H_
00021 
00022 #include "AQSCanvasItem_p.h"
00023 
00024 // @AQ_PTR_INDIRECTION@
00025 
00026 class AQSCanvasItemList : public AQSVoidPtr
00027 {
00028   Q_OBJECT
00029 
00030   AQ_DECLARE_AQS_VOID(CanvasItemList, VoidPtr);
00031 
00032 public slots:
00033   int createIterator() {
00034     int itRet = itCount_;
00035     QCanvasItemList::const_iterator it;
00036     itMap_[itRet] = it;
00037     ++itCount_;
00038     return itRet;
00039   }
00040 
00041   void destroyIterator(int it) {
00042     itMap_.remove(it);
00043   }
00044 
00045   void iteratorBegin(int it) {
00046     if (!o_)
00047       return;
00048     itMap_[it] = o_->begin();
00049   }
00050 
00051   bool iteratorIsBegin(int it) {
00052     if (!o_)
00053       return false;
00054     return (itMap_.contains(it) && itMap_[it] == o_->begin());
00055   }
00056 
00057   void iteratorEnd(int it) {
00058     if (!o_)
00059       return;
00060     itMap_[it] = o_->end();
00061   }
00062 
00063   bool iteratorIsEnd(int it) {
00064     if (!o_)
00065       return false;
00066     return (itMap_.contains(it) && itMap_[it] == o_->end());
00067   }
00068 
00069   void iteratorNext(int it) {
00070     if (!itMap_.contains(it))
00071       return;
00072     itMap_[it]++;
00073   }
00074 
00075   void iteratorPrev(int it) {
00076     if (!itMap_.contains(it))
00077       return;
00078     itMap_[it]--;
00079   }
00080 
00081   QCanvasItem *iteratorValue(int it) {
00082     if (!itMap_.contains(it))
00083       return 0;
00084     return *itMap_[it];
00085   }
00086 
00087 private:
00088   static int itCount_;
00089   QMap<int, QCanvasItemList::const_iterator> itMap_;
00090 
00091   //@AQ_BEGIN_DEF_PUB_SLOTS@
00092 public slots:
00093   uint remove(QCanvasItem *);
00094   uint remove(AQSCanvasItem *);
00095   void clear();
00096   int size() const;
00097   bool empty() const;
00098   bool isEmpty() const;
00099   QCanvasItem *first();
00100   QCanvasItem *last();
00101   int findIndex(QCanvasItem *) const;
00102   int findIndex(AQSCanvasItem *) const;
00103   int contains(QCanvasItem *) const;
00104   int contains(AQSCanvasItem *) const;
00105   int count() const;
00106 
00107 protected:
00108   static void *construct(const QSArgumentList &args) {
00109     return 0;
00110   }
00111   //@AQ_END_DEF_PUB_SLOTS@
00112 };
00113 
00114 //@AQ_BEGIN_IMP_PUB_SLOTS@
00115 inline uint AQSCanvasItemList::remove(QCanvasItem *arg0)
00116 {
00117   AQ_CALL_RET_V(remove(arg0), uint);
00118 }
00119 inline uint AQSCanvasItemList::remove(AQSCanvasItem *arg0)
00120 {
00121   AQ_CALL_RET_V(remove(*arg0), uint);
00122 }
00123 inline void AQSCanvasItemList::clear()
00124 {
00125   AQ_CALL_VOID(clear());
00126 }
00127 inline int AQSCanvasItemList::size() const
00128 {
00129   AQ_CALL_RET_V(size(), int);
00130 }
00131 inline bool AQSCanvasItemList::empty() const
00132 {
00133   AQ_CALL_RET_V(empty(), bool);
00134 }
00135 inline bool AQSCanvasItemList::isEmpty() const
00136 {
00137   AQ_CALL_RET_V(isEmpty(), bool);
00138 }
00139 inline QCanvasItem *AQSCanvasItemList::first()
00140 {
00141   AQ_CALL_RET(first());
00142 }
00143 inline QCanvasItem *AQSCanvasItemList::last()
00144 {
00145   AQ_CALL_RET(last());
00146 }
00147 inline int AQSCanvasItemList::findIndex(QCanvasItem *arg0) const
00148 {
00149   AQ_CALL_RET_V(findIndex(arg0), int);
00150 }
00151 inline int AQSCanvasItemList::findIndex(AQSCanvasItem *arg0) const
00152 {
00153   AQ_CALL_RET_V(findIndex(*arg0), int);
00154 }
00155 inline int AQSCanvasItemList::contains(QCanvasItem *arg0) const
00156 {
00157   AQ_CALL_RET_V(contains(arg0), int);
00158 }
00159 inline int AQSCanvasItemList::contains(AQSCanvasItem *arg0) const
00160 {
00161   AQ_CALL_RET_V(contains(*arg0), int);
00162 }
00163 inline int AQSCanvasItemList::count() const
00164 {
00165   AQ_CALL_RET_V(count(), int);
00166 }
00167 //@AQ_END_IMP_PUB_SLOTS@
00168 
00169 #endif /* AQSCANVASITEMLIST_P_H_ */
00170 // @AQSVOIDPTR@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'