summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/diagramprintpage.h
blob: 0729e71b3b42c43c36e90a536b4895ec66006abe (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
90
91
92
93
94
95
96
97
98
99
100
101
102
/***************************************************************************
 *                                                                         *
 *   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) 2002-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef DIAGRAMPRINTPAGE_H
#define DIAGRAMPRINTPAGE_H

class TQListBox;
class TQRadioButton;
class TQComboBox;
class TQButtonGroup;
class TQGroupBox;

#include <tdeprint/kprintdialogpage.h>

#include "../umldoc.h"
#include "../umlview.h"
/**
 * This is a page on the print dialog to select what diagram(s)
 * you wish to print.  You add it to the @ref KPrinter instance.
 *
 * You will then need to get the options as shown in @ref KPrinter.
 *
 * @short  A print dialog page.
 * @author Paul Hensgen <phensgen@techie.com>
 * @see    KPrinter
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 */

class DiagramPrintPage : public KPrintDialogPage {
    Q_OBJECT
  
public:
    /**
     *  Constructs the diagram print page.
     *
     *  @param parent The parent to the page.
     *  @param doc      The @ref UMLDoc class instance being used.
     */
    DiagramPrintPage(TQWidget * parent, UMLDoc *doc);

    /**
     *  Stnadard deconstructor.
     */
    ~DiagramPrintPage();

    /**
     * Overriden method. It builds a list with the diagram name and the diagram
     * IDs.
     */
    void getOptions(TQMap<TQString,TQString>& opts, bool /* incldef=false */);

    /**
     * Overriden method.
     */
    void setOptions( const TQMap<TQString,TQString>& /*opts*/ );

    /**
     * Overriden method.
     */
    bool isValid( TQString& msg );

private:
    TQButtonGroup * m_pFilterBG;
    TQGroupBox * m_pSelectGB;
    TQListBox * m_pSelectLB;
    TQRadioButton * m_pAllRB, * m_pCurrentRB, * m_pSelectRB, * m_pTypeRB;
    TQComboBox * m_pTypeCB;

    UMLDoc * m_pDoc;
    Uml::Diagram_Type m_ViewType;

    /**
     * list containing the IDs of diagrams to print
     */
    TQValueList<Uml::IDType> m_nIdList;

    enum FilterType{Current = 0, All, Select, Type};
public slots:

    /**
     * Gets called when the users chooses to print all diagrams, the current
     * diagram, a selection of diagrams or diagrams by type. It will change the
     * listed diagrams in the diagram box.
     */
    void slotClicked(int id);

    /**
     * Gets called when the user chooses another diagram type. Only diagrams of
     * this type will be shown in the diagram box.
     */
    void slotActivated(const TQString & text);
};

#endif