phoneapp/phoneuiqtviewadapter/inc/phonebubblewrapper.h
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*!
       
     2 * Copyright (c) 2009 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 wrapper.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PHONEBUBBLEWRAPPER_H
       
    19 #define PHONEBUBBLEWRAPPER_H
       
    20 
       
    21 #include <exception> // must be before e32base.h so uncaught_exception gets defined
       
    22 #include <e32base.h>
       
    23 #include <QObject>
       
    24 #include <QMap>
       
    25 
       
    26 class BubbleManagerIF;
       
    27 class HbAction;
       
    28 
       
    29 class PhoneBubbleWrapper : public QObject
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Constructor
       
    37      */
       
    38     PhoneBubbleWrapper (BubbleManagerIF& bubble, QObject *parent = 0);
       
    39     
       
    40     /**
       
    41      * Destructor
       
    42      */
       
    43     virtual ~PhoneBubbleWrapper ();
       
    44     
       
    45     void updateCallState (int callId, int newState);
       
    46     
       
    47     int callId (int state);
       
    48     
       
    49     int createCallHeader (int callId);
       
    50 
       
    51     void removeCallHeader (int callId);
       
    52     
       
    53     void setState (int callId, int bubble, int callState);
       
    54     
       
    55     void setLabel (int bubble, const TDesC &text);
       
    56     
       
    57     void setCli (int bubble, const TDesC &cliText);
       
    58     
       
    59     void setSecondaryCli (int bubble, const TDesC &cliText);
       
    60     
       
    61     void setCallType (int bubble, int callType);
       
    62 
       
    63     BubbleManagerIF& bubbleManager ();
       
    64     
       
    65     int bubbleId (int callId);
       
    66     
       
    67     void setDivert (int bubble, bool enabled);
       
    68 
       
    69     int activeCallCount();    
       
    70     
       
    71     QMap<int, int> callStates() const;
       
    72     
       
    73     QMap<int, int> bubbles() const;
       
    74     
       
    75     void createConferenceBubble(int callId, int callState,
       
    76             const TDesC &labelText, const TDesC &cliText);
       
    77     
       
    78     void setConferenceCallId(int callId);
       
    79     
       
    80     QList<int> conferenceCallList() const;
       
    81     
       
    82     void removeConferenceCallId(int callId);
       
    83     
       
    84     bool conferenceCallId(int callId) const;
       
    85     
       
    86     void removeCallFromConference(int callId);
       
    87     
       
    88     void removeConferenceBubble();
       
    89     
       
    90     int callIdByBubbleId(int bubbleId);
       
    91     
       
    92     void addToConferenceBubble();
       
    93     
       
    94     void setServiceId(int callId, int serviceId);
       
    95     
       
    96     int serviceIdByCallId(int callId) const;
       
    97     
       
    98     QMap<int,int> serviceIds() const;
       
    99     
       
   100 private:
       
   101 
       
   102     int callIdForConference();
       
   103     
       
   104     bool getCallIdsForConference(int &first, int &second);
       
   105     
       
   106 private:
       
   107 
       
   108     BubbleManagerIF& m_bubbleManager;
       
   109     
       
   110     // Call id - call state map
       
   111     QMap<int, int> m_callStates;
       
   112     
       
   113     // Call id - bubble id map
       
   114     QMap<int, int> m_bubbles;
       
   115     
       
   116     // Call id - service id map
       
   117     QMap<int, int> m_services;
       
   118     
       
   119     // Conference call id list
       
   120     QList<int>     m_conferenceList;
       
   121 };
       
   122 
       
   123 #endif // PHONEBUBBLEWRAPPER_H