summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/field.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/kexidb/field.h
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/kexidb/field.h')
-rw-r--r--kexi/kexidb/field.h132
1 files changed, 66 insertions, 66 deletions
diff --git a/kexi/kexidb/field.h b/kexi/kexidb/field.h
index 1fec04f6..9e0c9480 100644
--- a/kexi/kexidb/field.h
+++ b/kexi/kexidb/field.h
@@ -22,11 +22,11 @@
#ifndef KEXIDB_FIELD_H
#define KEXIDB_FIELD_H
-#include <qvariant.h>
-#include <qstring.h>
-#include <qpair.h>
-#include <qvaluevector.h>
-#include <qptrvector.h>
+#include <tqvariant.h>
+#include <tqstring.h>
+#include <tqpair.h>
+#include <tqvaluevector.h>
+#include <tqptrvector.h>
#include "kexidb/kexidb_export.h"
namespace KexiDB {
@@ -57,8 +57,8 @@ class BaseExpr;
Note that aliases for fields are defined within query, not in Field object,
because the same field can be used in different queries with different alias.
- Notes for advanced use: Field obeject is designed to be owned by a parent object.
- Such a parent object can be KexiDB::TableSchema, if the field defines single table column,
+ Notes for advanced use: Field obeject is designed to be owned by a tqparent object.
+ Such a tqparent object can be KexiDB::TableSchema, if the field defines single table column,
or KexiDB::QuerySchema, if the field defines an expression (KexiDB::BaseExpr class).
Using expression class for fields allos to define expressions within queries like
@@ -72,11 +72,11 @@ class BaseExpr;
class KEXI_DB_EXPORT Field
{
public:
- typedef QPtrList<Field> List; //!< list of fields
- typedef QPtrVector<Field> Vector; //!< vector of fields
- typedef QPtrListIterator<Field> ListIterator; //!< iterator for list of fields
- typedef QPair<Field*,Field*> Pair; //!< fields pair
- typedef QPtrList<Pair> PairList; //!< list of fields pair
+ typedef TQPtrList<Field> List; //!< list of fields
+ typedef TQPtrVector<Field> Vector; //!< vector of fields
+ typedef TQPtrListIterator<Field> ListIterator; //!< iterator for list of fields
+ typedef TQPair<Field*,Field*> Pair; //!< fields pair
+ typedef TQPtrList<Pair> PairList; //!< list of fields pair
/*! Unified (most common used) types of fields. */
enum Type
@@ -154,13 +154,13 @@ class KEXI_DB_EXPORT Field
Field();
/*! Creates a database field with specified properties. */
- Field(const QString& name, Type ctype,
+ Field(const TQString& name, Type ctype,
uint cconst=NoConstraints,
uint options = NoOptions,
uint length=0, uint precision=0,
- QVariant defaultValue=QVariant(),
- const QString& caption = QString::null,
- const QString& description = QString::null,
+ TQVariant defaultValue=TQVariant(),
+ const TQString& caption = TQString(),
+ const TQString& description = TQString(),
uint width = 0);
/*! Copy constructor. */
@@ -168,38 +168,38 @@ class KEXI_DB_EXPORT Field
virtual ~Field();
- //! Converts type \a type to QVariant equivalent as accurate as possible
- static QVariant::Type variantType(uint type);
+ //! Converts type \a type to TQVariant equivalent as accurate as possible
+ static TQVariant::Type variantType(uint type);
/*! \return a i18n'd type name for \a type (\a type has to be an element from Field::Type,
not greater than Field::LastType) */
- static QString typeName(uint type);
+ static TQString typeName(uint type);
/*! \return type string for \a type, e.g. "Integer" for Integer type
(not-i18n'd, \a type has to be an element from Field::Type,
not greater than Field::LastType) */
- static QString typeString(uint type);
+ static TQString typeString(uint type);
/*! \return type for a given \a typeString */
- static Type typeForString(const QString& typeString);
+ static Type typeForString(const TQString& typeString);
/*! \return type group for a given \a typeGroupString */
- static TypeGroup typeGroupForString(const QString& typeGroupString);
+ static TypeGroup typeGroupForString(const TQString& typeGroupString);
/*! \return group for \a type */
static TypeGroup typeGroup(uint type);
/*! \return a i18n'd group name for \a typeGroup
(\a typeGroup has to be an element from Field::TypeGroup) */
- static QString typeGroupName(uint typeGroup);
+ static TQString typeGroupName(uint typeGroup);
/*! \return type group string for \a typeGroup, e.g. "IntegerGroup" for IntegerGroup type
(not-i18n'd, \a type has to be an element from Field::Type,
not greater than Field::LastType) */
- static QString typeGroupString(uint typeGroup);
+ static TQString typeGroupString(uint typeGroup);
/* ! \return the name of this field */
- inline QString name() const { return m_name; }
+ inline TQString name() const { return m_name; }
/*! \return table schema of table that owns this field
or null if it has no table assigned.
@@ -287,43 +287,43 @@ class KEXI_DB_EXPORT Field
void setOptions(uint options) { m_options = options; }
- //! Converts field's type to QVariant equivalent as accurate as possible
- inline QVariant::Type variantType() const { return variantType(type()); }
+ //! Converts field's type to TQVariant equivalent as accurate as possible
+ inline TQVariant::Type variantType() const { return variantType(type()); }
/*! \return a type for this field. If there's expression assigned,
type of the expression is returned instead. */
Type type() const;
//! \return a i18n'd type name for this field
- inline QString typeName() const { return Field::typeName(type()); }
+ inline TQString typeName() const { return Field::typeName(type()); }
//! \return type group for this field
inline TypeGroup typeGroup() const { return Field::typeGroup(type()); }
//! \return a i18n'd type group name for this field
- inline QString typeGroupName() const { return Field::typeGroupName(type()); }
+ inline TQString typeGroupName() const { return Field::typeGroupName(type()); }
//! \return a type string for this field,
//! for example "Integer" string for Field::Integer type.
- inline QString typeString() const { return Field::typeString(type()); }
+ inline TQString typeString() const { return Field::typeString(type()); }
//! \return a type group string for this field,
//! for example "Integer" string for Field::IntegerGroup.
- inline QString typeGroupString() const { return Field::typeGroupString(type()); }
+ inline TQString typeGroupString() const { return Field::typeGroupString(type()); }
/*! \return (optional) subtype for this field.
Subtype is a string providing additional hint for field's type.
- E.g. for BLOB type, it can be a MIME type or certain QVariant type name,
- for example: "QPixmap", "QColor" or "QFont" */
- inline QString subType() const { return m_subType; }
+ E.g. for BLOB type, it can be a MIME type or certain TQVariant type name,
+ for example: TQPIXMAP_OBJECT_NAME_STRING, "TQColor" or "TQFont" */
+ inline TQString subType() const { return m_subType; }
/*! Sets (optional) subtype for this field.
\sa subType() */
- inline void setSubType(const QString& subType) { m_subType = subType; }
+ inline void setSubType(const TQString& subType) { m_subType = subType; }
//! \return default value for this field. Null value means there
//! is no default value declared. The variant value is compatible with field's type.
- inline QVariant defaultValue() const { return m_defaultValue; }
+ inline TQVariant defaultValue() const { return m_defaultValue; }
/*! \return length of text, only meaningful if the field type is text.
0 means "default length". */
@@ -342,7 +342,7 @@ class KEXI_DB_EXPORT Field
of 6 and a scale of 4. Integers can be considered to have a scale of zero. */
inline uint scale() const { return m_length; }
-//! @todo should we keep extended properties here or move them to a QVariant dictionary?
+//! @todo should we keep extended properties here or move them to a TQVariant dictionary?
/*! \return number of decimal places that should be visible to the user,
e.g. within table view widget, form or printout.
Only meaningful if the field type is floating point or (in the future: decimal or currency).
@@ -368,13 +368,13 @@ class KEXI_DB_EXPORT Field
inline int order() const { return m_order; }
/*! \return caption of this field. */
- inline QString caption() const { return m_caption; }
+ inline TQString caption() const { return m_caption; }
/*! \return caption of this field or - if empty - return its name. */
- inline QString captionOrName() const { return m_caption.isEmpty() ? m_name : m_caption; }
+ inline TQString captionOrName() const { return m_caption.isEmpty() ? m_name : m_caption; }
/*! \return description text for this field. */
- inline QString description() const { return m_desc; }
+ inline TQString description() const { return m_desc; }
/*! \return width of this field (usually in pixels or points)
0 (the default) means there is no hint for the width. */
@@ -404,7 +404,7 @@ class KEXI_DB_EXPORT Field
void setType(Type t);
/*! Sets name \a name for this field. */
- void setName(const QString& name);
+ void setName(const TQString& name);
/*! Sets constraints to \a c. If PrimaryKey is set in \a c, also
constraits implied by being primary key are enforced (see setPrimaryKey()).
@@ -432,13 +432,13 @@ class KEXI_DB_EXPORT Field
/*! Sets default value for this field. Setting null value removes the default value.
@see defaultValue() */
- void setDefaultValue(const QVariant& def);
+ void setDefaultValue(const TQVariant& def);
- /*! Sets default value decoded from QCString.
+ /*! Sets default value decoded from TQCString.
Decoding errors are detected (value is strictly checked against field type)
- - if one is encountered, default value is cleared (defaultValue()==QVariant()).
+ - if one is encountered, default value is cleared (defaultValue()==TQVariant()).
\return true if given value was valid for field type. */
- bool setDefaultValue(const QCString& def);
+ bool setDefaultValue(const TQCString& def);
/*! Sets auto increment flag. Only available to set true,
if isAutoIncrementAllowed() is true. */
@@ -490,10 +490,10 @@ class KEXI_DB_EXPORT Field
void setIndexed(bool s);
/*! Sets caption for this field to \a caption. */
- void setCaption(const QString& caption) { m_caption=caption; }
+ void setCaption(const TQString& caption) { m_caption=caption; }
/*! Sets description for this field to \a description. */
- void setDescription(const QString& description) { m_desc=description; }
+ void setDescription(const TQString& description) { m_desc=description; }
/*! Sets visible width for this field to \a w
(usually in pixels or points). 0 means there is no hint for the width. */
@@ -503,14 +503,14 @@ class KEXI_DB_EXPORT Field
to query schemas' field list. QueryAsterisk subclasses Field class,
and to check if the given object (pointed by Field*)
is asterisk or just ordinary field definition,
- you can call this method. This is just effective version of QObject::isA().
+ you can call this method. This is just effective version of TQObject::isA().
Every QueryAsterisk object returns true here,
and every Field object returns false.
*/
virtual bool isQueryAsterisk() const { return false; }
/*! \return string for debugging purposes. */
- virtual QString debugString() const;
+ virtual TQString debugString() const;
/*! Shows debug information about this field. */
void debug();
@@ -538,22 +538,22 @@ class KEXI_DB_EXPORT Field
//<TMP>
/*! \return the hints for enum fields. */
- QValueVector<QString> enumHints() const { return m_hints; }
- QString enumHint(uint num) { return (num < m_hints.size()) ? m_hints.at(num) : QString::null; }
+ TQValueVector<TQString> enumHints() const { return m_hints; }
+ TQString enumHint(uint num) { return (num < m_hints.size()) ? m_hints.at(num) : TQString(); }
/*! sets the hint for enum fields */
- void setEnumHints(const QValueVector<QString> &l) { m_hints = l; }
+ void setEnumHints(const TQValueVector<TQString> &l) { m_hints = l; }
//</TMP>
/*! \return custom property \a propertyName.
If there is no such a property, \a defaultValue is returned. */
- QVariant customProperty(const QCString& propertyName,
- const QVariant& defaultValue = QVariant()) const;
+ TQVariant customProperty(const TQCString& propertyName,
+ const TQVariant& defaultValue = TQVariant()) const;
//! Sets value \a value for custom property \a propertyName
- void setCustomProperty(const QCString& propertyName, const QVariant& value);
+ void setCustomProperty(const TQCString& propertyName, const TQVariant& value);
//! A data type used for handling custom properties of a field
- typedef QMap<QCString,QVariant> CustomPropertiesMap;
+ typedef TQMap<TQCString,TQVariant> CustomPropertiesMap;
//! \return all custom properties
inline const CustomPropertiesMap customProperties() const {
@@ -575,39 +575,39 @@ class KEXI_DB_EXPORT Field
FieldList *m_parent; //!< In most cases this points to a TableSchema
//!< object that field is assigned.
- QString m_name;
- QString m_subType;
+ TQString m_name;
+ TQString m_subType;
uint m_constraints;
uint m_length; //!< also used for storing scale for floating point types
uint m_precision;
int m_visibleDecimalPlaces; //!< used in visibleDecimalPlaces()
uint m_options;
- QVariant m_defaultValue;
+ TQVariant m_defaultValue;
int m_order;
- QString m_caption;
- QString m_desc;
+ TQString m_caption;
+ TQString m_desc;
uint m_width;
- QValueVector<QString> m_hints;
+ TQValueVector<TQString> m_hints;
KexiDB::BaseExpr *m_expr;
CustomPropertiesMap* m_customProperties;
//! @internal Used in m_typeNames member to handle i18n'd type names
- class KEXI_DB_EXPORT FieldTypeNames : public QValueVector<QString> {
+ class KEXI_DB_EXPORT FieldTypeNames : public TQValueVector<TQString> {
public:
FieldTypeNames();
void init();
- QMap<QString,Type> str2num;
+ TQMap<TQString,Type> str2num;
protected:
bool m_initialized : 1;
};
//! @internal Used in m_typeGroupNames member to handle i18n'd type group names
- class KEXI_DB_EXPORT FieldTypeGroupNames : public QValueVector<QString> {
+ class KEXI_DB_EXPORT FieldTypeGroupNames : public TQValueVector<TQString> {
public:
FieldTypeGroupNames();
void init();
- QMap<QString,TypeGroup> str2num;
+ TQMap<TQString,TypeGroup> str2num;
protected:
bool m_initialized : 1;
};