phonebookengines/VirtualPhonebook/VPbkEng/inc/CVPbkTopContactManagerImpl.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Top Contact manager implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VPBKTOPCONTACTMANAGERIMPL_H
       
    20 #define VPBKTOPCONTACTMANAGERIMPL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MVPbkContactLink;
       
    27 class MVPbkContactLinkArray;
       
    28 class MVPbkContactOperationBase;
       
    29 class CVPbkContactManager;
       
    30 class MVPbkContactViewBase;
       
    31 class MVPbkBaseContact;
       
    32 class MVPbkContactFieldTextData;
       
    33 class TVPbkContactStoreUriPtr;
       
    34 class MVPbkOperationObserver;
       
    35 template <typename T>
       
    36 class MVPbkOperationResultObserver;
       
    37 class MVPbkOperationErrorObserver;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42  * Implementation class for managing Top Contact properties of contacts.
       
    43  */
       
    44 NONSHARABLE_CLASS( CVPbkTopContactManagerImpl ):
       
    45     public CBase
       
    46     {
       
    47     public:
       
    48     	/**
       
    49          * Creates the top contact manager.
       
    50     	 * @param aContactManager Contact manager which already has its stores opened.
       
    51     	 * 
       
    52     	 * @return Top contact manager instance
       
    53     	 */
       
    54         static CVPbkTopContactManagerImpl* NewL(
       
    55                 CVPbkContactManager& aContactManager );
       
    56         
       
    57         /**
       
    58          * Creates the top contact manager passing an already constructed top
       
    59          * contacts view as a parameter. This greatly improves performance of adding 
       
    60          * new favorites as the top contact view contsrution can be a heavy operation.
       
    61          * 
       
    62          * Note, passing the view doesn't affect the view and links fetching 
       
    63          * (e.g. GetTopContactsViewL, GetTopContactLinksL, etc.)
       
    64          * 
       
    65          * @param aContactManager Contact manager which already has its stores opened.
       
    66          * @param aTopView top contact view which already has been constructed.
       
    67          * 
       
    68          * @return Top contact manager instance
       
    69          */
       
    70         static CVPbkTopContactManagerImpl* NewL(
       
    71                CVPbkContactManager& aContactManager,
       
    72                MVPbkContactViewBase& aTopView);
       
    73 
       
    74         /**
       
    75          * Creates the top contact manager impl.
       
    76          * Holds its own CVPbkContactManager instance.
       
    77          * 
       
    78          * @return Top contact manager instance 
       
    79          */
       
    80         static CVPbkTopContactManagerImpl* NewL();
       
    81 
       
    82         ~CVPbkTopContactManagerImpl();
       
    83 
       
    84     public:
       
    85         /// @see CVPbkTopContactManager
       
    86         MVPbkContactOperationBase* GetTopContactsViewL(
       
    87                 MVPbkOperationResultObserver<MVPbkContactViewBase*>& aObserver,
       
    88                 MVPbkOperationErrorObserver& aErrorObserver );
       
    89 
       
    90         /// @see CVPbkNonTopContactManager
       
    91         MVPbkContactOperationBase* GetNonTopContactsViewL(
       
    92                 MVPbkOperationResultObserver<MVPbkContactViewBase*>& aObserver,
       
    93                 MVPbkOperationErrorObserver& aErrorObserver );
       
    94 
       
    95         /// @see CVPbkTopContactManager
       
    96         MVPbkContactOperationBase* GetTopContactLinksL(
       
    97                 MVPbkOperationResultObserver<MVPbkContactLinkArray*>& aObserver,
       
    98                 MVPbkOperationErrorObserver& aErrorObserver );
       
    99         
       
   100         MVPbkContactOperationBase* GetNonTopContactLinksL(
       
   101                 MVPbkOperationResultObserver<MVPbkContactLinkArray*>& aObserver,
       
   102                 MVPbkOperationErrorObserver& aErrorObserver );
       
   103         
       
   104         /// @see CVPbkTopContactManager
       
   105         MVPbkContactOperationBase* AddToTopL(
       
   106                 const MVPbkContactLink& aContactLink,
       
   107                 MVPbkOperationObserver& aObserver,
       
   108                 MVPbkOperationErrorObserver& aErrorObserver );
       
   109 
       
   110         /// @see CVPbkTopContactManager
       
   111         MVPbkContactOperationBase* AddToTopL(
       
   112                 const MVPbkContactLinkArray& aContactLinks,
       
   113                 MVPbkOperationObserver& aObserver,
       
   114                 MVPbkOperationErrorObserver& aErrorObserver );
       
   115 
       
   116         /// @see CVPbkTopContactManager
       
   117         MVPbkContactOperationBase* AddToTopL(
       
   118                 const TDesC8& aPackedLinks,
       
   119                 MVPbkOperationObserver& aObserver,
       
   120                 MVPbkOperationErrorObserver& aErrorObserver );
       
   121 
       
   122         /// @see CVPbkTopContactManager
       
   123         MVPbkContactOperationBase* RemoveFromTopL(
       
   124         	const MVPbkContactLink& aContactLink,
       
   125         	MVPbkOperationObserver& aObserver,
       
   126         	MVPbkOperationErrorObserver& aErrorObserver );
       
   127 
       
   128         /// @see CVPbkTopContactManager
       
   129         MVPbkContactOperationBase* RemoveFromTopL(
       
   130         	const MVPbkContactLinkArray& aContactLinks,
       
   131         	MVPbkOperationObserver& aObserver,
       
   132         	MVPbkOperationErrorObserver& aErrorObserver );
       
   133 
       
   134         /// @see CVPbkTopContactManager
       
   135         MVPbkContactOperationBase* RemoveFromTopL(
       
   136         	const TDesC8& aPackedLinks,
       
   137         	MVPbkOperationObserver& aObserver,
       
   138         	MVPbkOperationErrorObserver& aErrorObserver );
       
   139 
       
   140         /// @see CVPbkTopContactManager
       
   141         MVPbkContactOperationBase* SetTopOrderL(
       
   142 	    	const MVPbkContactLinkArray& aContactLinks,
       
   143 	    	MVPbkOperationObserver& aObserver,
       
   144 	    	MVPbkOperationErrorObserver& aErrorObserver );
       
   145 
       
   146         /// @see CVPbkTopContactManager
       
   147         static TBool IsTopContact ( const MVPbkBaseContact& aContact );
       
   148         
       
   149     private: // construction
       
   150         void ConstructL();
       
   151         CVPbkTopContactManagerImpl();
       
   152 
       
   153     private: // data
       
   154         // Client's contact manager
       
   155         // or reference to own contact manager iOurContactManager
       
   156         CVPbkContactManager* iContactManager; // not owned
       
   157         CVPbkContactManager* iOurContactManager; // owned
       
   158         
       
   159         // Reference to a clients top contact view 
       
   160         MVPbkContactViewBase* iTopView; // not owned
       
   161     };
       
   162 
       
   163 #endif //VPBKTOPCONTACTMANAGERIMPL_H
       
   164 //End of file