summaryrefslogtreecommitdiff
path: root/libresourceqt/include
diff options
context:
space:
mode:
Diffstat (limited to 'libresourceqt/include')
-rw-r--r--libresourceqt/include/qt4/policy/audio-resource.h12
-rw-r--r--libresourceqt/include/qt4/policy/resource-set.h37
-rw-r--r--libresourceqt/include/qt4/policy/resource.h34
3 files changed, 54 insertions, 29 deletions
diff --git a/libresourceqt/include/qt4/policy/audio-resource.h b/libresourceqt/include/qt4/policy/audio-resource.h
index 99c2c7f..bb0783f 100644
--- a/libresourceqt/include/qt4/policy/audio-resource.h
+++ b/libresourceqt/include/qt4/policy/audio-resource.h
@@ -18,14 +18,26 @@ public:
QString audioGroup() const;
bool audioGroupIsSet() const;
+ /**
+ * Set the audio group (classification)
+ * \param newGroup The new audio group to set.
+ */
void setAudioGroup(const QString & newGroup);
quint32 processID() const;
+ /**
+ * Set the PID of the process which will render the audio. Use this if the
+ * audio renderer is in a separate process.
+ */
void setProcessID(quint32 newPID);
QString streamTagName() const;
QString streamTagValue() const;
bool streamTagIsSet() const;
+ /**
+ * Set the tream tag to help policy to correctly identify the audio stream
+ * beloning to you
+ */
void setStreamTag(const QString &name, const QString &value);
virtual ResourceType type() const;
diff --git a/libresourceqt/include/qt4/policy/resource-set.h b/libresourceqt/include/qt4/policy/resource-set.h
index e190cd0..ab0e597 100644
--- a/libresourceqt/include/qt4/policy/resource-set.h
+++ b/libresourceqt/include/qt4/policy/resource-set.h
@@ -24,23 +24,23 @@
* \code
* ResourcePolicy::ResourceSet *resources = new ResourcePolicy::ResourceSet("player");
* \endcode
- * Then to add resources to the set use the \ref addResource() method to add
- * resources to the \ref ResourceSet. Like this:
+ * Then to add resources to the set use the ResourceSet::addResource() method to add
+ * resources to the ResourcePolicy::ResourceSet. Like this:
* \code
* resources->addResource(AudioPlaybackType);
* resources->addResource(VideoPlaybackType);
* \endcode
* If you want to pre-populate the AudioResource with the audio group (it is a good idea)
- * and other oudio parameters you can create an audio object your self and then
- * give that to the \ref ResourceSet. Note that you should NOT free this object.
- * The \ref ResourceSet takes ownership of this pointer.
+ * and other oudio parameters you can create an audio object yourself and then
+ * give that to the ResourcePolicy::ResourceSet. Note that you should NOT free this object.
+ * The ResourcePolicy::ResourceSet takes ownership of this pointer.
* \code
- * ResourcePolicy::AudioResource *audioResource = new ResourcePolicy::AudioResource("fmradio");
+ * ResourcePolicy::AudioResource *audioResource = new ResourcePolicy::AudioResource("player");
* resources->addResourceObject(audioResource);
* \endcode
* Calling the ResourcePolicy::ResourceSet::deleteResource() method will remove
- * and delete the object. Then when you want to acquire the \ref ResourcePolicy::ResourceSet
- * you simply use the \ref acquire() method, like this:
+ * and delete the object. Then when you want to acquire the ResourcePolicy::ResourceSet
+ * you simply use the ResourcePolicy::ResourceSet::acquire() method, like this:
* \code
* QObject::connect(resources, SIGNAL(resourcesAcquired()),
* this, SLOT(acquireOkHandler(QList<ResourcePolicy::Resource>)));
@@ -55,7 +55,7 @@
* This signal tells you when you should stop using the resources you have asked for.
* So it is important that you connect to it.
*
- * To modify the properties of the resources you can use the \ref resource() method.
+ * To modify the properties of the resources you can use the ResourcePolicy::ResourceSet::resource() method.
*/
/**
@@ -101,8 +101,8 @@ public:
* This method adds a resource to the set. A set contains only a single
* instance of a given resource. If the ResourceSet already contains a
* resource of the given type it will be overridden.
- * \param resource The resource to add to the set. The \ref ResourseSet takes
- * ownership of the pointer. Do NOT free!
+ * \param resource The resource to add to the set.
+ * The ResourcePolicy::ResourseSet takes ownership of the pointer. Do NOT free!
*/
void addResourceObject(Resource *resource);
@@ -119,7 +119,7 @@ public:
QList<Resource *> resources() const;
/**
* This method returns a const pointer to a resource of a specific type.
- * \type The type of resource we are interested in.
+ * \param type The type of resource we are interested in.
* \return a pointer to the Resource if it is defined NULL otherwise.
*/
Resource * resource(ResourceType type) const;
@@ -159,17 +159,17 @@ public:
*/
bool release();
/**
- * Commit changes to the \ref ResourceSet. Remember to call update()
+ * Commit changes to the \ref ResourcePolicy::ResourceSet. Remember to call update()
* after adding and/or removing resources.
*/
bool update();
/**
- * Stes the auto-release. When loosing the resources doue to another
+ * Sets the auto-release. When loosing the resources due to another
* application with a higher priority the default is that we automatically
* re-gain our resources without having to re-request them. However if
* the AutoRelease is set we release the resources and need to re-acquire
- * them, when the pre-emting application releases it s resources.
+ * them, when the pre-emting application releases its resources.
*
* This feature is by default disabled.
*
@@ -177,6 +177,10 @@ public:
* and cannot be unset.
*/
bool setAutoRelease();
+ /**
+ * Check whether we have setAutoRelease().
+ * \return true if auto-release is ennabled.
+ */
bool willAutoRelease();
/**
* Sets that the resourcesGranted() signal is emited even if we already
@@ -186,6 +190,9 @@ public:
* and cannot be unset.
*/
bool setAlwaysReply();
+ /**
+ * Check whether the always-get-reply flag has been set.
+ * \return true if we will always get a reply (even if there is no change).
bool alwaysGetReply();
signals:
diff --git a/libresourceqt/include/qt4/policy/resource.h b/libresourceqt/include/qt4/policy/resource.h
index 434f3dd..4c18408 100644
--- a/libresourceqt/include/qt4/policy/resource.h
+++ b/libresourceqt/include/qt4/policy/resource.h
@@ -5,24 +5,27 @@
namespace ResourcePolicy
{
+/**
+ * This enumeration represents the resources which can be reserved.
+ * \see ResourcePolicy::ResourceSet::AddResource() for info on how to reserve
+ * resources.
+ */
enum ResourceType {
- AudioPlaybackType = 0,
- VideoPlaybackType,
- AudioRecorderType,
- VideoRecorderType,
- VibraType,
- LedsType,
- BacklightType,
- SystemButtonType,
- LockButtonType,
- ScaleButtonType,
- SnapButtonType,
+ AudioPlaybackType = 0, ///< For audio playback
+ VideoPlaybackType, ///< For video playback
+ AudioRecorderType, ///< For audio recording (using of the microphone)
+ VideoRecorderType, ///< For video recording (using the camera)
+ VibraType, ///< For Vibra
+ LedsType, ///< For LEDs
+ BacklightType, ///< For the backlight (of the display)
+ SystemButtonType, ///< For the system (power) button
+ LockButtonType, ///< For the lock button
+ ScaleButtonType, ///< The scale (zoom) button
+ SnapButtonType, ///< Use this if you are a camera application
LensCoverType,
NumberOfTypes
};
-class ResourceSet;
-
/**
* This class is the super class for all resources. It represents a generic
* \ref Resource. The type specific resource classes should be used.
@@ -30,7 +33,6 @@ class ResourceSet;
class Resource
{
public:
- friend class ResourceSet;
/**
* Whether or not this resource is optional, in that it doesn't need to
* be available for the set to be acquired.
@@ -51,6 +53,10 @@ public:
*/
bool isGranted() const;
+ /**
+ * Use this method to check for the type of Resource
+ * \return The ResourceType associated to this resource
+ */
virtual ResourceType type() const = 0;
virtual ~Resource();
protected: