Canorus 0.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CAResource Class Reference

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)
 
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:

When the resources are saved, internal resources are saved as

See also
CAResourceContainer

Member Enumeration Documentation

◆ CAResourceType

Enumerator
Undefined 
Image 
Sound 
Movie 
Document 
Other 

Constructor & Destructor Documentation

◆ CAResource()

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

Default constructor.

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

Here is the call graph for this function:

◆ ~CAResource()

CAResource::~CAResource ( )
virtual

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

Here is the call graph for this function:

Member Function Documentation

◆ copy()

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:

◆ description()

const QString CAResource::description ( )
inline

References _description.

Referenced by CACanorusMLExport::exportResources().

Here is the caller graph for this function:

◆ document()

CADocument * CAResource::document ( )
inline

References _document.

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

Here is the caller graph for this function:

◆ isLinked()

bool CAResource::isLinked ( )
inline

◆ name()

const QString CAResource::name ( )
inline

References _name.

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

Here is the caller graph for this function:

◆ resourceType()

const CAResourceType CAResource::resourceType ( )
inline

References _resType.

Referenced by CACanorusMLExport::exportResources().

Here is the caller graph for this function:

◆ resourceTypeFromString()

CAResource::CAResourceType CAResource::resourceTypeFromString ( QString  type)
static

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:

◆ resourceTypeToString()

QString CAResource::resourceTypeToString ( CAResourceType  type)
static

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:

◆ setDescription()

void CAResource::setDescription ( const QString  n)
inline

References _description.

Referenced by CACanorusMLImport::importResource().

Here is the caller graph for this function:

◆ setDocument()

void CAResource::setDocument ( CADocument d)
inline

References _document.

Referenced by CAResource().

Here is the caller graph for this function:

◆ setLinked()

void CAResource::setLinked ( bool  l)
inline

References _linked.

Referenced by CAResource().

Here is the caller graph for this function:

◆ setName()

void CAResource::setName ( const QString  n)
inline

References _name.

Referenced by CAResource().

Here is the caller graph for this function:

◆ setResourceType()

void CAResource::setResourceType ( const CAResourceType  t)
inline

References _resType.

Referenced by CAResource().

Here is the caller graph for this function:

◆ setUrl()

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:

◆ url()

const QUrl CAResource::url ( )
inline

Member Data Documentation

◆ _description

QString CAResource::_description
private

Referenced by description(), and setDescription().

◆ _document

CADocument* CAResource::_document
private

Referenced by document(), and setDocument().

◆ _linked

bool CAResource::_linked
private

Referenced by isLinked(), and setLinked().

◆ _name

QString CAResource::_name
private

Referenced by name(), and setName().

◆ _resType

CAResourceType CAResource::_resType
private

Referenced by resourceType(), and setResourceType().

◆ _url

QUrl CAResource::_url
private

Referenced by setUrl(), and url().


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