summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/codegenerationwizard.h
blob: 52a35bd97b26db7f7f674776b6f9ccfc4b0a9a85 (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
79
80
81
82
83
84
85
86
87
88
89
/***************************************************************************
                          codegenerationwizard.h  -  description
                             -------------------
    begin                : Wed Jul 24 2002
    copyright            : (C) 2002 by Luis De la Parra
    email                : luis@delaparra.org
  Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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) 2003-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef CODEGENERATIONWIZARD_H
#define CODEGENERATIONWIZARD_H

#include <tqwidget.h>
#include <tqptrlist.h>
#include "codegenerationwizardbase.h"
#include "settingsdlg.h"
#include "../umlclassifierlist.h"

class UMLApp;
class UMLDoc;
class CodeGenerator;
class CodeGenerationOptionsPage;

/**
 * @author Luis De la Parra
 * based on wizard from Paul Hensgen
 */

class CodeGenerationWizard : public CodeGenerationWizardBase {
    Q_OBJECT
  
public:
    CodeGenerationWizard(UMLClassifierList *classList);
    ~CodeGenerationWizard();

    void showPage(TQWidget *);

    int exec() {
        return TQWizard::exec();
    }
protected slots:

    /**
     * Adds the classes selected in the available classes list to the
     * list of classes used to generate the code.
     */
    void selectClass();

    /**
     * Removes the classes selected in the selected classes list from the
     * list of classes used to generate the code.
     */
    void deselectClass();
    void populateStatusList();
    void generateCode();
    void classGenerated(UMLClassifier* concept, bool generated);

private slots:
    void changeLanguage();


private:
    CodeGenerator* generator();

    /**
     * Moves the selected items from first list to second list.
     * The selected items are removed from the first list and added to the
     * second. An item is added to the second list only if it isn't already
     * there (no duplicated items are created).
     */
    void moveSelectedItems(TQListView* fromList, TQListView* toList);

    UMLApp* m_app;
    UMLDoc* m_doc;
    CodeGenerationOptionsPage* m_CodeGenerationOptionsPage;
};

#endif