phonebookengines/VirtualPhonebook/VPbkEng/inc/CVPbkFoldingViewContact.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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:  Virtual Phonebook folding view contact
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CVPBKFOLDINGVIEWCONTACT_H
       
    20 #define CVPBKFOLDINGVIEWCONTACT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <MVPbkViewContact.h>
       
    24 #include <MVPbkViewContactFieldCollection.h>
       
    25 #include <MVPbkViewContactField.h>
       
    26 #include <MVPbkContactFieldTextData.h>
       
    27 #include <bamdesca.h>
       
    28 
       
    29 class CVPbkFoldingContactView;
       
    30 class CVPbkFoldingViewContact;
       
    31 class MVPbkContactViewObserver;
       
    32 
       
    33 NONSHARABLE_CLASS(TFoldingViewContactTextFieldData) 
       
    34         : public MVPbkContactFieldTextData
       
    35     {
       
    36     public:
       
    37         TFoldingViewContactTextFieldData(CVPbkFoldingViewContact& aParentContact);
       
    38 
       
    39     private: // From MVPbkContactFieldTextData
       
    40         TBool IsEmpty() const;
       
    41         void CopyL(const MVPbkContactFieldData& aFieldData);
       
    42         TPtrC Text() const;
       
    43         void SetTextL(const TDesC& aText);
       
    44         TInt MaxLength() const;
       
    45 
       
    46     private: // Data
       
    47         CVPbkFoldingViewContact& iParentContact;
       
    48     };
       
    49 
       
    50 NONSHARABLE_CLASS(TFoldingViewContactField) : public MVPbkViewContactField
       
    51     {
       
    52     public: // Constructor
       
    53         TFoldingViewContactField(CVPbkFoldingViewContact& aParentContact);
       
    54 
       
    55     public:  // From MVPbkObjectHierarchy
       
    56         MVPbkObjectHierarchy& ParentObject() const;
       
    57 
       
    58     public:  // From MVPbkViewContactField
       
    59         MVPbkBaseContact& ParentContact() const;
       
    60         const MVPbkFieldType* MatchFieldType(TInt aMatchPriority) const;
       
    61         const MVPbkFieldType* BestMatchingFieldType() const;
       
    62         const MVPbkContactFieldData& FieldData() const;
       
    63         TBool IsSame(const MVPbkBaseContactField& aOther) const;
       
    64 
       
    65     private: // Data
       
    66         /// Ref: Parent contact
       
    67         CVPbkFoldingViewContact& iParentContact;
       
    68         TFoldingViewContactTextFieldData iFieldData;
       
    69         /// Field type
       
    70         mutable const MVPbkFieldType* iFieldType;
       
    71     };
       
    72 
       
    73 NONSHARABLE_CLASS(TFoldingViewFieldCollection) 
       
    74         : public MVPbkViewContactFieldCollection
       
    75     {
       
    76     public: // Construction
       
    77         TFoldingViewFieldCollection(CVPbkFoldingViewContact& aParentContact);
       
    78 
       
    79     public: // From MVPbkViewContactFieldCollection
       
    80         MVPbkBaseContact& ParentContact() const;
       
    81         TInt FieldCount() const;
       
    82         const MVPbkBaseContactField& FieldAt(TInt aIndex) const;
       
    83         
       
    84     private: // Data
       
    85         /// Ref: Parent contact
       
    86         CVPbkFoldingViewContact& iParentContact;
       
    87 
       
    88         TFoldingViewContactField iContactField;
       
    89     };
       
    90 
       
    91 NONSHARABLE_CLASS(CVPbkFoldingViewContact) : public CBase,
       
    92                                 public MVPbkViewContact
       
    93     {
       
    94     public:
       
    95         static CVPbkFoldingViewContact* NewL(CVPbkFoldingContactView& aParentView);
       
    96 
       
    97     public: // Interface
       
    98         CVPbkFoldingContactView& NativeParentView() const;
       
    99 
       
   100     public: // From MVPbkViewContact
       
   101         const MVPbkBaseContactFieldCollection& Fields() const;
       
   102         TBool IsSame(const MVPbkStoreContact& aOtherContact) const;
       
   103         TBool IsSame(const MVPbkViewContact& aOtherContact) const;
       
   104         MVPbkContactLink* CreateLinkLC() const;
       
   105         void DeleteL(MVPbkContactObserver& aObserver) const;
       
   106         MVPbkContactViewBase& ParentView() const;
       
   107         void ReadL(MVPbkContactObserver& aObserver) const;
       
   108         void ReadAndLockL(MVPbkContactObserver& aObserver) const;
       
   109         MVPbkExpandable* Expandable() const;
       
   110         TBool IsSame(const MVPbkViewContact& aOtherContact, 
       
   111                      const MVPbkContactStore* aContactStore) const;
       
   112         TBool IsSame(const MVPbkStoreContact& aOtherContact, 
       
   113                      const MVPbkContactStore* aContactStore) const;
       
   114         TBool MatchContactStore(const TDesC& aContactStoreUri) const;
       
   115         TBool MatchContactStoreDomain(const TDesC& aContactStoreDomain) const;
       
   116         MVPbkContactBookmark* CreateBookmarkLC() const;        
       
   117         
       
   118     private: // Implementation
       
   119         CVPbkFoldingViewContact(CVPbkFoldingContactView& aParentView);
       
   120 
       
   121     private: // Data
       
   122         /// Ref: Parent view of this contact
       
   123         CVPbkFoldingContactView& iParentView;
       
   124         TFoldingViewFieldCollection iFields;
       
   125     };
       
   126 
       
   127 inline CVPbkFoldingContactView& CVPbkFoldingViewContact::NativeParentView() const
       
   128     {
       
   129     return iParentView;
       
   130     }
       
   131 
       
   132 #endif // CVPBKFOLDINGVIEWCONTACT_H
       
   133 //End of file
       
   134 
       
   135