phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp
changeset 46 bc5a64e5bc3c
parent 45 6b911d05207e
child 50 377c906a8701
child 51 f39ed5e045e0
equal deleted inserted replaced
45:6b911d05207e 46:bc5a64e5bc3c
    13 *
    13 *
    14 * Description:  Conference call bubble handler.
    14 * Description:  Conference call bubble handler.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <QtGui>
    18 #include <QTimer>
       
    19 
    19 #include <hbaction.h>
    20 #include <hbaction.h>
    20 #include <hbtextitem.h>
    21 #include <hbtextitem.h>
    21 #include <hblabel.h>
    22 #include <hblabel.h>
    22 #include <hblistview.h>
    23 #include <hblistview.h>
    23 #include <hbcolorscheme.h>
       
    24 
    24 
    25 #include "bubblemanager2.h"
    25 #include "bubblemanager2.h"
    26 #include "bubbleconferencehandler.h"
    26 #include "bubbleconferencehandler.h"
    27 #include "bubbleconferenceheader.h"
    27 #include "bubbleconferenceheader.h"
    28 #include "bubbleutils.h"
    28 #include "bubbleutils.h"
    29 #include "bubbleparticipantlistitem.h"
    29 #include "bubbleparticipantlistitem.h"
    30 #include "bubbleparticipantlistmodel.h"
    30 #include "bubbleparticipantlistmodel.h"
    31 #include "bubblebutton.h"
    31 #include "bubblebutton.h"
       
    32 #include "bubbleheadingwidget.h"
    32 
    33 
    33 static const int BUBBLE_SELECTION_TIMEOUT = 3000;
    34 static const int BUBBLE_SELECTION_TIMEOUT = 3000;
    34 
    35 
    35 BubbleConferenceHandler::BubbleConferenceHandler(
    36 BubbleConferenceHandler::BubbleConferenceHandler(
    36     BubbleWidgetManager& widgetManager,
    37     BubbleWidgetManager& widgetManager,
    37     BubbleWidgetManager::View view,
    38     BubbleWidgetManager::View view,
    38     BubbleWidgetManager::Container container,
    39     BubbleWidgetManager::Container container,
    39     QObject* parent )
    40     QObject* parent )
    40     : BubbleHandler(widgetManager,view,container,parent)
    41     : BubbleHandler(widgetManager,view,container,parent)
    41 {
    42 {
    42     mTimerLabel =
    43     mHeading =
    43         qobject_cast<HbLabel*>(widget(BubbleWidgetManager::ConferenceTimer));
    44         qobject_cast<BubbleHeadingWidget*>(widget(BubbleWidgetManager::Heading));
    44     Q_ASSERT(mTimerLabel);
    45     Q_ASSERT(mHeading);
    45     HbDeviceProfile profile;
       
    46     HbFontSpec spec(HbFontSpec::Secondary);
       
    47     spec.setTextHeight(4*HbDeviceProfile::current().unitValue());
       
    48     mTimerLabel->setFontSpec(spec);
       
    49     mTimerLabel->setAlignment(Qt::AlignLeft);
       
    50 
    46 
    51     mButtonCenter =
    47     mButtonCenter =
    52         qobject_cast<BubbleButton*>(widget(BubbleWidgetManager::CenterButton));
    48         qobject_cast<BubbleButton*>(widget(BubbleWidgetManager::CenterButton));
    53     Q_ASSERT(mButtonCenter);
    49     Q_ASSERT(mButtonCenter);
    54     mButtonLeft =
    50     mButtonLeft =
    94 {  
    90 {  
    95     mHeader = 0;
    91     mHeader = 0;
    96 
    92 
    97     mSelectionTimer->stop();
    93     mSelectionTimer->stop();
    98     mPrototype->clearActions();
    94     mPrototype->clearActions();
    99     mTimerLabel->hide();
    95     mHeading->reset();
   100     mButtonCenter->hide();
    96     mButtonCenter->hide();
   101     mButtonCenter->setDown(false);
    97     mButtonCenter->setDown(false);
   102     mButtonCenter->disconnect();
    98     mButtonCenter->disconnect();
   103     mButtonLeft->hide();
    99     mButtonLeft->hide();
   104     mButtonLeft->setDown(false);
   100     mButtonLeft->setDown(false);
   128             participant->cli(),
   124             participant->cli(),
   129             (int)participant->callState(),
   125             (int)participant->callState(),
   130             !(mHeader->callFlags()&BubbleManagerIF::NoCiphering));
   126             !(mHeader->callFlags()&BubbleManagerIF::NoCiphering));
   131     }
   127     }
   132 
   128 
   133     if (header.timerCost().length()) {
   129     mHeading->readBubbleHeader(header);
   134         QColor color;
       
   135         color = HbColorScheme::color("list_item_title_normal");
       
   136         if (color.isValid()) {
       
   137             mTimerLabel->setTextColor(color);
       
   138         }
       
   139         mTimerLabel->setPlainText(header.timerCost());
       
   140         mTimerLabel->show();
       
   141     }
       
   142 
   130 
   143     setButtons(mHeader->actions());
   131     setButtons(mHeader->actions());
   144 
   132 
   145     clearSelection();
   133     clearSelection();
   146 }
   134 }
   192     }
   180     }
   193 }
   181 }
   194 
   182 
   195 void BubbleConferenceHandler::updateTimerDisplayNow()
   183 void BubbleConferenceHandler::updateTimerDisplayNow()
   196 {
   184 {
   197     Q_ASSERT(mHeader);
   185     mHeading->updateTimerDisplayNow();
   198 
       
   199     mTimerLabel->setPlainText(mHeader->timerCost());
       
   200     mTimerLabel->update();
       
   201 }
   186 }
   202 
   187 
   203 void BubbleConferenceHandler::handleItemSelected(
   188 void BubbleConferenceHandler::handleItemSelected(
   204     const QModelIndex & current,
   189     const QModelIndex & current,
   205     const QModelIndex & previous )
   190     const QModelIndex & previous )