streamDirectoryEntry Class Reference

Abstract data type representing an entry in a tree structure. More...

#include <streamdirectoryentry.h>

Inheritance diagram for streamDirectoryEntry:

Inheritance graph
[legend]
Collaboration diagram for streamDirectoryEntry:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 streamDirectoryEntry ()
virtual ~streamDirectoryEntry ()
void appendChild (streamDirectoryEntry *child)
virtual bool canFetchMore () const
streamDirectoryEntrychild (int row) const
int childCount () const
virtual QVariant data (const int column) const
virtual void fetchMore ()
virtual bool hasChildren () const =0
QString name () const
streamDirectoryEntryparent () const
virtual QVariant rawData (const int column) const
int row () const
void setName (const QString &name)
void setValue (const KUrl &value)
KUrl value () const

Private Attributes

QList< streamDirectoryEntry * > childItems
QString entryName
KUrl entryValue
streamDirectoryEntryparentItem
streamDirectoryEntryself


Detailed Description

Abstract data type representing an entry in a tree structure.

You can use it like ordinary data types. This class doesn't provide much intellegence. You should reimplement data() when deriving from this class.

Objects of this class have its data orginized in columns. Furthermore, they can have children. The children are organized in rows; each of them is accessible through its row number.

This class is designed for internal use and serves to providing a stream directory.

See also:
streamDirectoryModel
Note:
Objects of this class provide information about the actually existing tree structure, but they can't create or modify the tree structure. This is the unique responsibility of the code that creates the objects.

Definition at line 43 of file streamdirectoryentry.h.


Constructor & Destructor Documentation

streamDirectoryEntry::streamDirectoryEntry (  ) 

The constructor.

Definition at line 23 of file streamdirectoryentry.cpp.

References parentItem.

streamDirectoryEntry::~streamDirectoryEntry (  )  [virtual]

The destructor.

Will delete all child objects.

Definition at line 29 of file streamdirectoryentry.cpp.

References childItems.


Member Function Documentation

void streamDirectoryEntry::appendChild ( streamDirectoryEntry child  ) 

Makes an object become a child of this object.

Parameters:
child A pointer to the new child.
Warning:
Don't call this function with a child that has yet a parent!

Definition at line 50 of file streamdirectoryentry.cpp.

References childItems, and parentItem.

Referenced by icecast::use_data().

Here is the caller graph for this function:

bool streamDirectoryEntry::canFetchMore (  )  const [virtual]

Returns:
whether this entry can fetch missing children through fetchMore()
The default implementation returns false. Reimplement this to provide custom behaviour.
See also:
fetchMore()

Reimplemented in streamDirectoryEntry_genre.

Definition at line 100 of file streamdirectoryentry.cpp.

streamDirectoryEntry * streamDirectoryEntry::child ( int  row  )  const

Returns:
A pointer to the child entry at the specified row (or NULL if the row doesn't exist).
Parameters:
row The row number for which the pointer is requested.

Definition at line 41 of file streamdirectoryentry.cpp.

References childItems.

Referenced by streamDirectoryModel::index().

Here is the caller graph for this function:

int streamDirectoryEntry::childCount (  )  const

Returns:
The number of children of this object.

Definition at line 36 of file streamdirectoryentry.cpp.

References childItems.

Referenced by streamDirectoryEntry_root::hasChildren(), streamDirectoryEntry_genre::hasChildren(), and streamDirectoryModel::rowCount().

Here is the caller graph for this function:

QVariant streamDirectoryEntry::data ( const int  column  )  const [virtual]

Returns:
The data of this entry at the specified column, being formated.
Note:
This default implementation returns always an invalid QVariant. When deriving from this class you should reimplement this function to provide a useful behaviour.

Reimplemented in streamDirectoryEntry_genre, and streamDirectoryEntry_stream.

Definition at line 70 of file streamdirectoryentry.cpp.

Referenced by streamDirectoryModel::data(), and rawData().

Here is the caller graph for this function:

void streamDirectoryEntry::fetchMore (  )  [virtual]

Fetchs missing children entries.

The default implementation does nothing. Reimplement it for custom behavior.

See also:
canFetchMore()

Reimplemented in streamDirectoryEntry_genre.

Definition at line 105 of file streamdirectoryentry.cpp.

virtual bool streamDirectoryEntry::hasChildren (  )  const [pure virtual]

Returns:
whether the item has children

Implemented in streamDirectoryEntry_genre, streamDirectoryEntry_root, and streamDirectoryEntry_stream.

QString streamDirectoryEntry::name (  )  const

Returns:
entryName

Definition at line 80 of file streamdirectoryentry.cpp.

References entryName.

Referenced by streamDirectoryEntry_stream::data(), streamDirectoryEntry_genre::data(), and streamDirectoryEntry_stream::streamDirectoryEntry_stream().

Here is the caller graph for this function:

streamDirectoryEntry * streamDirectoryEntry::parent (  )  const

Returns:
A pointer to the parent of this object (or NULL if it has no parent).

Definition at line 75 of file streamdirectoryentry.cpp.

References parentItem.

Referenced by streamDirectoryModel::parent().

Here is the caller graph for this function:

QVariant streamDirectoryEntry::rawData ( const int  column  )  const [virtual]

Returns:
The data of this entry at the specified column, but without being formated.
Note:
This default implementation returns data(). Reimplement it in derived classes to make possible proper sorting of data.

Reimplemented in streamDirectoryEntry_stream.

Definition at line 56 of file streamdirectoryentry.cpp.

References data().

Referenced by streamDirectoryModel::data().

Here is the call graph for this function:

Here is the caller graph for this function:

int streamDirectoryEntry::row (  )  const

Returns:
The row number that this object has within it's parent (or 0 if it has no parent).

Definition at line 61 of file streamdirectoryentry.cpp.

References childItems, and parentItem.

Referenced by streamDirectoryModel::parent().

Here is the caller graph for this function:

void streamDirectoryEntry::setName ( const QString &  name  ) 

Sets entryName.

Parameters:
name The new value

Definition at line 85 of file streamdirectoryentry.cpp.

References entryName.

Referenced by icecast_internalThread::readStreamEntry().

Here is the caller graph for this function:

void streamDirectoryEntry::setValue ( const KUrl &  value  ) 

Sets entryValue.

Parameters:
value The new value

Definition at line 95 of file streamdirectoryentry.cpp.

References entryValue.

Referenced by icecast_internalThread::readStreamEntry().

Here is the caller graph for this function:

KUrl streamDirectoryEntry::value (  )  const

Returns:
entryValue

Definition at line 90 of file streamdirectoryentry.cpp.

References entryValue.

Referenced by streamDirectoryEntry_stream::data().

Here is the caller graph for this function:


Member Data Documentation

The list of child items.

Definition at line 101 of file streamdirectoryentry.h.

Referenced by appendChild(), child(), childCount(), row(), and ~streamDirectoryEntry().

The name of this entry.

In this class, this member is useless. However, when deriving from this class, you should return this value for column 0.

See also:
name()

setName()

Definition at line 109 of file streamdirectoryentry.h.

Referenced by name(), and setName().

The value of this entry. This is the URL that is used for Drag and Drop.

In this class, this member is useless. The implementation is up to the derived classes.

See also:
value()

setValue()

Definition at line 116 of file streamdirectoryentry.h.

Referenced by setValue(), and value().

A pointer to the parent of this object (or NULL if this object doesn't have a parent).

Definition at line 119 of file streamdirectoryentry.h.

Referenced by appendChild(), parent(), row(), and streamDirectoryEntry().

A pointer to this.

Definition at line 121 of file streamdirectoryentry.h.


The documentation for this class was generated from the following files:

doxygen