2023-02-21 14:11:40 +01:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/welcomepagehelper.h>
|
|
|
|
|
#include <utils/expected.h>
|
2023-02-22 10:17:19 +01:00
|
|
|
#include <utils/filepath.h>
|
2023-02-21 14:11:40 +01:00
|
|
|
|
|
|
|
|
namespace QtSupport::Internal {
|
|
|
|
|
|
|
|
|
|
enum InstructionalType { Example = 0, Demo, Tutorial };
|
|
|
|
|
|
|
|
|
|
class ExampleItem : public Core::ListItem
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-02-22 10:17:19 +01:00
|
|
|
Utils::FilePath projectPath;
|
2023-02-21 14:11:40 +01:00
|
|
|
QString docUrl;
|
2023-02-22 10:17:19 +01:00
|
|
|
Utils::FilePaths filesToOpen;
|
|
|
|
|
Utils::FilePath mainFile; /* file to be visible after opening filesToOpen */
|
|
|
|
|
Utils::FilePaths dependencies;
|
2023-02-21 14:11:40 +01:00
|
|
|
InstructionalType type;
|
|
|
|
|
int difficulty = 0;
|
|
|
|
|
bool hasSourceCode = false;
|
|
|
|
|
bool isVideo = false;
|
|
|
|
|
bool isHighlighted = false;
|
|
|
|
|
QString videoUrl;
|
|
|
|
|
QString videoLength;
|
|
|
|
|
QStringList platforms;
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-22 10:17:19 +01:00
|
|
|
Utils::expected_str<QList<ExampleItem *>> parseExamples(const Utils::FilePath &manifest,
|
|
|
|
|
const Utils::FilePath &examplesInstallPath,
|
|
|
|
|
const Utils::FilePath &demosInstallPath,
|
2023-02-21 14:11:40 +01:00
|
|
|
bool examples);
|
|
|
|
|
|
|
|
|
|
} // namespace QtSupport::Internal
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(QtSupport::Internal::ExampleItem *)
|