summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-01-21 13:23:03 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-01-21 13:23:03 +0200
commitcfb16c2a93650ac2e0c9677bce11ed101aceffb0 (patch)
tree1f958fa95d966e7d6bdbfd8237cc08d13ced56c3 /include
parentdef881f37f26d6f3b9bf1a9c077dae4916717157 (diff)
Chaged Resource::Type from QString to an enumerated type
Diffstat (limited to 'include')
-rw-r--r--include/resource.h66
1 files changed, 43 insertions, 23 deletions
diff --git a/include/resource.h b/include/resource.h
index ea4eda8..eed05c6 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -1,32 +1,52 @@
#ifndef RESOURCE_H
#define RESOURCE_H
-#include <QString>
+#include <QtGlobal>
-class Resource
-{
-public:
- Resource(const Resource &other);
- Resource();
- Resource &operator=(const Resource &other);
+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
+ };
- ~Resource();
+ /**
+ * 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);
- QString type() const;
- void setType(const QString type);
- bool isOptional() const;
- void setOptional(bool resourceIsOptional=true);
- bool isShared() const;
- void setShared(bool shared=true);
- quint32 id() const;
- void setId(quint32 newId);
+ ~Resource();
- bool operator==(const Resource &other);
-private:
- QString name;
- bool optional;
- bool shared;
- quint32 identifier;
-};
+ 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