summaryrefslogtreecommitdiff
path: root/include/resource.h
blob: eed05c66a9c9e89fd4de1877e5f92f7ac7ea9532 (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
#ifndef RESOURCE_H
#define RESOURCE_H

#include <QtGlobal>

namespace ResourcePolicy {
   /**
    * This enum defines the different resources that an application can use.
    */
   enum ResourceType {
	   InvalidResource = 0,
	   AudioPlaybackResource = 0x01,
	   VideoPlaybackResource = 0x02,
	   AudioRecorderResource = 0x04,
	   VideoRecorderResource = 0x08
   };

   /**
    * This class represents a resource which can be acquired. The main use of
    * Resources is to use then in a ResourceSet.
    * 
    * Other Resource types can be added later, these reflect the resources found
    * in the Policy configuration. 
    */
   class Resource
   {
  public:
      Resource(const Resource &other);
      Resource();
      Resource &operator=(const Resource &other);

      ~Resource();

      ResourceType type() const;
      bool setType(enum ResourceType type);
      bool isOptional() const;
      void setOptional(bool resourceIsOptional=true);
      bool isShared() const;
      void setShared(bool shared=true);
      quint32 id() const;
      void setId(quint32 newId);

      bool operator==(const Resource &other);
  private:
      ResourceType resourceType;
      bool optional;
      bool shared;
      quint32 identifier;
   };
   
}
#endif