messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 48 4f501b74aeb1
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    39 #define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("Unread Messages")
    39 #define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("Unread Messages")
    40 #define LOC_FAILED_SINGLE_MESSAGE hbTrId("Failed Message")
    40 #define LOC_FAILED_SINGLE_MESSAGE hbTrId("Failed Message")
    41 #define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("Failed Messages")
    41 #define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("Failed Messages")
    42 #define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("Outgoing Message")
    42 #define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("Outgoing Message")
    43 #define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("Outgoing Messages")
    43 #define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("Outgoing Messages")
    44 
    44 #define STATUS_MONO_NEW_MESSAGE QString("qtg_status_new_message")
       
    45 #define LOC_BUSINESSCARD hbTrId("Business card")
    45 /**
    46 /**
    46  * The number of indicators.
    47  * The number of indicators.
    47  */
    48  */
    48 static const int MsgIndicatorCount = 4;
    49 static const int MsgIndicatorCount = 4;
    49 
    50 
   114 // ----------------------------------------------------------------------------
   115 // ----------------------------------------------------------------------------
   115 // MsgIndicator::MsgIndicator
   116 // MsgIndicator::MsgIndicator
   116 // @see msgindicator.h
   117 // @see msgindicator.h
   117 // ----------------------------------------------------------------------------
   118 // ----------------------------------------------------------------------------
   118 MsgIndicator::MsgIndicator(const QString &indicatorType) :
   119 MsgIndicator::MsgIndicator(const QString &indicatorType) :
   119     HbIndicatorInterface(indicatorType, HbIndicatorInterface::GroupPriorityHigh,
   120     HbIndicatorInterface(indicatorType, HbIndicatorInterface::NotificationCategory,
   120         InteractionActivated),
   121         InteractionActivated),
   121 		mIndicatorType(NULL)
   122 		mIndicatorType(NULL)
   122 {
   123 {
   123     d_ptr = new MsgIndicatorPrivate(this);
   124     d_ptr = new MsgIndicatorPrivate(this);
   124 }
   125 }
   163     {
   164     {
   164         return mSecondaryText;
   165         return mSecondaryText;
   165     }
   166     }
   166     case DecorationNameRole:
   167     case DecorationNameRole:
   167     {
   168     {
   168         return IndicatorInfo[mIndicatorType].icon;
   169         return IndicatorInfo[mIndicatorType].icon;        
   169 
   170     }
       
   171     case MonoDecorationNameRole:
       
   172     {
       
   173         if (NewIndicatorPlugin == mIndicatorType) {
       
   174             return STATUS_MONO_NEW_MESSAGE;
       
   175         }
       
   176         else {
       
   177             // Don't show status-bar icons for indications other 
       
   178 			// than new-message
       
   179             return QVariant();
       
   180         }
   170     }
   181     }
   171     default:
   182     default:
   172         return QVariant();
   183         return QVariant();
   173     }
   184     }
   174 }
   185 }
   307         if (info.mFromSingle) {
   318         if (info.mFromSingle) {
   308             if (ECsBlueTooth == info.mMessageType) {
   319             if (ECsBlueTooth == info.mMessageType) {
   309                 QFileInfo fname(secondaryText);
   320                 QFileInfo fname(secondaryText);
   310                 secondaryText = fname.fileName();
   321                 secondaryText = fname.fileName();
   311             }
   322             }
       
   323             else if(ECsBioMsg_VCard == info.mMessageType) {
       
   324             secondaryText = LOC_BUSINESSCARD;
       
   325             }
   312         }
   326         }
   313         else {
   327         else {
   314             info.mConversationId = -100;
   328             info.mConversationId = -100;
   315         }
   329         }
   316     }
   330     }