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

libkdegames/libkdegamesprivate/kgame

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
  • libkdegamesprivate
  • kgame
kgamepropertyhandler.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) 2001 Martin Heni (kde at heni-online.de)
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 
21 #ifndef __KGAMEPROPERTYHANDLER_H_
22 #define __KGAMEPROPERTYHANDLER_H_
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QMultiHash>
26 
27 #include "kgameproperty.h"
28 #include "../libkdegamesprivate_export.h"
29 
30 class QDataStream;
31 class KGame;
32 //class KGamePropertyBase;
33 
34 class KGamePropertyHandlerPrivate; // wow - what a name ;-)
35 
73 class KDEGAMESPRIVATE_EXPORT KGamePropertyHandler : public QObject
74 {
75  Q_OBJECT
76 
77 public:
84  KGamePropertyHandler(QObject* parent = 0);
85 
91  KGamePropertyHandler(int id, const QObject* receiver, const char* sendf, const char* emitf, QObject* parent = 0);
92  ~KGamePropertyHandler();
93 
105  void registerHandler(int id, const QObject *receiver, const char * send, const char *emit);
106 
122  bool processMessage(QDataStream &stream, int id, bool isSender );
123 
127  int id() const;
128 
136  bool addProperty(KGamePropertyBase *data, const QString& name=QString());
137 
143  bool removeProperty(KGamePropertyBase *data);
144 
151  int uniquePropertyId();
152 
153 
160  virtual bool load(QDataStream &stream);
161 
168  virtual bool save(QDataStream &stream);
169 
175  bool sendProperty(QDataStream &s);
176 
177  void sendLocked(bool l);
178 
184  void emitSignal(KGamePropertyBase *data);
185 
192  QString propertyName(int id) const;
193 
198  KGamePropertyBase *find(int id);
199 
213  void clear();
214 
219  void setId(int id);//AB: TODO: make this protected in KGamePropertyHandler!!
220 
225  void unlockProperties();
226 
235  void setPolicy(KGamePropertyBase::PropertyPolicy p, bool userspace=true);
236 
247  void lockDirectEmit();
248 
253  void unlockDirectEmit();
254 
259  KGamePropertyBase::PropertyPolicy policy();
260 
270  void lockProperties();
271 
276  void flush();
277 
281  QMultiHash<int, KGamePropertyBase*> &dict() const;
282 
294  QString propertyValue(KGamePropertyBase* property);
295 
296 
300  void Debug();
301 
302 
303 Q_SIGNALS:
314  void signalPropertyChanged(KGamePropertyBase *);
315 
323  void signalSendMessage(int msgid, QDataStream &, bool* sent); // AB shall we change bool* into bool& again?
324 
344  void signalRequestValue(KGamePropertyBase* property, QString& value);
345 
346 private:
347  friend class KGamePropertyHandlerPrivate;
348  KGamePropertyHandlerPrivate *const d;
349 
350  Q_DISABLE_COPY(KGamePropertyHandler)
351 };
352 
353 #endif
QDataStream
KGamePropertyHandler
A collection class for KGameProperty objects.
Definition: kgamepropertyhandler.h:73
KGamePropertyBase::PropertyPolicy
PropertyPolicy
The policy of the property.
Definition: kgameproperty.h:112
kgameproperty.h
QObject
QString
KGamePropertyBase
Base class of KGameProperty.
Definition: kgameproperty.h:45
KGame
The main KDE game object.
Definition: kgame.h:60
QMultiHash< int, KGamePropertyBase * >
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames/libkdegamesprivate/kgame

Skip menu "libkdegames/libkdegamesprivate/kgame"
  • 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