alkimia  7.0.2
alkcompany.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright 2011 Alvaro Soliverez asoliverez@kde.org *
3 * *
4 * This file is part of libalkimia. *
5 * *
6 * libalkimia is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public License *
8 * as published by the Free Software Foundation; either version 2.1 of *
9 * the License or (at your option) version 3 or any later version. *
10 * *
11 * libalkimia is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/> *
18 ***************************************************************************/
19 
20 #include "alkcompany.h"
21 
22 #include <QDBusMetaType>
23 #include <QDBusArgument>
24 
26 {
27 public:
28  QString m_symbol;
29  QString m_name;
30  QString m_type;
31  QString m_exchange;
32  QString m_id;
33 };
34 
35 AlkCompany::AlkCompany(QObject *parent) :
36  QObject(parent),
37  d(new Private)
38 {
39 }
40 
42 {
43 }
44 
45 AlkCompany::AlkCompany(const AlkCompany& company, QObject *parent):
46  QObject(parent),
47  d(new Private)
48 {
49  setName(company.name());
50  setSymbol(company.symbol());
51  setType(company.type());
52  setExchange(company.exchange());
53  setRecordId(company.recordId());
54 }
55 
56 
57 const QString& AlkCompany::symbol() const
58 {
59  return d->m_symbol;
60 }
61 
62 const QString& AlkCompany::name() const
63 {
64  return d->m_name;
65 }
66 
67 const QString& AlkCompany::type() const
68 {
69  return d->m_type;
70 }
71 
72 const QString& AlkCompany::exchange() const
73 {
74  return d->m_exchange;
75 }
76 
77 const QString& AlkCompany::recordId() const
78 {
79  return d->m_id;
80 }
81 
82 void AlkCompany::setSymbol(const QString &symbol)
83 {
84  d->m_symbol = symbol;
85 }
86 
87 void AlkCompany::setName(const QString &name)
88 {
89  d->m_name = name;
90 }
91 
92 void AlkCompany::setType(const QString &type)
93 {
94  d->m_type = type;
95 }
96 
97 void AlkCompany::setExchange(const QString& exchange)
98 {
100 }
101 
102 void AlkCompany::setRecordId(const QString &recordId)
103 {
104  d->m_id = recordId;
105 }
106 
107 QDBusArgument& operator<<(QDBusArgument& argument, const AlkCompany &company)
108 {
109  argument.beginStructure();
110  argument << company.symbol() << company.name() << company.type() << company.exchange() << company.recordId();
111  argument.endStructure();
112  return argument;
113 }
114 
115 const QDBusArgument& operator>>(const QDBusArgument& argument, AlkCompany &company)
116 {
117  argument.beginStructure();
118  QString symbol;
119  QString name;
120  QString type;
121  QString exchange;
122  QString id;
123  argument >> symbol >> name >> type >> exchange >> id;
124  company.setSymbol(symbol);
125  company.setName(name);
126  company.setType(type);
127  company.setExchange(exchange);
128  company.setRecordId(id);
129  argument.endStructure();
130  return argument;
131 }
const QString & exchange() const
Definition: alkcompany.cpp:72
const QString & type() const
Definition: alkcompany.cpp:67
void setRecordId(const QString &recordId)
Definition: alkcompany.cpp:102
QDBusArgument & operator<<(QDBusArgument &argument, const AlkCompany &company)
Definition: alkcompany.cpp:107
const QString & recordId() const
Definition: alkcompany.cpp:77
void setExchange(const QString &exchange)
Definition: alkcompany.cpp:97
const QString & symbol() const
Definition: alkcompany.cpp:57
const QString & name() const
Definition: alkcompany.cpp:62
void setName(const QString &name)
Definition: alkcompany.cpp:87
void setType(const QString &type)
Definition: alkcompany.cpp:92
AlkCompany(QObject *parent=0)
Definition: alkcompany.cpp:35
Private *const d
Definition: alkcompany.h:73
const QDBusArgument & operator>>(const QDBusArgument &argument, AlkCompany &company)
Definition: alkcompany.cpp:115
void setSymbol(const QString &symbol)
Definition: alkcompany.cpp:82