connectionutilities/ConnectionDialogs/cconndlg/inc/ConnDlgPlugin.h
changeset 0 5a93021fdf25
child 14 7958d42f9d1a
child 20 9c97ad6591ae
child 57 05bc53fe583b
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Declaration of Generic Connection Dialog Plugins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CONNDLGPLUGIN_H__
       
    21 #define __CONNDLGPLUGIN_H__
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include "ConnectionDialogsNotifBase.h"
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <agentdialog.h>
       
    29 #include <AknNotifyStd.h>
       
    30 
       
    31 
       
    32 // ENUMERATIONS
       
    33 enum TConnDlgPluginPanic                        // Reasons for panic
       
    34     {
       
    35     EConnDlgPctNotOpen,                         // Post Connection Terminal not
       
    36                                                 // open
       
    37     EConnDlgPctAlreadyOpen,                     // Post Connection Terminal 
       
    38                                                 // already open
       
    39     EConnDlgReadPctOutstandingOnClose,          // Post Connection Terminal 
       
    40                                                 // outstanding on close
       
    41     EConnDlgDestroyPctNotfcnOutstandingOnClose, // Destroying Post Connection 
       
    42                                                 // Terminal 
       
    43     EConnDlgRMessageWriteFailed,                // Failed RMessage Write
       
    44     EConnDlgRMessageReadFailed,                 // Failed RMessage Read
       
    45     EConnDlgIllegalRequest                      // Illegal request
       
    46     };
       
    47 
       
    48 
       
    49 enum TConnDlgNotifierRequest                    // Opcodes used in message 
       
    50     {                                           // passing in notifiers
       
    51     EGetIAP,                                    // Get IAP
       
    52     EGetISP,                                    // Get ISP
       
    53     EWarnNewIAP,                                // Warning New IAP
       
    54     EWarnNewISP,                                // Warning New ISP
       
    55     EGetAuthentication,                         // Get Authentication
       
    56     EGetLogin,                                  // Get Login
       
    57     EGetReconnectReq,                           // Get Reconnect request
       
    58     EOpenPct,                                   // Open Post Connection
       
    59                                                 // Terminal
       
    60     EWritePct,                                  // Write Post Connection
       
    61                                                 // Terminal
       
    62     EReadPct,                                   // Read Post Connection
       
    63                                                 // Terminal
       
    64     EDestroyPctNotification,                    // Destroy Post Connection 
       
    65                                                 // Terminal Notification
       
    66     EClosePct,                                  // Close Post Connection 
       
    67                                                 // Terminal
       
    68     ECancelGetIAP,                              // Cancel Get IAP
       
    69     ECancelGetISP,                              // Cancel Get ISP
       
    70     ECancelWarnIAP,                             // Cancel Warning IAP
       
    71     ECancelWarnISP,                             // Cancel Warning ISP
       
    72     ECancelLogin,                               // Cancel Login
       
    73     ECancelAuthenticate,                        // Cancel Authenticate
       
    74     ECancelReconnect,                           // Cancel Reconnect
       
    75     ECancelReadPct,                             // Cancel Read Post Connection
       
    76                                                 // Terminal
       
    77     ECancelDestroyPctNotification               // Destroy Post Connection
       
    78                                                 // Terminal notification
       
    79     };
       
    80 
       
    81 
       
    82 // GLOBAL FUNCTIONS
       
    83 //
       
    84 IMPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray();
       
    85 
       
    86 
       
    87 // FORWARD DECLARATION
       
    88 class CAknMultiLineDataQueryDialog;
       
    89 class CAknQueryDialog;
       
    90 class CActiveCConnDlgIapPlugin;
       
    91 class CActiveSelectConnectionPlugin;
       
    92 
       
    93 // CLASS DECLARATION
       
    94 
       
    95 class TAuthenticationPairBuff
       
    96     {
       
    97 public:
       
    98     TBuf<KCommsDbSvrDefaultTextFieldLength> iUsername;
       
    99     TBuf<KCommsDbSvrDefaultTextFieldLength> iPassword;
       
   100     };
       
   101 
       
   102 
       
   103 /**
       
   104  * IAP Plugin class
       
   105  */
       
   106 NONSHARABLE_CLASS( CConnDlgIapPlugin ) : public CConnectionDialogsNotifBase
       
   107     {
       
   108 public:
       
   109     /**
       
   110     * NewL function
       
   111     * @param  -
       
   112     * return CConnDlgIapPlugin*
       
   113     */
       
   114     static CConnDlgIapPlugin* NewL( const TBool aResourceFileResponsible );
       
   115 
       
   116     /**
       
   117     * RegisterL register the client notifier function
       
   118     * @param  -
       
   119     * return TNotifierInfo
       
   120     */
       
   121     TNotifierInfo RegisterL();
       
   122 
       
   123     /**
       
   124     * Start the Notifier
       
   125     * @param  aBuffer    Buffer
       
   126     * @param  aReplySlot Identifies which message argument to use for the 
       
   127     *                    reply. This message argument will refer to a 
       
   128     *                    modifiable descriptor, a TDes8 type, into which data
       
   129     *                    can be returned. 
       
   130     * @param  aMessage   Message
       
   131     * return -
       
   132     */
       
   133     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   134                  const RMessagePtr2& aMessage );
       
   135 
       
   136     /**
       
   137     * Cancel() the notifier
       
   138     * @param  -
       
   139     * return -
       
   140     */
       
   141     void Cancel();
       
   142 
       
   143 public:
       
   144 
       
   145     /**
       
   146     * CompleteL the notifier is complete
       
   147     * @param  aStatus status
       
   148     * return  -
       
   149     */
       
   150     void CompleteL( TInt aStatus );
       
   151     
       
   152     /**
       
   153     * Sets the preferred iap into db.
       
   154     * calls iActivePlugin    
       
   155     * @param aIAPId id of the preferred iap
       
   156     */
       
   157     void SetPreferredIapIdL( TUint32 aIAPId );
       
   158     
       
   159 private:
       
   160 
       
   161     /**
       
   162     * Gets user connection info.    
       
   163     * @param aIapId id of the iap
       
   164     */ 
       
   165     TInt GetUserConnection( TInt& aIapId );
       
   166     
       
   167     /**
       
   168     * Gets active connection info.    
       
   169     * @param aIapId id of the iap
       
   170     * @param aBearer bearer type
       
   171     */
       
   172     TInt GetActiveConnection( TInt& aIapId, TInt& aBearer );    
       
   173     
       
   174 private:
       
   175     TUint32 iIAP;                       // Internet Access Point
       
   176     TPckgBuf<TConnectionPrefs> iPrefs;  // Selected preferences
       
   177     CActiveCConnDlgIapPlugin* iActivePlugin;    // pointer to active object
       
   178     };
       
   179 
       
   180 
       
   181 /**
       
   182  * Authentication Plugin class
       
   183  */
       
   184 NONSHARABLE_CLASS( CConnDlgAuthenticationPlugin ) : 
       
   185                                             public CConnectionDialogsNotifBase
       
   186     {
       
   187 public:
       
   188     CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin();
       
   189 
       
   190     /**
       
   191     * NewL function
       
   192     * @param  -
       
   193     * return CConnDlgAuthenticationPlugin*
       
   194     */
       
   195     static CConnDlgAuthenticationPlugin* NewL( 
       
   196                                         const TBool aResourceFileResponsible );
       
   197 
       
   198     /**
       
   199     * RegisterL register the client notifier function
       
   200     * @param  -
       
   201     * return TNotifierInfo
       
   202     */
       
   203     TNotifierInfo RegisterL();
       
   204 
       
   205     /**
       
   206     * Start the Notifier
       
   207     * @param  aBuffer    Buffer
       
   208     * @param  aReplySlot Identifies which message argument to use for the 
       
   209     *                    reply. This message argument will refer to a 
       
   210     *                    modifiable descriptor, a TDes8 type, into which data
       
   211     *                    can be returned. 
       
   212     * @param  aMessage   Message
       
   213     * return -
       
   214     */
       
   215     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   216                  const RMessagePtr2& aMessage );
       
   217 
       
   218     /**
       
   219     * Cancel() the notifier
       
   220     * @param  -
       
   221     * return -
       
   222     */
       
   223     void Cancel();
       
   224 
       
   225 public:
       
   226 
       
   227     /**
       
   228     * GetAuthenticationL() show the Authenticate  dialog
       
   229     * @param  -
       
   230     * return -
       
   231     */
       
   232     void GetAuthenticationL();
       
   233 
       
   234     /**
       
   235     * CompleteL the notifier is complete
       
   236     * @param  aStatus status
       
   237     * return  -
       
   238     */
       
   239     void CompleteL( TInt aStatus );
       
   240 
       
   241 private:
       
   242     TPckgBuf<TAuthenticationPair> iAuthPair;    // Authentication pair 
       
   243                                                 // (username and password)
       
   244     TPckgBuf<TAuthenticationPairBuff> iAuthPairBuff;    // Authentication pair 
       
   245                                                 // (username and password)
       
   246     CAknMultiLineDataQueryDialog *iDialog;      // Pointer to the dialog
       
   247     };
       
   248 
       
   249 
       
   250 /**
       
   251  * Reconnect Plugin class
       
   252  */
       
   253 NONSHARABLE_CLASS( CConnDlgReconnectPlugin ) : 
       
   254                                             public CConnectionDialogsNotifBase
       
   255     {
       
   256 public:
       
   257 
       
   258     /**
       
   259     * NewL function
       
   260     * @param  -
       
   261     * return CConnDlgReconnectPlugin*
       
   262     */
       
   263     static CConnDlgReconnectPlugin* NewL( 
       
   264                                         const TBool aResourceFileResponsible );
       
   265 
       
   266     /**
       
   267     * RegisterL register the client notifier function
       
   268     * @param  -
       
   269     * return TNotifierInfo
       
   270     */
       
   271     TNotifierInfo RegisterL();
       
   272 
       
   273     /**
       
   274     * Start the Notifier
       
   275     * @param  aBuffer    Buffer
       
   276     * @param  aReplySlot Identifies which message argument to use for the 
       
   277     *                    reply. This message argument will refer to a 
       
   278     *                    modifiable descriptor, a TDes8 type, into which data
       
   279     *                    can be returned. 
       
   280     * @param  aMessage   Message
       
   281     * return -
       
   282     */
       
   283     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   284                  const RMessagePtr2& aMessage );
       
   285 
       
   286     /**
       
   287     * Cancel() the notifier
       
   288     * @param  -
       
   289     * return -
       
   290     */
       
   291     void Cancel();
       
   292 
       
   293 public:
       
   294 
       
   295     /**
       
   296     * GetReconnectL() call the reconnect dialog
       
   297     * @param  -
       
   298     * return -
       
   299     */
       
   300     void GetReconnectL();
       
   301 
       
   302     /**
       
   303     * CompleteL the notifier is complete
       
   304     * @param  aStatus status
       
   305     * return  -
       
   306     */
       
   307     void CompleteL(TInt aStatus);
       
   308 
       
   309 private:
       
   310     CAknQueryDialog* iDialog;   // Pointer to the dialog
       
   311     TBool iBool;                // Tells if it has to connect to the IAP
       
   312     };
       
   313 
       
   314 
       
   315 /**
       
   316  * Quality of service Plugin class
       
   317  */
       
   318 NONSHARABLE_CLASS( CConnDlgQosPlugin ) : public CConnectionDialogsNotifBase
       
   319     {
       
   320 public:
       
   321 
       
   322     /**
       
   323     * NewL function
       
   324     * @param  -
       
   325     * return CConnDlgReconnectPlugin*
       
   326     */
       
   327     static CConnDlgQosPlugin* NewL( const TBool aResourceFileResponsible );
       
   328 
       
   329     /**
       
   330     * RegisterL register the client notifier function
       
   331     * @param  -
       
   332     * return TNotifierInfo
       
   333     */
       
   334     TNotifierInfo RegisterL();
       
   335 
       
   336     /**
       
   337     * Start the Notifier
       
   338     * @param  aBuffer    Buffer
       
   339     * @param  aReplySlot Identifies which message argument to use for the 
       
   340     *                    reply. This message argument will refer to a 
       
   341     *                    modifiable descriptor, a TDes8 type, into which data
       
   342     *                    can be returned. 
       
   343     * @param  aMessage   Message
       
   344     * return -
       
   345     */
       
   346     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   347                  const RMessagePtr2& aMessage );
       
   348 
       
   349     /**
       
   350     * Cancel() the notifier
       
   351     * @param  -
       
   352     * return -
       
   353     */
       
   354     void Cancel();
       
   355 
       
   356 public:
       
   357 
       
   358     /**
       
   359     * GetReconnectL() call the reconnect dialog
       
   360     * @param  -
       
   361     * return -
       
   362     */
       
   363     void GetReconnectL();
       
   364 
       
   365     /**
       
   366     * CompleteL the notifier is complete
       
   367     * @param  aStatus status
       
   368     * return  -
       
   369     */
       
   370     void CompleteL( TInt aStatus );
       
   371 
       
   372 private:
       
   373     CAknQueryDialog* iDialog;   // Pointer to the dialog
       
   374     TBool iBool;                // Tells if it has to connect to the IAP
       
   375     };
       
   376 
       
   377 
       
   378 /**
       
   379  * New IAP Plugin class
       
   380  */
       
   381 NONSHARABLE_CLASS( CConnDlgNewIapPlugin ) : public CConnectionDialogsNotifBase
       
   382     {
       
   383 public:
       
   384 
       
   385     /**
       
   386     * NewL function
       
   387     * @param  -
       
   388     * return CConnDlgNewIapPlugin*
       
   389     */
       
   390     static CConnDlgNewIapPlugin* NewL( const TBool aResourceFileResponsible );
       
   391 
       
   392     /**
       
   393     * RegisterL register the client notifier function
       
   394     * @param  -
       
   395     * return TNotifierInfo
       
   396     */
       
   397     TNotifierInfo RegisterL();
       
   398 
       
   399     /**
       
   400     * Start the Notifier
       
   401     * @param  aBuffer    Buffer
       
   402     * @param  aReplySlot Identifies which message argument to use for the 
       
   403     *                    reply. This message argument will refer to a 
       
   404     *                    modifiable descriptor, a TDes8 type, into which data
       
   405     *                    can be returned. 
       
   406     * @param  aMessage   Message
       
   407     * return -
       
   408     */
       
   409     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   410                  const RMessagePtr2& aMessage );
       
   411 
       
   412     /**
       
   413     * Cancel() the notifier
       
   414     * @param  -
       
   415     * return -
       
   416     */
       
   417     void Cancel();
       
   418 
       
   419 public:
       
   420 
       
   421     /**
       
   422     * GetNewIapL show NewIap dialog
       
   423     * @param  -
       
   424     * return  -
       
   425     */
       
   426     void GetNewIapL();
       
   427 
       
   428     /**
       
   429     * CompleteL the notifier is complete
       
   430     * @param  aStatus status
       
   431     * return  -
       
   432     */
       
   433     void CompleteL( TInt aStatus );
       
   434 
       
   435 private:
       
   436     CAknQueryDialog* iDialog;                   // Pointer to the dialog
       
   437     TBool iConnect;                             // Tells if it has to connect 
       
   438                                                 // to the IAP
       
   439     TPckgBuf<TNewIapConnectionPrefs> iPrefs;    // Selected preferences
       
   440     };
       
   441 
       
   442 
       
   443 
       
   444 /**
       
   445  * Connection Selection Plugin class
       
   446  */
       
   447 NONSHARABLE_CLASS( CConnDlgSelectConnectionPlugin ) : 
       
   448                                             public CConnectionDialogsNotifBase
       
   449     {
       
   450 public:
       
   451     /**
       
   452     * NewL function
       
   453     * @param  -
       
   454     * return CConnDlgSelectConnectionPlugin*
       
   455     */
       
   456     static CConnDlgSelectConnectionPlugin* NewL( 
       
   457                                         const TBool aResourceFileResponsible );
       
   458 
       
   459     /**
       
   460     * RegisterL register the client notifier function
       
   461     * @param  -
       
   462     * return TNotifierInfo
       
   463     */
       
   464     TNotifierInfo RegisterL();
       
   465 
       
   466     /**
       
   467     * Start the Notifier
       
   468     * @param  aBuffer    Buffer
       
   469     * @param  aReplySlot Identifies which message argument to use for the 
       
   470     *                    reply. This message argument will refer to a 
       
   471     *                    modifiable descriptor, a TDes8 type, into which data
       
   472     *                    can be returned. 
       
   473     * @param  aMessage   Message
       
   474     * return -
       
   475     */
       
   476     void StartL( const TDesC8& aBuffer, TInt aReplySlot, 
       
   477                  const RMessagePtr2& aMessage );
       
   478 
       
   479     /**
       
   480     * Cancel() the notifier
       
   481     * @param  -
       
   482     * return -
       
   483     */
       
   484     void Cancel();
       
   485 
       
   486 public:
       
   487 
       
   488     /**
       
   489     * CompleteL the notifier is complete
       
   490     * @param  aStatus status
       
   491     * return  -
       
   492     */
       
   493     void CompleteL( TInt aStatus );
       
   494     
       
   495     /**
       
   496     * Sets the preferred iap into db.
       
   497     * calls iActivePlugin    
       
   498     * @param aIAPId id of the preferred iap
       
   499     * @param aDestinationId id of the preferred Destination
       
   500     */
       
   501     void SetElementIDL( TUint32 aIAPId, TUint32 aDestinationId );
       
   502     
       
   503 private:
       
   504 
       
   505     /**
       
   506     * Gets user connection info.    
       
   507     * @param aIapId id of the iap
       
   508     * @param aSnapId id of the destination
       
   509     */
       
   510     TInt GetUserConnection( TInt& aIapId, TInt& aSnapId );
       
   511     
       
   512     /**
       
   513     * Gets active connection info.    
       
   514     * @param aIapId id of the iap
       
   515     * @param aSnapId id of the destination
       
   516     * @param aBearer bearer type
       
   517     */    
       
   518     TInt GetActiveConnection( TInt& aIapId, TInt& aSnapId, TInt& aBearer );
       
   519 
       
   520 private:
       
   521     TUint32 iElementID;
       
   522     TPckgBuf<TConnectionPrefs> iPrefs;  // Selected preferences
       
   523     CActiveSelectConnectionPlugin* iActivePlugin;   // pointer to active object
       
   524     };
       
   525 
       
   526 #endif
       
   527 
       
   528 // End of File