digiKam
DigikamGenericINatPlugin::INatTalker Class Reference
+ Inheritance diagram for DigikamGenericINatPlugin::INatTalker:

Classes

struct  NearbyObservation
 
struct  PhotoUploadRequest
 
struct  PhotoUploadResult
 

Signals

void signalBusy (bool val)
 
void signalComputerVisionResults (const ImageScores &)
 
void signalLinkingFailed (const QString &error)
 
void signalLinkingSucceeded (const QString &login, const QString &name, const QUrl &iconUrl)
 
void signalLoadUrlSucceeded (const QUrl &, const QByteArray &)
 
void signalNearbyObservation (const INatTalker::NearbyObservation &)
 
void signalNearbyPlaces (const QStringList &)
 
void signalObservationCreated (const INatTalker::PhotoUploadRequest &)
 
void signalObservationDeleted (int id)
 
void signalPhotoUploaded (const INatTalker::PhotoUploadResult &)
 
void signalTaxonAutoCompletions (const AutoCompletions &)
 

Public Member Functions

int apiTokenExpiresIn () const
 
void cancel ()
 
void closestObservation (uint taxon, double latitude, double longitude, double radius_km=10.0, const QString &origQuery=QString())
 
void computerVision (const QUrl &localImage)
 
void createObservation (const QByteArray &, const PhotoUploadRequest &)
 
void deleteObservation (int id, const QString &apiKey, int retries=0)
 
 INatTalker (QWidget *const parent, const QString &serviceName, DInfoInterface *const iface)
 
void loadUrl (const QUrl &url, int retries=0)
 
void nearbyPlaces (double latitude, double longitude)
 
void removeUserName (const QString &userName)
 
bool restoreApiToken (const QString &username, QList< QNetworkCookie > &, bool emitSignal)
 
bool stillUploading () const
 
void taxonAutoCompletions (const QString &partialName)
 
void unLink ()
 
void uploadNextPhoto (const PhotoUploadRequest &)
 
void userInfo (const QList< QNetworkCookie > &)
 
void verifyCreateObservation (const QByteArray &, const PhotoUploadRequest &, int page, int retries)
 
void verifyUploadNextPhoto (const PhotoUploadRequest &, int retries)
 
 ~INatTalker () override
 

Public Attributes

QProgressDialog * m_authProgressDlg
 

Friends

class AutoCompletionRequest
 
class ComputerVisionRequest
 
class LoadUrlRequest
 
class NearbyObservationRequest
 
class NearbyPlacesRequest
 
class UserRequest
 

Constructor & Destructor Documentation

◆ INatTalker()

DigikamGenericINatPlugin::INatTalker::INatTalker ( QWidget *const  parent,
const QString &  serviceName,
DInfoInterface *const  iface 
)

◆ ~INatTalker()

DigikamGenericINatPlugin::INatTalker::~INatTalker ( )
override

Member Function Documentation

◆ apiTokenExpiresIn()

int DigikamGenericINatPlugin::INatTalker::apiTokenExpiresIn ( ) const

Returns -1 if there is no valid token; number of seconds otherwise.

Referenced by computerVision(), and restoreApiToken().

◆ cancel()

void DigikamGenericINatPlugin::INatTalker::cancel ( )

References m_authProgressDlg, and signalBusy().

◆ closestObservation()

void DigikamGenericINatPlugin::INatTalker::closestObservation ( uint  taxon,
double  latitude,
double  longitude,
double  radius_km = 10.0,
const QString &  origQuery = QString() 
)

◆ computerVision()

◆ createObservation()

void DigikamGenericINatPlugin::INatTalker::createObservation ( const QByteArray &  parameters,
const PhotoUploadRequest photoUpload 
)

Create an iNaturalist observation; photo uploads follow.

References DigikamGenericINatPlugin::INatTalker::PhotoUploadRequest::m_apiKey.

◆ deleteObservation()

void DigikamGenericINatPlugin::INatTalker::deleteObservation ( int  id,
const QString &  apiKey,
int  retries = 0 
)

Delete an observation; called when canceling uploads.

◆ loadUrl()

void DigikamGenericINatPlugin::INatTalker::loadUrl ( const QUrl &  url,
int  retries = 0 
)

Download an image from iNaturalist servers.

References LoadUrlRequest, and signalLoadUrlSucceeded().

◆ nearbyPlaces()

void DigikamGenericINatPlugin::INatTalker::nearbyPlaces ( double  latitude,
double  longitude 
)

◆ removeUserName()

void DigikamGenericINatPlugin::INatTalker::removeUserName ( const QString &  userName)

◆ restoreApiToken()

bool DigikamGenericINatPlugin::INatTalker::restoreApiToken ( const QString &  username,
QList< QNetworkCookie > &  cookies,
bool  emitSignal 
)

Try to restore a valid API token; they are good for 24 hours.

References apiTokenExpiresIn(), DigikamGenericINatPlugin::INatBrowserDlg::filterCookie(), and userInfo().

◆ signalBusy

void DigikamGenericINatPlugin::INatTalker::signalBusy ( bool  val)
signal

Referenced by cancel(), and userInfo().

◆ signalComputerVisionResults

void DigikamGenericINatPlugin::INatTalker::signalComputerVisionResults ( const ImageScores )
signal

Referenced by computerVision().

◆ signalLinkingFailed

void DigikamGenericINatPlugin::INatTalker::signalLinkingFailed ( const QString &  error)
signal

◆ signalLinkingSucceeded

void DigikamGenericINatPlugin::INatTalker::signalLinkingSucceeded ( const QString &  login,
const QString &  name,
const QUrl &  iconUrl 
)
signal

◆ signalLoadUrlSucceeded

void DigikamGenericINatPlugin::INatTalker::signalLoadUrlSucceeded ( const QUrl &  ,
const QByteArray &   
)
signal

Referenced by loadUrl().

◆ signalNearbyObservation

void DigikamGenericINatPlugin::INatTalker::signalNearbyObservation ( const INatTalker::NearbyObservation )
signal

Referenced by closestObservation().

◆ signalNearbyPlaces

void DigikamGenericINatPlugin::INatTalker::signalNearbyPlaces ( const QStringList &  )
signal

Referenced by nearbyPlaces().

◆ signalObservationCreated

void DigikamGenericINatPlugin::INatTalker::signalObservationCreated ( const INatTalker::PhotoUploadRequest )
signal

◆ signalObservationDeleted

void DigikamGenericINatPlugin::INatTalker::signalObservationDeleted ( int  id)
signal

◆ signalPhotoUploaded

void DigikamGenericINatPlugin::INatTalker::signalPhotoUploaded ( const INatTalker::PhotoUploadResult )
signal

◆ signalTaxonAutoCompletions

void DigikamGenericINatPlugin::INatTalker::signalTaxonAutoCompletions ( const AutoCompletions )
signal

Referenced by taxonAutoCompletions().

◆ stillUploading()

bool DigikamGenericINatPlugin::INatTalker::stillUploading ( ) const

Are we still uploading observations or photos?

◆ taxonAutoCompletions()

void DigikamGenericINatPlugin::INatTalker::taxonAutoCompletions ( const QString &  partialName)

Obtain auto completions for taxa from iNaturalist servers.

References AutoCompletionRequest, DigikamGenericINatPlugin::locale, signalTaxonAutoCompletions(), and value.

◆ unLink()

void DigikamGenericINatPlugin::INatTalker::unLink ( )

◆ uploadNextPhoto()

◆ userInfo()

void DigikamGenericINatPlugin::INatTalker::userInfo ( const QList< QNetworkCookie > &  cookies)

Retrieve login, name, and icon of current user.

References m_authProgressDlg, signalBusy(), and UserRequest.

Referenced by restoreApiToken().

◆ verifyCreateObservation()

void DigikamGenericINatPlugin::INatTalker::verifyCreateObservation ( const QByteArray &  parameters,
const PhotoUploadRequest photoUpload,
int  page,
int  retries 
)

Check whether an iNaturalist observation has been created. Called upon timeout in createObservation().

References DigikamGenericINatPlugin::INatTalker::PhotoUploadRequest::m_apiKey, and DigikamGenericINatPlugin::INatTalker::PhotoUploadRequest::m_user.

◆ verifyUploadNextPhoto()

void DigikamGenericINatPlugin::INatTalker::verifyUploadNextPhoto ( const PhotoUploadRequest request,
int  retries 
)

Friends And Related Function Documentation

◆ AutoCompletionRequest

friend class AutoCompletionRequest
friend

Referenced by taxonAutoCompletions().

◆ ComputerVisionRequest

friend class ComputerVisionRequest
friend

Referenced by computerVision().

◆ LoadUrlRequest

friend class LoadUrlRequest
friend

Referenced by loadUrl().

◆ NearbyObservationRequest

friend class NearbyObservationRequest
friend

Referenced by closestObservation().

◆ NearbyPlacesRequest

friend class NearbyPlacesRequest
friend

Referenced by nearbyPlaces().

◆ UserRequest

friend class UserRequest
friend

Referenced by userInfo().

Member Data Documentation

◆ m_authProgressDlg

QProgressDialog* DigikamGenericINatPlugin::INatTalker::m_authProgressDlg

Referenced by cancel(), INatTalker(), and userInfo().


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