wlansecuritysettings/wifiprotectedsetup/plugininc/wifiprotdlgsplugin.h
branchRCL_3
changeset 46 c74b3d9f6b9e
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
       
     1 /*
       
     2 * Copyright (c) 2001-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 the License "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: Declaration of CWiFiProtDlgsPlugin
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: tr1cfwln#11 %
       
    20 */
       
    21 
       
    22 #ifndef C_WIFIPROTDLGSPLUGIN_H
       
    23 #define C_WIFIPROTDLGSPLUGIN_H
       
    24 
       
    25 
       
    26 // INCLUDES
       
    27 #include <cmmanagerext.h>
       
    28 #include <wlanmgmtcommon.h>
       
    29 #include <wifiprotreturn.h>
       
    30 #include <eiknotapi.h>
       
    31 
       
    32 using namespace WiFiProt;
       
    33 
       
    34 class TWiFiOutputParams;
       
    35 class CWiFiProtActiveRunner;
       
    36 
       
    37 
       
    38 
       
    39 
       
    40 
       
    41 /**
       
    42  * CWiFiProtDlgsPlugin class
       
    43  * Notifier Framework plugin for Wi-Fi Protected Setup
       
    44  */
       
    45 class CWiFiProtDlgsPlugin : public CBase, public MEikSrvNotifierBase2
       
    46 
       
    47     {
       
    48     
       
    49 public:
       
    50     
       
    51     /**
       
    52     * NewL function
       
    53     * @param  aResourceFileResponsible - ETrue if the plugin handles the
       
    54     * resource file
       
    55     * @param  aCmManagerExt - CmManager to use during Wi-Fi Protected Setup
       
    56     * return CWiFiProtDlgsPlugin*
       
    57     */
       
    58     static CWiFiProtDlgsPlugin* NewL( const TBool aResourceFileResponsible,
       
    59                                               RCmManagerExt* aCmManagerExt );
       
    60 
       
    61     /**
       
    62     * NewL function
       
    63     * @param  aResourceFileResponsible - ETrue if the plugin handles the
       
    64     * resource file
       
    65     * return CWiFiProtDlgsPlugin*
       
    66     */
       
    67     static CWiFiProtDlgsPlugin* NewL( const TBool aResourceFileResponsible );
       
    68 
       
    69 
       
    70     /**
       
    71     * Destructor
       
    72     */
       
    73     ~CWiFiProtDlgsPlugin( );
       
    74 
       
    75     // From MEikSrvNotifierBase
       
    76 
       
    77     /**
       
    78     * Get Notifier information
       
    79     * return TNotifierInfo Notifier info
       
    80     */
       
    81     TNotifierInfo Info() const;
       
    82 
       
    83     /**
       
    84     * Start the Notifier
       
    85     * @param  aBuffer   Not used
       
    86     * return TPtrC8     Always NULL
       
    87     */
       
    88     TPtrC8 StartL( const TDesC8& aBuffer );
       
    89 
       
    90     /**
       
    91     * Cancel() the notifier
       
    92     * @param  -
       
    93     * return -
       
    94     */
       
    95     void Cancel();
       
    96 
       
    97     /**
       
    98     * Release the notifier
       
    99     * @param  -
       
   100     * return -
       
   101     */
       
   102     void Release();
       
   103 
       
   104     /**
       
   105     * Update Notifier
       
   106     * @param  aBuffer   Not used
       
   107     * return TPtrC8     Always NULL
       
   108     */
       
   109     TPtrC8 UpdateL( const TDesC8& aBuffer );
       
   110 
       
   111     /**
       
   112     * CompleteL the notifier is complete
       
   113     * @param  aStatus status
       
   114     * return  -
       
   115     */
       
   116     void CompleteL( TInt aStatus );
       
   117 
       
   118     /**
       
   119     * Sets iCancelled flag that indicates that the notifier was cancelled
       
   120     * @param  aCancelled   Not used
       
   121     */
       
   122     void SetCancelledFlag( TBool aCancelled );
       
   123     
       
   124     /**
       
   125     * RegisterL register the client notifier function
       
   126     * return TNotifierInfo Contains uid, channel and priority of
       
   127     * the registered notifier
       
   128     */
       
   129     TNotifierInfo RegisterL();
       
   130 
       
   131     /**
       
   132     * Start the Notifier
       
   133     * @param  aBuffer    Buffer that stores parameters from client side
       
   134     * @param  aReplySlot Identifies which message argument to use for the 
       
   135     *                    reply. This message argument will refer to a 
       
   136     *                    modifiable descriptor, a TDes8 type, into which data
       
   137     *                    can be returned. 
       
   138     * @param  aMessage   Message
       
   139     */
       
   140     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   141                  const RMessagePtr2& aMessage );
       
   142 
       
   143     /**
       
   144     * Asynchronous notifier dialog sequence is completed by calling this function.
       
   145     * @param aReturnValue - possible return values are ok, cancel
       
   146     * process and not use protected setup (No Automatic Setup).
       
   147     */
       
   148     void CompleteProcessL( WiFiProt::TWiFiReturn aReturnValue );
       
   149     
       
   150     /**
       
   151     * Starts Wi-Fi Protected Setup
       
   152     * Private interface to be used by applications with ui
       
   153     * runs in the same process, so pointers can be passed
       
   154     * @param aSSid contains SSid of the network we want to configure 
       
   155     * @param aConnectionNeeded ETrue if we need a connection via the
       
   156     * configured network 
       
   157     * @param aUidsReturned uids of the configured connection methods
       
   158     * @return aReturnValue - possible return values are ok, cancel
       
   159     * process and not use protected setup (No Automatic Setup).
       
   160     */  
       
   161     
       
   162     WiFiProt::TWiFiReturn StartFromUiL( const TWlanSsid& aSSid,
       
   163                                         TBool aConnectionNeeded,
       
   164                                         RArray<TUint32>& aUidsReturned);
       
   165 
       
   166 
       
   167 private:
       
   168 
       
   169     /**
       
   170     * Returns the correct RCmManagerExt instance's reference
       
   171     * it can be an own instance, or a passed reference in case
       
   172     * StartFromUiL was called (we are in the same process as the caller)
       
   173     * This is necessary because we can't open two CmManagers the same time
       
   174     * and the client is possibly using one already.
       
   175     * @return a passed or an own RCmManagerExt& instance, based on the 
       
   176     * method of calling CWiFiProtDlgsPlugin 
       
   177     */
       
   178     RCmManagerExt& CmManagerToUse();
       
   179     
       
   180 private:    
       
   181 
       
   182     /**
       
   183     * Constructor
       
   184     */
       
   185     CWiFiProtDlgsPlugin( );
       
   186     
       
   187     /**
       
   188     * CWiFiProtDlgsPlugin second level constructor
       
   189     * @param  aResourceFileName Resource file to open
       
   190     * @param  aResourceFileResponsible ETrue if this notifier is
       
   191     * responsible for the resource file
       
   192     * @param aCmManagerExt CmManager to use
       
   193     * @see CWiFiProtDlgsPlugin::CmManagerToUse
       
   194     */
       
   195     void ConstructL( const TDesC& aResourceFileName,
       
   196                      const TBool aResourceFileResponsible,
       
   197                       RCmManagerExt* aCmManagerExt = NULL );
       
   198 
       
   199 
       
   200                   
       
   201 private:
       
   202 
       
   203     RCmManagerExt iCmManagerExt;        // own CmManager
       
   204     RCmManagerExt* iPassedCmManagerExt; // passed CmManager, not owned
       
   205     CWiFiProtActiveRunner* iRunner;     // Active Runner object
       
   206     TWiFiReturn iReturn;                // return value towards the client 
       
   207     RArray<TUint32> iUids;              // uids of created connection methods
       
   208     TNotifierInfo iInfo;                // Notifier info
       
   209     RMessagePtr2 iMessage;              // Message
       
   210     TInt iReplySlot;                    // Reply slot
       
   211     TBool iCancelled;                   // ETrue if WPS process is cancelled
       
   212     TInt iResource;                     // Resource
       
   213     TBool   iConnMode;                  // ETrue if creating a connection
       
   214     // network settings to be returned if WPS is used for connection creation
       
   215     TWlanProtectedSetupCredentialAttribute iNetworkSettings;
       
   216     TBool iCancelledFromInside;               // ETrue if user or WLAN engine has cancelled
       
   217     TBool iClientCancelled;		// ETrue if the notifier client has called Cancel()
       
   218     };
       
   219 
       
   220 
       
   221 #endif // C_WIFIPROTDLGSPLUGIN_H
       
   222 
       
   223 // End of File