00001
00002 #include "bticonloader.h"
00003
00004 #include <qpe/resource.h>
00005
00006 namespace OpieTooth {
00007
00008
00009 BTIconLoader::BTIconLoader() {
00010
00011
00012 deviceIcons.insert( 100 , "computer_16" );
00013 deviceIcons.insert( 101 , "phone_16" );
00014 deviceIcons.insert( 102 , "brain_16" );
00015 deviceIcons.insert( 103 , "conduit_16" );
00016
00017
00018 serviceIcons.insert( 4357 , "obex_16" );
00019 serviceIcons.insert( 4358 , "obex_16" );
00020 serviceIcons.insert( 4369 , "print_16" );
00021 serviceIcons.insert( 4353 , "serial_16" );
00022 serviceIcons.insert( 4356 , "sync_16" );
00023 serviceIcons.insert( 4359 , "sync_16" );
00024 serviceIcons.insert( 4354 , "network_16" );
00025 serviceIcons.insert( 4355 , "network_16");
00026 serviceIcons.insert( 4360 , "phone_16");
00027 serviceIcons.insert( 4370 , "audio_16");
00028 serviceIcons.insert( 4374 , "network_16");
00029 serviceIcons.insert( 4361 , "phone_16");
00030 serviceIcons.insert( 4362 , "audio_16");
00031 serviceIcons.insert( 4363 , "audio_16");
00032 serviceIcons.insert( 4390 , "print_16" );
00033 serviceIcons.insert( 4392 , "phone_16" );
00034
00035 serviceIcons.insert( 4609 , "network_16" );
00036 serviceIcons.insert( 4610 , "folder_16" );
00037 serviceIcons.insert( 4392 , "audio_16" );
00038
00039
00040
00041
00042
00043 }
00044
00045 BTIconLoader::~BTIconLoader() {
00046 }
00047
00048 QPixmap BTIconLoader::deviceIcon( int deviceClass ) {
00049
00050 QString iconName;
00051
00052 QMap<int, QString>::Iterator it;
00053
00054 it = deviceIcons.find( deviceClass );
00055 iconName = it.data();
00056
00057 if ( iconName.isEmpty() ) {
00058 iconName = "unknown_16";
00059 }
00060 return( Resource::loadPixmap( "opietooth/icons/" + iconName ) );
00061 }
00062
00063 QPixmap BTIconLoader::serviceIcon( int serviceClass ) {
00064
00065 QString iconName;
00066
00067 QMap<int, QString>::Iterator it;
00068
00069 it = serviceIcons.find( serviceClass );
00070 iconName = it.data();
00071
00072 if ( iconName.isEmpty() ) {
00073 iconName = "unknown_16";
00074 }
00075 return( Resource::loadPixmap( "opietooth/icons/" + iconName ) );
00076 }
00077
00078 }