summaryrefslogtreecommitdiff
path: root/libresourceqt
diff options
context:
space:
mode:
authorMartin Wolf <ext-martin.2.wolf@nokia.com>2010-03-19 12:29:36 +0200
committerMartin Wolf <ext-martin.2.wolf@nokia.com>2010-03-19 12:29:36 +0200
commitcedefad1cbd0857fd1247dfb65a38f1bd0323304 (patch)
tree0cc87b46efdc11d631ddecd5bab1bddb2f3f7305 /libresourceqt
parent6eff9f8263541053b66d10960e909707ed592f62 (diff)
parent50dbb5b9aad308fe9c23db4e6db3f4b1a07dab17 (diff)
downloadlibresourceqt-cedefad1cbd0857fd1247dfb65a38f1bd0323304.tar.gz
Merge branch 'master' of ssh://mawolf@karma.research.nokia.com/u/repositories/libresourceqt
Diffstat (limited to 'libresourceqt')
-rw-r--r--libresourceqt/Doxyfile15
-rw-r--r--libresourceqt/include/qt4/policy/audio-resource.h12
-rw-r--r--libresourceqt/include/qt4/policy/resource-set.h42
-rw-r--r--libresourceqt/include/qt4/policy/resource.h33
-rw-r--r--libresourceqt/src/resource-engine.h4
5 files changed, 67 insertions, 39 deletions
diff --git a/libresourceqt/Doxyfile b/libresourceqt/Doxyfile
index d41c553..f2c2e14 100644
--- a/libresourceqt/Doxyfile
+++ b/libresourceqt/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = ResourcePolicy
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 0.1
+PROJECT_NUMBER = 1.1
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -573,8 +573,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = include/resource.h \
- include/resource-set.h
+INPUT = include/qt4
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -627,7 +626,7 @@ FILE_PATTERNS = *.c \
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
-RECURSIVE = NO
+RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
@@ -923,13 +922,13 @@ GENERATE_QHP = YES
# be used to specify the file name of the resulting .qch file.
# The path specified is relative to the HTML output folder.
-QCH_FILE = ../libresourceqt.qch
+QCH_FILE = ../com.nokia.policy.libresourceqt.qch
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#namespace
-QHP_NAMESPACE = libresourceqt
+QHP_NAMESPACE = ResourcePolicy
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
@@ -1349,7 +1348,7 @@ PERL_PATH = /usr/bin/perl
# fallback. It is recommended to install and use dot, since it yields more
# powerful graphs.
-CLASS_DIAGRAMS = YES
+CLASS_DIAGRAMS = NO
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
@@ -1371,7 +1370,7 @@ HIDE_UNDOC_RELATIONS = YES
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
-HAVE_DOT = NO
+HAVE_DOT = YES
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
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 bc81b89..0d72cb7 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,10 @@ 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:
@@ -195,13 +203,13 @@ signals:
* \param availableResources A list of available resources. The list of
* available resources contains only available resource which we have in the set.
*/
- void resourcesBecameAvailable(const QList<ResourceType> &availableResources);
+ void resourcesBecameAvailable(const QList<ResourcePolicy::ResourceType> &availableResources);
/**
* This signal is emited as a response to the acquire() request.
* \param grantedOptionalResources The list of granted optional resources.
* All the mandatory resources have also been aquired.
*/
- void resourcesGranted(const QList<ResourceType> &grantedOptionalResources);
+ void resourcesGranted(const QList<ResourcePolicy::ResourceType> &grantedOptionalResources);
/**
* This signal is emited as a response to the acquire() request, in the
* case where one or more of the mandatroy resources were not availalble.
diff --git a/libresourceqt/include/qt4/policy/resource.h b/libresourceqt/include/qt4/policy/resource.h
index 434f3dd..4f9b02e 100644
--- a/libresourceqt/include/qt4/policy/resource.h
+++ b/libresourceqt/include/qt4/policy/resource.h
@@ -5,18 +5,23 @@
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
};
@@ -29,8 +34,8 @@ class ResourceSet;
*/
class Resource
{
-public:
friend class ResourceSet;
+public:
/**
* Whether or not this resource is optional, in that it doesn't need to
* be available for the set to be acquired.
@@ -51,6 +56,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:
diff --git a/libresourceqt/src/resource-engine.h b/libresourceqt/src/resource-engine.h
index 6caaef7..897c27e 100644
--- a/libresourceqt/src/resource-engine.h
+++ b/libresourceqt/src/resource-engine.h
@@ -17,8 +17,8 @@ class ResourceEngine: public QObject
{
Q_OBJECT
Q_DISABLE_COPY( ResourceEngine )
-#ifndef QT_NO_DEBUG
- friend class TestResourceEngine;
+#ifdef TEST_RESOURCE_ENGINE_H
+ friend class ::TestResourceEngine;
#endif
public: