|
Canorus
0.7
|
Different resources included in the file. More...
#include <resource.h>
Public Types | |
| enum | CAResourceType { Undefined = -1, Image, Sound, Movie, Document, Other } |
Public Member Functions | |
| CAResource (QUrl fileName, QString name, bool linked=false, CAResourceType t=Other, CADocument *c=0) | |
| virtual | ~CAResource () |
| void | setName (const QString n) |
| const QString | name () |
| void | setDescription (const QString n) |
| const QString | description () |
| void | setUrl (const QUrl url) |
| const QUrl | url () |
| void | setResourceType (const CAResourceType t) |
| const CAResourceType | resourceType () |
| void | setLinked (bool l) |
| bool | isLinked () |
| void | setDocument (CADocument *d) |
| CADocument * | document () |
| bool | copy (QString fileName) |
Static Public Member Functions | |
| static QString | resourceTypeToString (CAResourceType type) |
| static CAResourceType | resourceTypeFromString (QString type) |
Private Attributes | |
| QString | _name |
| QString | _description |
| QUrl | _url |
| CAResourceType | _resType |
| bool | _linked |
| CADocument * | _document |
Different resources included in the file.
Copyright (c) 2008-2009, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
CAResource is a wrapper for any file attached to the document.
Resource files are usually the recorded midi files, transcripts of
the score or a scanned music, audio and video files, score in other
formats, images in the score etc.
CAResource contains a valid absolute path (_fileName) to the actual file:
- If the resource is external (not included in file, but linked), _linked is
True and a _fileName is the absolute path of the linked file (or URL).
- If the resource is internal (saved along the file), _linked is False and a
_fileName is an absolute path to the extracted file in the system temporary
directory.
When the resources are saved, internal resources are saved as
\sa CAResourceContainer| CAResource::CAResource | ( | QUrl | url, |
| QString | name, | ||
| bool | linked = false, |
||
| CAResourceType | t = Other, |
||
| CADocument * | parent = 0 |
||
| ) |
Default constructor.
References setDocument(), setLinked(), setName(), setResourceType(), and setUrl().

| CAResource::~CAResource | ( | ) | [virtual] |
References document(), isLinked(), CADocument::removeResource(), and url().

| bool CAResource::copy | ( | QString | fileName | ) |
Copies the resource to the specified fileName. Overwrites the specified fileName, if the file already exists.
References url().
Referenced by CAResourceView::contextMenuEvent(), and CACanorusMLExport::exportResources().


| const QString CAResource::description | ( | ) | [inline] |
References _description.
Referenced by CACanorusMLExport::exportResources().

| CADocument* CAResource::document | ( | ) | [inline] |
References _document.
Referenced by CAResourceCtl::createEmptyResource(), CAResourceCtl::deleteResource(), and ~CAResource().

| bool CAResource::isLinked | ( | ) | [inline] |
References _linked.
Referenced by CAResourceView::contextMenuEvent(), CACanExport::exportDocumentImpl(), CACanorusMLExport::exportResources(), CACanImport::importDocumentImpl(), and ~CAResource().

| const QString CAResource::name | ( | ) | [inline] |
References _name.
Referenced by CAResourceView::contextMenuEvent(), CACanorusMLExport::exportResources(), and CACanImport::importDocumentImpl().

| const CAResourceType CAResource::resourceType | ( | ) | [inline] |
References _resType.
Referenced by CACanorusMLExport::exportResources().

| CAResource::CAResourceType CAResource::resourceTypeFromString | ( | QString | type | ) | [static] |
| QString CAResource::resourceTypeToString | ( | CAResourceType | type | ) | [static] |
| void CAResource::setDescription | ( | const QString | n | ) | [inline] |
References _description.
Referenced by CACanorusMLImport::importResource().

| void CAResource::setDocument | ( | CADocument * | d | ) | [inline] |
| void CAResource::setLinked | ( | bool | l | ) | [inline] |
| void CAResource::setName | ( | const QString | n | ) | [inline] |
| void CAResource::setResourceType | ( | const CAResourceType | t | ) | [inline] |
| void CAResource::setUrl | ( | const QUrl | url | ) | [inline] |
Referenced by CAResource(), and CACanImport::importDocumentImpl().


| const QUrl CAResource::url | ( | ) | [inline] |
References _url.
Referenced by copy(), CACanExport::exportDocumentImpl(), CACanorusMLExport::exportResources(), CACanImport::importDocumentImpl(), setUrl(), CAMidiRecorder::startRecording(), and ~CAResource().

QString CAResource::_description [private] |
Referenced by description(), and setDescription().
CADocument* CAResource::_document [private] |
Referenced by document(), and setDocument().
bool CAResource::_linked [private] |
Referenced by isLinked(), and setLinked().
QString CAResource::_name [private] |
CAResourceType CAResource::_resType [private] |
Referenced by resourceType(), and setResourceType().
QUrl CAResource::_url [private] |
1.8.0