Warning, /libraries/kirigami-addons/src/components/AlbumModelItem.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003
0004 import QtQuick
0005
0006 /**
0007 * @brief An object container for defining content items to show in a AlbumMaximizeComponent.
0008 *
0009 * The intended use is that a list of these can be used as the ListView model for
0010 * a AlbumMaximizeComponent.
0011 *
0012 * Example definition:
0013 * @code
0014 * property list<AlbumModelItem> model: [
0015 * AlbumModelItem {
0016 * type: AlbumModelItem.Image
0017 * source: "path/to/source"
0018 * tempSource: "path/to/tempSource"
0019 * },
0020 * AlbumModelItem {
0021 * type: AlbumModelItem.Video
0022 * source: "path/to/source"
0023 * tempSource: "path/to/tempSource"
0024 * }
0025 * ]
0026 * @endcode
0027 *
0028 */
0029 QtObject {
0030 id: root
0031
0032 enum Type {
0033 Image,
0034 Video
0035 }
0036
0037 /**
0038 * @brief The delegate type that should be shown for this item.
0039 *
0040 * Possible values:
0041 * - AlbumModelItem.Image - Show an image delegate (including GIFs).
0042 * - AlbumModelItem.Video - Show a video delegate.
0043 */
0044 property int type
0045
0046 /**
0047 * @brief The source for the item.
0048 */
0049 property string source
0050
0051 /**
0052 * @brief Source for the temporary content.
0053 *
0054 * Typically used when downloading the image to show a thumbnail or other
0055 * temporary image while the main image downloads.
0056 */
0057 property string tempSource: ""
0058
0059 /**
0060 * @brief The caption for the item.
0061 *
0062 * Typically set to the filename if no caption is available.
0063 */
0064 property string caption: ""
0065
0066 /**
0067 * @brief The height of the source image.
0068 *
0069 * Used to calculate the aspect ratio of the image.
0070 */
0071 property real sourceHeight: 0
0072
0073 /**
0074 * @brief The width of the source image.
0075 *
0076 * Used to calculate the aspect ratio of the image.
0077 */
0078 property real sourceWidth: 0
0079 }