phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 30 ebdbd102c78a
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
    36     HbListViewItem(parent),
    36     HbListViewItem(parent),
    37     mStylePluginName(stylePluginName),
    37     mStylePluginName(stylePluginName),
    38     mButtonStyle(buttonStyle),
    38     mButtonStyle(buttonStyle),
    39     mBackground(0),
    39     mBackground(0),
    40     mText(0),
    40     mText(0),
    41     mIcon(0),
    41     mStatusIcon(0),
       
    42     mCipheringIcon(0),
       
    43     mExpandIcon(0),
    42     mButton1(0),
    44     mButton1(0),
    43     mButton2(0),
    45     mButton2(0),
    44     mExpanded(false)
    46     mExpanded(false)
    45 {
    47 {
    46     mStylePluginBaseId = style()->registerPlugin(mStylePluginName);
    48     mStylePluginBaseId = style()->registerPlugin(mStylePluginName);
    79         if ( mText ) {
    81         if ( mText ) {
    80             style()->setItemName( mText, "text" );
    82             style()->setItemName( mText, "text" );
    81         }
    83         }
    82     }
    84     }
    83 
    85 
    84     if (!mIcon) {
    86     if (!mCipheringIcon) {
    85         mIcon = style()->createPrimitive(
    87         mCipheringIcon = style()->createPrimitive(
       
    88                 (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon), this);
       
    89         if ( mCipheringIcon ) {
       
    90             style()->setItemName( mCipheringIcon, "ciphering" );
       
    91         }
       
    92     }
       
    93 
       
    94     if (!mStatusIcon) {
       
    95         mStatusIcon = style()->createPrimitive(
    86                 (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), this);
    96                 (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), this);
    87         if ( mIcon ) {
    97         if ( mStatusIcon ) {
    88             style()->setItemName( mIcon, "icon" );
    98             style()->setItemName( mStatusIcon, "icon" );
       
    99         }
       
   100     }
       
   101 
       
   102     if (!mExpandIcon) {
       
   103         mExpandIcon = new HbIconItem(this);
       
   104         if ( mExpandIcon ) {
       
   105             style()->setItemName( mExpandIcon, "expand-indi" );
    89         }
   106         }
    90     }
   107     }
    91 
   108 
    92     BubbleParticipantListItem* p =
   109     BubbleParticipantListItem* p =
    93             static_cast<BubbleParticipantListItem*>(prototype());
   110             static_cast<BubbleParticipantListItem*>(prototype());
   148     // check canConvert()
   165     // check canConvert()
   149     option.mCallState = (BubbleManagerIF::PhoneCallState)
   166     option.mCallState = (BubbleManagerIF::PhoneCallState)
   150                          modelIndex().data(Qt::DecorationRole).toInt();
   167                          modelIndex().data(Qt::DecorationRole).toInt();
   151     option.mText1 = modelIndex().data(Qt::DisplayRole).toString();
   168     option.mText1 = modelIndex().data(Qt::DisplayRole).toString();
   152     option.mCliLineNumber = 1;
   169     option.mCliLineNumber = 1;
   153 
   170     bool ciphering = modelIndex().data(Qt::StatusTipRole).toBool();
       
   171     if (!ciphering) {
       
   172         option.mCallFlags = BubbleManagerIF::NoCiphering;
       
   173     }
   154 
   174 
   155     if (mBackground) {
   175     if (mBackground) {
   156         style()->updatePrimitive(
   176         style()->updatePrimitive(
   157             mBackground,
   177             mBackground,
   158             (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame),
   178             (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame),
   164             mText,
   184             mText,
   165             (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text),
   185             (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text),
   166             &option);
   186             &option);
   167     }
   187     }
   168 
   188 
   169     if (mIcon) {
   189     if (mStatusIcon) {
   170         style()->updatePrimitive(
   190         style()->updatePrimitive(
   171             mIcon,
   191             mStatusIcon,
   172             (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon),
   192             (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon),
   173             &option );
   193             &option );
       
   194     }
       
   195 
       
   196     if (mCipheringIcon) {
       
   197         style()->updatePrimitive(
       
   198             mCipheringIcon,
       
   199             (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon),
       
   200             &option );
       
   201     }
       
   202 
       
   203     if (mExpandIcon) {
       
   204         if (mExpanded) {
       
   205             mExpandIcon->setIcon(HbIcon("qtg_small_expand"));
       
   206         } else {
       
   207             mExpandIcon->setIcon(HbIcon("qtg_small_collapse"));
       
   208         }
   174     }
   209     }
   175 
   210 
   176     repolish();
   211     repolish();
   177 }
   212 }
   178 
   213 
   182         setProperty("layoutOption","expanded");
   217         setProperty("layoutOption","expanded");
   183     } else {
   218     } else {
   184         setProperty("layoutOption","collapsed");
   219         setProperty("layoutOption","collapsed");
   185     }
   220     }
   186 
   221 
   187     HbWidget::polish(params);
   222     HbListViewItem::polish(params);
   188 }
   223 }
   189 
   224 
   190 void BubbleParticipantListItem::receivedFocus()
   225 void BubbleParticipantListItem::receivedFocus()
   191 {
   226 {
   192     HbListViewItem::receivedFocus();
   227     HbListViewItem::receivedFocus();