1 /* |
1 /* |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
32 #include <ConnectionUiUtilities.h> |
32 #include <ConnectionUiUtilities.h> |
33 |
33 |
34 #include "mpmcommon.h" |
34 #include "mpmcommon.h" |
35 #include "rmpm.h" |
35 #include "rmpm.h" |
36 #include "mpmroamingwatcher.h" |
36 #include "mpmroamingwatcher.h" |
|
37 #include "mpmvpntogglewatcher.h" |
37 |
38 |
38 |
39 |
39 class CMPMCommsDatAccess; |
40 class CMPMCommsDatAccess; |
40 class CMpmCsIdWatcher; |
41 class CMpmCsIdWatcher; |
41 class CMpmDataUsageWatcher; |
42 class CMpmDataUsageWatcher; |
42 class CMpmOfflineWatcher; |
43 class CMpmVpnToggleWatcher; |
43 |
44 |
44 // CONSTANTS |
45 // CONSTANTS |
45 _LIT( KMPMPanicCategory, "Mobility Policy Manager Server" ); |
46 _LIT( KMPMPanicCategory, "Mobility Policy Manager Server" ); |
46 |
47 |
47 const TInt KPhoneRetryCount = 7; |
48 const TInt KPhoneRetryCount = 7; |
691 |
693 |
692 |
694 |
693 public: // Functions from base classes |
695 public: // Functions from base classes |
694 |
696 |
695 /** |
697 /** |
|
698 * From MMpmVpnToggleWatcherNotify. Sets values for VPN toggle after |
|
699 * VPN toggle key changes in central repository. |
|
700 * @param aVpnPreferred Informs if VPN connection is preferred |
|
701 * connection |
|
702 * @param aVpnIapId VPN IAP Id, which is used for VPN connection, when |
|
703 * VPN connection is preferred |
|
704 * @param aSnapId SNAP Id SNAP Id, which is used for VPN connection, |
|
705 * when VPN connection is preferred |
|
706 */ |
|
707 void SetVpnToggleValuesL( const TBool aVpnPreferred, |
|
708 const TUint32 aVpnIapId, |
|
709 const TUint32 aSnapId ); |
|
710 |
|
711 /** |
696 * From CServer2. Creates a new session for a client. |
712 * From CServer2. Creates a new session for a client. |
697 * @since 3.0 |
713 * @since 3.0 |
698 * @param aVersion Version information |
714 * @param aVersion Version information |
699 * @param aMessage Not really used here |
715 * @param aMessage Not really used here |
700 * @return Pointer to the new client session |
716 * @return Pointer to the new client session |
702 CSession2* NewSessionL( const TVersion& aVersion, |
718 CSession2* NewSessionL( const TVersion& aVersion, |
703 const RMessage2& aMessage) const; |
719 const RMessage2& aMessage) const; |
704 |
720 |
705 // Stops connection of certain IAP, zero for all connections |
721 // Stops connection of certain IAP, zero for all connections |
706 void StopConnections( TInt aIapId = 0 ); |
722 void StopConnections( TInt aIapId = 0 ); |
707 |
723 |
708 public: |
724 public: |
709 |
725 |
710 /** |
726 /** |
711 * Mark that there is an active user connection. |
727 * Mark that there is an active user connection. |
712 * @since 5.1 |
728 * @since 5.1 |
744 * Checks whether user connection is in internet snap. |
760 * Checks whether user connection is in internet snap. |
745 * @since 5.1 |
761 * @since 5.1 |
746 * @return ETrue if user connection is in internet snap |
762 * @return ETrue if user connection is in internet snap |
747 */ |
763 */ |
748 TBool UserConnectionInInternet() const; |
764 TBool UserConnectionInInternet() const; |
|
765 |
|
766 /** |
|
767 * Mark that there is an active VPN user connection. |
|
768 */ |
|
769 void AddVpnUserConnectionSession(); |
|
770 |
|
771 /** |
|
772 * Mark that VPN user connection is not active |
|
773 */ |
|
774 void RemoveVpnUserConnectionSession(); |
|
775 |
|
776 /** |
|
777 * Informs if VPN user connection is used with given MPM preferences |
|
778 * and application. |
|
779 * @param aMpmConnPref MPM connection preferences. |
|
780 * @param aAppUid Application UID |
|
781 * @return Informs if VPN connection is preferred |
|
782 */ |
|
783 TBool UseVpnUserConnection( const TMpmConnPref aMpmConnPref, |
|
784 const TUint32 aAppUid ) const; |
|
785 |
|
786 /** |
|
787 * Prepares VPN user connection. |
|
788 * @param aMpmConnPref Connection preferences, which are modified |
|
789 * for VPN user connection (returned) |
|
790 * @return Informs if preparation was successful. |
|
791 */ |
|
792 TBool PrepareVpnUserConnection( TMpmConnPref& aMpmConnPref ); |
749 |
793 |
750 /** |
794 /** |
751 * Handle to central repository watcher |
795 * Handle to central repository watcher |
752 * @since 5.1 |
796 * @since 5.1 |
753 * @return Pointer to watcher object. |
797 * @return Pointer to watcher object. |
754 */ |
798 */ |
755 inline CMpmCsIdWatcher* CsIdWatcher(); |
799 inline CMpmCsIdWatcher* CsIdWatcher(); |
|
800 |
|
801 /** |
|
802 * Handle to VPN toggle central repository watcher |
|
803 * @return Pointer to watcher object. |
|
804 */ |
|
805 inline CMpmVpnToggleWatcher* VpnToggleWatcher(); |
756 |
806 |
757 /** |
807 /** |
758 * Returns server session instance that corresponds to given |
808 * Returns server session instance that corresponds to given |
759 * connection id. |
809 * connection id. |
760 * @since 5.2 |
810 * @since 5.2 |
887 TMpmConnPref iUserConnPref; |
937 TMpmConnPref iUserConnPref; |
888 |
938 |
889 // Set when user connection in internet snap |
939 // Set when user connection in internet snap |
890 TBool iUserConnectionInInternet; |
940 TBool iUserConnectionInInternet; |
891 |
941 |
|
942 // Count of sessions using VPN user connection |
|
943 // |
|
944 TInt iVpnUserConnectionSessionCount; |
|
945 |
892 /** |
946 /** |
893 * Handle to central repository watcher |
947 * Handle to central repository watcher |
894 * Own. |
948 * Own. |
895 */ |
949 */ |
896 CMpmCsIdWatcher* iMpmCsIdWatcher; |
950 CMpmCsIdWatcher* iMpmCsIdWatcher; |
897 |
951 |
898 /** |
952 /** |
|
953 * Handle to VPN toggle central repository watcher. |
|
954 * Own. |
|
955 */ |
|
956 CMpmVpnToggleWatcher* iMpmVpnToggleWatcher; |
|
957 |
|
958 /** |
899 * Handle to central repository watcher |
959 * Handle to central repository watcher |
900 */ |
960 */ |
901 CMpmDataUsageWatcher* iMpmDataUsageWatcher; |
961 CMpmDataUsageWatcher* iMpmDataUsageWatcher; |
902 |
|
903 /** |
|
904 * Handle to central repository watcher |
|
905 */ |
|
906 CMpmOfflineWatcher* iMpmOfflineWatcher; |
|
907 |
962 |
908 // Dedicated clients |
963 // Dedicated clients |
909 RArray<TUint32> iDedicatedClients; |
964 RArray<TUint32> iDedicatedClients; |
910 |
965 |
911 // Used for commsdat related functionalities |
966 // Used for commsdat related functionalities |