Source: ./mylistviewitemdata.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef MYLISTVIEWITEMDATA_H
#define MYLISTVIEWITEMDATA_H
#include "umlnamespace.h"
#include 

/**
 *	Contains all the uml data of
 *	a MyListViewItem object
 *	@author Gustavo Madrigal
 */

class MyListViewItem;
class QDataStream;
class UMLObject;

class MyListViewItemData {
public:
	/**
	 *		Constructor
	 */
	MyListViewItemData();

	/**
	 * 		Constructor
	 */
	MyListViewItemData(MyListViewItemData& Other);

	/**
	 * 		Deconstructor
	 */
	virtual ~MyListViewItemData();

	/**
	 * sets the MyListViewItem that contains the object
	 */
	void setListViewItem(MyListViewItem* Item);

	/**
	 * Returns the number of children of the MyListViewItem
	 *	containing this object
	 */
	int childCount();

	/**
	 * returns a pointer to the MyListViewItem containing this object
	 */
	MyListViewItem* getListViewItem();

	/**
	 *	 serializes this object to a QDataStream
	 */
	bool serialize(QDataStream *s, bool archive);

	/**
	 *	Serialize an instance of this class to a QDataStream that will be put in the clipboard
	 */
	virtual bool clipSerialize(QDataStream *s, const bool toClip);

	/**
	 *	 Returns the amount of bytes needed to serialize an instance object to the clipboard
	 */
	virtual long getClipSizeOf();

	/**
	 * Returns the text of the MyListViewItem containing this object
	 */
	QString text(int index);

	/**
	 * Overload '==' operator
	 */
	bool operator==(const MyListViewItemData& Other);

	/**
	 *	Overload '=' operator
	 */
	MyListViewItemData& operator=(MyListViewItemData & Other);

	/**
	 * 		Returns the UMLObject associated with this item.
	 */
	UMLObject * getUMLObject() {
		return object;
	}

	/**
	 *		Returns the type of item.
	 */
	Uml::ListView_Type getType() {
		return m_Type;
	}

	/**
	 * 	Returns the id of the item being represented.
	 */
	int getID() {
		return m_nId;
	}

	/**
	 * 		Returns the label text.
	 */
	QString getLabel() {
		return label;
	}

	/**
	 * 	Returns the amount of childer the item has.
	 */
	int getChildren() {
		return m_nChildren;
	}

	/**
	 * 		Sets the UMLObject associated with this item.
	 */
	void setUMLObject( UMLObject * _object ) {
		object = _object;
	}

	/**
	 * Sets the type of the item being represented.
	 */
	void setType( Uml::ListView_Type type ) {
		m_Type = type;
	}

	/**
	 * 	Sets the id of the item being represented.
	 */
	void setID( int id ) {
		m_nId = id;
	}

	/**
	 * 		Sets the label text.
	 */
	void setLabel( QString _label ) {
		label = _label;
	}

	bool saveToXMI( QDomDocument & qDoc, QDomElement & qElement );

protected: // Private methods

	MyListViewItem * m_pItem;
	int m_nId, m_nChildren;
	Uml::ListView_Type m_Type;
	UMLObject * object;
	QString label;
};

#endif

Generated by: jr on radge on Wed Sep 25 00:11:47 2002, using kdoc 2.0a54.