inc/MPEngContactListProperties.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:  Contact list properties.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MPENGCONTACTLISTPROPERTIES_H
       
    19 #define __MPENGCONTACTLISTPROPERTIES_H
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <E32Base.h>
       
    24 
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MPEngContactListPropertiesExt;
       
    28 class MPEngAttributeList2;
       
    29 class TPEngContactListBaseSettings;
       
    30 
       
    31 
       
    32 
       
    33 // CONSTANTS
       
    34 /********************************************************/
       
    35 /* Contact list property levels.                        */
       
    36 /* @since 3.0                                           */
       
    37 /********************************************************/
       
    38 
       
    39 
       
    40 /**
       
    41  * Presence Engine contact list native permanent properties.
       
    42  * Those properties are permanent over the sessions.
       
    43  */
       
    44 const TUint KPEngCntLstPropertyNativePermanent =   0x00000010;
       
    45 
       
    46 
       
    47 /**
       
    48  * Presence Engine contact list native cached properties.
       
    49  * These property values are discarded on the session close.
       
    50  */
       
    51 const TUint KPEngCntLstPropertyNativeCached =      0x00000020;
       
    52 
       
    53 
       
    54 /**
       
    55  * External permanent contact list properties.
       
    56  *
       
    57  * These properties are not used by the Presence Engine but
       
    58  * the clients can use this level to store external
       
    59  * settings that must be permanent over the sessions.
       
    60  */
       
    61 const TUint KPEngCntLstPropertyExternalPermanent = 0x00000030;
       
    62 
       
    63 /**
       
    64  * External cached contact list properties.
       
    65  *
       
    66  * These properties are not used by the Presence Engine but
       
    67  * the clients can use this level to store external settings
       
    68  * that needs to be cleared when the session is closed.
       
    69  */
       
    70 const TUint KPEngCntLstPropertyExternalCached =    0x00000040;
       
    71 
       
    72 
       
    73 
       
    74 
       
    75 
       
    76 
       
    77 
       
    78 /********************************************************/
       
    79 /* Contact list properties.                             */
       
    80 /* These properties should be defined by the client     */
       
    81 /* once contact list is created. If clients do not      */
       
    82 /* define these, default values are used instead.       */
       
    83 /*                                                      */
       
    84 /* @since 3.0                                           */
       
    85 /********************************************************/
       
    86 
       
    87 
       
    88 /**
       
    89  * Contact list TInt property name.
       
    90  * Property level: KPEngCntLstPropertyNativePermanent
       
    91  *
       
    92  * Flag if the contact lists must exist on the network server.
       
    93  *
       
    94  * Possible property values:
       
    95  *  - 0: (Default) Contact list is lazy initializated
       
    96  *       on the Network server when needed.
       
    97  *  - 1: Contact list is created on the Network server, even
       
    98  *       there is no content for such contact list.
       
    99  */
       
   100 const TUint KPEngCntLstMustExistOnServer = 0x0001001;
       
   101 
       
   102 
       
   103 
       
   104 /**
       
   105  * Contact list TInt property name.
       
   106  * Property level: KPEngCntLstPropertyNativePermanent
       
   107  *
       
   108  * Flag if contact list is master on the terminal or
       
   109  * on the network server. This rule is used when local copy
       
   110  * of the contact list is synchronized with the network server.
       
   111  *
       
   112  * Possible property values:
       
   113  *  - 0: (Default) Network version of the contact list
       
   114  *       is the master.
       
   115  *  - 1: Terminal version of the lists is master.
       
   116  */
       
   117 const TUint KPEngCntLstSyncMaster =			0x0001002;
       
   118 
       
   119 
       
   120 
       
   121 // Following Contact list properties will will be hiden and not
       
   122 // used as public
       
   123 
       
   124 /**
       
   125  * Contact list TInt property name.
       
   126  * Property level: KPEngCntLstPropertyNativePermanent
       
   127  *
       
   128  * Flag if the contact list needs to be subscribed or not.
       
   129  *
       
   130  * Possible property values:
       
   131  *  - 0: (Default) Contact list isn't subscribed.
       
   132  *  - 1: Contact list will is subscribed.
       
   133  */
       
   134 const TUint KPEngCntLstSubscribe =			0x0001003;
       
   135 
       
   136 
       
   137 /**
       
   138  * Contact list TInt property name.
       
   139  * Property level: KPEngCntLstPropertyNativePermanent
       
   140  *
       
   141  * Flag if the contact list is default contact list
       
   142  *
       
   143  * Possible property values:
       
   144  *  - 0: (Default) Contact list isn't default contact list.
       
   145  *  - 1: Contact is default.
       
   146  */
       
   147 const TUint KPEngCntLstDefault =			0x0001004;
       
   148 
       
   149 
       
   150 
       
   151 
       
   152 // CLASS DECLARATION
       
   153 
       
   154 /**
       
   155  * Contact list settings.
       
   156  *
       
   157  * Interface to access all properties of the contact list
       
   158  *
       
   159  * @since 3.0
       
   160  */
       
   161 class MPEngContactListProperties
       
   162     {
       
   163     public: // New functions
       
   164 
       
   165         /**
       
   166          *  Is contact list synchronized?
       
   167          *
       
   168          *  ETrue if local contact list has been synchronized
       
   169          *  with network server. Else EFalse.
       
   170          *
       
   171          *  @since 3.0
       
   172          *  @return ETrue if contact list is synchronized.
       
   173          *  Else EFalse.
       
   174          */
       
   175         virtual TBool Synchronized() const = 0 ;
       
   176 
       
   177 
       
   178         /**
       
   179          *  Contact list local name.
       
   180          *
       
   181          *  Unique name of the contact list how it it is addressed locally.
       
   182          *
       
   183          *  This name can vary from the how contact list is represented
       
   184          *  on the server side, since in some cases contact list name
       
   185          *  on the server side also includes user name of logged client.
       
   186          *
       
   187          *  @since 3.0
       
   188          *  @return Contact list local name.
       
   189          */
       
   190         virtual const TDesC& Name() const = 0;
       
   191 
       
   192 
       
   193         /**
       
   194          *  Contact list server name.
       
   195          *
       
   196          *  Name how contact list is addressed on the network server
       
   197          *  This name is not intended to be used for local addressing
       
   198          *  of the contact list. For that client should used Name() instead.
       
   199          *
       
   200          *  @since 3.0
       
   201          *  @return Contact list server name.
       
   202          */
       
   203         virtual const TDesC& ServerName() const = 0;
       
   204 
       
   205 
       
   206         /**
       
   207          *  Contact list display name.
       
   208          *
       
   209          *  Gets the contact list display name.
       
   210          *
       
   211          *  For contact lists that are unknown to Presence Engine,
       
   212          *  there doesn't exist diplay name for the list before
       
   213          *  the list is synchronized with network server.
       
   214          *
       
   215          *  @since 3.0
       
   216          *  @param aDispName On the return points to display name.
       
   217          *  @return KErrNone If there is a display name for the list.
       
   218          *  Else KErrNotFound.
       
   219          */
       
   220         virtual TInt DisplayName( TPtrC& aDispName ) const = 0;
       
   221 
       
   222 
       
   223         /**
       
   224          *  Sets a new display name for the contact list.
       
   225          *
       
   226          *  To make the name change active, contact list has to
       
   227          *  be updated to network.
       
   228          *
       
   229          *  @since 3.0
       
   230          *  @param aDisplayName New display name for the contact list.
       
   231          */
       
   232         virtual void SetDisplayNameL( const TDesC& aDisplayName ) = 0;
       
   233 
       
   234 
       
   235         /**
       
   236          *  Is the contact list the default list?
       
   237          *
       
   238          *  @since 3.0
       
   239          *  @return ETrue if contact list is the default
       
   240          *  contact list. Else EFalse.
       
   241          */
       
   242         virtual TBool IsDefault() const = 0;
       
   243 
       
   244 
       
   245     public: //Subscription attributes
       
   246 
       
   247 
       
   248         /**
       
   249          *  Gets presence attributes used for subscription.
       
   250          *
       
   251          *  When Contact list is not subscribed or presence
       
   252          *	attributes are not defined for subscription,
       
   253          *  returned array is empty
       
   254          *
       
   255          *  @since 3.0
       
   256          *  @return Assigned attributes for subscription.
       
   257          *  NULL if no attributes assigned.
       
   258          */
       
   259         virtual const RArray<TUint32>& SubscriptionAttributes() const = 0;
       
   260 
       
   261 
       
   262         /**
       
   263          *  Sets used presence attributes for subscription.
       
   264          *
       
   265          *  Sets a new set of presence attributes to be used
       
   266          *  for subscription of the contact list. Sets also the
       
   267          *  contact list as subscribed contact list. -ActivateSubscriptionL()
       
   268          *
       
   269          *  In order to subscrive all presence attributes known to the
       
   270          *	Presence Server, array should be left empty.
       
   271          *
       
   272          *  To make new subscription active, contact list has to
       
   273          *  be updated to network with the contact list transaction
       
   274          *	manager	<CPEngContactListTransaction2.h>
       
   275          *
       
   276          *  @since 3.0
       
   277          *  @param aAttributelist The attribute list to be used
       
   278          *  in subscription.
       
   279          *  @return ETrue if subscription settings were updated in any
       
   280          *  way and contact list needs to be Published/Synchronized
       
   281          */
       
   282         virtual TBool SetSubscriptionAttributesL(
       
   283             const MPEngAttributeList2& aAttributelist ) = 0;
       
   284 
       
   285         virtual TBool SetSubscriptionAttributesL(
       
   286             const TArray<TUint32>& aAttributelist ) = 0;
       
   287 
       
   288         /**
       
   289          *  Activates subscription for the contact list
       
   290          *
       
   291          *  Contact list is set as to be subscribed, set off attributes to
       
   292          *  be used for subscription is empty if not defined previously.
       
   293          *
       
   294          *  Contact list is marked to update its subscription at next
       
   295          *  contact list update transaction
       
   296          *
       
   297          *  @since 3.0
       
   298          *  @return ETrue if subscription settings were updated in any
       
   299          *  way and contact list needs to be Published/Synchronized
       
   300          */
       
   301         virtual TBool ActivateSubscriptionL() = 0;
       
   302 
       
   303         /**
       
   304          *  De Activates subscription for the contact list
       
   305          *
       
   306          *  Contact list is set as NOT to be subscribed.
       
   307          *
       
   308          *  Contact list is marked to update its subscription at next
       
   309          *  contact list update transaction
       
   310          *
       
   311          *  @since 3.0
       
   312          *  @return ETrue if subscription settings were updated in any
       
   313          *  way and contact list needs to be Published/Synchronized
       
   314          */
       
   315         virtual TBool DeActivateSubscriptionL() = 0;
       
   316 
       
   317     public: // Base settings getters
       
   318 
       
   319 
       
   320         /**
       
   321          *  Gets contact list base settings.
       
   322          *
       
   323          *  Base settings are given when the contact list is
       
   324          *  first time created and those cannot be modified later.
       
   325          *
       
   326          *  @since 3.0
       
   327          *  @param Gets contact list base settings.
       
   328          */
       
   329         virtual const TPEngContactListBaseSettings& BaseSettings() const = 0;
       
   330 
       
   331 
       
   332     public: // Property getters
       
   333 
       
   334         /**
       
   335          *  Gets a property.
       
   336          *
       
   337          *  Gets value of property.
       
   338          *  Overloaded version for different data types.
       
   339          *
       
   340          *  @since 3.0
       
   341          *  @param  aName Name of the property.
       
   342          *  @param  aLevel Level of the property to look for.
       
   343          *  @param  aValue Where value is be stored.
       
   344          *  @return KErrNone if property was found. Else KErrNotFound.
       
   345          */
       
   346         virtual TInt GetProperty( TUint aName,
       
   347                                   TUint aLevel,
       
   348                                   TInt& aValue ) const = 0;
       
   349 
       
   350         virtual TInt GetProperty( TUint aName,
       
   351                                   TUint aLevel,
       
   352                                   TPtrC8& aValue ) const = 0;
       
   353 
       
   354         virtual TInt GetProperty( TUint aName,
       
   355                                   TUint aLevel,
       
   356                                   TPtrC16& aValue ) const = 0;
       
   357 
       
   358         /**
       
   359          *  Gets a property.
       
   360          *
       
   361          *  @since 3.0
       
   362          *  @param  aName Name of the property.
       
   363          *  @param  aLevel Level of the property to look for.
       
   364          *  @return if property is found, its value, if not found
       
   365          *			zero is returned as default value
       
   366          */
       
   367         virtual TInt Property( TUint aName,
       
   368                                TUint aLevel ) const = 0;
       
   369 
       
   370     public: // Property setters
       
   371 
       
   372 
       
   373         /**
       
   374          *  Sets a property.
       
   375          *
       
   376          *  Sets value of property.
       
   377          *  Overloaded version for different data types.
       
   378          *
       
   379          *  @since 3.0
       
   380          *  @param  aName Name of the property
       
   381          *              Predefined Property names are specified above
       
   382          *				Client can also use own property names
       
   383          *  @param  aLevel Level of the property to set.
       
   384          *				Predefined levels are specified above.
       
   385          *  @param  aValue Value to be set.
       
   386          */
       
   387         virtual void SetPropertyL( TUint aName,
       
   388                                    TUint aLevel,
       
   389                                    TInt aValue ) = 0;
       
   390 
       
   391         virtual void SetPropertyL( TUint aName,
       
   392                                    TUint aLevel,
       
   393                                    const TDesC8& aValue ) = 0;
       
   394 
       
   395         virtual void SetPropertyL( TUint aName,
       
   396                                    TUint aLevel,
       
   397                                    const TDesC16& aValue ) = 0;
       
   398 
       
   399 
       
   400         /**
       
   401          *  Delete a property
       
   402          *
       
   403          *	Deletes property out of the contact list preferences
       
   404          *  Property defined by the PEC engine cannot be deleted
       
   405          *	if defined property is not found, function will do nothing
       
   406          *
       
   407          *  @since 3.0
       
   408          *  @param aName name of the property to delete
       
   409          *	@param aLevel level of the property to delete
       
   410          */
       
   411         virtual void DeletePropertyL( TUint aName, TUint aLevel ) = 0;
       
   412 
       
   413     private: //Extensions interfaces
       
   414 
       
   415 
       
   416         /**
       
   417          *  Contact list properties extension interface.
       
   418          *
       
   419          *  @since 3.0
       
   420          *  @return Contact list properties extension.
       
   421          */
       
   422         virtual MPEngContactListPropertiesExt* Extension() = 0;
       
   423         virtual const MPEngContactListPropertiesExt* Extension() const = 0;
       
   424 
       
   425 
       
   426 
       
   427 
       
   428     protected: //Destructor
       
   429 
       
   430         /**
       
   431          *  Inline virtual destructor.
       
   432          *
       
   433          *  Concrete contact list property objects
       
   434          *  can't be destroyed using this interface.
       
   435          */
       
   436         virtual ~MPEngContactListProperties() {};
       
   437     };
       
   438 
       
   439 
       
   440 #endif      //  __MPENGCONTACTLISTPROPERTIES_H
       
   441 
       
   442 //  End of File
       
   443