emailuis/nmailuiengine/src/nmicons.cpp
changeset 20 ecc8def7944a
parent 18 578830873419
child 30 759dc5235cdb
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
    24     \brief Icon resource structure
    24     \brief Icon resource structure
    25 */
    25 */
    26 struct IconRes {
    26 struct IconRes {
    27     NmIcons::Icon id;
    27     NmIcons::Icon id;
    28     QString resName;
    28     QString resName;
       
    29     QString animXmlName;
    29 };
    30 };
    30 
    31 
    31 /*!
    32 /*!
    32     Icon array
    33     Icon array
    33 */
    34 */
    34 static IconRes icon_res[] = {
    35 static IconRes icon_res[] = {
    35     {NmIcons::NmIconDefaultMailbox, "qtg_large_email"},
    36     {NmIcons::NmIconDefaultMailbox, "qtg_large_email", ""},
    36     {NmIcons::NmIconPlusSign, "qtg_small_expand"},
    37     {NmIcons::NmIconPlusSign, "qtg_small_expand", ""},
    37     {NmIcons::NmIconMinusSign, "qtg_small_collapse"},
    38     {NmIcons::NmIconMinusSign, "qtg_small_collapse", ""},
    38     {NmIcons::NmIconAttachment, "qtg_small_attachment"},
    39     {NmIcons::NmIconAttachment, "qtg_small_attachment", ""},
    39     {NmIcons::NmIconPriorityHigh, "qtg_small_priority_high"},
    40     {NmIcons::NmIconPriorityHigh, "qtg_small_priority_high", ""},
    40     {NmIcons::NmIconPriorityLow, "qtg_small_priority_low"},
    41     {NmIcons::NmIconPriorityLow, "qtg_small_priority_low", ""},
    41     {NmIcons::NmIconAttach, "qtg_mono_attach"},
    42     {NmIcons::NmIconAttach, "qtg_mono_attach", ""},
    42     {NmIcons::NmIconSend, "qtg_mono_send"},
    43     {NmIcons::NmIconSend, "qtg_mono_send", ""},
    43     {NmIcons::NmIconContacts, "qtg_mono_contacts"},
    44     {NmIcons::NmIconContacts, "qtg_mono_contacts", ""},
    44     {NmIcons::NmIconNewEmail, "qtg_mono_create_email"},
    45     {NmIcons::NmIconNewEmail, "qtg_mono_create_email", ""},
    45     {NmIcons::NmIconDelete, "qtg_mono_delete"},
    46     {NmIcons::NmIconDelete, "qtg_mono_delete", ""},
    46     {NmIcons::NmIconForward, "qtg_mono_forward"},
    47     {NmIcons::NmIconForward, "qtg_mono_forward", ""},
    47     {NmIcons::NmIconReply, "qtg_mono_reply"},
    48     {NmIcons::NmIconReply, "qtg_mono_reply", ""},
    48     {NmIcons::NmIconReplyAll, "qtg_mono_reply_all"},
    49     {NmIcons::NmIconReplyAll, "qtg_mono_reply_all", ""},
    49     {NmIcons::NmIconSynching, "qtg_small_attachment"},
    50     {NmIcons::NmIconSynching, "qtg_anim_small_loading", "qtg_anim_small_loading.axml"},
    50     {NmIcons::NmIconOnline, "qtg_small_priority_low"},
    51     {NmIcons::NmIconOnline, "qtg_small_connected", ""},
    51     {NmIcons::NmIconDisconnected, "qtg_small_priority_high"},
    52     {NmIcons::NmIconDisconnected, "qtg_small_disconnected", ""},
    52     {NmIcons::NmIconOffline, "qtg_small_fail"},
    53     {NmIcons::NmIconOffline, "qtg_small_fail", ""},
    53     {NmIcons::NmLastItem, ""} // Last item definion.
    54     {NmIcons::NmLastItem, ""} // Last item definion.
    54 };
    55 };
    55 
    56 
    56 /*!
    57 /*!
    57     \class NmIcons
    58     \class NmIcons
    68     if (!icons[icon]) {
    69     if (!icons[icon]) {
    69         for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    70         for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    70             if (icon_res[i].id == icon) {
    71             if (icon_res[i].id == icon) {
    71                 // Branding icon check here. If branded icon is not found
    72                 // Branding icon check here. If branded icon is not found
    72                 // default icon is to be loaded.
    73                 // default icon is to be loaded.
       
    74             
       
    75                 if (icon_res[i].animXmlName.length() > 0) {
       
    76                     HbIconAnimationManager::global()->addDefinitionFile(icon_res[i].animXmlName);
       
    77                 }
    73                 icons[icon] = new HbIcon(icon_res[i].resName);
    78                 icons[icon] = new HbIcon(icon_res[i].resName);
    74                 break;
    79                 break;
    75             }
    80             }
    76         }
    81         }
    77     }
    82     }