1
/*
2
 * This file is part of the API Extractor project.
3
 *
4
 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
5
 *
6
 * Contact: PySide team <contact@pyside.org>
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * version 2 as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful, but
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
 * 02110-1301 USA
21
 *
22
 */
23
24
#ifndef APIEXTRACTOR_H
25
#define APIEXTRACTOR_H
26
27
#include "reporthandler.h"
28
#include "abstractmetalang.h"
29
#include "apiextractormacros.h"
30
#include <QStringList>
31
32
class AbstractMetaBuilder;
33
class QIODevice;
34
35
class APIEXTRACTOR_API ApiExtractor
36
{
37
public:
38
    ApiExtractor();
39
    ~ApiExtractor();
40
41
    void setTypeSystem(const QString& typeSystemFileName);
42
    void setCppFileName(const QString& cppFileName);
43
    void setDebugLevel(ReportHandler::DebugLevel debugLevel);
44
    void setSuppressWarnings(bool value);
45
    void setSilent(bool value);
46
    void addTypesystemSearchPath(const QString& path);
47
    void addTypesystemSearchPath(const QStringList& paths);
48
    void addIncludePath(const QString& path);
49
    void addIncludePath(const QStringList& paths);
50
    void setLogDirectory(const QString& logDir);
51
    APIEXTRACTOR_DEPRECATED(void setApiVersion(double version));
52
    void setApiVersion(const QString& package, const QByteArray& version);
53
    void setDropTypeEntries(QString dropEntries);
54
55
    AbstractMetaEnumList globalEnums() const;
56
    AbstractMetaFunctionList globalFunctions() const;
57
    AbstractMetaClassList classes() const;
58
    PrimitiveTypeEntryList primitiveTypes() const;
59
    ContainerTypeEntryList containerTypes() const;
60
    QSet<QString> qtMetaTypeDeclaredTypeNames() const;
61
62
    const AbstractMetaEnum* findAbstractMetaEnum(const EnumTypeEntry* typeEntry) const;
63
    const AbstractMetaEnum* findAbstractMetaEnum(const TypeEntry* typeEntry) const;
64
    const AbstractMetaEnum* findAbstractMetaEnum(const FlagsTypeEntry* typeEntry) const;
65
    const AbstractMetaEnum* findAbstractMetaEnum(const AbstractMetaType* metaType) const;
66
67
    int classCount() const;
68
69
    bool run();
70
private:
71
    QString m_typeSystemFileName;
72
    QString m_cppFileName;
73
    QStringList m_includePaths;
74
    AbstractMetaBuilder* m_builder;
75
    QString m_logDirectory;
76
77
    // disable copy
78
    ApiExtractor(const ApiExtractor&);
79
    ApiExtractor& operator=(const ApiExtractor&);
80
};
81
82
#endif // APIEXTRACTOR_H