QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
paramspec.h
00001 /*
00002     Copyright (C) 2009-2010  George Kiagiadakis <kiagiadakis.george@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as published
00006     by the Free Software Foundation; either version 2.1 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 #ifndef QGLIB_PARAMSPEC_H
00018 #define QGLIB_PARAMSPEC_H
00019 
00020 #include "global.h"
00021 #include "refpointer.h"
00022 #include "type.h"
00023 #include "value.h"
00024 #include <QtCore/QString>
00025 
00026 namespace QGlib {
00027 
00034 class QTGLIB_EXPORT ParamSpec : public RefCountedObject
00035 {
00036     QGLIB_WRAPPER(ParamSpec)
00037 public:
00038     enum ParamFlag { //codegen: prefix=G_PARAM_, ReadWrite=READWRITE
00039         Readable = 1<<0,
00040         Writable = 1<<1,
00041         ReadWrite = Readable | Writable,
00042         Construct = 1<<2,
00043         ConstructOnly = 1<<3,
00044         LaxValidation = 1<<4,
00045         Deprecated = 1<<31
00046     };
00047     Q_DECLARE_FLAGS(ParamFlags, ParamFlag);
00048 
00049     QString name() const;
00050     QString nick() const;
00051     QString description() const;
00052 
00053     ParamFlags flags() const;
00054     Type valueType() const;
00055     Type ownerType() const;
00056 
00057     void *quarkData(const Quark & quark) const;
00058     void *stealQuarkData(const Quark & quark) const;
00059     void setQuarkData(const Quark & quark, void *data, void (*destroyCallback)(void*) = NULL);
00060 
00061 protected:
00062     virtual void ref(bool increaseRef);
00063     virtual void unref();
00064 };
00065 
00066 Q_DECLARE_OPERATORS_FOR_FLAGS(ParamSpec::ParamFlags)
00067 
00068 } //namespace QGlib
00069 
00070 QGLIB_REGISTER_TYPE(QGlib::ParamSpec) //codegen: GType=G_TYPE_PARAM
00071 QGLIB_REGISTER_TYPE(QGlib::ParamSpec::ParamFlags)
00072 QGLIB_REGISTER_WRAPIMPL_FOR_SUBCLASSES_OF(QGlib::ParamSpec, QGlib::Private::wrapParamSpec)
00073 
00074 // HACK to support glib 2.24 when compiling the generated assertions of ParamFlag
00075 // REMOVE THIS in future versions
00076 #ifdef INCLUDED_FROM_CODEGEN
00077 # if !GLIB_CHECK_VERSION(2,26,0)
00078 #  define G_PARAM_DEPRECATED QGlib::ParamSpec::Deprecated
00079 # endif
00080 #endif //CODEGEN_RUN
00081 
00082 #endif