contentstorage/caclient/stub/src/camenuiconutility.cpp
changeset 66 32469d7d46ff
child 83 156f692b1687
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/camenuiconutility.cpp	Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * 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:
+ *
+ */
+
+#include <HbIcon>
+#include <QDir>
+#include <cadefs.h>
+
+#include "camenuiconutility.h"
+#include "caicondescription.h"
+#include "caentry.h"
+
+/*!
+ Get icon when uid is defined.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getApplicationIcon(int uid,
+        const QSize &size)
+{
+    HbIcon icon;
+    return icon;
+}
+
+/*!
+ Get icon.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry,
+        const QSize &size)
+{
+    HbIcon icon;
+    QString filename(entry.iconDescription().filename());
+    if (!filename.isEmpty()) {
+        icon = HbIcon(filename);
+    }
+    if (icon.isNull() || !(icon.size().isValid())) {
+        icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
+    }
+    return icon;
+}
+
+