• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames/libkdegamesprivate

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
  • libkdegamesprivate
kchatbase.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4  Copyright (C) 2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef __KCHATBASE_H__
21 #define __KCHATBASE_H__
22 
23 #include <QtGui/QFrame>
24 
25 #include <kglobalsettings.h>
26 #include "libkdegamesprivate_export.h"
27 
28 class KConfig;
29 
30 class KChatBasePrivate;
31 class KChatBaseModel;
32 class KChatBaseItemDelegate;
33 class QModelIndex;
34 class QPoint;
35 
71 class KDEGAMESPRIVATE_EXPORT KChatBase : public QFrame
72 {
73  Q_OBJECT
74 public:
83  explicit KChatBase(QWidget* parent, KChatBaseModel* model=0,
84  KChatBaseItemDelegate* delegate=0,
85  bool noComboBox = false);
86 
92  virtual ~KChatBase();
93 
94  enum SendingIds {
95  SendToAll = 0
96  };
97 
103  virtual QString fromName() const = 0;
104 
116  bool addSendingEntry(const QString& text, int id);
117 
129  bool insertSendingEntry(const QString& text, int id, int index = -1);
130 
136  void changeSendingEntry(const QString& text, int id);
137 
142  void setSendingEntry(int id);
143 
150  void removeSendingEntry(int id);
151 
159  int sendingEntry() const;
160 
164  int findIndex(int id) const;
165 
170  int nextId() const;
171 
178  virtual bool acceptMessage() const;
179 
183  void setCompletionMode(KGlobalSettings::Completion mode);
184 
189  void setNameFont(const QFont& font);
190 
195  void setMessageFont(const QFont& font);
196 
203  void setBothFont(const QFont& font);
204 
209  void setSystemNameFont(const QFont& font);
210 
215  void setSystemMessageFont(const QFont& font);
216 
221  void setSystemBothFont(const QFont& font);
222 
230  QFont nameFont() const;
231 
239  QFont messageFont() const;
240 
245  QFont systemNameFont() const;
246 
251  QFont systemMessageFont() const;
252 
262  virtual void saveConfig(KConfig* conf = 0);
263 
269  virtual void readConfig(KConfig* conf = 0);
270 
278  void setMaxItems(int maxItems);
279 
283  void clear();
284 
289  int maxItems() const;
290 
291  KChatBaseModel* model();
292  void setModel(KChatBaseModel* m);
293 
294 public Q_SLOTS:
306  virtual void addMessage(const QString& fromName, const QString& text);
307 
315  virtual void addSystemMessage(const QString& fromName, const QString& text);
316 
321  void slotClear();
322 
327  void setAcceptMessage(bool a);
328 
329 protected:
341  virtual void returnPressed(const QString& text) = 0;
342 
350  virtual QString comboBoxItem(const QString& name) const;
351 
357  const QModelIndex indexAt(const QPoint& pos) const;
358 
359 private Q_SLOTS:
365  void slotReturnPressed(const QString&);
366 
371  virtual void customMenuHandler(const QPoint &pos);
372 
373 private:
374 
375  KChatBasePrivate* d;
376 };
377 
378 #endif
QModelIndex
QWidget
KDEGAMESPRIVATE_EXPORT
#define KDEGAMESPRIVATE_EXPORT
Definition: libkdegamesprivate_export.h:46
QFont
KChatBase
The base class for chat widgets.
Definition: kchatbase.h:71
KChatBaseItemDelegate
A delegate (see the Qt Model/View module for details) to paint the lines of the KChatBase list model ...
Definition: kchatbaseitemdelegate.h:37
QPoint
KChatBase::SendingIds
SendingIds
Definition: kchatbase.h:94
libkdegamesprivate_export.h
QString
QFrame
KChatBaseModel
The model used to store messages displayed in the chat dialog messages list.
Definition: kchatbasemodel.h:76
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames/libkdegamesprivate

Skip menu "libkdegames/libkdegamesprivate"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal