diff -r 053c6c7c14f3 -r 0efa10d348c0 contentstorage/caclient/inc/caiconcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/inc/caiconcache.h Tue Aug 31 15:30:51 2010 +0300 @@ -0,0 +1,64 @@ +/* + * 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: + * + */ + +#ifndef ICONCACHE_H +#define ICONCACHE_H + +// System includes +#include +#include + +// User includes +#include "canotifier.h" + +// Forward declarations +class CaEntry; +class CaService; + +// Class declaration +class CaIconCache: public QObject +{ + Q_OBJECT +public: + + static CaIconCache *cache(); + HbIcon icon(const CaEntry &entry, const QSizeF &size); + void insert(const CaEntry &entry, const QSizeF &size, const HbIcon &icon); + +private: + + explicit CaIconCache(QObject *parent = 0); + ~CaIconCache(); + QString key(const CaEntry &entry, const QSizeF &size = QSizeF()); + +private slots: + + void remove(const CaEntry &entry, ChangeType changeType); + +private: + static QSharedPointer mInstance; + + QCache mCache; + + QSharedPointer mService; + + CaNotifier *mNotifier; + + friend class QtSharedPointer::ExternalRefCount; +}; + +#endif // ICONCACHE_H