homescreenapp/examples/helloworldwidgetplugin/src/helloworldwidgetplugin.cpp
branchRCL_3
changeset 82 5f0182e07bfb
equal deleted inserted replaced
79:f00a6757af32 82:5f0182e07bfb
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Example of home screen widget
       
    15 *
       
    16 */
       
    17 
       
    18 #include <qserviceinterfacedescriptor.h>
       
    19 #include <qabstractsecuritysession.h>
       
    20 #include <qservicecontext.h>
       
    21 
       
    22 #include "helloworldwidgetplugin.h"
       
    23 #include "helloworldwidget.h"
       
    24 
       
    25 /*!
       
    26     \ingroup group_helloworld_widget
       
    27     \class HelloWorldWidgetPlugin
       
    28     \brief Example implementation for home screen widget plugin.
       
    29 */    
       
    30     
       
    31 /*!
       
    32     Initialize plugin for hello world widget. Contains necessary information about 
       
    33     the hello world widget that it can be loaded through QT Service Framework.
       
    34 */
       
    35 // Start of snippet 1
       
    36 QObject *HelloWorldWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
       
    37                                              QServiceContext *context,
       
    38                                              QAbstractSecuritySession *session)
       
    39 {
       
    40     Q_UNUSED(context);
       
    41     Q_UNUSED(session);
       
    42 
       
    43     if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
       
    44         return new HelloWorldWidget();
       
    45     } else {
       
    46         return 0;
       
    47     }
       
    48 }
       
    49 // End of snippet 1
       
    50 
       
    51 // Start of snippet 2
       
    52 Q_EXPORT_PLUGIN2(helloworldwidgetplugin, HelloWorldWidgetPlugin)
       
    53 // End of snippet 2