vpnui/vpnecomnotifier/inc/vpnecomnotifier.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2007 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:   VPN Ecom Notifier's definition file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __VPNECOMNOTIFIER_H__
       
    21 #define __VPNECOMNOTIFIER_H__
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <eiknotapi.h>
       
    26 #include <eikenv.h>
       
    27 
       
    28 #include "vpndialogmanagerecomstub.h"
       
    29 #include "vpnnotifierdefs.h"
       
    30 
       
    31 #include <ecom/implementationproxy.h>
       
    32 
       
    33 // Notifier should go to a dialog channel, not a led or sound channel
       
    34 const TUid KCrystalScreenOutputChannel = {0x10009D48};
       
    35 
       
    36 // Method at ordinal 1 to get a list of notifiers from this dll
       
    37 IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount);
       
    38 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray();
       
    39 
       
    40 //////////////////////////////////////////////////////////////////////////////////
       
    41 //
       
    42 //  The CVpnNotifier class is registered with the dialog server and
       
    43 //  is responsible for receiving and sending messages and creating dialogs
       
    44 //  for user requests.
       
    45 //
       
    46 //////////////////////////////////////////////////////////////////////////////////
       
    47 
       
    48 class MVpnDialog;
       
    49 
       
    50 class CVpnNotifier : public CBase, public MEikSrvNotifierBase2, public MVpnNotifierCallback
       
    51     {
       
    52 public:
       
    53     CVpnNotifier(const TUid& aNotifierUid, const TDesC& aResourceFilename,
       
    54                    CVpnDialogManagerEcomStub* aDialogManager);
       
    55     ~CVpnNotifier();
       
    56     void DialogComplete(TInt aReturnCode);
       
    57     void DialogCompleteL(TInt aReturnCode, TVpnDialogOutput& aOutput);
       
    58 
       
    59 private: // From MEikSrvNotifierBase(2)
       
    60     void Release();
       
    61     TNotifierInfo RegisterL();
       
    62     TNotifierInfo Info() const;
       
    63     void StartL( const TDesC8& aBuffer, TInt aReturnValue, const RMessagePtr2& aMessage);
       
    64     TPtrC8 StartL( const TDesC8& aBuffer);
       
    65     void Cancel();
       
    66     TPtrC8 UpdateL( const TDesC8& aBuffer);
       
    67 
       
    68 private:    
       
    69     TFileName GetResourceFileNameL();
       
    70     // Added to overcome uninstallation problems
       
    71     void LoadResourceFileL();
       
    72     void UnloadResourceFile();
       
    73     TBool LaunchDialogL(TInt aDialogId, TInt aNoteDialogId, const TDesC8& aInput);
       
    74     
       
    75     /**
       
    76      * Function for loading the actual VPN dialog manager implementation DLL
       
    77      * (due to ecom architecture specialities, it will be unloaded and loaded 
       
    78      * again whenever LaunchDialogL is called).
       
    79      *
       
    80      * @leave Leaves if (e.g.) the DLL is not found
       
    81      */
       
    82     void        LoadManagerDllL();
       
    83 
       
    84     /**
       
    85      * Unloads the manager DLL.
       
    86      *
       
    87      */
       
    88     void        CloseManagerDll();
       
    89 
       
    90 
       
    91 private:
       
    92     CEikonEnv* iEikEnv;         // Does not need to be destroyed
       
    93     TInt iResourceFileOffset;   // Resource file id
       
    94     TNotifierInfo iInfo;        //notifier info
       
    95     MVpnDialog* iDialog;
       
    96     RMessagePtr2 iMessage;
       
    97     TInt iReturnValue;
       
    98 
       
    99     CVpnDialogManagerEcomStub* iDialogManager;
       
   100 
       
   101     TPtrC iResourceFilename;
       
   102     TUid iNotifierUid;
       
   103     HBufC8* iInput;
       
   104     // Added to overcome uninstallation problems
       
   105     TBool iResourceFileLoaded;
       
   106 
       
   107     // Instance variables for handling the "real" (non-ecom) dialog manager DLL.
       
   108     MVpnDialogManager*  iRealDialogManager;
       
   109     RLibrary            iDialogManagerLib;
       
   110 
       
   111 
       
   112     };
       
   113 
       
   114 #endif  // __VPNNOTIFIER_H__