File indexing completed on 2025-01-19 03:55:41
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2018-07-26 0007 * Description : common items needed for web services 0008 * 0009 * SPDX-FileCopyrightText: 2018 by Thanh Trung Dinh <dinhthanhtrung1996 at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_WS_ITEM_H 0016 #define DIGIKAM_WS_ITEM_H 0017 0018 // Qt includes 0019 0020 #include <QString> 0021 #include <QStringList> 0022 0023 // Local includes 0024 0025 #include "digikam_export.h" 0026 0027 namespace Digikam 0028 { 0029 0030 class DIGIKAM_EXPORT WSAlbum 0031 { 0032 0033 public: 0034 0035 explicit WSAlbum() 0036 : parentID(QLatin1String("")), 0037 isRoot(true), 0038 description(QLatin1String("")), 0039 url(QLatin1String("")), 0040 uploadable(true) 0041 { 0042 } 0043 0044 /** 0045 * This method is used by derived class of WSAblum, 0046 * to set the attributes inherited from WSAlbum, knowing 0047 * a WSAlbum. 0048 */ 0049 void setBaseAlbum(const WSAlbum& album) 0050 { 0051 id = album.id; 0052 parentID = album.parentID; 0053 isRoot = album.isRoot; 0054 title = album.title; 0055 description = album.description; 0056 location = album.location; 0057 url = album.url; 0058 uploadable = album.uploadable; 0059 } 0060 0061 QString id; 0062 QString parentID; 0063 bool isRoot; 0064 0065 QString title; 0066 QString description; 0067 QString location; 0068 QString url; 0069 bool uploadable; 0070 }; 0071 0072 /** 0073 * This class is used when parsing response of listAlbums(). 0074 * It contains only the most important attributes of an album, 0075 * which is needed for further usage (e.g upload photos, create new album). 0076 */ 0077 class DIGIKAM_EXPORT AlbumSimplified 0078 { 0079 0080 public: 0081 0082 explicit AlbumSimplified() 0083 : uploadable(true) 0084 { 0085 } 0086 0087 explicit AlbumSimplified(const QString& title) 0088 : title(title), 0089 uploadable(true) 0090 { 0091 } 0092 0093 explicit AlbumSimplified(const QString& title, bool uploadable) 0094 : title(title), 0095 uploadable(uploadable) 0096 { 0097 } 0098 0099 public: 0100 0101 QString title; 0102 QStringList childrenIDs; 0103 bool uploadable; 0104 }; 0105 0106 } // namespace Digikam 0107 0108 #endif // DIGIKAM_WS_ITEM_H