phonebookui/Phonebook2/inc/CPbk2AiwInterestItemBase.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:  Phonebook 2 AIW interest item base.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2AIWINTERESTITEMBASE_H
       
    20 #define CPBK2AIWINTERESTITEMBASE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2AiwInterestItem.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CAiwServiceHandler;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  * Phonebook 2 AIW interest item base.
       
    33  */
       
    34 class CPbk2AiwInterestItemBase : public CActive,
       
    35                                  public MPbk2AiwInterestItem
       
    36     {
       
    37     public: // Constructors and destructor
       
    38 
       
    39         /**
       
    40          * Creates a new instance of this class.
       
    41          *
       
    42          * @param aInterestId       Interest id.
       
    43          * @param aServiceHandler   AIW service handler.
       
    44          * @return  A new instance of this class.
       
    45          */
       
    46         IMPORT_C CPbk2AiwInterestItemBase(
       
    47                 TInt aInterestId,
       
    48                 CAiwServiceHandler& aServiceHandler );
       
    49 
       
    50         /**
       
    51          * Destructor.
       
    52          */
       
    53         virtual ~CPbk2AiwInterestItemBase(){}
       
    54 
       
    55     public: // Interface
       
    56 
       
    57         /**
       
    58          * Check if this object has already attached into 
       
    59          * a menupane.
       
    60          *
       
    61          * @param aMenuResourceId       Menu resource id.
       
    62          * @return  ETrue if already attached to menu, 
       
    63          *          EFalse if not attached.
       
    64          */
       
    65         IMPORT_C TBool IsMenuPaneAttached(
       
    66                 TInt aMenuResourceId );
       
    67 
       
    68     public: // From MPbk2AiwInterestItem
       
    69         IMPORT_C TInt InterestId() const;
       
    70         IMPORT_C void AttachL(
       
    71                 TInt aMenuResourceId,
       
    72                 TInt aInterestResourceId,
       
    73                 TBool aAttachBaseServiceInterest );
       
    74   
       
    75     private: // Data structures
       
    76         struct TAttachedResources
       
    77             {
       
    78             TAttachedResources()
       
    79                 {
       
    80                 iMenuResourceId = 0;
       
    81                 iInterestResourceId = 0;
       
    82                 iBaseServiceAttached = 0;
       
    83                 }
       
    84             TInt iMenuResourceId;
       
    85             TInt iInterestResourceId;
       
    86             TBool iBaseServiceAttached;
       
    87             };
       
    88 
       
    89     protected: // Data
       
    90         /// Ref: AIW service handler
       
    91         CAiwServiceHandler& iServiceHandler;
       
    92 
       
    93     private: // Data
       
    94         /// Own: Interest id
       
    95         TInt iInterestId;
       
    96         /// Own: Attached resources
       
    97         CArrayFixFlat<TAttachedResources> iAttachedResources;
       
    98     };
       
    99 
       
   100 #endif // CPBK2AIWINTERESTITEMBASE_H
       
   101             
       
   102 // End of File