phoneapp/phoneuiview/inc/phonebubbleextension.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Bubble extension plugin wrapper
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPHONEBUBBLEEXTENSION_H
       
    20 #define C_CPHONEBUBBLEEXTENSION_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <telbubbleextensionobserver.h>
       
    24 #include <telbubbleextensioninterface.h>
       
    25 
       
    26 class CTelBubbleCustomElement;
       
    27 class MTelBubbleExtensionData;
       
    28 class CTelBubbleExtension;
       
    29 class CBubbleManager;
       
    30 
       
    31 /**
       
    32  *  Bubble extension plugin wrapper
       
    33  *  This class wraps a plugin, hiding the actual plugin from the
       
    34  *  phoneapp and phoneapp from the plugin.
       
    35  *
       
    36  *  @lib ?library
       
    37  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    38  */
       
    39 class CPhoneBubbleExtension : public CBase,
       
    40                               public MTelBubbleExtensionObserver,
       
    41                               public MTelBubbleExtensionInterface
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      *
       
    48      * @param aBubbleManager Reference to bubble manager
       
    49      * @param aUid Plugin UID
       
    50      * @param aPriority Priority of the plugin
       
    51      */
       
    52     static CPhoneBubbleExtension* NewL(
       
    53             CBubbleManager& aBubbleManager,
       
    54             TUid aUid,
       
    55             TUint8 aPriority );
       
    56 
       
    57     /**
       
    58      * Two-phased constructor.
       
    59      *
       
    60      * @param aBubbleManager Reference to bubble manager
       
    61      * @param aUid Plugin UID
       
    62      * @param aPriority Priority of the plugin
       
    63      */
       
    64     static CPhoneBubbleExtension* NewLC(
       
    65             CBubbleManager& aBubbleManager,
       
    66             TUid aUid,
       
    67             TUint8 aPriority );
       
    68 
       
    69     /**
       
    70     * Destructor.
       
    71     */
       
    72     virtual ~CPhoneBubbleExtension();
       
    73 
       
    74 // from base class MTelBubbleExtensionObserver
       
    75 
       
    76     /**
       
    77      * Call this before attach, detach and replace operations,
       
    78      * when doing multipe changes outside BubbleUpdating() method. 
       
    79      * UI is not redrawn until calling EndChanges() is called. 
       
    80      */
       
    81     void StartChanges();
       
    82     
       
    83     /**
       
    84      * Call this when all changes have been done and UI can be
       
    85      * redrawn.
       
    86      */
       
    87     void EndChanges();
       
    88     
       
    89     /**
       
    90      * Attaches element to bubble. Causes redraw.
       
    91      *
       
    92      * @param aBubbleId Bubble id
       
    93      * @param aElement Element to be attached, ownership is not transferred
       
    94      */
       
    95     void AttachElement( TInt aBubbleId, CTelBubbleCustomElement* aElement );
       
    96 
       
    97     /**
       
    98      * Replaces element in bubble. Causes redraw.
       
    99      *
       
   100      * @param aId Bubble id
       
   101      * @param aOld Element to be detached, ownership is not transferred
       
   102      * @param aNew Element to be attached, ownership is not transferred
       
   103      */
       
   104     void ReplaceElement(
       
   105             TInt aBubbleId,
       
   106             CTelBubbleCustomElement* aOld,
       
   107             CTelBubbleCustomElement* aNew );
       
   108 
       
   109     /**
       
   110      * Detaches element in bubble. Causes redraw.
       
   111      *
       
   112      * @param aId Bubble id
       
   113      * @param aElement Element to be detached, ownership is not transferred
       
   114      */
       
   115     void DetachElement( TInt aBubbleId, CTelBubbleCustomElement* aElement );
       
   116 
       
   117 
       
   118 // from base class MTelBubbleExtensionInterface
       
   119 
       
   120     /**
       
   121      * Notifies that a new customizable bubble is available
       
   122      *
       
   123      * @param aCallData Reference to call data.
       
   124      */
       
   125     void StartCustomizedBubble( MTelBubbleExtensionData& aCallData );
       
   126 
       
   127     /**
       
   128      * Notifies that a customizable bubble has been removed
       
   129      *
       
   130      * @param aCallData Reference to call data.
       
   131      */
       
   132     void StopCustomizedBubble( MTelBubbleExtensionData& aCallData );
       
   133 
       
   134     /**
       
   135      * Indicates that currently bubble drawing is started.
       
   136      * Customizing is preferred to be done during this call.
       
   137      */
       
   138     void BubbleUpdating();
       
   139 
       
   140 private:
       
   141 
       
   142     /**
       
   143      * First-phase constructor.
       
   144      *
       
   145      * @param aBubbleManager Reference to bubble manager
       
   146      * @param aUid Plugin UID
       
   147      * @param aPriority Priority of the plugin
       
   148      */
       
   149     CPhoneBubbleExtension( CBubbleManager& aBubbleManager, TUid aUid, TUint8 aPriority );
       
   150 
       
   151     void ConstructL();
       
   152 
       
   153 private: // data
       
   154 
       
   155     /**
       
   156      * Bubble manager reference
       
   157      */
       
   158     CBubbleManager& iBubbleManager;
       
   159 
       
   160     /**
       
   161      * Plugin UID
       
   162      */
       
   163     const TUid iUid;
       
   164 
       
   165     /**
       
   166      * Plugin priority
       
   167      */
       
   168     const TUint8 iPriority;
       
   169 
       
   170     /**
       
   171      * Loaded plugin.
       
   172      * Own.
       
   173      */
       
   174     CTelBubbleExtension* iPlugin;
       
   175 
       
   176     };
       
   177 
       
   178 #endif // C_CPHONEBUBBLEEXTENSION_H