| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Digikam::CoreDbUrl Class Reference
Inheritance diagram for Digikam::CoreDbUrl:

## Public Member Functions
| CoreDbUrl ()=default
| Create an invalid database URL.
| CoreDbUrl (const CoreDbUrl &url)
| CoreDbUrl (const QUrl &digikamUrl)
| Create a CoreDbUrl object from a QUrl, to retrieve the information stored.
QString | album () const
| Returns the album: This is the directory hierarchy below the album root.
QUrl | albumRoot () const
| The following methods are only applicable for a certain protocol each.
int | albumRootId () const
| Returns the album root id.
QString | albumRootPath () const
| Returns the album root path of the file or album referenced by this URL In the example above, this is "/media/fotos".
bool | areaCoordinates (double *lat1, double *lat2, double *lon1, double *lon2) const
| MapImages URL.
QDate | endDate () const
| Return the referenced end date (excluded from the referenced span)
QUrl | fileUrl () const
| Converts this digikamalbums:// URL to a file:// URL.
bool | isAlbumUrl () const
| These test for the protocol of this URL.
bool | isDateUrl () const
bool | isMapImagesUrl () const
bool | isSearchUrl () const
bool | isTagUrl () const
QString | name () const
| Returns the file name.
CoreDbUrl & | operator= (const CoreDbUrl &url)
CoreDbUrl & | operator= (const QUrl &digikamalbumsUrl)
bool | operator== (const QUrl &digikamalbumsUrl) const
DbEngineParameters | parameters () const
| Returns the DbEngineParameters stored in this URL.
int | searchId () const
| Search URL.
void | setParameters (const DbEngineParameters &parameters)
| Change the database parameters stored in this URL Applicable to all protocols.
QDate | startDate () const
| Date URL.
int | tagId () const
| Tag URL.
QList< int > | tagIds () const
| Returns the tag ids of all tags in the tag path of this tag, the topmost tag in the hierarchy first.

## Static Public Member Functions
static CoreDbUrl | albumUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create an empty digikamalbums:/ url.
static CoreDbUrl | dateUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create an empty digikamdates:/ url.
static CoreDbUrl | fromAlbumAndName (const QString &name, const QString &album, const QUrl &albumRoot, const DbEngineParameters &parameters=CoreDbAccess::parameters())
static CoreDbUrl | fromAlbumAndName (const QString &name, const QString &album, const QUrl &albumRoot, int albumRootId, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamalbums:/ url from an album name and an image in this album.
static CoreDbUrl | fromAreaRange (const qreal lat1, const qreal lng1, const qreal lat2, const qreal lng2, const DbEngineParameters &parameters=CoreDbAccess::parameters())
static CoreDbUrl | fromDateForMonth (const QDate &date, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamdates:/ url for the month of the given date.
static CoreDbUrl | fromDateForYear (const QDate &date, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamdates:/ url for the year of the given date.
static CoreDbUrl | fromDateRange (const QDate &startDate, const QDate &endDate, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamdates:/ url for a specified time span which begin with the start date (inclusive) and ends before the end date (exclusive).
static CoreDbUrl | fromFileUrl (const QUrl &fileUrl, const QUrl &albumRoot, const DbEngineParameters &parameters=CoreDbAccess::parameters())
static CoreDbUrl | fromFileUrl (const QUrl &fileUrl, const QUrl &albumRoot, int albumRootId, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| This class shall facilitate the usage of digikamalbums:/, digikamtags:/, digikamdates:/ and digikamsearch: URLs.
static CoreDbUrl | fromTagIds (const QList< int > &tagIds, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamtags:/ url from a list of tag IDs, where this list is the tag hierarchy of the referenced tag, with the topmost parent first, and the tag last in the list.
static CoreDbUrl | mapImagesUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create an empty digikammapimages:/ url.
static CoreDbUrl | searchUrl (int searchId, const DbEngineParameters &parameters=CoreDbAccess::parameters())
| Create a digikamsearch: URL for the search with the given id.

## Member Function Documentation

## ◆ album()

QString Digikam::CoreDbUrl::album | ( |  | ) | const

In the example above, the album is "/Summer 2007"

## ◆ albumRoot()

QUrl Digikam::CoreDbUrl::albumRoot | ( |  | ) | const

If the URL has another protocol, the return value of these methods is undefined. Album URL Returns the album root URL of the file or album referenced by this URL In the example above, this is "file://media/fotos"

## ◆ areaCoordinates()

bool Digikam::CoreDbUrl::areaCoordinates | ( | double * | lat1,
|  | double * | lat2,
|  | double * | lon1,
|  | double * | lon2
| ) |  | const

Returns the coordinates surrounding the map area. Returns true if the string to number conversion was ok.

## ◆ fromAlbumAndName()

CoreDbUrl Digikam::CoreDbUrl::fromAlbumAndName | ( | const QString & | name,
|  | const QString & | album,
|  | const QUrl & | albumRoot,
|  | int | albumRootId,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

If name is empty, the album is referenced. Other parameters as above.

## ◆ fromDateForMonth()

CoreDbUrl Digikam::CoreDbUrl::fromDateForMonth | ( | const QDate & | date,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

(The whole month of the given date will included in the referenced time span)

## ◆ fromDateForYear()

CoreDbUrl Digikam::CoreDbUrl::fromDateForYear | ( | const QDate & | date,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

(The whole year of the given date will included in the referenced time span)

## ◆ fromDateRange()

CoreDbUrl Digikam::CoreDbUrl::fromDateRange | ( | const QDate & | startDate,
|  | const QDate & | endDate,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

To cover the whole year of 1984, you would pass 1/1/1984 and 1/1/1985.

## ◆ fromFileUrl()

CoreDbUrl Digikam::CoreDbUrl::fromFileUrl | ( | const QUrl & | fileUrl,
|  | const QUrl & | albumRoot,
|  | int | albumRootId,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

It provides functions to set and get the parameters stored in such a URL. (with the exception of the search parameters in a search URL, which are out of the scope of this class.) Create a digikamalbums:/ URL from a file:// URL. The file URL can point to a file or a directory (an album in this case). The additional information stored in the URL need to be supplied as well:

- The album root in which the entity pointed to is stored. This is the left part of the file URL. (if the file is "/media/fotos/Summer 2007/001.jpg", the album root may be "/media/fotos")
- The parameters of the database that is referenced

## ◆ fromTagIds()

CoreDbUrl Digikam::CoreDbUrl::fromTagIds | ( | const QList< int > & | tagIds,
|  | const DbEngineParameters & | parameters = `CoreDbAccess::parameters()`
| ) |  |
| static

An empty list references the root tag.

## ◆ isAlbumUrl()

bool Digikam::CoreDbUrl::isAlbumUrl | ( |  | ) | const

The protocol string is of course available via protocol().

## ◆ name()

QString Digikam::CoreDbUrl::name | ( |  | ) | const

In the example above, this is "001.jpg"

## ◆ parameters()

DbEngineParameters Digikam::CoreDbUrl::parameters | ( |  | ) | const

Applicable to all protocols.

## ◆ searchId()

int Digikam::CoreDbUrl::searchId | ( |  | ) | const

Return the id of the search.

## ◆ startDate()

QDate Digikam::CoreDbUrl::startDate | ( |  | ) | const

Return the referenced start date (included in the referenced span)

## ◆ tagId()

int Digikam::CoreDbUrl::tagId | ( |  | ) | const

Returns the tag ID, or -1 if the root tag is referenced