PLModel Class Reference

Collaboration diagram for PLModel:

Collaboration graph
[legend]

Public Types

enum  { IsCurrentRole = Qt::UserRole, IsLeafNodeRole }

Public Slots

void activateItem (const QModelIndex &index)
void activateItem (playlist_item_t *p_item)

Signals

void currentChanged (const QModelIndex &)
void rootChanged ()

Public Member Functions

 PLModel (playlist_t *, intf_thread_t *, playlist_item_t *, QObject *parent=0)
 ~PLModel ()
QVariant data (const QModelIndex &index, int role) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
Qt::ItemFlags flags (const QModelIndex &index) const
QModelIndex index (int r, int c, const QModelIndex &parent) const
QModelIndex parent (const QModelIndex &index) const
Qt::DropActions supportedDropActions () const
QMimeData * mimeData (const QModelIndexList &indexes) const
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &target)
QStringList mimeTypes () const
QStringList selectedURIs ()
QModelIndex index (PLItem *, int c) const
QModelIndex index (int i_id, int c)
QModelIndex currentIndex ()
bool isCurrent (const QModelIndex &index) const
int itemId (const QModelIndex &index) const
bool popup (const QModelIndex &index, const QPoint &point, const QModelIndexList &list)
void doDelete (QModelIndexList selected)
 Deletion, here we have to do a ugly slow hack as we retrieve the full list of indexes to delete at once: when we delete a node and all of its children, we need to update the list.
void search (const QString &search_text, const QModelIndex &root, bool b_recursive)
void sort (int column, Qt::SortOrder order)
void sort (int i_root_id, int column, Qt::SortOrder order)
void rebuild ()
void rebuild (playlist_item_t *)
PLItemgetItem (QModelIndex index) const

Static Public Member Functions

static int columnFromMeta (int meta_column)
static int columnToMeta (int column)

Friends

class PLItem
class PLSelector

Member Enumeration Documentation

anonymous enum

Enumerator:
IsCurrentRole 
IsLeafNodeRole 


Constructor & Destructor Documentation

PLModel::PLModel ( playlist_t _p_playlist,
intf_thread_t _p_intf,
playlist_item_t p_root,
QObject *  parent = 0 
)

References ADD_ICON, CONNECT, DCONNECT, rebuild(), and THEMIM.

PLModel::~PLModel (  ) 


Member Function Documentation

QVariant PLModel::data ( const QModelIndex &  index,
int  role 
) const

QVariant PLModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

int PLModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

References PLItem::childCount(), and getItem().

int PLModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const

References COLUMN_END, and columnFromMeta().

Qt::ItemFlags PLModel::flags ( const QModelIndex &  index  )  const

QModelIndex PLModel::index ( int  r,
int  c,
const QModelIndex &  parent 
) const

QModelIndex PLModel::parent ( const QModelIndex &  index  )  const

Qt::DropActions PLModel::supportedDropActions (  )  const

QMimeData * PLModel::mimeData ( const QModelIndexList &  indexes  )  const

bool PLModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  target 
)

References getItem().

QStringList PLModel::mimeTypes (  )  const

QStringList PLModel::selectedURIs (  ) 

QModelIndex PLModel::index ( PLItem item,
int  c 
) const

QModelIndex PLModel::index ( int  i_id,
int  c 
)

References index().

QModelIndex PLModel::currentIndex (  ) 

References index(), input_GetItem(), and THEMIM.

Referenced by sort().

bool PLModel::isCurrent ( const QModelIndex &  index  )  const

References getItem(), PLItem::p_input, and THEMIM.

Referenced by data().

int PLModel::itemId ( const QModelIndex &  index  )  const

References getItem(), and PLItem::i_id.

Referenced by StandardPLPanel::browseInto(), popup(), and search().

int PLModel::columnFromMeta ( int  meta_column  )  [static]

int PLModel::columnToMeta ( int  column  )  [static]

References COLUMN_END.

Referenced by data(), headerData(), and sort().

bool PLModel::popup ( const QModelIndex &  index,
const QPoint &  point,
const QModelIndexList &  list 
)

void PLModel::doDelete ( QModelIndexList  selected  ) 

Deletion, here we have to do a ugly slow hack as we retrieve the full list of indexes to delete at once: when we delete a node and all of its children, we need to update the list.

Todo: investigate whethere we can use ranges to be sure to delete all items?

References PLItem::children, getItem(), index(), PLItem::p_input, PL_LOCK, pl_Locked, PL_UNLOCK, and playlist_DeleteFromInput().

void PLModel::search ( const QString &  search_text,
const QModelIndex &  root,
bool  b_recursive 
)

void PLModel::sort ( int  column,
Qt::SortOrder  order 
)

References PLItem::i_id.

void PLModel::sort ( int  i_root_id,
int  column,
Qt::SortOrder  order 
)

void PLModel::rebuild (  ) 

void PLModel::rebuild ( playlist_item_t p_root  ) 

PLItem* PLModel::getItem ( QModelIndex  index  )  const [inline]

void PLModel::currentChanged ( const QModelIndex &   )  [signal]

Referenced by sort().

void PLModel::rootChanged (  )  [signal]

Referenced by rebuild().

void PLModel::activateItem ( const QModelIndex &  index  )  [slot]

void PLModel::activateItem ( playlist_item_t p_item  )  [slot]


Friends And Related Function Documentation

friend class PLItem [friend]

Referenced by rebuild().

friend class PLSelector [friend]


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

Generated on Tue May 25 08:06:19 2010 for VLC by  doxygen 1.5.6