PECengine/AttributeLibrary2/SrcWVAttributes/PEngWVAttributeConstructorFactory.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Wireless Village attribute constructor factory.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "PEngWVAttributeConstructorFactory.h"
       
    20 #include "CPEngAttrConstructorCon.h"
       
    21 #include "PresenceDebugPrint.h"
       
    22 
       
    23 #include "CPEngWVAttributeConstructBase.h"
       
    24 #include "CPEngWVOnlineStatusConstruct.h"
       
    25 #include "CPEngWVUserAvailabilityConstruct.h"
       
    26 #include "CPEngWVStatusTextConstruct.h"
       
    27 #include "CPEngWVClientInfoConstruct.h"
       
    28 #include "CPEngWVCommCapConstruct.h"
       
    29 
       
    30 #include "CPEngWVStatusContentConstruct.h"
       
    31 #include "CPEngWVThumbnailConstruct.h"
       
    32 #include "CPEngWVAliasConstruct.h"
       
    33 #include "CPEngWVInfoLinkConstruct.h"
       
    34 #include "PEngInfoLinkSupport.h"
       
    35 
       
    36 #include "MPEngPresenceAttrModel2.h"
       
    37 #include "MPEngPresenceAttrManager.h"
       
    38 
       
    39 #include <E32Base.h>
       
    40 
       
    41 
       
    42 
       
    43 // ============================ MEMBER FUNCTIONS ===============================
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // PEngWVAttributeConstructorFactory::CreateConstructorsL()
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 void PEngWVAttributeConstructorFactory::CreateConstructorsL(
       
    50     CPEngAttrConstructorCon& aConstructors )
       
    51     {
       
    52     TPEngWVCspVersion cspVer = PEngWVCspVersion::SelectVersionL();
       
    53     MPEngPresenceAttrConstructorTypeImp* typeConstructor = NULL;
       
    54 
       
    55 
       
    56     //WV CSP Attributes supported in all versions (WV CSP 1.1 and 1.2)
       
    57     typeConstructor = new ( ELeave ) CPEngWVOnlineStatusConstruct( cspVer );  // CSI: 35 #
       
    58     aConstructors.AddConstructorL( typeConstructor,
       
    59                                    KUidPrAttrOnlineStatus,
       
    60                                    EPEngClientServerOriginated );
       
    61 
       
    62 
       
    63     typeConstructor = new ( ELeave ) CPEngWVUserAvailabilityConstruct( cspVer );  // CSI: 35 #
       
    64     aConstructors.AddConstructorL( typeConstructor,
       
    65                                    KUidPrAttrUserAvailability,
       
    66                                    EPEngClientOriginated );
       
    67 
       
    68 
       
    69     typeConstructor = new ( ELeave ) CPEngWVStatusTextConstruct( cspVer );  // CSI: 35 #
       
    70     aConstructors.AddConstructorL( typeConstructor,
       
    71                                    KUidPrAttrStatusText,
       
    72                                    EPEngClientOriginated );
       
    73 
       
    74 
       
    75     typeConstructor = CPEngWVClientInfoConstruct::NewL( cspVer );           // CSI: 35 #
       
    76     aConstructors.AddConstructorL( typeConstructor,
       
    77                                    KUidPrAttrClientInfo,
       
    78                                    EPEngClientOriginated );
       
    79 
       
    80 
       
    81     typeConstructor = new ( ELeave ) CPEngWVCommCapConstruct( cspVer );     // CSI: 35 #
       
    82     aConstructors.AddConstructorL( typeConstructor,
       
    83                                    KUidPrAttrCommCap,
       
    84                                    EPEngClientServerOriginated );
       
    85 
       
    86 
       
    87     typeConstructor = new ( ELeave ) CPEngWVStatusContentConstruct( cspVer ); // CSI: 35 #
       
    88     aConstructors.AddConstructorL( typeConstructor,
       
    89                                    KUidPrAttrStatusContent,
       
    90                                    EPEngClientOriginated );
       
    91 
       
    92 
       
    93     typeConstructor = new ( ELeave ) CPEngWVThumbnailConstruct( cspVer );   // CSI: 35 #
       
    94     aConstructors.AddConstructorL( typeConstructor,
       
    95                                    KUidPrAttrMyLogoThumbnail,
       
    96                                    EPEngLocalAttribute );
       
    97 
       
    98 
       
    99     typeConstructor = new ( ELeave ) CPEngWVAliasConstruct( cspVer );       // CSI: 35 #
       
   100     aConstructors.AddConstructorL( typeConstructor,
       
   101                                    KUidPrAttrAlias,
       
   102                                    EPEngClientOriginated );
       
   103 
       
   104 
       
   105 
       
   106     //WV CSP Attributes supported only in WV CSP 1.2
       
   107     if ( ( cspVer == EWVCspV12 ) && PEngInfoLinkSupport::InfoLinkSupportedL() )
       
   108         {
       
   109         typeConstructor = new ( ELeave ) CPEngWVInfoLinkConstruct( cspVer );  // CSI: 35 #
       
   110         aConstructors.AddConstructorL( typeConstructor,
       
   111                                        KUidPrAttrInfoLink,
       
   112                                        EPEngClientOriginated );
       
   113         }
       
   114     }
       
   115 
       
   116 
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // PEngWVAttributeConstructorFactory::LoadSessionTracingAttributesL()
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 void PEngWVAttributeConstructorFactory::LoadSessionTracingAttributesL(
       
   123     RPointerArray< MPEngPresenceAttrModel2 >& aSessionAttributes,
       
   124     MPEngPresenceAttrManager& aAttributeManager )
       
   125     {
       
   126     MPEngPresenceAttrModel2* model = NULL;
       
   127     aAttributeManager.LoadAttributeLC( model,
       
   128                                        KNullDesC,
       
   129                                        KUidPrAttrOnlineStatus,
       
   130                                        EPEngUserAttribute | EPEngStorableModel );
       
   131     aSessionAttributes.AppendL( model );
       
   132     CleanupStack::Pop(); //model
       
   133     }
       
   134 
       
   135 
       
   136 
       
   137 //  End of File
       
   138 
       
   139 
       
   140