AlkOnlineQuoteSource

Search for usage in LXR

#include <alkonlinequotesource.h>

Public Types

enum  DataFormat {
  StrippedHTML , HTML , CSV , CSS ,
  JSON
}
 
enum  DecimalSeparator { Legacy , Period , Comma }
 
enum  DownloadType { Default , Javascript }
 
enum  IdSelector { Symbol , IdentificationNumber , Name }
 

Public Member Functions

 AlkOnlineQuoteSource (const AlkOnlineQuoteSource &other)
 
 AlkOnlineQuoteSource (const QString &name, AlkOnlineQuotesProfile *profile)
 
 AlkOnlineQuoteSource (const QString &name, const QString &url, const QString &idRegex, const IdSelector idBy, const QString &priceRegex, const QString &dateRegex, const QString &dateFormat, DataFormat dataFormat=HTML, DecimalSeparator priceDecimalSeparator=Legacy, DownloadType downloadType=Default)
 
AlkOnlineQuoteSource asReference () const
 
DataFormat dataFormat () const
 
QString dateFormat () const
 
QString dateRegex () const
 
const QStringdefaultId () const
 
DownloadType downloadType () const
 
QString financeQuoteName () const
 
QString ghnsWriteFileName () const
 
QString idRegex () const
 
IdSelector idSelector () const
 
bool isEmpty ()
 
bool isFinanceQuote () const
 
bool isGHNS () const
 
bool isReadOnly () const
 
bool isReference () const
 
bool isValid ()
 
QString name () const
 
AlkOnlineQuoteSourceoperator= (AlkOnlineQuoteSource other)
 
DecimalSeparator priceDecimalSeparator () const
 
QString priceRegex () const
 
AlkOnlineQuotesProfile * profile ()
 
AlkOnlineQuotesProfile * profile () const
 
bool read ()
 
QString referenceName () const
 
void remove ()
 
void rename (const QString &name)
 
bool requiresTwoIdentifier () const
 
void setDataFormat (DataFormat dataFormat)
 
void setDateFormat (const QString &dateFormat)
 
void setDateRegex (const QString &dateRegex)
 
void setDefaultId (const QString &defaultId)
 
void setDownloadType (DownloadType downloadType)
 
void setGHNS (bool state)
 
void setIdRegex (const QString &idRegex)
 
void setIdSelector (IdSelector idSelector)
 
void setName (const QString &name)
 
void setPriceDecimalSeparator (DecimalSeparator separator)
 
void setPriceRegex (const QString &priceRegex)
 
void setProfile (AlkOnlineQuotesProfile *profile)
 
void setReferenceName (const QString &name)
 
void setUrl (const QString &url)
 
bool supportsDateRange () const
 
QString url () const
 
bool write ()
 

Static Public Member Functions

static AlkOnlineQuoteSource defaultCurrencyQuoteSource (const QString &name)
 
static bool isFinanceQuote (const QString &name)
 
static AlkOnlineQuoteSource testQuoteSource (const QString &name, bool twoSymbols=false, DownloadType downloadType=Default, DataFormat format=HTML)
 

Protected Attributes

Private * d
 

Detailed Description

Author
Thomas Baumgart & Ace Jones

This is a helper class to store information about an online source for stock prices or currency exchange rates.

Definition at line 25 of file alkonlinequotesource.h.

Member Enumeration Documentation

◆ DataFormat

Supported formats of downloaded data.

Definition at line 37 of file alkonlinequotesource.h.

◆ DecimalSeparator

Type of decimal separator.

Definition at line 48 of file alkonlinequotesource.h.

◆ DownloadType

enum AlkOnlineQuoteSource::DownloadType

Definition at line 54 of file alkonlinequotesource.h.

◆ IdSelector

enum AlkOnlineQuoteSource::IdSelector

Definition at line 28 of file alkonlinequotesource.h.

Constructor & Destructor Documentation

◆ AlkOnlineQuoteSource() [1/4]

AlkOnlineQuoteSource::AlkOnlineQuoteSource ( )

Definition at line 22 of file alkonlinequotesource.cpp.

◆ AlkOnlineQuoteSource() [2/4]

AlkOnlineQuoteSource::AlkOnlineQuoteSource ( const QString & name,
AlkOnlineQuotesProfile * profile )
explicit

Definition at line 63 of file alkonlinequotesource.cpp.

◆ AlkOnlineQuoteSource() [3/4]

AlkOnlineQuoteSource::AlkOnlineQuoteSource ( const QString & name,
const QString & url,
const QString & idRegex,
const IdSelector idBy,
const QString & priceRegex,
const QString & dateRegex,
const QString & dateFormat,
DataFormat dataFormat = HTML,
DecimalSeparator priceDecimalSeparator = Legacy,
DownloadType downloadType = Default )
explicit

Definition at line 38 of file alkonlinequotesource.cpp.

◆ ~AlkOnlineQuoteSource()

AlkOnlineQuoteSource::~AlkOnlineQuoteSource ( )

Definition at line 141 of file alkonlinequotesource.cpp.

◆ AlkOnlineQuoteSource() [4/4]

AlkOnlineQuoteSource::AlkOnlineQuoteSource ( const AlkOnlineQuoteSource & other)

Definition at line 27 of file alkonlinequotesource.cpp.

Member Function Documentation

◆ asReference()

AlkOnlineQuoteSource AlkOnlineQuoteSource::asReference ( ) const

Return referenced quote source.

If this source is not a reference, an empty source is returned.

Returns
referenced quote source or empty source otherwise

Definition at line 146 of file alkonlinequotesource.cpp.

◆ dataFormat()

AlkOnlineQuoteSource::DataFormat AlkOnlineQuoteSource::dataFormat ( ) const

Return the format of the downloaded data.

Returns
Format identifier

Definition at line 206 of file alkonlinequotesource.cpp.

◆ dateFormat()

QString AlkOnlineQuoteSource::dateFormat ( ) const

Definition at line 214 of file alkonlinequotesource.cpp.

◆ dateRegex()

QString AlkOnlineQuoteSource::dateRegex ( ) const

Definition at line 201 of file alkonlinequotesource.cpp.

◆ defaultCurrencyQuoteSource()

AlkOnlineQuoteSource AlkOnlineQuoteSource::defaultCurrencyQuoteSource ( const QString & name)
static

Definition at line 75 of file alkonlinequotesource.cpp.

◆ defaultId()

const QString & AlkOnlineQuoteSource::defaultId ( ) const

Return the default identifier known to work.

Returns
default identifier

Definition at line 409 of file alkonlinequotesource.cpp.

◆ downloadType()

AlkOnlineQuoteSource::DownloadType AlkOnlineQuoteSource::downloadType ( ) const

Definition at line 219 of file alkonlinequotesource.cpp.

◆ financeQuoteName()

QString AlkOnlineQuoteSource::financeQuoteName ( ) const

Returns the name of the "Finance::Quote" source.

This function only makes sense if the current source is of the specified type.

Returns
"Finance::Quote" source name

Definition at line 231 of file alkonlinequotesource.cpp.

◆ ghnsWriteFileName()

QString AlkOnlineQuoteSource::ghnsWriteFileName ( ) const

Definition at line 336 of file alkonlinequotesource.cpp.

◆ idRegex()

QString AlkOnlineQuoteSource::idRegex ( ) const

Definition at line 181 of file alkonlinequotesource.cpp.

◆ idSelector()

AlkOnlineQuoteSource::IdSelector AlkOnlineQuoteSource::idSelector ( ) const

Definition at line 186 of file alkonlinequotesource.cpp.

◆ isEmpty()

bool AlkOnlineQuoteSource::isEmpty ( )

Definition at line 156 of file alkonlinequotesource.cpp.

◆ isFinanceQuote() [1/2]

bool AlkOnlineQuoteSource::isFinanceQuote ( ) const

Checks whether the current source is of type "Finance::Quote".

Returns
state

Definition at line 321 of file alkonlinequotesource.cpp.

◆ isFinanceQuote() [2/2]

bool AlkOnlineQuoteSource::isFinanceQuote ( const QString & name)
static

Checks whether the specified source name is of type "Finance::Quote".

Returns
state

Definition at line 331 of file alkonlinequotesource.cpp.

◆ isGHNS()

bool AlkOnlineQuoteSource::isGHNS ( ) const

Definition at line 306 of file alkonlinequotesource.cpp.

◆ isReadOnly()

bool AlkOnlineQuoteSource::isReadOnly ( ) const

Definition at line 311 of file alkonlinequotesource.cpp.

◆ isReference()

bool AlkOnlineQuoteSource::isReference ( ) const

Return state if this source is a reference.

Returns
true the current source is a reference
false the current source is not a reference

Definition at line 151 of file alkonlinequotesource.cpp.

◆ isValid()

bool AlkOnlineQuoteSource::isValid ( )

Definition at line 161 of file alkonlinequotesource.cpp.

◆ name()

QString AlkOnlineQuoteSource::name ( ) const

Definition at line 171 of file alkonlinequotesource.cpp.

◆ operator=()

AlkOnlineQuoteSource & AlkOnlineQuoteSource::operator= ( AlkOnlineQuoteSource other)

Definition at line 32 of file alkonlinequotesource.cpp.

◆ priceDecimalSeparator()

AlkOnlineQuoteSource::DecimalSeparator AlkOnlineQuoteSource::priceDecimalSeparator ( ) const

Definition at line 196 of file alkonlinequotesource.cpp.

◆ priceRegex()

QString AlkOnlineQuoteSource::priceRegex ( ) const

Definition at line 191 of file alkonlinequotesource.cpp.

◆ profile() [1/2]

AlkOnlineQuotesProfile * AlkOnlineQuoteSource::profile ( )

Definition at line 347 of file alkonlinequotesource.cpp.

◆ profile() [2/2]

AlkOnlineQuotesProfile * AlkOnlineQuoteSource::profile ( ) const

Definition at line 352 of file alkonlinequotesource.cpp.

◆ read()

bool AlkOnlineQuoteSource::read ( )

Definition at line 357 of file alkonlinequotesource.cpp.

◆ referenceName()

QString AlkOnlineQuoteSource::referenceName ( ) const

Return name of the referenced quote source.

Returns
referenced source name

Definition at line 166 of file alkonlinequotesource.cpp.

◆ remove()

void AlkOnlineQuoteSource::remove ( )

Definition at line 400 of file alkonlinequotesource.cpp.

◆ rename()

void AlkOnlineQuoteSource::rename ( const QString & name)

Definition at line 390 of file alkonlinequotesource.cpp.

◆ requiresTwoIdentifier()

bool AlkOnlineQuoteSource::requiresTwoIdentifier ( ) const

Return state if this source requires two identifier.

Returns
false required one identifier
true required two identifier

Definition at line 419 of file alkonlinequotesource.cpp.

◆ setDataFormat()

void AlkOnlineQuoteSource::setDataFormat ( DataFormat dataFormat)

Set the format of the downloaded data.

Parameters
dataFormatFormat identifier

Definition at line 285 of file alkonlinequotesource.cpp.

◆ setDateFormat()

void AlkOnlineQuoteSource::setDateFormat ( const QString & dateFormat)

Definition at line 290 of file alkonlinequotesource.cpp.

◆ setDateRegex()

void AlkOnlineQuoteSource::setDateRegex ( const QString & dateRegex)

Set regular expression for parsing dates.

An empty string as expression disables the extraction of the date, which is sometimes necessary, for example if the service does not provide a complete date.

Parameters
dateregular expression

Definition at line 280 of file alkonlinequotesource.cpp.

◆ setDefaultId()

void AlkOnlineQuoteSource::setDefaultId ( const QString & defaultId)

Set the default identifier, which is known to work.

Parameters
defaultIDdefault identifier

Definition at line 414 of file alkonlinequotesource.cpp.

◆ setDownloadType()

void AlkOnlineQuoteSource::setDownloadType ( DownloadType downloadType)

Definition at line 295 of file alkonlinequotesource.cpp.

◆ setGHNS()

void AlkOnlineQuoteSource::setGHNS ( bool state)

Definition at line 300 of file alkonlinequotesource.cpp.

◆ setIdRegex()

void AlkOnlineQuoteSource::setIdRegex ( const QString & idRegex)

Definition at line 261 of file alkonlinequotesource.cpp.

◆ setIdSelector()

void AlkOnlineQuoteSource::setIdSelector ( AlkOnlineQuoteSource::IdSelector idSelector)

Definition at line 266 of file alkonlinequotesource.cpp.

◆ setName()

void AlkOnlineQuoteSource::setName ( const QString & name)

Definition at line 241 of file alkonlinequotesource.cpp.

◆ setPriceDecimalSeparator()

void AlkOnlineQuoteSource::setPriceDecimalSeparator ( DecimalSeparator separator)

Definition at line 256 of file alkonlinequotesource.cpp.

◆ setPriceRegex()

void AlkOnlineQuoteSource::setPriceRegex ( const QString & priceRegex)

Definition at line 251 of file alkonlinequotesource.cpp.

◆ setProfile()

void AlkOnlineQuoteSource::setProfile ( AlkOnlineQuotesProfile * profile)

Definition at line 341 of file alkonlinequotesource.cpp.

◆ setReferenceName()

void AlkOnlineQuoteSource::setReferenceName ( const QString & name)

Make this source a reference.

Calling this method makes this source a reference to a remote online quote source.

Parameters
namename of the referenced source

Definition at line 236 of file alkonlinequotesource.cpp.

◆ setUrl()

void AlkOnlineQuoteSource::setUrl ( const QString & url)

Definition at line 246 of file alkonlinequotesource.cpp.

◆ supportsDateRange()

bool AlkOnlineQuoteSource::supportsDateRange ( ) const

Return state if this source supports a date range.

Returns
true source supports a date range
false source does not support a date range
Since
8.1.90

Definition at line 427 of file alkonlinequotesource.cpp.

◆ testQuoteSource()

AlkOnlineQuoteSource AlkOnlineQuoteSource::testQuoteSource ( const QString & name,
bool twoSymbols = false,
DownloadType downloadType = Default,
DataFormat format = HTML )
static

Definition at line 87 of file alkonlinequotesource.cpp.

◆ url()

QString AlkOnlineQuoteSource::url ( ) const

Definition at line 176 of file alkonlinequotesource.cpp.

◆ write()

bool AlkOnlineQuoteSource::write ( )

Definition at line 367 of file alkonlinequotesource.cpp.

Member Data Documentation

◆ d

Private* AlkOnlineQuoteSource::d
protected

Definition at line 193 of file alkonlinequotesource.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.