summaryrefslogtreecommitdiffstats
path: root/konversation/src/konviconfigdialog.h
blob: b492de143013b57bd744ca640c0d708e68ff1b81 (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
114
115
116
117
118
119
120
121
122
123
124
125
/*
 *  This file is part of the KDE libraries
 *  Copyright (C) 2003 Benjamin C Meyer (ben+tdelibs at meyerhome dot net)
 *  Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
 *  Copyright (C) 2004 Michael Brade <brade@kde.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 */

/*
 *  TDEConfigDialog derivative allowing for a multi-level hierarchical TreeList.
 *  Differences from TDEConfigDialog:
 *  - Use TQStringList instead of TQString for the item name(s) in addPage and
 *    addPageInternal, thus calling the respective KDialogBase methods which
 *    allow specifying a path from which the TreeList hierarchy is constructed.
 *  - Use 16x16 icons in the TreeList.
 *  - Fill a new int m_lastAddedIndex with the pageIndex() of a new page added
 *    with addPageInternal, and offer a public interface int lastAddedIndex().
 *  See the TDEConfigDialog reference for detailed documentation.
 *
 *  begin:     Nov 22 2005
 *  copyright: (C) 2005-2006 by Eike Hein, TDEConfigDialog developers
 *  email:     hein@kde.org
 */

#ifndef KONVICONFIGDIALOG_H
#define KONVICONFIGDIALOG_H

#include <tqasciidict.h>

#include <kdialogbase.h>


class TDEConfig;
class TDEConfigSkeleton;
class TDEConfigDialogManager;

class KonviConfigDialog : public KDialogBase
{
    TQ_OBJECT
  

    signals:
    void widgetModified();

    void settingsChanged();

    void settingsChanged(const char *dialogName);

    void sigUpdateWidgets();

    public:
        KonviConfigDialog( TQWidget *parent, const char *name,
                           TDEConfigSkeleton *config,
                           DialogType dialogType = IconList,
                           int dialogButtons = Default|Ok|Apply|Cancel|Help,
                           ButtonCode defaultButton = Ok,
                           bool modal=false );

        ~KonviConfigDialog();

        void addPage( TQWidget *page, const TQStringList &items,
                      const TQString &pixmapName,
                      const TQString &header=TQString(),
                      bool manage=true );

        void addPage( TQWidget *page, TDEConfigSkeleton *config,
                      const TQStringList &items,
                      const TQString &pixmapName,
                      const TQString &header=TQString() );

        static KonviConfigDialog* exists( const char* name );

        static bool showDialog( const char* name );

        virtual void show();

        int lastAddedIndex();

    protected slots:
        virtual void updateSettings();

        virtual void updateWidgets();

        virtual void updateWidgetsDefault();

    protected:
        virtual bool hasChanged() { return false; }

        virtual bool isDefault() { return true; }

    protected slots:
        void updateButtons();

        void settingsChangedSlot();

    private:
        void addPageInternal(TQWidget *page, const TQStringList &items,
                             const TQString &pixmapName, const TQString &header);

        void setupManagerConnections(TDEConfigDialogManager *manager);

    private:
        static TQAsciiDict<KonviConfigDialog> openDialogs;

        class TDEConfigDialogPrivate;

        TDEConfigDialogPrivate *d;

        int m_lastAddedIndex;
};
#endif //KONVICONFIGDIALOG_H