contentstorage/camificonengine/src/main.cpp
changeset 115 3ab5c078b490
equal deleted inserted replaced
109:e0aa398e6810 115:3ab5c078b490
       
     1 /*
       
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  main.cpp
       
    15  *
       
    16  */
       
    17 
       
    18 #include <QIconEnginePlugin>
       
    19 #include <QStringList>
       
    20 #include <QDebug.h>
       
    21 
       
    22 #include "camificonengine.h"
       
    23 #include "cambmiconengine.h"
       
    24 
       
    25 QT_BEGIN_NAMESPACE
       
    26 
       
    27 class CaMifIconPlugin : public QIconEnginePluginV2
       
    28 {
       
    29 public:
       
    30     QStringList keys() const;
       
    31     QIconEngineV2 *create(const QString &filename = QString());
       
    32 };
       
    33 
       
    34 QStringList CaMifIconPlugin::keys() const
       
    35 {
       
    36     return QStringList() << QLatin1String("mif") << QLatin1String("mbm");
       
    37 }
       
    38 
       
    39 QIconEngineV2 *CaMifIconPlugin::create(const QString &file)
       
    40 {
       
    41     QIconEngineV2 *engine(0);
       
    42     if (file.endsWith(QLatin1String(".mif"), Qt::CaseInsensitive)) {
       
    43         engine  = new CaMifIconEngine;
       
    44     } else if (file.endsWith(QLatin1String(".mbm"), Qt::CaseInsensitive)) {
       
    45         engine  = new CaMbmIconEngine;
       
    46     }
       
    47     return engine;
       
    48 }
       
    49 
       
    50 #ifdef COVERAGE_MEASUREMENT
       
    51 #pragma CTC SKIP
       
    52 #endif //COVERAGE_MEASUREMENT (QT macro)
       
    53 
       
    54 Q_EXPORT_STATIC_PLUGIN(CaMifIconPlugin)
       
    55 Q_EXPORT_PLUGIN2(camificon, CaMifIconPlugin)
       
    56 
       
    57 #ifdef COVERAGE_MEASUREMENT
       
    58 #pragma CTC ENDSKIP
       
    59 #endif //COVERAGE_MEASUREMENT
       
    60 
       
    61 QT_END_NAMESPACE
       
    62 
       
    63