diff -r 96907930389d -r 12af337248b1 notes/notesui/notesmodel/inc/notesmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/notesui/notesmodel/inc/notesmodel.h Tue Aug 31 15:13:43 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header file for class NotesModel. +* +*/ + +#ifndef NOTESMODEL_H +#define NOTESMODEL_H + +// System includes +#include +#include + +// User includes +#include "notesmodeldefines.h" +#include "notestest_global.h" + +// Forward declarations +class QAbstractItemModel; +class QStandardItemModel; +class AgendaUtil; +class AgendaEntry; + +NOTES_TEST_CLASS(TestNotesModel) + +class NOTESMODEL_EXPORT NotesModel : public QObject +{ + Q_OBJECT + +public: + NotesModel(AgendaUtil *mAgendaUtil, QObject *parent = 0); + virtual ~NotesModel(); + +public: + QAbstractItemModel *sourceModel(); + +signals: + void rowAdded(QModelIndex index); + +private slots: + void populateSourceModel(); + void updateSourceModel(ulong id); + void populateSourceModel(QList ids); + void addEntryToModel(ulong id); + void removeEntryFromModel(ulong id); + void handleInstanceViewCreationCompleted(int status); + +private: + void modifyEntryInModel(ulong id, int row); + void appendNotesToModel(QList &agendaEntryList); + void appendInCompTodosToModel(QList &agendaEntryList); + void appendCompTodosToModel(QList &agendaEntryList); + bool insertNoteToModel(QModelIndex &index, ulong id); + bool insertInCompTodoToModel(QModelIndex &index, ulong id); + bool insertCompTodoToModel(QModelIndex &index, ulong id); + QString dateFormatString(); + QString timeFormatString(); + +private: + QStandardItemModel *mSourceModel; + AgendaUtil *mAgendaUtil; + + int mNotesCount; + int mInCompTodoCount; + int mCompTodoCount; + +private: + NOTES_TEST_FRIEND_CLASS(TestNotesModel) +}; + +#endif // NOTESMODEL_H + +// End of file --Don't remove this