gsprofilesrv_plat/controlpanel_api/inc/cplauncherinterface.h
changeset 61 33e86ecbfdb4
parent 52 58cebe0861a8
equal deleted inserted replaced
52:58cebe0861a8 61:33e86ecbfdb4
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Interface for controlpanel plugins, with this interface client application can launch a view from outside of controlpanel application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPLAUNCHERINTERFACE_H
       
    20 #define CPLAUNCHERINTERFACE_H
       
    21 
       
    22 #include <QtPlugin>
       
    23 #include <QList>
       
    24 
       
    25 /*!
       
    26     \class CpLauncherInterface
       
    27     \brief The class CpLauncherInterface defines an interface for plugins, if one controlpanel plugin implements
       
    28     this interface, client application can launch a setting view from outside of controlpanel application by two ways.
       
    29     
       
    30     (1) launch setting view in client process, using CpPluginLauncher.
       
    31     
       
    32     \code
       
    33     CpBaseSettingView *settingView = CpPluginLauncher::launchSettingView("cpmyplugin.dll",QVariant());
       
    34     \endcode
       
    35     
       
    36     (2) launch setting view in embedded mode, using QtHighway client API.
       
    37     
       
    38     \code
       
    39     if (mRequest) {
       
    40         delete mRequest;
       
    41         mRequest = 0;
       
    42     }
       
    43     
       
    44     mRequest = mAppMgr.create("com.nokia.symbian.ICpPluginLauncher", "launchSettingView(QString,QVariant)", true);
       
    45 
       
    46     if (!mRequest)
       
    47     {
       
    48         return;
       
    49     }
       
    50     else
       
    51     {
       
    52         connect(mRequest, SIGNAL(requestOk(QVariant)), SLOT(handleReturnValue(QVariant)));
       
    53         connect(mRequest, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
       
    54     }
       
    55 
       
    56     // Set arguments for request 
       
    57     QList<QVariant> args;
       
    58     args << QVariant("cpmyplugin.dll");
       
    59     args << QVariant();
       
    60     mRequest->setArguments(args);
       
    61 
       
    62     mRequest->setSynchronous(false);    
       
    63     // Make the request
       
    64     if (!mRequest->send())
       
    65     {
       
    66         //report error     
       
    67     }
       
    68     \endcode
       
    69     
       
    70  */
       
    71 
       
    72 class QVariant;
       
    73 class CpBaseSettingView;
       
    74 
       
    75 class CpLauncherInterface
       
    76 {
       
    77 public:
       
    78     /*!
       
    79      Destructor of CpLauncherInterface.
       
    80      */
       
    81     virtual ~CpLauncherInterface()
       
    82     {
       
    83     }
       
    84     
       
    85     /*!
       
    86      Create a CpBaseSettingView by the parameter hint.
       
    87      */
       
    88     virtual CpBaseSettingView *createSettingView(const QVariant &hint) const = 0;
       
    89 };
       
    90 
       
    91 Q_DECLARE_INTERFACE(CpLauncherInterface, "com.nokia.controlpanel.launcher.interface/1.0");
       
    92 
       
    93 #endif /* CPLAUNCHERINTERFACE_H */