uiservicetab/vimpstui/inc/cvimpstuiextensionservice.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008 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: Header for extension service
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef     C_CVIMPSTUIEXTENSIONSERVICE_H
       
    20 #define     C_CVIMPSTUIEXTENSIONSERVICE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32const.h>
       
    25 #include "tvimpstenums.h"
       
    26 
       
    27 // FORWARD DECLARATINS
       
    28 class CVIMPSTUiTabbedView;
       
    29 class CVIMPSTUiSearchView;
       
    30 class CVIMPSTUIExtensionViewInfo;
       
    31 class MxSPViewMapper;
       
    32 class CPbk2UIExtensionView;
       
    33 class MxSPContactManager;
       
    34 class MVIMPSTEngine;
       
    35 class CVIMPSTUiBrandData;
       
    36 class MVIMPSTCmdHandler;
       
    37 class CVIMPSTUiSearchFieldArray;
       
    38 class CVIMPSTUiBlockView;
       
    39 class CVIMPSTUIMenuExtension;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  *  Extension Service
       
    45  *  This class represents one service
       
    46  *
       
    47  *  @lib vimpstui.lib
       
    48  *  @since S60 5.0
       
    49  */
       
    50 NONSHARABLE_CLASS( CVIMPSTUIExtensionService ) : public CBase
       
    51     {
       
    52     public: // Constructor and destructor
       
    53 
       
    54         /**
       
    55          * Two-phased constructor.
       
    56          *
       
    57          * @param aServiceId, service id
       
    58          * @param aTabbedViewId, tabbed view id for this service
       
    59          * @param aSearchViewId, Search view id for this service
       
    60          * @param aServiceName, 
       
    61          * @param aEngine, engine for logic handling
       
    62          */
       
    63         static CVIMPSTUIExtensionService* NewL(
       
    64             TUint aServiceId,
       
    65             TInt aTabbedViewId,
       
    66             TInt aSearchViewId, 
       
    67             TInt aBlockedViewId,
       
    68             const TDesC& aServiceName,
       
    69             CVIMPSTUIMenuExtension& aMenuExtension,
       
    70             MVIMPSTEngine& aEngine );
       
    71 
       
    72         /**
       
    73          * Two-phased constructor.
       
    74          *
       
    75          * @param aService, service id
       
    76          * @param aTabbedViewId, tabbed view id for this service
       
    77          * @param aSearchViewId, Search view id for this service
       
    78          * @param aServiceName, 
       
    79          * @param aEngine, engine for logic handling
       
    80          */
       
    81         static CVIMPSTUIExtensionService* NewLC(
       
    82             TUint aServiceId,
       
    83             TInt aTabbedViewId,
       
    84             TInt aSearchViewId, 
       
    85             TInt aBlockedViewId,
       
    86             const TDesC& aServiceName,
       
    87             CVIMPSTUIMenuExtension& aMenuExtension,
       
    88             MVIMPSTEngine& aEngine );
       
    89 
       
    90         /**
       
    91          * Standard C++ destructor
       
    92          */    
       
    93         ~CVIMPSTUIExtensionService();
       
    94         
       
    95             
       
    96         
       
    97     public:
       
    98 
       
    99         /**
       
   100          * Returns pointer to tabbed view of this service. 
       
   101          * Ownership is passed
       
   102          *
       
   103          * @param aMapper, view mapper
       
   104          * @param aContactManager, contact manager
       
   105          * @param aView, view
       
   106          * @param aTabbedViewId, tabbed view id
       
   107          * @param aId, id                 
       
   108          * @return CVIMPSTUiTabbedView*, pointer
       
   109          * to tabbed view. Ownership is passed.
       
   110          */
       
   111         CVIMPSTUiTabbedView* TabbedViewL(
       
   112             MxSPViewMapper& aMapper, 
       
   113             MxSPContactManager& aContactManager,
       
   114             CPbk2UIExtensionView& aView,
       
   115             TInt aTabbedViewId,
       
   116             TUid aId,
       
   117             MVIMPSTEngine& aEngine );
       
   118         
       
   119          /**
       
   120          * Returns pointer to Search view of this service. 
       
   121          * Ownership is passed
       
   122          *
       
   123          * @param aMapper, view mapper
       
   124          * @param aContactManager, contact manager
       
   125          * @param aView, view
       
   126          * @param aSearchViewId, search view id
       
   127          * @param aId, old view id for search view                
       
   128          * @return CVIMPSTUiSearchView*, pointer
       
   129          * to tabbed view. Ownership is passed.
       
   130          */    
       
   131 		CVIMPSTUiSearchView*  SearchViewL( 
       
   132 	        MxSPViewMapper& aMapper, 
       
   133 	        MxSPContactManager& aContactManager, 
       
   134 	        CPbk2UIExtensionView& aView,
       
   135 	        TInt aSearchViewId,
       
   136 	        TUid aId,
       
   137 	        MVIMPSTEngine& aEngine );            
       
   138 
       
   139          /**
       
   140          * Returns pointer to Block view of this service. 
       
   141          * Ownership is passed
       
   142          *
       
   143          * @param aMapper, view mapper
       
   144          * @param aContactManager, contact manager
       
   145          * @param aView, view
       
   146          * @param aSearchViewId, search view id
       
   147          * @return CVIMPSTUiSearchView*, pointer
       
   148          * to tabbed view. Ownership is passed.
       
   149          */    
       
   150 		CVIMPSTUiBlockView*  BlockViewL( 
       
   151 	        MxSPViewMapper& aMapper, 
       
   152 	        MxSPContactManager& aContactManager, 
       
   153 	        CPbk2UIExtensionView& aView,
       
   154 	        TInt aSearchViewId,
       
   155 	        MVIMPSTEngine& aEngine );            
       
   156         
       
   157         /**
       
   158          * Returns tabbed view id assigned to this service
       
   159          *
       
   160          * @return TInt, tabbed view id of this service
       
   161          */
       
   162         TInt TabbedViewId();
       
   163 
       
   164         /**
       
   165          * Returns Search view id assigned to this service
       
   166          *
       
   167          * @return TInt, details view id of this service
       
   168          */
       
   169 		TInt SearchViewId();
       
   170 		
       
   171         /**
       
   172          * Returns Block view id assigned to this service
       
   173          *
       
   174          * @return TInt, details view id of this service
       
   175          */
       
   176 		TInt BlockViewId();
       
   177         
       
   178         /**
       
   179          * Returns service id
       
   180          *
       
   181          * @return TInt, service id
       
   182          */        
       
   183         TUint32 ServiceId();
       
   184         
       
   185         
       
   186         /**
       
   187          * Returns pointer of tabbed view info. Ownership is passed.
       
   188          *
       
   189          * @return CVIMPSTUIExtensionViewInfo, view info data
       
   190          */                    
       
   191         CVIMPSTUIExtensionViewInfo* TabbedViewInfoL();
       
   192         
       
   193          /**
       
   194          * Returns pointer of Search view info. Ownership is passed.
       
   195          *
       
   196          * @return CVIMPSTUIExtensionViewInfo, view info data
       
   197          */ 
       
   198         CVIMPSTUIExtensionViewInfo* SearchViewInfo();
       
   199 
       
   200          /**
       
   201          * Returns pointer of Blocked view info. Ownership is passed.
       
   202          *
       
   203          * @return CVIMPSTUIExtensionViewInfo, view info data
       
   204          */ 
       
   205         CVIMPSTUIExtensionViewInfo* BlockedViewInfo();
       
   206 
       
   207 
       
   208         
       
   209         /**
       
   210          * Returns service name
       
   211          *
       
   212          * @return TDesC&, service name
       
   213          */                            
       
   214         const TDesC& ServiceName();
       
   215         
       
   216         
       
   217         /**
       
   218          * Returns search string
       
   219          *
       
   220          * @return TDesC&, search string
       
   221          */                            
       
   222         const TDesC& SearchString();
       
   223         
       
   224         /**
       
   225          * Sets search string
       
   226          *
       
   227          * @param aSearchString, search string used in search view for navi pane text
       
   228          */ 
       
   229         void SetSearchStringL( const TDesC& aSearchString );
       
   230             
       
   231         /**
       
   232          * Checks if this service has aViewId in use.
       
   233          *
       
   234          * @since S60 5.0
       
   235          * @param aViewId, view id to check
       
   236          * @return ETrue if aViewId belongs to this service
       
   237          */                                 
       
   238         TBool HasViewId( TInt aViewId );
       
   239         
       
   240         /**
       
   241          * Returns service Engine
       
   242          *
       
   243          * @return Ref to the Engine
       
   244          */  
       
   245         MVIMPSTEngine& ServiceEngine ();
       
   246         
       
   247         /**
       
   248          * set all search field found from server
       
   249          * @param aEnumKeysArray, array of enums key field
       
   250          * @param aLebelKeysArray, array of label key field
       
   251          */ 
       
   252         void SetSearchFieldsDataL( RArray<TInt>& aEnumKeysArray, RPointerArray<HBufC>& aLebelKeysArray ) ;
       
   253         
       
   254         /**
       
   255          * @returns search field array refernce
       
   256          */
       
   257         CVIMPSTUiSearchFieldArray& GetSearchFieldArray()  ; 
       
   258         
       
   259     private :
       
   260     	/**
       
   261          * get label of given search key
       
   262          * 
       
   263          * @returns HBufC* lable of the given search key.
       
   264          */
       
   265     	HBufC* GetSearchKeyLabelL(TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ,TBool& aBasicField )  ;
       
   266     	
       
   267     	/**
       
   268          * sort the basic field in order of 
       
   269          * first name , last name and user
       
   270          */
       
   271     	void SortBasicFields()  ;
       
   272     	
       
   273     private: // Implementation
       
   274 
       
   275         /**
       
   276          * Standard C++ constructor
       
   277          * @param aServiceId, service id
       
   278          * @param aTabbedViewId, tabbedview id
       
   279          * @param aSearchViewId, search view id
       
   280          * @param aEngine, reference to engine.
       
   281          */    
       
   282         CVIMPSTUIExtensionService( 
       
   283             TUint aServiceId,
       
   284             TInt aTabbedViewId,                             
       
   285             TInt aSearchViewId, 
       
   286             TInt aBlockedViewId,                           
       
   287             CVIMPSTUIMenuExtension& aMenuExtension,
       
   288             MVIMPSTEngine& aEngine );
       
   289 
       
   290         /**
       
   291          * Performs the 2nd phase of construction.
       
   292          * @param aServiceName, name of the installed service.
       
   293          */             
       
   294         void ConstructL(const TDesC& aServiceName);
       
   295         
       
   296     private: // Data
       
   297     
       
   298         // Service id of this service
       
   299         TUint32   iServiceId;
       
   300     
       
   301         // tabbed view id for this service
       
   302         TInt    iTabbedViewId;        
       
   303         
       
   304         // search view id for this service
       
   305         TInt    iSearchViewId;    
       
   306         
       
   307         // blocked view id for this service
       
   308         TInt    iBlockedViewId;    
       
   309 
       
   310         //does not own, reference to menu extension
       
   311         CVIMPSTUIMenuExtension& iMenuExtension;
       
   312         
       
   313         // Own Service name
       
   314         HBufC*  iServiceName;
       
   315         
       
   316         // Not own, tabbed view class for this service
       
   317         CVIMPSTUiTabbedView* iTabbedView;        
       
   318         
       
   319         //Not own,search view class for this subservice if supported      
       
   320         CVIMPSTUiSearchView* iSearchView;    
       
   321         
       
   322         CVIMPSTUiBlockView* iBlockedView;
       
   323                 
       
   324         // Not own, tabbed view info of this service
       
   325         CVIMPSTUIExtensionViewInfo* iTabbedViewInfo;
       
   326         
       
   327          // Not own, search view info of this service
       
   328         CVIMPSTUIExtensionViewInfo* iSearchViewInfo;
       
   329 
       
   330          // Not own, search view info of this service
       
   331         CVIMPSTUIExtensionViewInfo* iBlockViewInfo;
       
   332 
       
   333 		//not owned
       
   334         MVIMPSTEngine& iEngine;
       
   335         
       
   336         //Owns command Handler for this view
       
   337         MVIMPSTCmdHandler* iCommandHandler;  
       
   338         
       
   339         /** Owns Search string
       
   340          * used to show the string in search view's navi pane
       
   341          * remove if there any other way to do the same
       
   342          */
       
   343         HBufC* iSearchString;
       
   344         
       
   345          // owns , collection of all supported fields
       
   346         CVIMPSTUiSearchFieldArray* iUiFieldsArray;
       
   347 
       
   348     };
       
   349 
       
   350 #endif // C_CVIMPSTUIEXTENSIONSERVICE_H
       
   351 
       
   352 // End of file