digiKam
Digikam::CoreDbUrl Class Reference
+ Inheritance diagram for Digikam::CoreDbUrl:

Public Member Functions

QString album () const
 
QUrl albumRoot () const
 Album URL. More...
 
int albumRootId () const
 
QString albumRootPath () const
 
bool areaCoordinates (double *lat1, double *lat2, double *lon1, double *lon2) const
 MapImages URL. More...
 
 CoreDbUrl ()
 
 CoreDbUrl (const CoreDbUrl &url)
 
 CoreDbUrl (const QUrl &digikamUrl)
 
QDate endDate () const
 
QUrl fileUrl () const
 
bool isAlbumUrl () const
 
bool isDateUrl () const
 
bool isMapImagesUrl () const
 
bool isSearchUrl () const
 
bool isTagUrl () const
 
QString name () const
 
CoreDbUrloperator= (const CoreDbUrl &url)
 
CoreDbUrloperator= (const QUrl &digikamalbumsUrl)
 
bool operator== (const QUrl &digikamalbumsUrl) const
 
DbEngineParameters parameters () const
 
int searchId () const
 Search URL. More...
 
void setParameters (const DbEngineParameters &parameters)
 
QDate startDate () const
 Date URL. More...
 
int tagId () const
 Tag URL. More...
 
QList< int > tagIds () const
 

Static Public Member Functions

static CoreDbUrl albumUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
static CoreDbUrl dateUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
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())
 
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())
 
static CoreDbUrl fromDateForYear (const QDate &date, const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
static CoreDbUrl fromDateRange (const QDate &startDate, const QDate &endDate, const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
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())
 
static CoreDbUrl fromTagIds (const QList< int > &tagIds, const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
static CoreDbUrl mapImagesUrl (const DbEngineParameters &parameters=CoreDbAccess::parameters())
 
static CoreDbUrl searchUrl (int searchId, const DbEngineParameters &parameters=CoreDbAccess::parameters())
 

Constructor & Destructor Documentation

◆ CoreDbUrl() [1/3]

Digikam::CoreDbUrl::CoreDbUrl ( const QUrl &  digikamUrl)
explicit

Create a CoreDbUrl object from a QUrl, to retrieve the information stored

◆ CoreDbUrl() [2/3]

Digikam::CoreDbUrl::CoreDbUrl ( )

Create an invalid database URL

◆ CoreDbUrl() [3/3]

Digikam::CoreDbUrl::CoreDbUrl ( const CoreDbUrl url)

Member Function Documentation

◆ album()

QString Digikam::CoreDbUrl::album ( ) const

Returns the album: This is the directory hierarchy below the album root. In the example above, the album is "/Summer 2007"

Referenced by Digikam::ItemInfoJob::allItemsFromAlbum(), fromAlbumAndName(), Digikam::ItemLister::list(), and Digikam::ItemAlbumModel::startListJob().

◆ albumRoot()

QUrl Digikam::CoreDbUrl::albumRoot ( ) const

Album URL.

The following methods are only applicable for a certain protocol each. If the URL has another protocol, the return value of these methods is undefined. Returns the album root URL of the file or album referenced by this URL In the example above, this is "file://media/fotos"

Referenced by fileUrl(), fromAlbumAndName(), and fromFileUrl().

◆ albumRootId()

int Digikam::CoreDbUrl::albumRootId ( ) const

◆ albumRootPath()

QString Digikam::CoreDbUrl::albumRootPath ( ) const

Returns the album root path of the file or album referenced by this URL In the example above, this is "/media/fotos"

Referenced by fromFileUrl().

◆ albumUrl()

CoreDbUrl Digikam::CoreDbUrl::albumUrl ( const DbEngineParameters parameters = CoreDbAccess::parameters())
static

Create an empty digikamalbums:/ url

References parameters(), and setParameters().

◆ areaCoordinates()

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

MapImages URL.

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

Referenced by Digikam::ItemLister::list().

◆ dateUrl()

CoreDbUrl Digikam::CoreDbUrl::dateUrl ( const DbEngineParameters parameters = CoreDbAccess::parameters())
static

Create an empty digikamdates:/ url

References parameters(), and setParameters().

◆ endDate()

QDate Digikam::CoreDbUrl::endDate ( ) const

Return the referenced end date (excluded from the referenced span)

Referenced by Digikam::ItemInfoJob::allItemsFromAlbum(), fromDateRange(), Digikam::ItemLister::list(), and Digikam::ItemAlbumModel::startListJob().

◆ fileUrl()

QUrl Digikam::CoreDbUrl::fileUrl ( ) const

◆ fromAlbumAndName() [1/2]

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

◆ fromAlbumAndName() [2/2]

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

Create a digikamalbums:/ url from an album name and an image in this album. If name is empty, the album is referenced. Other parameters as above.

References album(), albumRoot(), albumRootId(), name(), parameters(), and setParameters().

Referenced by Digikam::PAlbum::databaseUrl(), fromAlbumAndName(), and Digikam::ItemScanner::ItemScanner().

◆ fromAreaRange()

CoreDbUrl Digikam::CoreDbUrl::fromAreaRange ( const qreal  lat1,
const qreal  lng1,
const qreal  lat2,
const qreal  lng2,
const DbEngineParameters parameters = CoreDbAccess::parameters() 
)
static

References parameters(), and setParameters().

◆ fromDateForMonth()

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

Create a digikamdates:/ url for the month of the given date. (The whole month of the given date will included in the referenced time span)

References fromDateRange(), and parameters().

Referenced by Digikam::DAlbum::databaseUrl().

◆ fromDateForYear()

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

Create a digikamdates:/ url for the year of the given date. (The whole year of the given date will included in the referenced time span)

References fromDateRange(), and parameters().

Referenced by Digikam::DAlbum::databaseUrl().

◆ fromDateRange()

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

Create a digikamdates:/ url for a specified time span which begin with the start date (inclusive) and ends before the end date (exclusive). To cover the whole year of 1984, you would pass 1/1/1984 and 1/1/1985.

References endDate(), parameters(), setParameters(), and startDate().

Referenced by fromDateForMonth(), and fromDateForYear().

◆ fromFileUrl() [1/2]

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

◆ fromFileUrl() [2/2]

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

This class shall facilitate the usage of digikamalbums:/, digikamtags:/, digikamdates:/ and digikamsearch: URLs. 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

References albumRoot(), albumRootId(), albumRootPath(), fileUrl(), parameters(), and setParameters().

Referenced by fromFileUrl().

◆ fromTagIds()

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

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. An empty list references the root tag.

References parameters(), setParameters(), and tagIds().

Referenced by Digikam::TAlbum::databaseUrl(), and Digikam::ItemAlbumModel::startListJob().

◆ isAlbumUrl()

bool Digikam::CoreDbUrl::isAlbumUrl ( ) const

These test for the protocol of this URL. The protocol string is of course available via protocol().

Referenced by Digikam::DeleteItem::DeleteItem(), and Digikam::ItemLister::list().

◆ isDateUrl()

bool Digikam::CoreDbUrl::isDateUrl ( ) const

◆ isMapImagesUrl()

bool Digikam::CoreDbUrl::isMapImagesUrl ( ) const

◆ isSearchUrl()

bool Digikam::CoreDbUrl::isSearchUrl ( ) const

◆ isTagUrl()

bool Digikam::CoreDbUrl::isTagUrl ( ) const

◆ mapImagesUrl()

CoreDbUrl Digikam::CoreDbUrl::mapImagesUrl ( const DbEngineParameters parameters = CoreDbAccess::parameters())
static

Create an empty digikammapimages:/ url

References parameters(), and setParameters().

◆ name()

QString Digikam::CoreDbUrl::name ( ) const

Returns the file name. In the example above, this is "001.jpg"

Referenced by fromAlbumAndName().

◆ operator=() [1/2]

CoreDbUrl & Digikam::CoreDbUrl::operator= ( const CoreDbUrl url)

◆ operator=() [2/2]

CoreDbUrl & Digikam::CoreDbUrl::operator= ( const QUrl &  digikamalbumsUrl)

◆ operator==()

bool Digikam::CoreDbUrl::operator== ( const QUrl &  digikamalbumsUrl) const

◆ parameters()

DbEngineParameters Digikam::CoreDbUrl::parameters ( ) const

◆ searchId()

int Digikam::CoreDbUrl::searchId ( ) const

Search URL.

Return the id of the search.

Referenced by Digikam::ItemInfoJob::allItemsFromAlbum().

◆ searchUrl()

CoreDbUrl Digikam::CoreDbUrl::searchUrl ( int  searchId,
const DbEngineParameters parameters = CoreDbAccess::parameters() 
)
static

Create a digikamsearch: URL for the search with the given id.

References parameters(), and setParameters().

Referenced by Digikam::SAlbum::databaseUrl().

◆ setParameters()

void Digikam::CoreDbUrl::setParameters ( const DbEngineParameters parameters)

Change the database parameters stored in this URL Applicable to all protocols.

References Digikam::DbEngineParameters::insertInUrl(), and parameters().

Referenced by albumUrl(), dateUrl(), fromAlbumAndName(), fromAreaRange(), fromDateRange(), fromFileUrl(), fromTagIds(), mapImagesUrl(), and searchUrl().

◆ startDate()

QDate Digikam::CoreDbUrl::startDate ( ) const

Date URL.

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

Referenced by Digikam::ItemInfoJob::allItemsFromAlbum(), fromDateRange(), Digikam::ItemLister::list(), and Digikam::ItemAlbumModel::startListJob().

◆ tagId()

int Digikam::CoreDbUrl::tagId ( ) const

Tag URL.

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

Referenced by Digikam::ItemInfoJob::allItemsFromAlbum().

◆ tagIds()

QList< int > Digikam::CoreDbUrl::tagIds ( ) const

Returns the tag ids of all tags in the tag path of this tag, the topmost tag in the hierarchy first.

References QT_SKIP_EMPTY_PARTS.

Referenced by fromTagIds(), and Digikam::ItemLister::list().


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