AlkOnlineQuote

Search for usage in LXR

#include <alkonlinequote.h>

Inheritance diagram for AlkOnlineQuote:

Classes

class  Errors
 

Public Types

enum  LastPriceState { Off , Always , AlwaysWhenToday }
 
- Public Types inherited from QObject
typedef  QObjectList
 

Signals

void error (QString s)
 
void failed (QString id, QString symbol)
 
void quote (QString id, QString symbol, QDate date, double price)
 
void quotes (const QString &id, const QString &symbol, const AlkDatePriceMap &prices)
 
void status (QString s)
 

Public Slots

const AlkOnlineQuote::Errorserrors ()
 
bool launch (const QString &_symbol, const QString &_id, const QString &_source=QString())
 

Public Member Functions

 AlkOnlineQuote (AlkOnlineQuotesProfile *profile=0, QObject *=0)
 
bool enableReverseLaunch ()
 
AlkOnlineQuotesProfile * profile ()
 
LastPriceState returnLastPriceState ()
 
void setAcceptLanguage (const QString &language)
 
void setDateRange (const QDate &from, const QDate &to)
 
void setEnableReverseLaunch (bool state)
 
void setProfile (AlkOnlineQuotesProfile *profile)
 
void setReturnLastPriceState (LastPriceState state)
 
void setTimeout (int newTimeout)
 
void setUseSingleQuoteSignal (bool state)
 
const AlkOnlineQuoteSourcesource () const
 
int timeout () const
 
bool useSingleQuoteSignal ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

Private & d_ptr ()
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Detailed Description

Retrieves a price quote from a web-based quote source.

Author
Ace Jones acejones @users.sourceforge.net

Definition at line 31 of file alkonlinequote.h.

Member Enumeration Documentation

◆ LastPriceState

Supported values for returning prices in special cases.

Enumerator
Off 

No handling of special cases.

Always 

If no price is available in the specified period, but older ones are available, the most current price is returned.

AlwaysWhenToday 

If the date range has the same start and end date, is identical to the current date, no price was found but older ones are available, the most current price is returned.

(Default)

Definition at line 79 of file alkonlinequote.h.

Constructor & Destructor Documentation

◆ AlkOnlineQuote()

AlkOnlineQuote::AlkOnlineQuote ( AlkOnlineQuotesProfile * profile = 0,
QObject * _parent = 0 )
explicit

Definition at line 54 of file alkonlinequote.cpp.

◆ ~AlkOnlineQuote()

AlkOnlineQuote::~AlkOnlineQuote ( )

Definition at line 66 of file alkonlinequote.cpp.

Member Function Documentation

◆ d_ptr()

AlkOnlineQuote::Private & AlkOnlineQuote::d_ptr ( )
protected

Definition at line 161 of file alkonlinequote.cpp.

◆ enableReverseLaunch()

bool AlkOnlineQuote::enableReverseLaunch ( )

Returns the status whether a search with swapped symbols should be performed after a query for a symbol returned nothing.

Returns
current state

Definition at line 136 of file alkonlinequote.cpp.

◆ errors

const AlkOnlineQuote::Errors & AlkOnlineQuote::errors ( )
slot

If launch() returns false, this method can be used to get details about the errors that occurred.

Returns
bit map of errors, see class Errors for details

Definition at line 156 of file alkonlinequote.cpp.

◆ launch

bool AlkOnlineQuote::launch ( const QString & _symbol,
const QString & _id,
const QString & _source = QString() )
slot

This launches a web-based quote update for the given _symbol.

When the quote is received back from the web source, it will be emitted on the 'quote' signal.

If services do not provide a date, parsing of the date can be disabled by specifying an empty date attribute of the given online source.

If a timeout is set with setTimeout() and the web source does not return the requested data, the update will be aborted after this time.

Parameters
_symbolthe trading symbol of the stock to fetch a price for
_idan arbitrary identifier, which will be emitted in the quote signal when a price is sent back.
_sourcethe source of the quote (must be a valid value returned by quoteSources(). Send QString() to use the default source.
Returns
bool Whether the quote fetch process was launched successfully In case of failures it returns false and errors() could be used to get error details.

Definition at line 151 of file alkonlinequote.cpp.

◆ profile()

AlkOnlineQuotesProfile * AlkOnlineQuote::profile ( )

Definition at line 71 of file alkonlinequote.cpp.

◆ returnLastPriceState()

AlkOnlineQuote::LastPriceState AlkOnlineQuote::returnLastPriceState ( )

Returns the status of the price to be returned for special date ranges.

See setReturnLastPriceState() for details.

Returns
current state used, see AlkOnlineQuote::LastPriceState for the supported values.

Definition at line 116 of file alkonlinequote.cpp.

◆ setAcceptLanguage()

void AlkOnlineQuote::setAcceptLanguage ( const QString & language)

Set accepted language the online quote should be returned for.

Parameters
languageaccepted language to set

Definition at line 95 of file alkonlinequote.cpp.

◆ setDateRange()

void AlkOnlineQuote::setDateRange ( const QDate & from,
const QDate & to )

Defines a date range within which the data is to be retrieved.

This range is only taken into account for data in CSV format and provides online quotes via the quotes signal.

Parameters
fromfirst date to include the online quote
tolast date to include the online quote

Definition at line 110 of file alkonlinequote.cpp.

◆ setEnableReverseLaunch()

void AlkOnlineQuote::setEnableReverseLaunch ( bool state)

Set the status whether a search with swapped symbole should be performed after a query for a symbol returned nothing.

Parameters
stateEnable or disable search with swapped symbols

Definition at line 141 of file alkonlinequote.cpp.

◆ setProfile()

void AlkOnlineQuote::setProfile ( AlkOnlineQuotesProfile * profile)

Definition at line 76 of file alkonlinequote.cpp.

◆ setReturnLastPriceState()

void AlkOnlineQuote::setReturnLastPriceState ( LastPriceState state)

Sets the status of the price to be returned for special date range.

This setting is intended for handling special cases when returning prices and rates, for example in cases where the time range for a price query does not match the delivered prices, e.g. because only today was specified and the last available price is from the day before yesterday.

Parameters
statethe state to use, see AlkOnlineQuote::LastPriceState for the supported values.

Definition at line 121 of file alkonlinequote.cpp.

◆ setTimeout()

void AlkOnlineQuote::setTimeout ( int newTimeout)

Set timeout for fetching online quotes If the timeout is != -1, a request to retrieve online quotes will be aborted if the time set with this function has been exceeded.

Parameters
newTimeouttimeout in millseconds

Definition at line 105 of file alkonlinequote.cpp.

◆ setUseSingleQuoteSignal()

void AlkOnlineQuote::setUseSingleQuoteSignal ( bool state)

Always use signal quote.

For online sources in CSV data format (see AlkOnlineQuoteSource::DataFormat), the quotes found are normally returned via the quotes signal, which can be changed to the quote signal using this method.

This means that sources in CSV format can be processed via the same interface as other formats.

Parameters
stateEnable or disable use of the quote signal

Definition at line 126 of file alkonlinequote.cpp.

◆ source()

const AlkOnlineQuoteSource & AlkOnlineQuote::source ( ) const

Provides the currently used online source.

Returns
online quote source

Definition at line 146 of file alkonlinequote.cpp.

◆ timeout()

int AlkOnlineQuote::timeout ( ) const

Return actual used timeout for fetching online quotes If the returned value is -1, no timeout has been set.

Returns
timeout

Definition at line 100 of file alkonlinequote.cpp.

◆ useSingleQuoteSignal()

bool AlkOnlineQuote::useSingleQuoteSignal ( )

Returns the status of whether the quote signal is always used.

Returns
current state

Definition at line 131 of file alkonlinequote.cpp.


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.