• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

Digikam::Album

Digikam::Album Class Reference

Abstract base class for all album types. More...

#include <album.h>

Inheritance diagram for Digikam::Album:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Type { PHYSICAL = 0, TAG, DATE, SEARCH }

Public Member Functions

virtual DatabaseUrl databaseUrl () const =0
void * extraData (const void *key) const
Album * firstChild () const
int globalID () const
int id () const
bool isAncestorOf (Album *album) const
bool isRoot () const
Album * lastChild () const
Album * next () const
Album * parent () const
Album * prev () const
void removeExtraData (const void *key)
void setExtraData (const void *key, void *value)
QString title () const
Type type () const

Protected Member Functions

 Album (Album::Type type, int id, bool root)
virtual ~Album ()
void clear ()
void insertChild (Album *child)
void removeChild (Album *child)
void setParent (Album *parent)
void setTitle (const QString &title)

Detailed Description

Abstract base class for all album types.

A class which provides an abstraction for a type Album. This class is meant to be derived and every time a new Album Type is defined add a enum corresponding to that to Album::Type

This class provides a means of building a tree representation for Albums

See also:
Album::setParent().

Definition at line 60 of file album.h.


Member Enumeration Documentation

enum Digikam::Album::Type
Enumerator:
PHYSICAL 

PHYSICAL: A physical album type.

See also:
PAlbum
TAG 

TAG: A tag album type.

See also:
TAlbum
DATE 

DATE: A date album type.

See also:
DAlbum
SEARCH 

SEARCH: A search album type.

See also:
SAlbum

Definition at line 64 of file album.h.


Constructor & Destructor Documentation

Digikam::Album::Album ( Album::Type  type,
int  id,
bool  root 
) [protected]

Constructor.

Definition at line 44 of file album.cpp.

Digikam::Album::~Album (  )  [protected, virtual]

Destructor.

this will also recursively delete all child Albums

Definition at line 57 of file album.cpp.


Member Function Documentation

void Digikam::Album::clear (  )  [protected]

Delete all child albums and also remove any associated extra data.

Definition at line 151 of file album.cpp.

virtual DatabaseUrl Digikam::Album::databaseUrl (  )  const [pure virtual]
Returns:
the kde url of the album

Implemented in Digikam::PAlbum, Digikam::TAlbum, Digikam::DAlbum, and Digikam::SAlbum.

void * Digikam::Album::extraData ( const void *  key  )  const

Retrieve the associated extra data associated with key.

Parameters:
key the key of the extra data
See also:
setExtraData
extraData

Definition at line 218 of file album.cpp.

Album * Digikam::Album::firstChild (  )  const
Returns:
the first child of this album or 0 if no children

Definition at line 79 of file album.cpp.

int Digikam::Album::globalID (  )  const

An album ID is only unique among the set of all Albums of its Type.

This is a global Identifier which will uniquely identifying the Album among all Albums

Note:
If you are adding a new Album Type make sure to update this implementation.

You can always get the ID of the album using something like

 int albumID = rootAlbum->globalID() - album->globalID();
Returns:
the globalID of the album
See also:
id()

Definition at line 169 of file album.cpp.

int Digikam::Album::id (  )  const

Each album has a ID uniquely identifying it in the set of Albums of a Type.

Note:
The ID for a root Album is always 0
Returns:
the ID of the album
See also:
globalID()

Definition at line 188 of file album.cpp.

void Digikam::Album::insertChild ( Album *  child  )  [protected]

For internal use only.

use onlyInsert an Album as a child for this album

Parameters:
child the Album to add as child

Definition at line 99 of file album.cpp.

bool Digikam::Album::isAncestorOf ( Album *  album  )  const
Returns:
true if the album is in the parent hierarchy
Parameters:
album Album to check whether it belongs in the child hierarchy

Definition at line 233 of file album.cpp.

bool Digikam::Album::isRoot (  )  const
Returns:
true is the album is a Root Album

Definition at line 228 of file album.cpp.

Album * Digikam::Album::lastChild (  )  const
Returns:
the last child of this album or 0 if no children

Definition at line 84 of file album.cpp.

Album * Digikam::Album::next (  )  const
Returns:
the next sibling of this album of this album or 0 if no next sibling
See also:
AlbumIterator

Definition at line 89 of file album.cpp.

Album * Digikam::Album::parent (  )  const
Returns:
the parent album for this album

Definition at line 74 of file album.cpp.

Album * Digikam::Album::prev (  )  const
Returns:
the previous sibling of this album of this album or 0 if no previous sibling
See also:
AlbumIterator

Definition at line 94 of file album.cpp.

void Digikam::Album::removeChild ( Album *  child  )  [protected]

For internal use only.

use onlyRemove a Album from the children list for this album

Parameters:
child the Album to remove

Definition at line 120 of file album.cpp.

void Digikam::Album::removeExtraData ( const void *  key  ) 

Remove the associated extra data associated with key.

Parameters:
key the key of the extra data
See also:
setExtraData
extraData

Definition at line 213 of file album.cpp.

void Digikam::Album::setExtraData ( const void *  key,
void *  value 
)

This allows to associate some "extra" data to a Album.

As one Album can be used by several objects (often views) which all need to add some data, you have to use a key to reference your extra data within the Album.

That way a Album can hold and provide access to all those views separately.

for eg,

 album->setExtraData( this, searchFolderItem );

and can later access the searchFolderItem by doing

 SearchFolderItem *item = static_cast<SearchFolderItem*>(album->extraData(this));

Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!

Parameters:
key the key of the extra data
value the value of the extra data
See also:
extraData
removeExtraData

Definition at line 208 of file album.cpp.

void Digikam::Album::setParent ( Album *  parent  )  [protected]

For internal use only.

use onlySet the parent of the album

Parameters:
parent set the parent album of album to parent

Definition at line 65 of file album.cpp.

void Digikam::Album::setTitle ( const QString &  title  )  [protected]

For internal use only.

use onlySet a new title for the album

Parameters:
title new title for the album

Definition at line 193 of file album.cpp.

QString Digikam::Album::title (  )  const
Returns:
the title aka name of the album

Definition at line 198 of file album.cpp.

Album::Type Digikam::Album::type (  )  const
Returns:
the type of album
See also:
Type

Reimplemented in Digikam::SAlbum.

Definition at line 203 of file album.cpp.


The documentation for this class was generated from the following files:
  • album.h
  • album.cpp

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • digikam
Generated for API Reference by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal