~ubuntu-branches/ubuntu/intrepid/kdebluetooth/intrepid-proposed

« back to all changes in this revision

Viewing changes to kdebluetooth/libkbluetooth/sdpservice.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2008-08-07 09:49:47 UTC
  • mto: This revision was merged to the branch mainline in revision 56.
  • Revision ID: james.westby@ubuntu.com-20080807094947-pj6q3uxwuv7l844q
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//-*-c++-*-
2
 
/***************************************************************************
3
 
 *   Copyright (C) 2003 by Fred Schaettgen                                 *
4
 
 *   kdebluetooth@schaettgen.de                                            *
5
 
 *                                                                         *
6
 
 *   This program is free software; you can redistribute it and/or modify  *
7
 
 *   it under the terms of the GNU General Public License as published by  *
8
 
 *   the Free Software Foundation; either version 2 of the License, or     *
9
 
 *   (at your option) any later version.                                   *
10
 
 ***************************************************************************/
11
 
 
12
 
#ifndef SDPSERVICE_H
13
 
#define SDPSERVICE_H
14
 
 
15
 
#include <vector>
16
 
#include <map>
17
 
#include "sdpattribute.h"
18
 
 
19
 
namespace KBluetooth
20
 
{
21
 
namespace SDP
22
 
{
23
 
 
24
 
/**
25
 
@author Fred Schaettgen
26
 
*/
27
 
class Service
28
 
{
29
 
    friend class Device;
30
 
private:
31
 
    struct AttributeEntry
32
 
    {
33
 
        int id;
34
 
        Attribute attr;
35
 
    };
36
 
    std::vector<AttributeEntry> attributeList;
37
 
    std::vector<int> languageBases;
38
 
    std::map<int,int> languageBaseToMibEnum;
39
 
protected:
40
 
    Service();
41
 
public:
42
 
    void addAttribute(int id, const Attribute& attr);
43
 
    const Attribute& getAttribute(int index);
44
 
    int getAttributeID(int index);
45
 
    std::vector<SDP::Attribute> getSubAttributes(SDP::Attribute attr);
46
 
 
47
 
    bool getAttributeByID(int id, Attribute& attrib);
48
 
    bool getI18nAttributeByID(int id, Attribute& attrib, int &languageBase);
49
 
    QString decodeI18nString(int languageBase, const QCString &cstring);
50
 
 
51
 
    // See Bluetooth Core Spec Sec. 5.1
52
 
    bool getServiceRecordHandle(uint32_t *handle); // 0x00
53
 
    //bool getServiceClassIDList(vector<uuid_t> *classIDList); // 0x01
54
 
    //bool getServiceRecordState(uint32_t *state); // 0x02
55
 
    //bool getServiceID(uuid_t *id); // 0x03;
56
 
    //bool getProtocolDescriptorList(SDP::Attribute *attribute); // 0x04
57
 
    //bool getBrowseGroupList(vector<uuid_t> *browseGroupList); // 0x05
58
 
    bool getServiceName(QString &name); // langBase + 0x00
59
 
    bool getServiceDescription(QString &desc); // langBase + 0x01
60
 
    std::vector<SDP::uuid_t> getAllUUIDs();
61
 
 
62
 
 
63
 
 
64
 
    /** Retrieves the Rfcomm channel.
65
 
    This function is provided just for conveniance.
66
 
    @param n The Rfcomm channel.
67
 
    @ret true if an rfcomm channel was found, false otherwise. */
68
 
    bool getRfcommChannel(unsigned int &n);
69
 
    SDP::UUIDVec getClassIdList();
70
 
 
71
 
        bool haveServiceClassID(SDP::uuid_t uuid);
72
 
 
73
 
    virtual ~Service();
74
 
};
75
 
 
76
 
}
77
 
}
78
 
 
79
 
#endif