2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-01-04 11:36:55 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-07-27 13:55:30 +02:00
|
|
|
|
2014-12-19 12:05:40 +01:00
|
|
|
#include "core_global.h"
|
2009-07-27 13:55:30 +02:00
|
|
|
|
2014-12-19 12:05:40 +01:00
|
|
|
#include "id.h"
|
2014-12-16 12:01:35 +01:00
|
|
|
|
2017-02-24 18:41:22 +01:00
|
|
|
#include <QWidget>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2010-11-11 16:49:17 +01:00
|
|
|
|
2017-01-06 21:41:46 +01:00
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QPixmap;
|
|
|
|
|
QT_END_NAMESPACE
|
2009-07-27 13:55:30 +02:00
|
|
|
|
2014-12-19 12:05:40 +01:00
|
|
|
namespace Core {
|
2009-07-27 13:55:30 +02:00
|
|
|
|
2014-12-19 12:05:40 +01:00
|
|
|
class CORE_EXPORT IWelcomePage : public QObject
|
2009-07-27 13:55:30 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
2010-11-11 16:49:17 +01:00
|
|
|
Q_PROPERTY(QString title READ title CONSTANT)
|
|
|
|
|
Q_PROPERTY(int priority READ priority CONSTANT)
|
|
|
|
|
|
2009-07-27 13:55:30 +02:00
|
|
|
public:
|
|
|
|
|
IWelcomePage();
|
2018-05-07 15:00:03 +02:00
|
|
|
~IWelcomePage() override;
|
2009-07-27 13:55:30 +02:00
|
|
|
|
|
|
|
|
virtual QString title() const = 0;
|
|
|
|
|
virtual int priority() const { return 0; }
|
2020-06-26 13:59:38 +02:00
|
|
|
virtual Utils::Id id() const = 0;
|
2017-01-06 21:41:46 +01:00
|
|
|
virtual QWidget *createWidget() const = 0;
|
2017-12-08 17:20:48 +01:00
|
|
|
|
|
|
|
|
static const QList<IWelcomePage *> allWelcomePages();
|
2017-01-06 21:41:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class WelcomePageButtonPrivate;
|
|
|
|
|
|
2017-02-24 18:41:22 +01:00
|
|
|
class CORE_EXPORT WelcomePageFrame : public QWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WelcomePageFrame(QWidget *parent);
|
|
|
|
|
|
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CORE_EXPORT WelcomePageButton : public WelcomePageFrame
|
2017-01-06 21:41:46 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WelcomePageButton(QWidget *parent);
|
2018-05-07 15:00:03 +02:00
|
|
|
~WelcomePageButton() override;
|
2017-01-06 21:41:46 +01:00
|
|
|
|
|
|
|
|
void mousePressEvent(QMouseEvent *) override;
|
|
|
|
|
void enterEvent(QEvent *) override;
|
|
|
|
|
void leaveEvent(QEvent *) override;
|
|
|
|
|
|
|
|
|
|
void setText(const QString &text);
|
|
|
|
|
void setIcon(const QPixmap &pixmap);
|
|
|
|
|
void setOnClicked(const std::function<void ()> &value);
|
|
|
|
|
void setActiveChecker(const std::function<bool ()> &value);
|
|
|
|
|
void recheckActive();
|
|
|
|
|
void click();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
WelcomePageButtonPrivate *d;
|
2009-07-27 13:55:30 +02:00
|
|
|
};
|
|
|
|
|
|
2014-12-19 12:05:40 +01:00
|
|
|
} // Core
|