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 REPORTHANDLER_H
25
#define REPORTHANDLER_H
26
27
class QString;
28
#include "apiextractormacros.h"
29
30
class APIEXTRACTOR_API ReportHandler
31
{
32
public:
33
    enum DebugLevel { NoDebug, SparseDebug, MediumDebug, FullDebug };
34
35
    static void setContext(const QString &context);
36
37
    static DebugLevel debugLevel();
38
    static void setDebugLevel(DebugLevel level);
39
40
    static int warningCount();
41
42
    static int suppressedCount();
43
44
    static void warning(const QString &str);
45
46
    template <typename T>
47
    static void setProgressReference(T collection)
48
    {
49
        setProgressReference(collection.count());
50
    }
51
52
    static void setProgressReference(int max);
53
54
    static void progress(const QString &str, ...);
55
56
    static void debugSparse(const QString &str)
57
    {
58
        debug(SparseDebug, str);
59
    }
60
    static void debugMedium(const QString &str)
61
    {
62
        debug(MediumDebug, str);
63
    }
64
    static void debugFull(const QString &str)
65
    {
66
        debug(FullDebug, str);
67
    }
68
    static void debug(DebugLevel level, const QString &str);
69
70
    static bool isSilent();
71
    static void setSilent(bool silent);
72
    static void flush();
73
};
74
75
#endif // REPORTHANDLER_H