SVN_SILENT made messages (.desktop file)
[kdegames.git] / libkdegames / kchatdialog.h
blobe3ddf2742fec9b1b2a58369efb63c1175db21025
1 /*
2 This file is part of the KDE games library
3 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef __KCHATDIALOG_H__
21 #define __KCHATDIALOG_H__
23 #include <libkdegames_export.h>
25 #include <kdialog.h>
27 class KChatBase;
29 class KChatDialogPrivate;
31 /**
32 * \class KChatDialog kchatdialog.h <KChatDialog>
33 * */
34 class KDEGAMES_EXPORT KChatDialog : public KDialog
36 Q_OBJECT
37 public:
38 /**
39 * Construct a KChatDialog widget
40 **/
41 explicit KChatDialog(QWidget* parent, bool modal = false);
43 /**
44 * Construct a KChatDialog widget which automatically configures the
45 * @ref KChatBase widget. You probably want to use this as you don't
46 * have to care about the configuration stuff yourself.
47 **/
48 KChatDialog(KChatBase* chatWidget, QWidget* parent, bool modal = false);
50 /**
51 * Destruct the dialog
52 **/
53 ~KChatDialog();
55 /**
56 * @return The font that shall be used as the "name: " part of a normal
57 * message.
58 **/
59 QFont nameFont() const;
61 /**
62 * @return The font that shall be used for normal messages.
63 **/
64 QFont textFont() const;
66 /**
67 * @return The font that shall be used as the "name: " part of a system
68 * (game) message.
69 **/
70 QFont systemNameFont() const;
72 /**
73 * @return The font that shall be used for a system (game) message.
74 **/
75 QFont systemTextFont() const;
77 /**
78 * Set the widget that will be configured by the dialog. Use this if you
79 * don't want to configure the widget yourself.
80 * @param widget The chat widget that shall be configured
81 * @param applyFonts Whether you want to have the current @ref KChatBase fonts as
82 * defaults in the dialog
83 **/
84 void plugChatWidget(KChatBase* widget, bool applyFonts = true);
86 /**
87 * Used to configure the chat widget according to the user settings.
88 * This is called automatically if @ref plugChatWidget was called
89 * before.
90 * @param widget The chat widget that shall be configured
91 **/
92 void configureChatWidget(KChatBase* widget);
94 /**
95 * @return The maximal allowed messages in the chat widget. -1 is
96 * unlimited
97 **/
98 int maxMessages() const;
100 protected Q_SLOTS:
101 void slotGetNameFont();
102 void slotGetTextFont();
103 void slotGetSystemNameFont();
104 void slotGetSystemTextFont();
106 virtual void slotApply();
107 virtual void slotOk();
109 private:
110 void setNameFont(QFont);
111 void setTextFont(QFont);
112 void setSystemNameFont(QFont);
113 void setSystemTextFont(QFont);
114 void setMaxMessages(int max);
116 private:
117 void init();
119 private:
120 KChatDialogPrivate* const d;
123 #endif