summaryrefslogtreecommitdiffstats
path: root/parts/classview/classtooldlg.h
blob: c4b2e79a4f4ec1561002f983553df580cf8b5ad2 (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
/***************************************************************************
 *   Copyright (C) 1999 by Jonas Nordin                                    *
 *   jonas.nordin@syncom.se                                                *
 *   Copyright (C) 2000-2001 by Bernd Gehrmann                             *
 *   bernd@kdevelop.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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef _CLASSTOOLDLG_H_
#define _CLASSTOOLDLG_H_

#include <tqdialog.h>
#include <tqlabel.h>
#include <tqtoolbutton.h>
#include <tqcombobox.h>
#include <tqlayout.h>
#include "classtoolwidget.h"
#include "parseditem.h"

class ClassViewPart;
class ClassStore;
class ParsedClass;


class ClassToolDialog : public TQWidget
{
    Q_OBJECT
  

public:
    enum Operations { ViewParents, ViewChildren, ViewClients, ViewSuppliers,
                      ViewMethods, ViewAttributes, ViewNone };
    
    ClassToolDialog( ClassViewPart *part );
    ~ClassToolDialog();

    void setClassName(const TQString &name);

public slots:

    /** View nothing. */
    void viewNone();
    /** View the parents of the current class. */
    void viewParents();
    /** View the children of the current class. */
    void viewChildren();
    /** View all classes that has this class as an attribute. */
    void viewClients();
    /** View all classes that this class has as attributes. */
    void viewSuppliers();
    /** View methods in this class and parents. */
    void viewMethods();
    /** View attributes in this class and parents. */
    void viewAttributes();

private slots:
    void setLanguageSupport(TDevLanguageSupport *ls);
    void refresh();

    void delayedClose();
    void slotClose();
    void slotAccessComboChoice(const TQString &str);
    void slotClassComboChoice(const TQString &str);


private:
    void updateCaptionAndButtons();
    void buildTree();

    ClassToolWidget *class_tree;
    TQComboBox *class_combo;
    
    TQToolButton *parents_button;
    TQToolButton *children_button;
    TQToolButton *clients_button;
    TQToolButton *suppliers_button;
    TQToolButton *methods_button;
    TQToolButton *attributes_button;
    TQComboBox *access_combo;
    
    /** Store that holds all classes in the system. */
    ClassStore *m_store;
    TDevLanguageSupport *m_ls;
    ClassViewPart *m_part;
    
    /** The class we are currently viewing. */
    ParsedClass *currentClass;
    /** The current exportstatus selected in the combo. */
    PIAccess comboAccess;
    /** Stores what operation the user selected last. */
    Operations currentOperation;
};

#endif