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