1 /* 2 Copyright (C) 2014 Aseman 3 http://aseman.co 4 5 This project is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This project is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef PHOTOSIZELIST_H 20 #define PHOTOSIZELIST_H 21 22 #include <QObject> 23 24 #include "telegramqml_global.h" 25 26 class PhotoSize; 27 class PhotoSizeObject; 28 class PhotoSizeListPrivate; 29 class TELEGRAMQMLSHARED_EXPORT PhotoSizeList : public QObject 30 { 31 Q_OBJECT 32 33 Q_PROPERTY(PhotoSizeObject* first READ first NOTIFY firstChanged) 34 Q_PROPERTY(PhotoSizeObject* last READ last NOTIFY lastChanged) 35 Q_PROPERTY(int count READ count NOTIFY countChanged) 36 37 public: 38 PhotoSizeList(QObject *parent = 0); 39 PhotoSizeList(const QList<PhotoSize> & another, QObject *parent = 0); 40 ~PhotoSizeList(); 41 42 void operator =( const QList<PhotoSize> & another ); 43 44 PhotoSizeObject *first() const; 45 PhotoSizeObject *last() const; 46 47 int count() const; 48 49 public Q_SLOTS: 50 PhotoSizeObject *at( int idx ); 51 52 Q_SIGNALS: 53 void firstChanged(); 54 void lastChanged(); 55 void countChanged(); 56 57 private: 58 PhotoSizeListPrivate *p; 59 }; 60 61 Q_DECLARE_METATYPE(PhotoSizeList*) 62 63 #endif // PHOTOSIZELIST_H 64