1 /* This file is part of qjson
3 * Copyright (C) 2009 Till Adam <adam@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
24 #include <QtCore/QDate>
25 #include <QtCore/QObject>
27 class Person : public QObject
31 Q_PROPERTY(QString name READ name WRITE setName)
32 Q_PROPERTY(int phoneNumber READ phoneNumber WRITE setPhoneNumber)
33 Q_PROPERTY(Gender gender READ gender WRITE setGender)
34 Q_PROPERTY(QDate dob READ dob WRITE setDob)
38 Person(QObject* parent = 0);
42 void setName(const QString& name);
44 int phoneNumber() const;
45 void setPhoneNumber(const int phoneNumber);
47 enum Gender {Male, Female};
48 void setGender(Gender gender);
49 Gender gender() const;
52 void setDob(const QDate& dob);