syncmlfw/syncmlnotifier/inc/SyncMLAppLaunchNotifier.h
changeset 0 b497e44ab2fc
child 9 57a65a3a658c
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Server alerts for Data Sync and Device Management engines. 
       
    15 *                
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CSYNCMLAPPLAUNCHNOTIFIER_H
       
    22 #define CSYNCMLAPPLAUNCHNOTIFIER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <SyncMLClient.h>
       
    26 
       
    27 #include <SyncMLNotifierParams.h>
       
    28 #include "SyncMLNotifierBase.h"    // Base class
       
    29 #include <SyncService.h>
       
    30 #include <centralrepository.h>
       
    31 
       
    32 // CONSTANTS
       
    33 // From S60\SyncMLFota
       
    34 const TUid KUidNSmlMediumTypeInternet = { 0x101F99F0 };
       
    35 _LIT8( KNSmlIAPId, "NSmlIapId" );
       
    36 _LIT8( KNSmlAlwaysAsk, "-1" );
       
    37 const TInt  KDefaultTimeoutforNotes ( 30 );
       
    38 
       
    39 const TUid KCRUidNSmlDSApp       = { 0x101F9A1D };
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42 *  Notifier for launching SyncML applications
       
    43 *
       
    44 *  @lib SyncMLNotifier
       
    45 *  @since Series 60 3.0
       
    46 */
       
    47 NONSHARABLE_CLASS( CSyncMLAppLaunchNotifier ) : public CSyncMLNotifierBase
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         enum TSanSupport
       
    51         {
       
    52         	EOff,EON
       
    53         };
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         */
       
    57         static CSyncMLAppLaunchNotifier* NewL();
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CSyncMLAppLaunchNotifier();
       
    63         
       
    64     public:
       
    65         /**
       
    66         * Returns correct SyncService depending on the Service Id
       
    67         * @param aServiceId
       
    68         * @return CSyncService* 
       
    69         */
       
    70         CSyncService* SyncServiceL( TUint aServiceId );
       
    71 
       
    72     private: // New functions
       
    73 
       
    74         /**
       
    75         * Retrieves required parameters for the note and launching of the
       
    76         * synchronization application.
       
    77         * @param aParam Parameter structure that is forwarded to syncservice
       
    78         * @param aServerName Returns the clear-text name of the corresponding server.
       
    79         * @param aUserInteraction Returns the profile setting of whether the user
       
    80         *                         acceptance should be queried.
       
    81         * @return None
       
    82         */
       
    83         void RetrieveSyncParamsL( TSyncServiceParam& aParam,
       
    84                                   TDes& aServerName,
       
    85                                   TSmlServerAlertedAction& aUserInteraction );
       
    86 
       
    87         /**
       
    88         * Retrieves required parameters for the note and launching of the
       
    89         * device management application.
       
    90         * @param aParam Parameter structure that is forwarded to syncservice
       
    91         * @param aServerName Returns the clear-text name of the corresponding server.
       
    92         * @param aUserInteraction Returns the profile setting of whether the user
       
    93         *                         acceptance should be queried.
       
    94         * @return None
       
    95         */
       
    96         void RetrieveMgmtParamsL( TSyncServiceParam& aParam,
       
    97                                   TDes& aServerName,
       
    98                                   TSmlServerAlertedAction& aUserInteraction );
       
    99 
       
   100         /**
       
   101         * Checks if the user and/or parameters have defined that the session
       
   102         * should be accepted without querying the user.
       
   103         * @param aUserInteraction Sync profile interaction enumeration.
       
   104         * @return True, if the session is accepted automatically.
       
   105         */
       
   106         TBool IsSilent( TSmlServerAlertedAction& aUserInteraction );
       
   107 
       
   108     private: // Functions from base classes
       
   109 
       
   110         /**
       
   111         * From CSyncMLNotifierBase Called when a notifier is first loaded.        
       
   112         * @param None.
       
   113         * @return A structure containing priority and channel info.
       
   114         */
       
   115         TNotifierInfo RegisterL();
       
   116 
       
   117         /**
       
   118         * From CSyncMLNotifierBase The notifier has been deactivated 
       
   119         * so resources can be freed and outstanding messages completed.
       
   120         * @param None.
       
   121         * @return None.
       
   122         */
       
   123         void Cancel();
       
   124 
       
   125         /**
       
   126         * From CSyncMLNotifierBase Used in asynchronous notifier launch to 
       
   127         * store received parameters into members variables and 
       
   128         * make needed initializations.
       
   129         * @param aBuffer A buffer containing received parameters
       
   130         * @param aReturnVal The return value to be passed back.
       
   131         * @param aMessage Should be completed when the notifier is deactivated.
       
   132         * @return None.
       
   133         */
       
   134         void GetParamsL( const TDesC8& aBuffer,
       
   135                                TInt aReplySlot,
       
   136                          const RMessagePtr2& aMessage );
       
   137 
       
   138         /**
       
   139         * From CSyncMLNotifierBase Gets called when a request completes.
       
   140         * @param None.
       
   141         * @return None.
       
   142         */
       
   143         void RunL();
       
   144         
       
   145         /**
       
   146         * From RConnectionMonitor gets the staus of roaming .
       
   147         * If roaming returns true else returns false
       
   148         * @param ret
       
   149         * @return None.
       
   150         */
       
   151         void IsRoamingL(TBool& ret);
       
   152         /**
       
   153         * HandleDMSession
       
   154         * @param ret
       
   155         * @return TBool 
       
   156         */
       
   157 				TBool HandleDMSessionL();
       
   158 				/**
       
   159         * HandleCompleteMessage
       
   160         * @param TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes
       
   161         * @return None.
       
   162         */
       
   163 				void HandleCompleteMessageL(TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes);
       
   164 				/**
       
   165         * IsLanguageSupported
       
   166         * @param ret
       
   167         * @return True if the language is supported.
       
   168         */
       
   169 				TBool IsLanguageSupportedL();
       
   170         
       
   171         void ReadRepositoryL(TInt aKey, TInt& aValue);
       
   172         
       
   173         void ShowRoamingMessageL(TInt keypress, TUint profileId);
       
   174 
       
   175     private:
       
   176 
       
   177         /**
       
   178         * C++ default constructor.
       
   179         */
       
   180         CSyncMLAppLaunchNotifier();
       
   181 
       
   182     private: // Data
       
   183         // Type of session queried
       
   184         TSyncMLSessionTypes iSmlProtocol;
       
   185         
       
   186         // Job identifier from the parameters
       
   187         TInt                iJobId;
       
   188         
       
   189         // Identifier of the used SyncML profile from the parameters
       
   190         TInt                iProfileId;
       
   191         
       
   192         // Sync Service for Data Sync
       
   193         CSyncService*       iDSSyncService;
       
   194         // Sync Service for Device Management
       
   195         CSyncService*       iDMSyncService;
       
   196         // Is always ask selected as accesspoint for current profile
       
   197         TBool               iAlwaysAsk;
       
   198        // Alert mode
       
   199         TInt iUimode;        
       
   200         // DM Sync Server        
       
   201         TBuf<KSyncMLMaxProfileNameLength> DMSyncServerName;
       
   202         // UI behaviour 
       
   203     		TSmlServerAlertedAction uiAction;
       
   204     		// Sync Service param 
       
   205    			TSyncServiceParam param;
       
   206    			// Stringholder
       
   207     		HBufC* stringholder;  
       
   208     		// Central Respository   
       
   209     		CRepository* centrep; 
       
   210         // To store the bearer type
       
   211         TInt iBearerType;
       
   212     };
       
   213 
       
   214 
       
   215 #endif      // CSYNCMLAPPLAUNCHNOTIFIER_H   
       
   216             
       
   217 // End of File