Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
CAResource Class Reference

Different resources included in the file. More...

#include <resource.h>

List of all members.

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)
CADocumentdocument ()
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

Detailed Description

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

Member Enumeration Documentation

Enumerator:
Undefined 
Image 
Sound 
Movie 
Document 
Other 

Constructor & Destructor Documentation

CAResource::CAResource ( QUrl  url,
QString  name,
bool  linked = false,
CAResourceType  t = Other,
CADocument parent = 0 
)

Default constructor.

References setDocument(), setLinked(), setName(), setResourceType(), and setUrl().

Here is the call graph for this function:

CAResource::~CAResource ( ) [virtual]

References document(), isLinked(), CADocument::removeResource(), and url().

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

const QString CAResource::description ( ) [inline]

References _description.

Referenced by CACanorusMLExport::exportResources().

Here is the caller graph for this function:

References _document.

Referenced by CAResourceCtl::createEmptyResource(), CAResourceCtl::deleteResource(), and ~CAResource().

Here is the caller graph for this function:

bool CAResource::isLinked ( ) [inline]
const QString CAResource::name ( ) [inline]

References _name.

Referenced by CAResourceView::contextMenuEvent(), CACanorusMLExport::exportResources(), and CACanImport::importDocumentImpl().

Here is the caller graph for this function:

References _resType.

Referenced by CACanorusMLExport::exportResources().

Here is the caller graph for this function:

Converts the given string type to CAResourceType. Usually called when opening the resource.

References Document, Image, Movie, Other, Sound, and Undefined.

Referenced by CACanorusMLImport::importResource().

Here is the caller graph for this function:

Converts the given type to string. Usually called when saving the resource.

References Document, Image, Movie, Other, and Sound.

Referenced by CACanorusMLExport::exportResources().

Here is the caller graph for this function:

void CAResource::setDescription ( const QString  n) [inline]

References _description.

Referenced by CACanorusMLImport::importResource().

Here is the caller graph for this function:

void CAResource::setDocument ( CADocument d) [inline]

References _document.

Referenced by CAResource().

Here is the caller graph for this function:

void CAResource::setLinked ( bool  l) [inline]

References _linked.

Referenced by CAResource().

Here is the caller graph for this function:

void CAResource::setName ( const QString  n) [inline]

References _name.

Referenced by CAResource().

Here is the caller graph for this function:

References _resType.

Referenced by CAResource().

Here is the caller graph for this function:

void CAResource::setUrl ( const QUrl  url) [inline]

References _url, and url().

Referenced by CAResource(), and CACanImport::importDocumentImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

const QUrl CAResource::url ( ) [inline]

Member Data Documentation

QString CAResource::_description [private]

Referenced by description(), and setDescription().

Referenced by document(), and setDocument().

bool CAResource::_linked [private]

Referenced by isLinked(), and setLinked().

QString CAResource::_name [private]

Referenced by name(), and setName().

Referenced by resourceType(), and setResourceType().

QUrl CAResource::_url [private]

Referenced by setUrl(), and url().


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