| Home · All Classes · Annotated · Functions |
The QContent class represents a content carrying entity in the Qtopia system. More...
#include <QContent>
Inherited by QDrmContent.
The QContent class represents a content carrying entity in the Qtopia system.
Each entity may include:
The QContent class is responsible for providing access to metadata about the content contained in a file or stream.
A server process calls install(...) and iuninstall(...) to update the records of metadata in the backing store in response to hardware and software events such as:
To be notified of these events, create a QContentSet object and connect to its changed(QContentId) signal.
This enum specifies the type of change made to a QContent.
| Constant | Value | Description |
|---|---|---|
| QContent::Added | 0 | the QContent has been added. |
| QContent::Removed | 1 | the QContent has been deleted. |
| QContent::Updated | 2 | the QContent has been modified. |
This enum specifies the DRM State of this QContent object.
| Constant | Value | Description |
|---|---|---|
| QContent::Unprotected | 0x00 | plain text "legacy" file, not subject to drm |
| QContent::Protected | 0x01 | file subject to drm |
| QContent::InvalidRights | 0x02 | current rights do not allow any access to content. |
| QContent::Redistributable | 0x04 | rights to content may be aquired seperate to initial delivery. |
This enum specifies the type of document this QContent object appears to be.
| Constant | Value | Description |
|---|---|---|
| QContent::UnknownUsage | 0 | unknown mode (default) |
| QContent::Document | 1 | a user-visible document file suitable for "open" |
| QContent::Data | 2 | a data or config file not suitable for "open" |
| QContent::Application | 3 | an application (possibly Java, possibly DRM controlled) |
Constructs an empty invalid content object.
Create a QContent object by fetching the metadata from the backing store of the passed id. This uses in-process caching with statics in the inner private class to save on SQL/calls to the backing store. This method will be fast if the object has already been referenced as the QContent and QContentSet classes are loaded in the current process.
Create an application or document content link based on the fileName. Passing store specifies whether this content object is stored into the backing store database, or only used as a local object.
Create a content link by copying the other content object.
Destroys the content object.
Return a list of strings representing the categories on this object. Usually it will make more sense to create a QContentSet and set category filters on it.
See also setCategories().
Clear all error flags and errors strings on all QContent objects. Note: this method clears the global error cache for all QContent objects in this process.
Return the comment for this object, typically used on ToolTips For DRM controlled objects this will include a summary of the rights and DRM status
Writes the changes to the QContent to the backing store.
Copy the contents of from to this QContent.
Returns true is successful, otherwise false.
Copy the contents of the file and the metainfo from this QContent to newPath.
Returns true is successful, otherwise false.
Return the DRM status of this object, as per the DRMState enum. This value is a cache of the real value available from the DRM agent. When an object expires an event should be fired to update the database but be aware that stale information may be displayed.
Return true if this QContent object is in an error state. Call the errorString() method to return a text description of the error.
Returns the executable name property. This is the name of the executable program associated with the QContent target.
See also setExecutableName() and execute().
Executes the application associated with this QContent, with args as arguments.
See also executableName() and setExecutableName().
This is an overloaded member function, provided for convenience.
Executes the application associated with this QContent.
See also executableName() and setExecutableName().
Returns the file associated with the QContent.
See also setFile(), executableName(), and name().
Return true if the file associated with this QContent object is already known. If false, calling file() will generate a file name.
Return the icon for this object. If the object is an application, then it will be the application icon, otherwise it will be a generic icon for the mime-type of the object.
If the object is a DRM controlled, a key emblem is super-imposed on the icon. If the content is DRM_unrenderable the icon is shown greyed out (using the QIcon dynamic routines).
See also setIcon().
Return the path to the icon for this file.
See also icon().
Returns the Id of this QContent. If this QContent is not present in the backing store its value will be QContent::InvalidId.
Takes a QFileInfo reference fi to a content object, and installs the metadata for it in the backing store/database. The path must be an absolute path and the file must exist. If the file is a .desktop file referring to an application or a document a QContent record is created.
If mimetype data is not available, it is determined by file extension, or failing that, the magic number.
If the object is a DRM-controlled file (is a .dcf file, or is otherwise shown as drm controlled) the DRM subsystem is queried for the DRM status.
See also QContentSet::scan().
Convenience function to test if this QContent is a Document or an Application.
See also usageMode().
Queries the launcher configuration settings to check if this object is in the systems PreloadApps list.
Content link is invalid if the backing file is unavailable, either due to removal of media or deletion of the file. If force is true, the content will be revalidated even if this value has been previously cached.
Return the value of the last time underlying file was updated.
Deprecated functionality: Return the path of the .desktop link file this metainfo ContentLink was generated from if available.
See also setLinkFile().
Return true if the file associated with this QContent object is already known. If false, calling file() will generate a file name.
See also QContent::fileKnown(), QContent::linkFile(), and QContent::file().
Loads the content into data.
Returns true if successful; otherwise false.
Return the location hint of the package that owns this QContent.
Returns the root path of the media the content is stored on.
See also setMedia().
Returns the MimeTypeIcons property of the QContent.
Returns MimeTypePermissions property of the QContent.
Returns the MimeTypes property. This is the list of MIME types that the application can view or edit.
Move the contents of the file and the metainfo from this QContent to newPath.
Returns true is successful, otherwise false.
Note: The id() of the original file will be invalid and should not be used.
Return the user-visible name for this content object
See also setName().
Opens a QIODevice using mode mode.
Returns the QIODevice if successful, otherwise returns 0. It is the caller's responsibility to delete the return value.
Return a property associated with this content with key key.
See also setProperty().
Uninstall this object from the database, and remove it from the filesystem.
Uninstall the .desktop/link file for this object from the database, and remove it from the filesystem.
Return a brief string representation of any rights for this object. If the drmStatus() returns Unprotected, then this method returns an empty string. Use drmStatus() != Unprotected instead of checking for an empty string.
Saves the data data.
Returns true is successful; otherwise false.
Set the categories associated with this content to categoryList. The categores will not be written to the backing store until commit() is called.
See also categories() and commit().
Sets the executable name property to exec. The property will not be written to the backing store until commit() is called.
See also executableName() and execute().
Set the file that this content references to filename
See also file().
Sets the icons associated with this content to iconpath. The property will not be written to the backing store until commit() is called.
Set the link/.desktop file that this content references to filename
See also linkFile().
Sets the root path of the media the file is stored on. Once a QContent has been commited to the database the media cannot be changed.
See also media().
Sets the Name property to docname. The property will not be written to the backing store until commit() is called.
See also name().
Set a property associated with the content with key key and value value. The property will not be written to the backing store until commit() is called.
See also property() and commit().
Sets the Type property to doctype. The property will not be written to the backing store until commit() is called.
Return the plaintext size of the content in bytes
Return the RFC2045 mime-type for the content If this is an application, instead return "Application" (the underlying QContent's type)
See also setType().
Remove the Content with id from the backing store
Return the document status of the object as per the UsageMode enum. This value does not usually change. The status is used to determine what to display to the user. Data objects make no sense to display to the user, as they cannot be launched or categorized. These files are only of use to the applications which operate on them.
Assignment operator. Sets data on this to be what is set on other.
Equality operator. Return true if this Content object is the same as the other. Is true if both have the same Id number, or if both are empty.
| Copyright © 2006 Trolltech | Trademarks | Qtopia 4.1.7 |