summaryrefslogtreecommitdiffstats
path: root/krename/helpdialog.h
blob: 33b5ceaf986f90eb6856fd06dbadb26828b62e36 (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
103
104
105
106
107
108
109
110
111
112
113
/***************************************************************************
                          helpdialog.h  -  description
                             -------------------
    begin                : Fr Nov 15 13:44:19 CEST 2001
    copyright            : (C) 2002 by Dominik Seichter
    email                : domseichter@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 HELPDIALOG_H
#define HELPDIALOG_H

#include <tqdialog.h>
#include <tqstringlist.h>
#include <tqpixmap.h>
#include <tqmap.h>

class TQVBoxLayout; 
class TQHBoxLayout; 
class TQGridLayout; 
class TQComboBox;
class TQLineEdit;
class TQPixmap;
class KListView;
class KPushButton;

class HelpDialogData : public TQObject {
    Q_OBJECT
  
    public:
        HelpDialogData() {}
        ~HelpDialogData() {}
        
        void add( const TQString & headline, TQStringList* commands, const TQPixmap & icon, bool first = false );
        void remove( const TQString & headline );
        
        /** returns all available and supported tokens 
          */
        TQStringList tokens() const;
    
        inline const TQMap<TQString,TQStringList> & map() const
        {
            return m_map;
        }
        
        inline const TQMap<TQString,TQPixmap> & icons() const
        {
            return m_icons;
        }
        
        inline const TQString & first() const 
        {
            return m_first;
        }
        
    signals:
        void updateHeadline();
        void updateItems();
        
    private:
        TQMap<TQString,TQStringList> m_map;
        TQMap<TQString,TQPixmap> m_icons;
    
        TQString m_first;
};

class HelpDialog : public TQDialog
{ 
    Q_OBJECT
  
    public:
        HelpDialog( HelpDialogData* data, TQWidget* parent = 0,
            const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
        ~HelpDialog();

        inline void setLineEdit( TQLineEdit* lineedit );

    public slots:
        void updateItems();
        void updateHeadline();
        
    private slots:
        void execute();

    private:        
        TQComboBox* comboHeadline;
        KListView* list;
        KPushButton* buttonAdd;
        KPushButton* buttonClose;

    protected:
        HelpDialogData* m_data;
        
        TQLineEdit* text;

        TQVBoxLayout* HelpDialogLayout;
        TQHBoxLayout* Layout1;
};

void HelpDialog::setLineEdit( TQLineEdit* lineedit )
{ 
     text = lineedit; 
}

#endif // HELPDIALOG_H