Home · All Classes · Annotated · Functions

QContentSet Class Reference

The QContentSet class represents a set of QContent objects. More...

#include <QContentSet>

Inherits QObject.

Public Types

Public Functions

Signals

Static Public Members

Protected Functions

Additional Inherited Members


Detailed Description

The QContentSet class represents a set of QContent objects.

When building GUI elements representing a collection of QContent objects perform the following:

As the model is automatically kept up-to-date, this is preferable to accessing a list of QContent.

The set is synchronized so that the data is as up-to-date as possible when new storage media (such as CF or SD cards) are inserted or removed, or when other applications change content files.

The mechanism for this synchronization is as follows:


Member Type Documentation

enum QContentSet::FilterType

This enum specifies the type of filter being used to filter the QContentSet down a useable set of QContent objects.

ConstantValueDescription
QContentSet::Location0filter by a directory, and any directories contained below it.
QContentSet::QtopiaType1filter by UsageMode, Applications, Documents, etc
QContentSet::MimeType2filter by mime type, image/gif etc
QContentSet::Directory3filter by directory name (subdirectories not included)
QContentSet::Category4filter by category
QContentSet::DRM5filter by drm permissions
QContentSet::Synthetic6filter by synthetic attributes eg mtime, event
QContentSet::SortOrder7set a sort ordering (field per entry) (eg, name/type/file/size/time, append " desc" for descending sort)
QContentSet::Unknown100invalid filter type, probable error

enum QContentSet::Priority

This enum specifies the priority to use when scanning a directory.

ConstantValueDescription
QContentSet::LowPriority0use low priority
QContentSet::NormalPriority1use normal priority
QContentSet::HighPriority2use low priority - directory will be scanned before lower priority jobs.

typedef QContentSet::QContentFilter

A searchable container of filters for a QContentSet


Member Function Documentation

QContentSet::QContentSet ( QObject * parent = 0 )

Create a new empty QContentSet with parent parent.

QContentSet::QContentSet ( const QContentFilter & catFilters, QObject * parent = 0 )

Create a new QContentSet with parent parent, containing all records from the backing store which pass all the filters listed in catFilters.

QContentSet::QContentSet ( FilterType tag, const QString & filter, QObject * parent = 0 )

Create a new QContentSet with parent parent, containing all records from the backing store which pass the filtering criteria specified by tag and filter.

QContentSet::QContentSet ( const QContentSet & original, QObject * parent = 0 )

Create a new QContentSet with parent parent, containing all records from original.

QContentSet::~QContentSet ()   [virtual]

Destroy the QContentSet object.

void QContentSet::add ( const QContent & content )

Explicitly add the QContent object content to this set but not to the backing store. QContentSet::contains() is called first and does not add if the object is already present.

If using this method and QContentSet::remove(), a filter expression is not used. This is useful for building up a set of Content objects to display or to perform bulk operations such as moving to a new location.

If a filter expression is used and the object added matches it, this method is effectively a null operation - although it will update the internal cache.

void QContentSet::addCriteria ( FilterType kind, const QString & filter )

Adds a filtering criteria of FilterType kind and value filter to the current filter set.

void QContentSet::addCriteria ( const QContentFilter & filters )

This is an overloaded member function, provided for convenience.

Adds a group of filtering criteria filters to the current filter set.

void QContentSet::appendFrom ( QContentSet & other )

Appends the contents of other to this QContentSet. Currently it appends them as explicit items to the current QContenSet, in the future, it will concatenate the two filter sets to create a new aggregate filter set.

void QContentSet::changed ( const QContentIdList & idList, QContent::ChangeType type )   [signal]

This signal is emitted when QContent with Ids idList, included in the filter expression for this QContentSet are changed, for example, by another application.

type specifies the type of change QContent::ChangeType.

void QContentSet::changed ()   [signal]

This is an overloaded member function, provided for convenience.

Emitted when a number of QContent objects included in the filter expression for this QContentSet are changed by another application or by removable media being inserted or removed.

void QContentSet::clear ()

Remove all content from this set.

void QContentSet::clearFilter ()

Clear the current filter expression on the set

int QContentSet::count () const

Return the number of QContent objects in this set.

QContentFilter QContentSet::filter () const

Returns a copy of the current filter for this QContentSet.

QContent QContentSet::findExecutable ( const QString & exec ) const

Find a QContent object for the executable exec in the current QContentSet. Returns an empty/invalid QContent if unsuccessful.

void QContentSet::installContent ()

Store the meta information objects into the backing store, and create a file on the file system if the content type is appropriate.

bool QContentSet::isEmpty () const

Returns true if this set is empty; otherwise false.

QContentIdList QContentSet::itemIds () const

Return a QContentIdList of content Ids in this set.

It is a snapshot of the currently known content in the list, which could go out of date immediately after it is obtained.

When considering using this method first examine the process of retrieving a pointer to the internal model and using an MVC solution.

See also QContentSet::items().

QContentList QContentSet::items () const

Return a QList<QContent> of items in this set. Note: This is a relatively expensive operation, and generally should not be used unless it is known that only a few items will be returned.

It is also a snapshot of the currently known items in the list, which could go out of date immediately after it is obtained.

When considering using this method first examine the process of retrieving a pointer to the internal model and using an MVC solution.

void QContentSet::remove ( const QContent & cl )

Remove the QContent object cl from this set. Note: This does not remove the object from the backing store. This is useful for trimming down a set of Content objects to display to the user, or perform bulk operations on such as moving to a new location.

The method cannot remove an object that matches the filter expression, if one is set.

See also QContentSet::add().

void QContentSet::scan ( const QString & path, Priority priority = NormalPriority )   [static]

Scan for added/removed content in path with priority priority. Directories will be scanned recusively in the background.

void QContentSet::setCriteria ( FilterType kind, const QString & filter )

Sets a filtering criteria of FilterType kind and value filter to the current filter set.

void QContentSet::setCriteria ( const QContentFilter & filters )

This is an overloaded member function, provided for convenience.

Sets a group of filtering criteria filters to the current filter set.

void QContentSet::timerEvent ( QTimerEvent * e )   [virtual protected]

QStringList QContentSet::types () const

Returns the list of types in the set.

For applications, games and settings the type is application/x-executable for documents the type is the document's MIME type, or application/octet-stream if unknown.

void QContentSet::uninstallContent ()

Remove the meta information objects in this set from the backing store, and remove any files from the file system if the content type is appropriate. In the case of DRM controlled files this will also remove any rights objects.

QContentSet & QContentSet::operator= ( const QContentSet & content )

Assigns the given content to this QContent and returns a reference to this QContent.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7