qtmobility/examples/servicenotesmanager/declarative-sfw-notes/note.h
changeset 4 90517678cc4f
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** You may use this file in accordance with the terms and conditions
       
    11 ** contained in the Technology Preview License Agreement accompanying
       
    12 ** this package.
       
    13 **
       
    14 ** GNU Lesser General Public License Usage
       
    15 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    16 ** General Public License version 2.1 as published by the Free Software
       
    17 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    18 ** packaging of this file.  Please review the following information to
       
    19 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    20 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    21 **
       
    22 ** In addition, as a special exception, Nokia gives you certain additional
       
    23 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    24 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    25 **
       
    26 ** If you have questions regarding the use of this file, please contact
       
    27 ** Nokia at qt-info@nokia.com.
       
    28 **
       
    29 **
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 ** $QT_END_LICENSE$
       
    37 **
       
    38 ****************************************************************************/
       
    39 
       
    40 #ifndef NOTE_H
       
    41 #define NOTE_H
       
    42 
       
    43 #include <QObject>
       
    44 #include <QDateTime>
       
    45 #include <QtDeclarative/qdeclarative.h>
       
    46 
       
    47 class Note : public QObject
       
    48 {
       
    49     Q_OBJECT
       
    50     Q_PROPERTY(int index READ index WRITE setIndex)
       
    51     Q_PROPERTY(QString message READ message WRITE setMessage)
       
    52     Q_PROPERTY(QDateTime alarm READ alarm WRITE setAlarm)
       
    53 
       
    54 public:
       
    55     Note(QObject *parent =0) : QObject(parent) {}
       
    56     ~Note() {}
       
    57 
       
    58 public slots:
       
    59     int index() const { return m_index; }
       
    60     void setIndex(int index) { m_index = index; }
       
    61 
       
    62     QString message() const { return m_message; }
       
    63     void setMessage(const QString &message) { m_message = message; }
       
    64 
       
    65     QDateTime alarm() const { return m_alarm; }
       
    66     void setAlarm(const QDateTime &alarm) { m_alarm = alarm; }
       
    67 
       
    68 private:
       
    69     int m_index;
       
    70     QString m_message;
       
    71     QDateTime m_alarm;
       
    72 };
       
    73 
       
    74 //QML_DECLARE_TYPE(Note)
       
    75 
       
    76 class NoteSet : public QObject
       
    77 {
       
    78     Q_OBJECT
       
    79     Q_PROPERTY(QList<Note*>* noteset READ noteset WRITE setnoteset)
       
    80 
       
    81 public:
       
    82     NoteSet(QObject *parent =0) : QObject(parent) {};
       
    83     ~NoteSet() {};
       
    84 
       
    85     QList<Note*> *noteset() { return &m_noteset; }
       
    86     void setnoteset(QList<Note*>* set) { m_noteset = *set; }
       
    87 
       
    88 private:
       
    89     QList<Note*> m_noteset;
       
    90 };
       
    91 
       
    92 //QML_DECLARE_TYPE(NoteSet)
       
    93 
       
    94 #endif
       
    95