diff -r 1a2a00e78665 -r f62f87b200ec homescreensrv_plat/contentstorage_api/caservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/contentstorage_api/caservice.h Fri Mar 19 09:35:23 2010 +0200 @@ -0,0 +1,133 @@ +/* + * 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: caservice.h + * + */ + +#ifndef CASERVICE_H +#define CASERVICE_H + +#include +#include + +#include + +#include "caclient_global.h" +#include "canotifierfilter.h" + +class CaQuery; +class CaEntry; +class CaServicePrivate; +class CaNotifier; + +class CACLIENT_EXPORT CaService: public QObject +{ + +Q_OBJECT + + explicit CaService(QObject *parent = 0); + + ~CaService(); + +public: + + static QSharedPointer instance(); + + CaEntry * getEntry(int entryId) const; + QList getEntries(const QList &entryIdList) const; + QList getEntries(const CaQuery &query) const; + QList getEntryIds(const CaQuery &query) const; + + CaEntry *createEntry(const CaEntry &entry) const; + + bool removeEntry(int entryId) const; + bool removeEntry(const CaEntry &entry) const; + bool removeEntries(const QList &entryIdList) const; + bool removeEntries(const QList &entryList) const; + + bool updateEntry(const CaEntry &entry) const; + bool touch(const CaEntry &entry) const; + + bool insertEntryIntoGroup(int groupId, int entryId, + int beforeEntryId) const; + bool insertEntryIntoGroup(const CaEntry &group, const CaEntry &entry, + int beforeEntryId) const; + bool insertEntriesIntoGroup(int groupId, const QList &entryIdList, + int beforeEntryId) const; + bool insertEntriesIntoGroup(const CaEntry &group, + const QList &entryList, int beforeEntryId) const; + + bool removeEntryFromGroup(int groupId, int entryId) const; + bool removeEntryFromGroup(const CaEntry &group, + const CaEntry &entry) const; + bool removeEntriesFromGroup(int groupId, + const QList &entryIdList) const; + bool removeEntriesFromGroup(const CaEntry &group, + const QList &entryList) const; + + bool appendEntryToGroup(int groupId, int entryId) const; + bool appendEntryToGroup(const CaEntry &group, + const CaEntry &entry) const; + bool appendEntriesToGroup(int groupId, + const QList &entryIdList) const; + bool appendEntriesToGroup(const CaEntry &group, + const QList &entryList) const; + + bool prependEntryToGroup(int groupId, int entryId) const; + bool prependEntryToGroup(const CaEntry &group, + const CaEntry &entry) const; + bool prependEntriesToGroup(int groupId, + const QList &entryIdList) const; + bool prependEntriesToGroup(const CaEntry &group, + const QList &entryList) const; + + bool executeCommand(int entryId, const QString &command = + caCmdOpen) const; + bool executeCommand(const CaEntry &entry, const QString &command = + caCmdOpen) const; + + CaNotifier * createNotifier(const CaNotifierFilter &filter) const; + + bool customSort(int groupId, QList &entryIdList) const; + + ErrorCode lastError() const; + + signals: + + void entryChanged(int entryId, ChangeType changeType); + void entryChanged(const CaEntry &entry, ChangeType changeType); + void entryTouched(int id); + void groupContentChanged(int groupId); + +private: + + /** + * Pointer to a private implementation. + */ + CaServicePrivate * const m_d; + + /** + * The static pointer to the instance of CaService. + */ + static QWeakPointer m_instance; + + friend class CaServicePrivate; + friend class QtSharedPointer::ExternalRefCount; + + Q_DISABLE_COPY(CaService) + +}; + + +#endif // CASERVICE_H