Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTIcons.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTIcons.cpp | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTIcons.cpp b/noncore/settings/networksettings2/opietooth2/OTIcons.cpp new file mode 100644 index 0000000..8b58b75 --- a/dev/null +++ b/noncore/settings/networksettings2/opietooth2/OTIcons.cpp | |||
@@ -0,0 +1,120 @@ | |||
1 | #include <OTIcons.h> | ||
2 | |||
3 | #include <opie2/odebug.h> | ||
4 | #include <qpe/resource.h> | ||
5 | |||
6 | using namespace Opietooth2; | ||
7 | |||
8 | OTIcons::OTIcons() : deviceIcons(), serviceIcons() { | ||
9 | |||
10 | // still need to find out real ids | ||
11 | deviceIcons.insert( "unknown", "unknown_16" ); | ||
12 | deviceIcons.insert( "misc", "misc_16" ); | ||
13 | deviceIcons.insert( "computer", "computer_16" ); | ||
14 | deviceIcons.insert( "phone", "phone_16" ); | ||
15 | deviceIcons.insert( "lan", "network_16" ); | ||
16 | deviceIcons.insert( "audiovideo", "audio_16" ); | ||
17 | deviceIcons.insert( "peripheral", "print_16" ); | ||
18 | deviceIcons.insert( "imaging", "other_16" ); | ||
19 | |||
20 | serviceIcons.insert( 0x1101 , "serial_16" ); //SerialPort | ||
21 | serviceIcons.insert( 0x1102 , "network_16" ); //LANAccessUsingPPP | ||
22 | serviceIcons.insert( 0x1103 , "network_16"); //DialupNetworking | ||
23 | serviceIcons.insert( 0x1104 , "sync_16" ); //IrMCSync | ||
24 | serviceIcons.insert( 0x1105 , "obex_16" ); //OBEXObjectPush | ||
25 | serviceIcons.insert( 0x1106 , "obex_16" ); //OBEXFileTransfer | ||
26 | serviceIcons.insert( 0x1107 , "sync_16" ); //IrMCSyncCommand | ||
27 | serviceIcons.insert( 0x1108 , "phone_16"); // Headset | ||
28 | serviceIcons.insert( 0x1109 , "phone_16"); // CordlessTelephony | ||
29 | serviceIcons.insert( 0x110A , "audio_16"); // AudioSource | ||
30 | serviceIcons.insert( 0x110B , "audio_16"); // AudioSink | ||
31 | //serviceIcons.insert( 0x110C , "remotecontrol_16" ); // remote control target --- | ||
32 | //serviceIcons.insert( 0x110D , "audio_16" ); // advanced audio distribution --- | ||
33 | //serviceIcons.insert( 0x110E , "remotecontrol_16" ); // remote control --- | ||
34 | //serviceIcons.insert( 0x110F , "video_16" ); // video conferencing --- | ||
35 | //serviceIcons.insert( 0x1110 , "audio_16" ); // intercom --- | ||
36 | serviceIcons.insert( 0x1111 , "fax_16" ); //Fax | ||
37 | serviceIcons.insert( 0x1112 , "audio_16"); //HeadsetAudioGateway | ||
38 | //serviceIcons.insert( 0x1113 , "wap_16" ); // WAP --- | ||
39 | //serviceIcons.insert( 0x1114 , "wap_16" ); // WAP client --- | ||
40 | serviceIcons.insert( 0x1115 , "network_16"); // Network Access Point (PANU) | ||
41 | serviceIcons.insert( 0x1116 , "network_16"); // Network Access Point (NAP) | ||
42 | serviceIcons.insert( 0x1117 , "network_16"); // Network Access Point (GN) | ||
43 | serviceIcons.insert( 0x1118 , "print_16" ); // direct printing | ||
44 | serviceIcons.insert( 0x1119 , "print_16" ); // reference printing | ||
45 | //serviceIcons.insert( 0x111A , "image_16" ); // imaging --- | ||
46 | //serviceIcons.insert( 0x111B , "image_16" ); // imaging responder --- | ||
47 | //serviceIcons.insert( 0x111C , "image_16" ); // imaging automatic archive --- | ||
48 | //serviceIcons.insert( 0x111D , "image_16" ); // imaging referenced objects --- | ||
49 | //serviceIcons.insert( 0x111E , "handsfree_16" ); // handsfree --- | ||
50 | //serviceIcons.insert( 0x111F , "handsfree_16" ); // handsfree audio gateway --- | ||
51 | serviceIcons.insert( 0x1120 , "print_16" ); // direct printing referenced object service | ||
52 | //serviceIcons.insert( 0x1121 , "handsfree_16" ); // reflected UI --- | ||
53 | serviceIcons.insert( 0x1122 , "print_16" ); // basic printing | ||
54 | serviceIcons.insert( 0x1123 , "print_16" ); // printing status | ||
55 | //serviceIcons.insert( 0x1124 , "handsfree_16" ); // human interface device service --- | ||
56 | //serviceIcons.insert( 0x1125 , "handsfree_16" ); // hardcopy cable replacement --- | ||
57 | serviceIcons.insert( 0x1126 , "print_16" ); // HCR print | ||
58 | serviceIcons.insert( 0x1127 , "print_16" ); // HCR scan | ||
59 | serviceIcons.insert( 0x1128 , "phone_16" ); // Common_ISDN_Access | ||
60 | //serviceIcons.insert( 0x1129 , "audio_16" ); // video conferencing GW --- | ||
61 | //serviceIcons.insert( 0x112C , "audio_16" ); // audio video --- | ||
62 | //serviceIcons.insert( 0x112D , "phone_16" ); // SIM access --- | ||
63 | serviceIcons.insert( 0x1201 , "network_16" ); //GenericNetworking | ||
64 | serviceIcons.insert( 0x1202 , "folder_16" ); //GenericFileTransfer | ||
65 | serviceIcons.insert( 0x1203 , "audio_16" ); //GenericAudio | ||
66 | serviceIcons.insert( 0x1204 , "phone_16" ); //GenericTelephony | ||
67 | //serviceIcons.insert( 0x1303 , "video_16" ); // video source --- | ||
68 | //serviceIcons.insert( 0x1304 , "video_16" ); // video sink --- | ||
69 | |||
70 | Modems.resize( 3 ); | ||
71 | Modems[0].setUUID32( 0x1101 ); // SerialPort | ||
72 | Modems[1].setUUID32( 0x1102 ); // Lan access using PPP | ||
73 | Modems[2].setUUID32( 0x1103 ); // DialupNetworking | ||
74 | |||
75 | Networks.resize( 3 ); | ||
76 | Networks[0].setUUID32( 0x1115 ); // PANU | ||
77 | Networks[1].setUUID32( 0x1116 ); // NAP | ||
78 | Networks[2].setUUID32( 0x1117 ); // GN | ||
79 | } | ||
80 | |||
81 | OTIcons::~OTIcons() { | ||
82 | } | ||
83 | |||
84 | QPixmap OTIcons::deviceIcon( const QString & deviceClass ) { | ||
85 | |||
86 | QString iconName; | ||
87 | |||
88 | QMap<QString, QString>::Iterator it; | ||
89 | |||
90 | it = deviceIcons.find( deviceClass ); | ||
91 | iconName = it.data(); | ||
92 | |||
93 | if ( iconName.isEmpty() ) { | ||
94 | iconName = "unknown_16"; | ||
95 | } | ||
96 | return loadPixmap( iconName, 1 ); | ||
97 | } | ||
98 | |||
99 | QPixmap OTIcons::serviceIcon( int serviceClass, bool & found ) { | ||
100 | |||
101 | QString iconName; | ||
102 | |||
103 | QMap<int, QString>::Iterator it; | ||
104 | |||
105 | it = serviceIcons.find( serviceClass ); | ||
106 | iconName = it.data(); | ||
107 | |||
108 | if ( iconName.isEmpty() ) { | ||
109 | iconName = "unknown_16"; | ||
110 | found = 0 ; | ||
111 | } else | ||
112 | found = 1 ; | ||
113 | return loadPixmap( iconName, 1 ); | ||
114 | } | ||
115 | |||
116 | QPixmap OTIcons::loadPixmap( const QString & name, bool Sub ) { | ||
117 | return( Resource::loadPixmap( "opietooth/" + | ||
118 | QString( (Sub) ? "icons/" : "" ) + | ||
119 | name ) ); | ||
120 | } | ||