diff -r d1dadafc5584 -r 26079c1bb561 homescreensrv_plat/contentstorage_api/inc/caservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/contentstorage_api/inc/caservice.h Wed Oct 06 16:00:22 2010 +0300 @@ -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(); + + QSharedPointer getEntry(int entryId) const; + QList< QSharedPointer > getEntries(const QList &entryIdList) const; + QList< QSharedPointer > getEntries(const CaQuery &query) const; + QList getEntryIds(const CaQuery &query) const; + + QSharedPointer 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< QSharedPointer > &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< QSharedPointer > &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< QSharedPointer > &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< QSharedPointer > &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< QSharedPointer > &entryList) const; + + int executeCommand(int entryId, const QString &command = + caCmdOpen, QObject* receiver = NULL, const char* member = NULL) const; + int executeCommand(const CaEntry &entry, const QString &command = + caCmdOpen, QObject* receiver = NULL, const char* member = NULL) 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