|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 #include "usbdisconnectingindicator.h" |
|
18 #include <QVariant> |
|
19 #include "usbindicatorplugin.h" |
|
20 #include "usbindicator.h" |
|
21 |
|
22 |
|
23 /*! |
|
24 UsbDisconnectingIndicator::UsbDisconnectingIndicator |
|
25 */ |
|
26 USBDisconnectingIndicator::USBDisconnectingIndicator(const QString &indicatorType) : |
|
27 HbIndicatorInterface(indicatorType, |
|
28 HbIndicatorInterface::ProgressCategory, |
|
29 NoInteraction) |
|
30 { |
|
31 } |
|
32 |
|
33 /*! |
|
34 USBDisconnectingIndicator::~USBDisconnectingIndicator |
|
35 */ |
|
36 USBDisconnectingIndicator::~USBDisconnectingIndicator() |
|
37 { |
|
38 } |
|
39 |
|
40 |
|
41 /*! |
|
42 USBDisconnectingIndicator::indicatorData |
|
43 returns the data and icon that needs to be displayed in the universal pop up and indicator menu |
|
44 */ |
|
45 QVariant USBDisconnectingIndicator::indicatorData(int role) const |
|
46 { |
|
47 switch(role) { |
|
48 case PrimaryTextRole: |
|
49 { |
|
50 QString text = QString(hbTrId("txt_usb_dblist_usb_disconnecting")); |
|
51 return text; |
|
52 } |
|
53 case DecorationNameRole: |
|
54 { |
|
55 QString iconName(KUsbIconFile); |
|
56 return iconName; |
|
57 } |
|
58 default: |
|
59 return QVariant(); |
|
60 } |
|
61 } |
|
62 |
|
63 /*! |
|
64 UsbDisconnectingIndicator::handleClientRequest |
|
65 handles client's activate and deactivate request |
|
66 */ |
|
67 bool USBDisconnectingIndicator::handleClientRequest( RequestType type, |
|
68 const QVariant ¶meter) |
|
69 { |
|
70 switch (type) { |
|
71 case RequestActivate: |
|
72 emit dataChanged(); |
|
73 break; |
|
74 default: |
|
75 emit deactivate(); |
|
76 break; |
|
77 } |
|
78 //request always handled |
|
79 return true; |
|
80 } |
|
81 |
|
82 |