uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactViewDefinition.cpp
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2004-2007 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:  
       
    15 :                
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include <CVPbkContactViewDefinition.h>
       
    23 
       
    24 /**
       
    25  * Creates a new contact view definition and initializes
       
    26  * it from resource. Takes a VPBK_CONTACT_VIEW resource
       
    27  * structure as a parameter.
       
    28  *
       
    29  * @param aReader A resource reader to a VPBK_CONTACT_VIEW
       
    30  *                structure.
       
    31  * @return A new instance of this class.
       
    32  */
       
    33 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL(
       
    34         TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; }
       
    35 
       
    36 /**
       
    37  * Creates a new empty contact view definition.
       
    38  * Client must then set the needed information.
       
    39  *
       
    40  * @return A new instance of this class.
       
    41  */
       
    42 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL(){  return new (ELeave) CVPbkContactViewDefinition;  }
       
    43 
       
    44 /**
       
    45  * Constructs a new contact view definition from an existing one
       
    46  * by copying the data.
       
    47  *
       
    48  * @param aViewDef A view definition to copy.
       
    49  * @return A new instance of this class.
       
    50  */
       
    51 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL(
       
    52         const CVPbkContactViewDefinition& /*aViewDef*/ ){  return new (ELeave) CVPbkContactViewDefinition;  }
       
    53 
       
    54 /**
       
    55  * Creates a new contact view definition and initializes
       
    56  * it from resource. Takes a VPBK_CONTACT_VIEW resource
       
    57  * structure as a parameter.
       
    58  *
       
    59  * @param aReader A resource reader to a VPBK_CONTACT_VIEW
       
    60  *                structure.
       
    61  * @return A new instance of this class.
       
    62  */
       
    63 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC(
       
    64         TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; }
       
    65 
       
    66 /**
       
    67  * Creates a new empty contact view definition.
       
    68  * Client must then set the needed information.
       
    69  *
       
    70  * @return A new instance of this class.
       
    71  */
       
    72 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC()
       
    73 { 
       
    74 CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition;
       
    75 CleanupStack::PushL(self);
       
    76 return self;
       
    77 
       
    78 }
       
    79 
       
    80 /**
       
    81  * Constructs a new contact view definition from an existing one
       
    82  * by copying the data.
       
    83  *
       
    84  * @param aViewDef A view definition to copy.
       
    85  * @return A new instance of this class.
       
    86  */
       
    87 EXPORT_C  CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC(
       
    88         const CVPbkContactViewDefinition& /*aViewDef*/ )
       
    89         { 
       
    90         CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition;
       
    91 		CleanupStack::PushL(self);
       
    92 		return self;
       
    93         }
       
    94 
       
    95 /**
       
    96  * Destructor.
       
    97  */
       
    98 CVPbkContactViewDefinition::~CVPbkContactViewDefinition(){ }
       
    99 
       
   100 /**
       
   101  * Returns the number of sub views owned by this view.
       
   102  *
       
   103  * @return The number of sub views.
       
   104  */
       
   105 EXPORT_C TInt CVPbkContactViewDefinition::SubViewCount() const{ return 0; }
       
   106 
       
   107 /**
       
   108  * Returns the sub view definition at aIndex.
       
   109  *
       
   110  * @param aIndex The index of the sub view definition.
       
   111  * @return The sub view definition at aIndex.
       
   112  */
       
   113 EXPORT_C const CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( 
       
   114         TInt /*aIndex*/ ) const{ return *this; }
       
   115 
       
   116 /**
       
   117  * Returns the sub view definition at aIndex.
       
   118  *
       
   119  * @param aIndex    The index to query.
       
   120  * @return The sub view definition.
       
   121  */
       
   122 EXPORT_C CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( TInt /*aIndex*/ ){ return *this; }
       
   123 
       
   124 /**
       
   125  * Returns the type of this view.
       
   126  *
       
   127  * @return The type of this view.
       
   128  */
       
   129 EXPORT_C TVPbkContactViewType CVPbkContactViewDefinition::Type() const{ return EVPbkContactsView; }
       
   130 
       
   131 /**
       
   132  * Returns ETrue if aFlag is on, otherwise EFalse.
       
   133  *
       
   134  * @param aFlag The flag to check.
       
   135  * @return A flag state.
       
   136  */
       
   137 EXPORT_C TBool CVPbkContactViewDefinition::FlagIsOn( TVPbkContactViewFlag /*aFlag*/ ) const{ return EFalse;}
       
   138 
       
   139 /**
       
   140  * Returns the URI of this view. KNullDesC if this is not a leaf node.
       
   141  *
       
   142  * @return The URI of this view or KNullDesC.
       
   143  */
       
   144 EXPORT_C const TDesC& CVPbkContactViewDefinition::Uri() const{ return KNullDesC(); }
       
   145 
       
   146 /**
       
   147  * Returns the sorting policy of this view.
       
   148  *
       
   149  * @return The sorting policy of this view.
       
   150  */
       
   151 EXPORT_C TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy() const{ return EVPbkOrderedContactView; }
       
   152 
       
   153 /**
       
   154  * Returns the name of the view. Default is KNullDesC.
       
   155  *
       
   156  * In view types EVPbkContactsView and EVPbkGroupsView
       
   157  * the name can be used as a shared view identifier by the
       
   158  * store. Shared view creation is indicated by
       
   159  * TVPbkContactViewSharing. If the name is empty for shared
       
   160  * view then store implementation uses its default name.
       
   161  * This is a preferred way to use shared views in the platform.
       
   162  * 
       
   163  * In view type EVPbkFoldingView the name is the label
       
   164  * of the only contact in the view.
       
   165  *
       
   166  * In view type EVPbkCompositeView the name has no meaning.
       
   167  *
       
   168  * @return The name of the view.
       
   169  */
       
   170 EXPORT_C const TDesC& CVPbkContactViewDefinition::Name() const{ return KNullDesC(); }
       
   171 
       
   172 /**
       
   173  * Returns the view sharing type. The store can support
       
   174  * a shared view creation for saving RAM. 
       
   175  *
       
   176  * Default value for types EVPbkContactsView and EVPbkGroupsView
       
   177  * is EVPbkSharedView. Store implementation creates
       
   178  * then a shared view if it's possible for the store.
       
   179  * Prefer using the default values for saving resources.
       
   180  * 
       
   181  * For view types EVPbkFoldingView and EVPbkCompositeView the
       
   182  * sharing has no effect.
       
   183  *
       
   184  * See also the documentation of Name()
       
   185  *
       
   186  * @return The view sharing type.
       
   187  * 
       
   188  */
       
   189 EXPORT_C TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing() const{ return EVPbkViewSharingUndefined; }
       
   190 
       
   191 /**
       
   192  * Returns the field type selector used to filter the view or NULL.
       
   193  *
       
   194  * The view contains only contacts having the fields defined
       
   195  * by the field type filter.
       
   196  *
       
   197  * @return The field type filter.
       
   198  */
       
   199 EXPORT_C CVPbkFieldTypeSelector* CVPbkContactViewDefinition::FieldTypeFilter() const{ return NULL; }
       
   200 
       
   201 /**
       
   202  * Returns the id of this view.
       
   203  *
       
   204  * @return the id of this view.
       
   205  */
       
   206 EXPORT_C TInt CVPbkContactViewDefinition::Id() const{ return 1; }
       
   207 /**
       
   208  * Adds new view as a subview. This object takes ownership
       
   209  * of the subview. If this function leaves ownership is not taken.
       
   210  *
       
   211  * @param aSubView The new subview to add.
       
   212  */
       
   213 EXPORT_C void CVPbkContactViewDefinition::AddSubViewL( CVPbkContactViewDefinition* /*aSubView*/ ){ }
       
   214 
       
   215 /**
       
   216  * Sets aType as this views type.
       
   217  *
       
   218  * @param aType The type to set.
       
   219  */
       
   220 EXPORT_C void CVPbkContactViewDefinition::SetType( TVPbkContactViewType /*aType*/ ){ }
       
   221 
       
   222 /**
       
   223  * Sets aId as this views id.
       
   224  *
       
   225  * @param aId the id to set.
       
   226  */
       
   227 EXPORT_C void CVPbkContactViewDefinition::SetId( TInt /*aId*/ ){ }
       
   228 /**
       
   229  * Sets the saFlag's state as aState.
       
   230  *
       
   231  * @param aFlag The flag to modify.
       
   232  * @param aState The state to set.
       
   233  */
       
   234 EXPORT_C void CVPbkContactViewDefinition::SetFlag( TVPbkContactViewFlag /*aFlag*/, TBool /*aState*/ ){ }
       
   235 
       
   236 /**
       
   237  * Sets aUri as this views URI. This function takes a copy of aUri.
       
   238  *
       
   239  * @param aUri The URI to set.
       
   240  */
       
   241 EXPORT_C void CVPbkContactViewDefinition::SetUriL( const TDesC& /*aUri*/ ){ }
       
   242 
       
   243 /**
       
   244  * Sets aSortPolicy as this views sorting policy.
       
   245  *
       
   246  * @param aSortPolicy The sort policy to set.
       
   247  */
       
   248 EXPORT_C void CVPbkContactViewDefinition::SetSortPolicy( TVPbkContactViewSortPolicy /*aSortPolicy*/ ){ }
       
   249 
       
   250 /**
       
   251  * Sets aName as this views Name. This function takes a copy of aName.
       
   252  *
       
   253  * @param aName The name to set.
       
   254  */
       
   255 EXPORT_C void CVPbkContactViewDefinition::SetNameL( const TDesC& /*aName*/ ){ }
       
   256 
       
   257 /**
       
   258  * Sets the view sharing type.
       
   259  *
       
   260  * @param aViewSharing One of the values defined in
       
   261  *                     VPbkContactView.hrh.
       
   262  */
       
   263 EXPORT_C void CVPbkContactViewDefinition::SetSharing( TVPbkContactViewSharing /*aViewSharing*/ ){ }
       
   264 
       
   265 /**
       
   266  * Sets the field type selector used to filter the view.
       
   267  *
       
   268  * The view contains only contacts having the fields defined
       
   269  * by the field type filter.
       
   270  *
       
   271  * @param aFilter The field type filter. Use NULL to
       
   272  *                filter nothing.
       
   273  */
       
   274 EXPORT_C void CVPbkContactViewDefinition::SetFieldTypeFilterL( CVPbkFieldTypeSelector* /*aFilter*/ ){ }
       
   275 
       
   276 /**
       
   277  * Sets the contact selector used to filter the view.
       
   278  *
       
   279  * The view contains only contacts accepted by the selector.
       
   280  *
       
   281  * @param aContactSelector The contact selector. Use NULL to
       
   282  *                filter nothing. Ownership not transferred.
       
   283  */
       
   284 EXPORT_C void CVPbkContactViewDefinition::SetContactSelector( MVPbkContactSelector* /*aContactSelector*/ ){ }
       
   285 
       
   286 /**
       
   287  * Gives either the contact selector or NULL. Ownership is not transferred.
       
   288  */
       
   289 EXPORT_C MVPbkContactSelector* CVPbkContactViewDefinition::ContactSelector() const{ return NULL; }
       
   290 
       
   291 CVPbkContactViewDefinition::CVPbkContactViewDefinition(){ }
       
   292 void CVPbkContactViewDefinition::ConstructL(){ }
       
   293 void CVPbkContactViewDefinition::ConstructL(
       
   294         const CVPbkContactViewDefinition& /*aViewDef*/ ){ }
       
   295 void CVPbkContactViewDefinition::ConstructFromResourceL(
       
   296         TResourceReader& /*aReader*/ ){ }
       
   297 void CVPbkContactViewDefinition::InitializeSharing(){ }
       
   298 
       
   299 // End of File