/*
 * Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#pragma once

#include "folderwizard.h"

#include "libsync/account.h"

#include <QPointer>
#include <QCoreApplication>
#include <QLoggingCategory>
#include <QStringList>

namespace OCC {
Q_DECLARE_LOGGING_CATEGORY(lcFolderWizard);

class FolderWizardPrivate
{
public:
    FolderWizardPrivate(FolderWizard *q, Account *account);
    static QString formatWarnings(const QStringList &warnings, bool isError = false);

    QString initialLocalPath() const;

    // todo: #44 this used to be calculated by the folderWizardRemotePath impl, which was oc10 specific and is not longer used
    // However! the folder defition still wants this value so I'm leaving this dummy here for now (which is the value returned for non oc10
    // accounts), to be investigated later
    QString remotePath() const { return QString(); }

    uint32_t priority() const;

    QString defaultSyncRoot() const;

    QUuid uuid() const;
    QUrl davUrl() const;
    QString spaceId() const;
    bool useVirtualFiles() const;
    QString displayName() const;

private:
    Q_DECLARE_PUBLIC(FolderWizard)
    FolderWizard *q_ptr;

    QPointer<Account> _account;
    class SpacesPage *_spacesPage = nullptr;
    class FolderWizardLocalPath *_folderWizardSourcePage = nullptr;
    class FolderWizardSelectiveSync *_folderWizardSelectiveSyncPage = nullptr;
};


class FolderWizardPage : public QWizardPage
{
    Q_OBJECT
public:
    FolderWizardPage(FolderWizardPrivate *parent)
        : QWizardPage(nullptr)
        , _parent(parent)
    {
    }

protected:
    inline FolderWizardPrivate *folderWizardPrivate() const
    {
        return _parent;
    }

private:
    FolderWizardPrivate *_parent;
};
}
