summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/services.h
blob: 4a4dea849a56324824a32daa4d8fce29f7ba7828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

#ifndef OpieToothServices_H
#define OpieToothServices_H

#include <qvaluelist.h>

namespace OpieTooth {
  /**
   * Services lets shows you all available services
   * on a remote device
   */
  class Services {

    /** The profile descriptor
     *
     */
    class ProfileDesriptor{
    public:
      /** typedef */
      typedef QValueList<ProfileDescriptor> ValueList;
      /** c'tor for QValueList */
      ProfileDescriptor();
      /**
       *  c'tor
       *  @param id The id or name ("Lan Access Using PPP")
       *  @param idInt The id as uint ( 0x1102 )
       *  @param version Version of the Profile ( 1 )
       */
      ProfileDescriptor(const QString &id, uint idInt, uint version );
      /**
       * copy c'tor
       */
      ProfileDescriptor(const ProfileDescriptor& );
      /**
       * returns the id
       */
      QString id()const;
      /**
       * sets the id
       */
      void setId(const QString& id);

      /**
       * sets the uint id
       */
      void setId(uint );
      /**
       * reutns the id as int
       */
      uint idInt()const;
      /**
       * returns the version
       */
      uint version()const;
      /**
       * sets the Version
       */
      void setVersion(uint version );
      /**
       * copy operator
       */
      ProfileDescriptor &operator=( const ProfileDescriptor );
      /**
       * operator==
       */
      friend bool operator==(const ProfileDescriptor&, const ProfileDescriptor& );
    };
    /**
     * Protocol Descriptor
     */
    class ProtocolDescriptor {
    public:
      typedef QValueList<ProtocolDescriptor> ValueList;
      /**
       * c'tor
       */
      ProtocolDescriptor();
      /**
       * name
       * number
       * channel/port
       */
      ProtocolDescriptor(const QString&, uint, uint channel ); // Q_UINT8 ?
      ProtocolDescriptot(const ProtocolDescriptor& );
      ~ProtocolDescriptor();
      QString name()const;
      void setName(const QString& );
      uint id()const;
      void setId(uint );
      uint port()const;
      void setPort(uint );
      ProtocolDescriptor &operator=( const ProtocolDescriptor& );
      friend bool operator==( const ProtocolDescription&,
			      const ProtocolDescription& );
    };

  public:
    typedef QValueList<Services> ValueList;
    Services();
    Services(const  Services& service );
    ~Services();

    Services &operator=( const Services& );
    friend bool operator==(const Services&, const Services& );
    QString serviceName()const;
    void setServiceName( const QString& service );

    int recHandle()const;
    void setRecHandle( int );

    QString classIdList()const;
    void setClassIdList( const QString& );
    int classIdListInt()const;
    void setClassIdList(int );

    void insertProtocolDescriptor(const ProtocolDescriptor& );
    void clearProtocolDescriptorList();
    void removeProtocolDescriptor( const ProtocolDescriptor& );
    ProtocolDescriptor::ValueList protocolDescriptorList()const;

    void insertProfileDescriptor( const ProfileDescriptor& );
    void clearProfileDescriptorList();
    void removeProfileDescriptor(const ProfileDescriptor& );
    ProfileDescriptor::ValueList profileDescriptor()const;



  };
};
#endif