messagingfw/senduiservices/serviceresolver/inc/senduisrappui.h
branchRCL_3
changeset 22 d2c4c66342f3
parent 21 e5b3a2155e1a
child 23 d51193d814ea
equal deleted inserted replaced
21:e5b3a2155e1a 22:d2c4c66342f3
     1 /*
       
     2 * Copyright (c) 2006 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:   Resolves sending service information and stores it to 
       
    15 *                Central Repository.    
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_CSENDUISRAPPUI_H
       
    24 #define C_CSENDUISRAPPUI_H
       
    25 
       
    26 
       
    27 #include <aknappui.h>
       
    28 #include <msvapi.h>
       
    29 
       
    30 // Forward declarations
       
    31 class CSendUiPropertyObserver;
       
    32 class CSendingServiceInfo;
       
    33 class CSendingService;
       
    34 class TSendingCapabilities;
       
    35 class CSendUiSrAppView;
       
    36 class CRepository;
       
    37 class CSendUiSingleton;
       
    38 
       
    39 const TInt KEightBits = 8;
       
    40 
       
    41 /**
       
    42  *  An instance of class CSendUiSrAppUi is the UserInterface part of the AVKON
       
    43  *  application framework for the SendUiServiceResolver application
       
    44  *
       
    45  *  @since S60 v3.2
       
    46  */
       
    47 class CSendUiSrAppUi : public CAknAppUi
       
    48     {
       
    49 
       
    50 public:
       
    51 
       
    52     /**  Publish & Subscribe API keys */
       
    53     enum TSendUiPropertyKeys { ESendUiListStatus };
       
    54 
       
    55     virtual ~CSendUiSrAppUi();
       
    56 
       
    57     CSendUiSrAppUi();
       
    58     
       
    59 // from base class CAknAppUi
       
    60 
       
    61     /**
       
    62      * From CAknAppUi.
       
    63      *
       
    64      * @since S60 v3.2
       
    65      * @param aCommand Command code
       
    66      */
       
    67     void HandleCommandL( TInt aCommand );
       
    68     
       
    69 private:
       
    70 
       
    71     void ConstructL();
       
    72 
       
    73     /**
       
    74      * Resolves and stores sending service information
       
    75      *
       
    76      * @since S60 v3.2
       
    77      */
       
    78     void HandleUpdateSendListL();
       
    79     
       
    80     /**
       
    81      * Removes all SendUi's sending service information from the central repository
       
    82      *
       
    83      * @since S60 v3.2
       
    84      * @param aRep Reference to an open CRepository object
       
    85      */
       
    86     void ClearPluginListL( CRepository* aRep );
       
    87  
       
    88     /**
       
    89      * Inserts given sending service information to Central Repository.
       
    90      *
       
    91      * @since S60 v3.2
       
    92      * @param aRep          Reference to an open CRepository object
       
    93      * @param aServiceId    Identification code of this service
       
    94      * @param aServiceProviderId Identification code of the service provider
       
    95      * @param aTechnologyType   Identification code of the service's technology type
       
    96      * @param aCapabilities     Sending capabilities of this service
       
    97      * @param aServiceMenuName  Name of the service shown in menu (Send...)
       
    98      * @param aServiceName      Name of the service (Write...)
       
    99      */ 
       
   100     TInt AddSendingService( 
       
   101         CRepository* aRep,
       
   102         TUint aIndex, 
       
   103         TUid aServiceId,
       
   104         TUid aServiceProviderId,
       
   105         TUid aTechnologyType,
       
   106         TInt aFeatures,
       
   107         TSendingCapabilities aCapabilities,
       
   108         TPtrC aServiceMenuName,
       
   109         TPtrC aServiceName,
       
   110         TPtrC aServiceAddress );
       
   111 
       
   112     /**
       
   113     * Populates given list with the sending services.
       
   114     * The pointers in the list point to the actual objects
       
   115     * (which remain owned by the Service Providers).
       
   116     *
       
   117     * @since Series 60 3.2
       
   118     * @param aServiceList List of available services
       
   119     * @param aServiceProviders list of service providers.
       
   120     * @param aCoeEnv
       
   121     * @return aServiceList and aServiceProviders
       
   122     */
       
   123     void PopulateServicesListL(
       
   124         RPointerArray<CSendingServiceInfo>& aServiceList,
       
   125         RPointerArray<CSendingService>&      aServiceProviders,
       
   126         CCoeEnv* aCoeEnv );
       
   127 
       
   128     static TInt UpdateTask( TAny* aThis );
       
   129     
       
   130     /**
       
   131      * Loads a service provides and fetches the provided services. 
       
   132      * This functions is trapped in PopulateServicesListL to insulate serious
       
   133      * service loading problems to the service in question.
       
   134      *
       
   135      * @since Series 60 3.2
       
   136      * @param aServiceProviderUid 
       
   137      * @param aCoeEnv Pointer to CCoeEnv passed to the service provider
       
   138      * @param aSingleton Pointer to a singleton class passed to the service provider
       
   139      * @param aServiceList List of services available at the loaded service provider.
       
   140      */
       
   141      
       
   142     CSendingService* LoadServiceL( 
       
   143         TUid aServiceUid, 
       
   144         CCoeEnv* aCoeEnv, 
       
   145         CSendUiSingleton* aSingleton,
       
   146         RPointerArray<CSendingServiceInfo>& aServiceList );
       
   147     
       
   148 private:
       
   149 
       
   150       /**
       
   151        * Not own.
       
   152        */
       
   153        CCoeEnv* iCoeEnv;
       
   154        
       
   155       /**
       
   156        * Timer for updater. HandleUpdateSendListL can not be called directly from ConstructL,
       
   157        * so HandleUpdateSendListL call is requested after construction with timer.
       
   158        *
       
   159        * Own.
       
   160        */
       
   161        CIdle* iIdle;
       
   162    };
       
   163 
       
   164 #endif // C_CSENDUIAPPUI_H