wvuing/IMPSConnectionUI/ClientPluginSrc/IMPSPublishLevelPolicy.h
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: Presence Publish Level Policy which offers publish level changing and initializing
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __IMPSPUBLISHLEVELPOLICY_H
       
    19 #define __IMPSPUBLISHLEVELPOLICY_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Std.h>
       
    23 #include <PECAppSharedData.h>
       
    24 
       
    25 
       
    26 //FORWARD DECLARATION
       
    27 class CPEngAttributeListStore2;
       
    28 class MPEngAttributeList2;
       
    29 class CPEngNWSessionSlotID2;
       
    30 
       
    31 // TYPE DEFINITIONS
       
    32 /**
       
    33  * Attribute list mutator function type definition.
       
    34  **/
       
    35 typedef void ( *TSetPresenceL )( MPEngAttributeList2& );
       
    36 
       
    37 
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 * Presence Publish Level Policy. Offers
       
    43 * publish level changing and initializing.
       
    44 *
       
    45 *  @lib IMPSuilib.dll
       
    46 *  @since 2.1
       
    47 */
       
    48 NONSHARABLE_CLASS( IMPSPublishLevelPolicy )
       
    49 
       
    50     {
       
    51 public: // New functions
       
    52 
       
    53     /**
       
    54      * Initialize settings of Publish level, based on the settings
       
    55      * from the settings stored in the shared data.
       
    56      * Function is synchronous and creates only attribute lists for
       
    57      * contact lists based on the publish level
       
    58      *
       
    59      * @param aNWSessionSlotID the network session slot ID
       
    60      * @since 2.1
       
    61      */
       
    62     static void InitializePublishLevelL( CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    63 
       
    64 
       
    65     // New set functions
       
    66 
       
    67     /**
       
    68      *  Update settings of the attribute lists, so it reflects publishinglevel passed
       
    69      *  as parameter, no network asynchronous operations are performed, all changes
       
    70      *  are done only on local machine
       
    71      *
       
    72      * @since 2.1
       
    73      * @param aPublishLevel publish level to
       
    74      * @return
       
    75      */
       
    76     static void UpdateAttributeListsL( TInt aPublishLevel,
       
    77                                        CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    78 
       
    79 private:
       
    80     /**
       
    81      *  Set Attribute lists so it reflects private and Public publish level
       
    82      *  as parameter, no network asynchronous operations are performed, all changes
       
    83      *  are done only on local machine
       
    84      *
       
    85      * @since 2.1
       
    86      * @param   aAttributeListFactory attribute lists factory instance, function does not take
       
    87      *          ownership
       
    88      * @return
       
    89      */
       
    90     static void SetPrivatePublicPublishingL( CPEngAttributeListStore2& aAttributeListFactory );
       
    91 
       
    92 
       
    93     /**
       
    94      *  Set Attribute lists so it reflects only private publishing
       
    95      *  as parameter, no network asynchronous operations are performed, all changes
       
    96      *  are done only on local machine
       
    97      *
       
    98      * @since 2.1
       
    99      * @param   aAttributeListFactory attribute lists factory instance, function does not take
       
   100      *          ownership
       
   101      * @return
       
   102      */
       
   103     static void SetOnlyPrivatePublishingL( CPEngAttributeListStore2& aAttributeListFactory );
       
   104 
       
   105 
       
   106     /**
       
   107      *  Set Attribute lists so it reflects only Public publishing
       
   108      *  as parameter, no network asynchronous operations are performed, all changes
       
   109      *  are done only on local machine
       
   110      *
       
   111      * @since 2.1
       
   112      * @param   aAttributeListFactory attribute lists factory instance, function does not take
       
   113      *          ownership
       
   114      * @return
       
   115      */
       
   116     static void SetOnlyPublicPublishingL( CPEngAttributeListStore2& aAttributeListFactory );
       
   117 
       
   118 
       
   119     /**
       
   120      *  Set Attribute lists so it reflects all publishing OFF
       
   121      *  as parameter, no network asynchronous operations are performed, all changes
       
   122      *  are done only on local machine
       
   123      *
       
   124      * @since 2.1
       
   125      * @param   aAttributeListFactory attribute lists factory instance, function does not take
       
   126      *          ownership
       
   127      * @return
       
   128      */
       
   129     static void SetPublishOffL( CPEngAttributeListStore2& aAttributeListFactory );
       
   130 
       
   131 
       
   132     /**
       
   133      *  Set Attribute lists so it reflects all publishing ON
       
   134      *  as parameter, no network asynchronous operations are performed, all changes
       
   135      *  are done only on local machine
       
   136      *
       
   137      * @since 2.1
       
   138      * @return
       
   139      */
       
   140     static void SetPublishAllOnL();
       
   141 
       
   142     /**
       
   143      * Attribute list mutator.
       
   144      *
       
   145      * Updates given PEC contact lists attribute list
       
   146      * to given publish level. (Publish level is declared
       
   147      * trough the given function pointer.)
       
   148      *
       
   149      * @since 2.1
       
   150      * @param   aAttrLstStore Attribute list store to use to mutate attribute list.
       
   151      * @param   aContactList The contact list which attribute list to change.
       
   152      * @return  aPresenceCall The attribute list mutator function to use to
       
   153      * alter the attribute list.
       
   154      */
       
   155     static void UpdateAttributeListL(	CPEngAttributeListStore2& aAttrLstStore,
       
   156                                       const TDesC& aContactList,
       
   157                                       TSetPresenceL aPresenceCall );
       
   158 
       
   159     /**
       
   160      * Attribute list mutator.
       
   161      *
       
   162      * Updates default attribute list to given publish level.
       
   163      * (Publish level is declared trough the given function pointer.)
       
   164      *
       
   165      * @since 2.1
       
   166      * @param   aAttrLstStore Attribute list store to use to mutate attribute list.
       
   167      * @return  aPresenceCall The attribute list mutator function to use to
       
   168      * alter the attribute list.
       
   169      */
       
   170     static void UpdateDefaultAttrListL( CPEngAttributeListStore2& aAttrLstStore,
       
   171                                         TSetPresenceL aPresenceCall );
       
   172 
       
   173 
       
   174     /**
       
   175      * Attribute list mutator.
       
   176      * Sets PEC "private presence" attributes on the
       
   177      * given attribute list.
       
   178      *
       
   179      * @since 2.1
       
   180      * @param aAttrListModel Attribute list to alter.
       
   181      */
       
   182     static void SetPrivatePresenceL( MPEngAttributeList2& aAttrListModel );
       
   183 
       
   184 
       
   185     /**
       
   186      * Attribute list mutator.
       
   187      * Sets PEC "public presence" attributes on the
       
   188      * given attribute list.
       
   189      *
       
   190      * @since 2.1
       
   191      * @param aAttrListModel Attribute list to alter.
       
   192      */
       
   193     static void SetPublicPresenceL( MPEngAttributeList2& aAttrListModel );
       
   194 
       
   195 
       
   196     /**
       
   197      * Attribute list mutator.
       
   198      * Sets PEC "no presence" attributes on the
       
   199      * given attribute list.
       
   200      *
       
   201      * @since 2.1
       
   202      * @param aAttrListModel Attribute list to alter.
       
   203      */
       
   204     static void SetNoPresence( MPEngAttributeList2& aAttrListModel );
       
   205 
       
   206 
       
   207 
       
   208 protected: //prohibited constructor / destructor
       
   209 
       
   210     ~IMPSPublishLevelPolicy();
       
   211     IMPSPublishLevelPolicy();
       
   212 
       
   213     };
       
   214 
       
   215 #endif      // __IMPSPUBLISHLEVELPOLICY_H
       
   216 
       
   217 // End of File