summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/cmdlineexportallviewsevent.h
blob: 8954955a6316c672bf99ce42fe65401192062207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2006                                                    *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef CMDLINEEXPORTALLVIEWSEVENT_H
#define CMDLINEEXPORTALLVIEWSEVENT_H

#include <tqevent.h>
#include <kurl.h>

/**
 * This class provides an event that is posted to the UMLApp when the "export all views"
 * option was set in the command line. Once the QT main loop begins, the event is processed.
 *
 * The processing made in UMLApp is execute the exportAllViews method in the event.
 * This method exports all the views using UMLViewImageExporterModel and then finishes
 * the application using a close event.
 *
 * @see UMLViewImageExporterModel
 */
class CmdLineExportAllViewsEvent : public TQCustomEvent {
public:

    /**
     * Returns the type of the event.
     */
    static int getType();

    /**
     * Constructor for CmdLineExportAllViewsEvent.
     *
     * @param imageType The type of the images the views will be exported to.
     * @param directory The url of the directory where the images will be saved.
     * @param useFolders If the tree structure of the views in the document must be created
     *                   in the target directory.
     */
    CmdLineExportAllViewsEvent(const TQString &imageType, const KURL &directory, const bool useFolders);

    /**
     * Destructor for CmdLineExportAllViewsEvent
     */
    virtual ~CmdLineExportAllViewsEvent() {
    }

    /**
     * Exports all the views using UMLViewImageExporterModel, prints the errors
     * occurred in the error output and sends a close event to the application to finish it.
     * To export the views, it uses the attributes set when the event was created.
     */
    void exportAllViews();

private:

    /**
     * The type of the images the views will be exported to.
     */
    TQString m_imageType;

    /**
     * The url of the directory where the images will be saved.
     */
    KURL m_directory;

    /**
     * If the tree structure of the views in the document must be created
     * in the target directory.
     */
    bool m_useFolders;
};

#endif