iaupdate/IAD/engine/controller/inc/iaupdatenodefactory.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IA_UPDATE_NODE_FACTORY_H
       
    21 #define IA_UPDATE_NODE_FACTORY_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class MNcdNode;
       
    27 class CIAUpdateController;
       
    28 class CIAUpdateNode;
       
    29 class CIAUpdateFwNode;
       
    30 
       
    31 
       
    32 /**
       
    33  * IAUpdateNodeFactory is used to create the correct iaupdate nodes
       
    34  * from the NCD nodes.
       
    35  *
       
    36  */
       
    37 namespace IAUpdateNodeFactory
       
    38     {
       
    39 
       
    40     /**
       
    41      * @note Ownership of aNode is transferred. And if this function leaves,
       
    42      * then it automatically deletes the aNode.
       
    43      *
       
    44      * @param aNode NCD Engine node that is used for the iaupdate node.
       
    45      * Ownership is transferred. So, do not release the node after
       
    46      * giving it here. This class object supposes that the reference
       
    47      * count of the given node is at least one when it is given.
       
    48      * @param aController Update controller that is required by the iaupdate node.
       
    49      * @return CIAUpdateNode* IAUpdate node that is created. 
       
    50      * Ownership is transferred.
       
    51      * @exception Leaves with KErrArgument if aNode is NULL. Else leaves with
       
    52      * system wide error code.
       
    53      **/
       
    54     CIAUpdateNode* CreateNodeLC( MNcdNode* aNode,
       
    55                                  CIAUpdateController& aController );
       
    56     
       
    57     /**
       
    58      * @see IAUpdateNodeFactory::CreateNodeLC
       
    59      **/
       
    60     CIAUpdateNode* CreateNodeL( MNcdNode* aNode,
       
    61                                 CIAUpdateController& aController );
       
    62 
       
    63     
       
    64     /**
       
    65      * @param aUid Uid of the node. This UID is checked agains the known UIDs that
       
    66      * require self update.
       
    67      * @return TBool ETrue if the node corresponding the given UID requires
       
    68      * self update. EFalse if the self update is not required.
       
    69      **/
       
    70     TBool IsSelfUpdate( const TUid& aUid );
       
    71 
       
    72 
       
    73     /**
       
    74      * @param aUid Uid of the node. This UID is checked agains the IAD UIDs.
       
    75      * @return TBool ETrue if the aUid describes IAD. Else EFalse.
       
    76      **/
       
    77     TBool IsIad( const TUid& aUid );
       
    78     
       
    79 
       
    80     /**
       
    81      * @param aUid Uid of the node. This UID is checked agains the NCD UIDs.
       
    82      * @return TBool ETrue if the aUid describes NCD. Else EFalse.
       
    83      **/
       
    84     TBool IsNcd( const TUid& aUid );
       
    85 
       
    86 
       
    87     /**
       
    88      * @param aUid Uid of the node. This UID is checked agains the IAD self 
       
    89      * updater UIDs.
       
    90      * @return TBool ETrue if the aUid describes IAD self updater. Else EFalse.
       
    91      **/
       
    92     TBool IsUpdater( const TUid& aUid );
       
    93 
       
    94 
       
    95     /**
       
    96      * @note Ownership of aNode is transferred. And if this function leaves,
       
    97      * then it automatically deletes the aNode.
       
    98      *
       
    99      * @param aNode NCD Engine node that is used for the iaupdate firmware node.
       
   100      * Ownership is transferred. So, do not release the node after
       
   101      * giving it here. This class object supposes that the reference
       
   102      * count of the given node is at least one when it is given.
       
   103      * @param aController Update controller that is required by the iaupdate node.
       
   104      * @return CIAUpdateNode* IAUpdate node that is created. 
       
   105      * Ownership is transferred.
       
   106      * @exception Leaves with KErrArgument if aNode is NULL. Else leaves with
       
   107      * system wide error code.
       
   108      **/
       
   109     CIAUpdateFwNode* CreateFwNodeLC( MNcdNode* aNode,
       
   110                                      CIAUpdateController& aController );
       
   111     
       
   112     /**
       
   113      * @see IAUpdateNodeFactory::CreateFwNodeLC
       
   114      **/
       
   115     CIAUpdateFwNode* CreateFwNodeL( MNcdNode* aNode,
       
   116                                     CIAUpdateController& aController );
       
   117 
       
   118 
       
   119     /**
       
   120      * @param aNode Node whose information is used to check if
       
   121      * the node describes a firmware update.
       
   122      * @return TBool ETrue if the given node is for firmware updates.
       
   123      * @exception Leaves with system wide error code.
       
   124      */
       
   125     TBool IsFwUpdateL( MNcdNode& aNode );
       
   126 
       
   127 
       
   128     /**
       
   129      * @param aMime MIME type is used to check if it describes 
       
   130      * a firmware update.
       
   131      * @return TBool ETrue if the given MIME is for firmware updates.
       
   132      */
       
   133     TBool IsFwUpdate( const TDesC& aMime );
       
   134 
       
   135 
       
   136     /**
       
   137      * @param aMime MIME type is used to check if it describes 
       
   138      * service pack.
       
   139      * @return TBool ETrue if the given MIME is for service pack.
       
   140      */
       
   141     TBool IsServicePack( const TDesC& aMime );
       
   142 
       
   143 
       
   144     /**
       
   145      * @param aMime MIME type is used to check if it describes 
       
   146      * a hidden item.
       
   147      * @return TBool ETrue if the given MIME is for a hidden item.
       
   148      * Else, EFalse.
       
   149      */
       
   150     TBool IsHidden( const TDesC& aMime );
       
   151     
       
   152     }
       
   153     
       
   154     
       
   155 #endif  //  IA_UPDATE_NODE_FACTORY_H