Alkimia API

alkcompany.cpp
1/*
2 SPDX-FileCopyrightText: 2011 Alvaro Soliverez asoliverez @kde.org
3
4 This file is part of libalkimia.
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7*/
8
9#include "alkcompany.h"
10
11#include <QDBusArgument>
12#include <QDBusMetaType>
13
14class AlkCompany::Private
15{
16public:
17 QString m_symbol;
18 QString m_name;
19 QString m_type;
20 QString m_exchange;
21 QString m_id;
22};
23
24AlkCompany::AlkCompany(QObject *parent)
25 : QObject(parent)
26 , d(new Private)
27{
28}
29
30AlkCompany::~AlkCompany()
31{
32}
33
34AlkCompany::AlkCompany(const AlkCompany &company, QObject *parent)
35 : QObject(parent)
36 , d(new Private)
37{
38 setName(company.name());
39 setSymbol(company.symbol());
40 setType(company.type());
41 setExchange(company.exchange());
42 setRecordId(company.recordId());
43}
44
45const QString &AlkCompany::symbol() const
46{
47 return d->m_symbol;
48}
49
50const QString &AlkCompany::name() const
51{
52 return d->m_name;
53}
54
55const QString &AlkCompany::type() const
56{
57 return d->m_type;
58}
59
60const QString &AlkCompany::exchange() const
61{
62 return d->m_exchange;
63}
64
65const QString &AlkCompany::recordId() const
66{
67 return d->m_id;
68}
69
70void AlkCompany::setSymbol(const QString &symbol)
71{
72 d->m_symbol = symbol;
73}
74
75void AlkCompany::setName(const QString &name)
76{
77 d->m_name = name;
78}
79
80void AlkCompany::setType(const QString &type)
81{
82 d->m_type = type;
83}
84
85void AlkCompany::setExchange(const QString &exchange)
86{
87 d->m_exchange = exchange;
88}
89
90void AlkCompany::setRecordId(const QString &recordId)
91{
92 d->m_id = recordId;
93}
94
95QDBusArgument &operator<<(QDBusArgument &argument, const AlkCompany &company)
96{
97 argument.beginStructure();
98 argument << company.symbol() << company.name() << company.type() << company.exchange()
99 << company.recordId();
100 argument.endStructure();
101 return argument;
102}
103
104const QDBusArgument &operator>>(const QDBusArgument &argument, AlkCompany &company)
105{
106 argument.beginStructure();
107 QString symbol;
110 QString exchange;
111 QString id;
112 argument >> symbol >> name >> type >> exchange >> id;
113 company.setSymbol(symbol);
114 company.setName(name);
115 company.setType(type);
116 company.setExchange(exchange);
117 company.setRecordId(id);
118 argument.endStructure();
119 return argument;
120}
Type type(const QSqlDatabase &db)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
QString name(StandardAction id)
void beginStructure()
void endStructure()
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.