androidrunfactories.h 3.53 KB
Newer Older
BogDan Vatra's avatar
BogDan Vatra committed
1 2
/**************************************************************************
**
3
** Copyright (c) 2013 BogDan Vatra <bog_dan_ro@yahoo.com>
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
BogDan Vatra's avatar
BogDan Vatra committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
BogDan Vatra's avatar
BogDan Vatra committed
7
**
hjk's avatar
hjk committed
8 9 10 11 12 13 14
** 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
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
BogDan Vatra's avatar
BogDan Vatra committed
15 16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17 18 19 20 21 22 23 24 25
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
BogDan Vatra's avatar
BogDan Vatra committed
26 27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
BogDan Vatra's avatar
BogDan Vatra committed
29 30 31 32 33

#ifndef ANDROIDRUNFACTORIES_H
#define ANDROIDRUNFACTORIES_H

#include <projectexplorer/runconfiguration.h>
Tobias Hunger's avatar
Tobias Hunger committed
34
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
BogDan Vatra's avatar
BogDan Vatra committed
35 36

namespace ProjectExplorer {
hjk's avatar
hjk committed
37 38 39 40 41
class RunControl;
class RunConfigWidget;
class Target;
class Node;
} // namespace ProjectExplorer
Tobias Hunger's avatar
Tobias Hunger committed
42

BogDan Vatra's avatar
BogDan Vatra committed
43 44 45
namespace Android {
namespace Internal {

Tobias Hunger's avatar
Tobias Hunger committed
46
class AndroidRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigurationFactory
BogDan Vatra's avatar
BogDan Vatra committed
47 48 49 50 51 52
{
    Q_OBJECT

public:
    explicit AndroidRunConfigurationFactory(QObject *parent = 0);

53
    QString displayNameForId(const Core::Id id) const;
hjk's avatar
hjk committed
54
    QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
BogDan Vatra's avatar
BogDan Vatra committed
55

hjk's avatar
hjk committed
56
    bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
BogDan Vatra's avatar
BogDan Vatra committed
57

hjk's avatar
hjk committed
58
    bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
BogDan Vatra's avatar
BogDan Vatra committed
59

hjk's avatar
hjk committed
60 61
    bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
    ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
Tobias Hunger's avatar
Tobias Hunger committed
62 63 64

    QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
                                                                        ProjectExplorer::Node *n);
65 66 67 68 69

private:
    bool canHandle(ProjectExplorer::Target *t) const;

    ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
70 71
    ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
                                                 const QVariantMap &map);
BogDan Vatra's avatar
BogDan Vatra committed
72 73
};

hjk's avatar
hjk committed
74
class AndroidRunControlFactory : public ProjectExplorer::IRunControlFactory
BogDan Vatra's avatar
BogDan Vatra committed
75 76
{
    Q_OBJECT
hjk's avatar
hjk committed
77

BogDan Vatra's avatar
BogDan Vatra committed
78 79 80 81 82
public:
    explicit AndroidRunControlFactory(QObject *parent = 0);

    QString displayName() const;

hjk's avatar
hjk committed
83
    bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
BogDan Vatra's avatar
BogDan Vatra committed
84
                ProjectExplorer::RunMode mode) const;
hjk's avatar
hjk committed
85
    ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
86 87
                       ProjectExplorer::RunMode mode,
                       QString *errorMessage);
BogDan Vatra's avatar
BogDan Vatra committed
88 89 90 91 92 93
};

} // namespace Internal
} // namespace Android

#endif  // ANDROIDRUNFACTORIES_H