![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Abstract base class for all album types. More...
Public Types | |
enum | Type { PHYSICAL = 0 , TAG , DATE , SEARCH , FACE } |
Public Member Functions | |
QList< int > | childAlbumIds (bool recursive=false) |
AlbumList | childAlbums (bool recursive=false) |
Album * | childAtRow (int row) const |
int | childCount () const |
virtual CoreDbUrl | databaseUrl () const =0 |
void * | extraData (const void *const key) const |
Retrieve the associated extra data associated with key . | |
Album * | firstChild () const |
int | globalID () const |
An album ID is only unique among the set of all Albums of its Type. | |
int | id () const |
Each album has a ID uniquely identifying it in the set of Albums of a Type. | |
bool | isAncestorOf (Album *const album) const |
bool | isRoot () const |
bool | isTrashAlbum () const |
bool | isUsedByLabelsTree () const |
Album * | lastChild () const |
Album * | next () const |
Album * | parent () const |
void | prepareForDeletion () |
For secure deletion in an album model, call this function beforehand. | |
Album * | prev () const |
void | removeExtraData (const void *const key) |
Remove the associated extra data associated with key . | |
int | rowFromAlbum () const |
void | setExtraData (const void *const key, void *const value) |
This allows to associate some "extra" data to a Album. | |
void | setUsedByLabelsTree (bool isUsed) |
Sets the property m_usedByLabelsTree to true if the search album was created using the Colors and labels tree view. | |
QString | title () const |
Type | type () const |
Static Public Member Functions | |
static int | globalID (Type type, int id) |
Produces the global id. | |
Protected Member Functions | |
Album (Album::Type type, int id, bool root) | |
Constructor. | |
virtual | ~Album () |
Destructor. | |
void | clear () |
Delete all child albums and also remove any associated extra data. | |
void | insertChild (Album *const child) |
void | removeChild (Album *const child) |
void | setParent (Album *const parent) |
void | setTitle (const QString &title) |
Friends | |
class | AlbumManager |
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
enum Digikam::Album::Type |
|
protectedvirtual |
this will also recursively delete all child Albums
QList< int > Digikam::Album::childAlbumIds | ( | bool | recursive = false | ) |
AlbumList Digikam::Album::childAlbums | ( | bool | recursive = false | ) |
Album * Digikam::Album::childAtRow | ( | int | row | ) | const |
int Digikam::Album::childCount | ( | ) | const |
childCount
of the album
|
pure virtual |
Implemented in Digikam::PAlbum, Digikam::TAlbum, Digikam::DAlbum, and Digikam::SAlbum.
void * Digikam::Album::extraData | ( | const void *const | key | ) | const |
key | the key of the extra data |
Album * Digikam::Album::firstChild | ( | ) | const |
int Digikam::Album::globalID | ( | ) | const |
This is a global Identifier which will uniquely identifying the Album among all Albums
You can always get the ID
of the album using something like
globalID
of the album
|
static |
type | The type of the album |
id | the (type-specific) id of the album |
int Digikam::Album::id | ( | ) | const |
bool Digikam::Album::isAncestorOf | ( | Album *const | album | ) | const |
album
is in the parent hierarchyalbum | the album to check whether it belongs in the child hierarchy |
bool Digikam::Album::isRoot | ( | ) | const |
bool Digikam::Album::isTrashAlbum | ( | ) | const |
bool Digikam::Album::isUsedByLabelsTree | ( | ) | const |
Album * Digikam::Album::lastChild | ( | ) | const |
Album * Digikam::Album::next | ( | ) | const |
Album * Digikam::Album::parent | ( | ) | const |
Album * Digikam::Album::prev | ( | ) | const |
void Digikam::Album::removeExtraData | ( | const void *const | key | ) |
key | the key of the extra data |
int Digikam::Album::rowFromAlbum | ( | ) | const |
rowFromAlbum
of the album void Digikam::Album::setExtraData | ( | const void *const | key, |
void *const | value | ||
) |
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,
and can later access the searchFolderItem by doing
Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!
key | the key of the extra data |
value | the value of the extra data |
void Digikam::Album::setUsedByLabelsTree | ( | bool | isUsed | ) |
isUsed | => the status of the usage |
QString Digikam::Album::title | ( | ) | const |
title
aka name of the album Album::Type Digikam::Album::type | ( | ) | const |