Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OTIcons.cpp

Go to the documentation of this file.
00001 #include <OTIcons.h>
00002 
00003 #include <opie2/odebug.h>
00004 #include <qpe/resource.h>
00005 
00006 using namespace Opietooth2;
00007 
00008 OTIcons::OTIcons() : deviceIcons(), serviceIcons() {
00009 
00010     // still need to find out real ids
00011     deviceIcons.insert( "unknown",    "unknown_16" );
00012     deviceIcons.insert( "misc",       "misc_16" );
00013     deviceIcons.insert( "computer",   "computer_16" );
00014     deviceIcons.insert( "phone",      "phone_16" );
00015     deviceIcons.insert( "lan",        "network_16" );
00016     deviceIcons.insert( "audiovideo", "audio_16" );
00017     deviceIcons.insert( "peripheral", "print_16" );
00018     deviceIcons.insert( "imaging",    "other_16" );
00019 
00020     serviceIcons.insert( 0x1101 , "serial_16" ); //SerialPort
00021     serviceIcons.insert( 0x1102 , "network_16" ); //LANAccessUsingPPP
00022     serviceIcons.insert( 0x1103 , "network_16"); //DialupNetworking
00023     serviceIcons.insert( 0x1104 , "sync_16" ); //IrMCSync
00024     serviceIcons.insert( 0x1105 , "obex_16" ); //OBEXObjectPush
00025     serviceIcons.insert( 0x1106 , "obex_16" ); //OBEXFileTransfer
00026     serviceIcons.insert( 0x1107 , "sync_16" ); //IrMCSyncCommand
00027     serviceIcons.insert( 0x1108 , "phone_16"); // Headset
00028     serviceIcons.insert( 0x1109 , "phone_16"); // CordlessTelephony
00029     serviceIcons.insert( 0x110A , "audio_16"); // AudioSource
00030     serviceIcons.insert( 0x110B , "audio_16"); // AudioSink
00031     //serviceIcons.insert( 0x110C , "remotecontrol_16" ); // remote control target ---
00032     //serviceIcons.insert( 0x110D , "audio_16" ); // advanced audio distribution ---
00033     //serviceIcons.insert( 0x110E , "remotecontrol_16" ); // remote control ---
00034     //serviceIcons.insert( 0x110F , "video_16" ); // video conferencing ---
00035     //serviceIcons.insert( 0x1110 , "audio_16" ); // intercom ---
00036     serviceIcons.insert( 0x1111 , "fax_16" ); //Fax
00037     serviceIcons.insert( 0x1112 , "audio_16");  //HeadsetAudioGateway
00038     //serviceIcons.insert( 0x1113 , "wap_16" ); // WAP ---
00039     //serviceIcons.insert( 0x1114 , "wap_16" ); // WAP client ---
00040     serviceIcons.insert( 0x1115 , "network_16"); // Network Access Point (PANU)
00041     serviceIcons.insert( 0x1116 , "network_16"); // Network Access Point (NAP)
00042     serviceIcons.insert( 0x1117 , "network_16"); // Network Access Point (GN)
00043     serviceIcons.insert( 0x1118 , "print_16" ); // direct printing
00044     serviceIcons.insert( 0x1119 , "print_16" ); // reference printing
00045     //serviceIcons.insert( 0x111A , "image_16" ); // imaging ---
00046     //serviceIcons.insert( 0x111B , "image_16" ); // imaging responder ---
00047     //serviceIcons.insert( 0x111C , "image_16" ); // imaging automatic archive  ---
00048     //serviceIcons.insert( 0x111D , "image_16" ); // imaging referenced objects ---
00049     //serviceIcons.insert( 0x111E , "handsfree_16" ); // handsfree ---
00050     //serviceIcons.insert( 0x111F , "handsfree_16" ); // handsfree audio gateway ---
00051     serviceIcons.insert( 0x1120 , "print_16" ); // direct printing referenced object service
00052     //serviceIcons.insert( 0x1121 , "handsfree_16" ); // reflected UI ---
00053     serviceIcons.insert( 0x1122 , "print_16" ); // basic printing
00054     serviceIcons.insert( 0x1123 , "print_16" ); // printing status
00055     //serviceIcons.insert( 0x1124 , "handsfree_16" ); // human interface device service ---
00056     //serviceIcons.insert( 0x1125 , "handsfree_16" ); // hardcopy cable replacement ---
00057     serviceIcons.insert( 0x1126 , "print_16" ); // HCR print
00058     serviceIcons.insert( 0x1127 , "print_16" ); // HCR scan
00059     serviceIcons.insert( 0x1128 , "phone_16" ); // Common_ISDN_Access
00060     //serviceIcons.insert( 0x1129 , "audio_16" ); // video conferencing GW ---
00061     //serviceIcons.insert( 0x112C , "audio_16" ); // audio video ---
00062     //serviceIcons.insert( 0x112D , "phone_16" ); // SIM access ---
00063     serviceIcons.insert( 0x1201 , "network_16" );  //GenericNetworking
00064     serviceIcons.insert( 0x1202 , "folder_16" ); //GenericFileTransfer
00065     serviceIcons.insert( 0x1203 , "audio_16" ); //GenericAudio
00066     serviceIcons.insert( 0x1204 , "phone_16" ); //GenericTelephony
00067     //serviceIcons.insert( 0x1303 , "video_16" ); // video source ---
00068     //serviceIcons.insert( 0x1304 , "video_16" ); // video sink ---
00069 
00070     Modems.resize( 3 );
00071     Modems[0].setUUID32( 0x1101 ); // SerialPort
00072     Modems[1].setUUID32( 0x1102 ); // Lan access using PPP
00073     Modems[2].setUUID32( 0x1103 ); // DialupNetworking
00074 
00075     Networks.resize( 3 );
00076     Networks[0].setUUID32( 0x1115 ); // PANU
00077     Networks[1].setUUID32( 0x1116 ); // NAP
00078     Networks[2].setUUID32( 0x1117 ); // GN
00079 }
00080 
00081 OTIcons::~OTIcons() {
00082 }
00083 
00084 QPixmap OTIcons::deviceIcon( const QString & deviceClass ) {
00085 
00086     QString iconName;
00087 
00088     QMap<QString, QString>::Iterator it;
00089 
00090     it = deviceIcons.find( deviceClass );
00091     iconName = it.data();
00092 
00093     if ( iconName.isEmpty() ) {
00094         iconName = "unknown_16";
00095     }
00096     return loadPixmap( iconName, 1 );
00097 }
00098 
00099 QPixmap OTIcons::serviceIcon( int serviceClass, bool & found ) {
00100 
00101     QString iconName;
00102 
00103     QMap<int, QString>::Iterator it;
00104 
00105     it = serviceIcons.find( serviceClass );
00106     iconName = it.data();
00107 
00108     if ( iconName.isEmpty() ) {
00109       iconName = "unknown_16";
00110       found = 0 ;
00111     } else 
00112       found = 1 ;
00113     return loadPixmap( iconName, 1 );
00114 }
00115 
00116 QPixmap OTIcons::loadPixmap( const QString & name, bool Sub ) {
00117     return( Resource::loadPixmap( "opietooth/" + 
00118                                   QString( (Sub) ? "icons/" : "" ) + 
00119                                   name ) );
00120 }

Generated on Sat Nov 5 16:17:55 2005 for OPIE by  doxygen 1.4.2