Source: fun/Nameable.h


Annotated List
Files
Globals
Hierarchy
Index
//  Nameable - uhh, it has a name
//  Copyright (C) 2002-2003 bozo & sgbeal @users.sourceforge.net
//
//  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.
//
//  This program 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 General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef _FUN_NAMEABLE_H
#define _FUN_NAMEABLE_H

#include 

namespace fun
{

/**
*  This is just a simple interface for objects which have some sort of name
*  string which can be set and retrieved.  I wanted it to be a QObject so
*  that it could emit a signal when its name changed, but that added a lot
*  of stuff (including 8 pointers per object!), and moc can't handle (or
*  "can almost handle") a class which inherits from two QObject subclasses
*  at once (such as Nameable & Describable).
*
*  Also, I tried making this & Describably be virtual public Serializables,
*  but then I got SEGV's during deserialization.  Nuts!!
*/
class Nameable : /*public QObject,*/ public virtual Serializable
{
//	Q_ O B J E C T;
	public:
	/**
	*  Returns this object's name.
	*/
	virtual QString getName() const { return name; }

//	public slots:
	/**
	*  Sets this object's name & emits the nameChanged() signal.
	*/
	virtual void setName(const QString &newName);

//	signals:
//	virtual void nameChanged(QString);

	public:
	virtual void serialize(Serializer &ser) const;
	/**
	*  Note that this does not emit the nameChanged() signal.
	*/
	virtual void deserialize(const Deserializer &ser);

	private:
	QString name;
};

}  //  namespace fun

#endif  //  _FUN_NAMEABLE_H

Generated by: stephan on cheyenne on Mon Aug 11 14:06:52 2003, using kdoc 2.0a54.