summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/queryschema.h
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/kexidb/queryschema.h')
-rw-r--r--kexi/kexidb/queryschema.h108
1 files changed, 54 insertions, 54 deletions
diff --git a/kexi/kexidb/queryschema.h b/kexi/kexidb/queryschema.h
index 76dfa757b..a68acffe7 100644
--- a/kexi/kexidb/queryschema.h
+++ b/kexi/kexidb/queryschema.h
@@ -17,13 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIDB_QUERY_H
-#define KEXIDB_QUERY_H
+#ifndef KEXIDB_TQUERY_H
+#define KEXIDB_TQUERY_H
-#include <qvaluevector.h>
-#include <qstring.h>
-#include <qmap.h>
-#include <qptrlist.h>
+#include <tqvaluevector.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqptrlist.h>
#include "fieldlist.h"
#include "schemadata.h"
@@ -36,7 +36,7 @@ class Connection;
class QueryAsterisk;
class QuerySchemaPrivate;
class QuerySchemaParameter;
-typedef QValueList<QuerySchemaParameter> QuerySchemaParameterList;
+typedef TQValueList<QuerySchemaParameter> QuerySchemaParameterList;
//! @short Helper class that assigns additional information for the column in a query
/*! The following information is assigned:
@@ -48,25 +48,25 @@ typedef QValueList<QuerySchemaParameter> QuerySchemaParameterList;
class KEXI_DB_EXPORT QueryColumnInfo
{
public:
- typedef QPtrVector<QueryColumnInfo> Vector;
- typedef QPtrList<QueryColumnInfo> List;
- typedef QPtrListIterator<QueryColumnInfo> ListIterator;
+ typedef TQPtrVector<QueryColumnInfo> Vector;
+ typedef TQPtrList<QueryColumnInfo> List;
+ typedef TQPtrListIterator<QueryColumnInfo> ListIterator;
- QueryColumnInfo(Field *f, const QCString& _alias, bool _visible, QueryColumnInfo *foreignColumn = 0);
+ QueryColumnInfo(Field *f, const TQCString& _alias, bool _visible, QueryColumnInfo *foreignColumn = 0);
~QueryColumnInfo();
//! \return alias if it is not empty, field's name otherwise.
- inline QCString aliasOrName() const {
+ inline TQCString aliasOrName() const {
return alias.isEmpty() ? field->name().latin1() : (const char*)alias;
}
//! \return field's caption if it is not empty, field's alias otherwise.
//! If alias is also empty - returns field's name.
- inline QString captionOrAliasOrName() const {
- return field->caption().isEmpty() ? QString(aliasOrName()) : field->caption(); }
+ inline TQString captionOrAliasOrName() const {
+ return field->caption().isEmpty() ? TQString(aliasOrName()) : field->caption(); }
Field *field;
- QCString alias;
+ TQCString alias;
/*! \return index of column with visible lookup value within the 'fields expanded' vector.
-1 means no visible lookup value is available because there is no lookup for the column defined.
@@ -81,7 +81,7 @@ class KEXI_DB_EXPORT QueryColumnInfo
QueryColumnInfo *foreignColumn() const { return m_foreignColumn; }
/*! \return string for debugging purposes. */
- QString debugString() const;
+ TQString debugString() const;
//! true if this column is visible to the user (and its data is fetched by the engine)
bool visible : 1;
@@ -100,7 +100,7 @@ class KEXI_DB_EXPORT QueryColumnInfo
class KEXI_DB_EXPORT OrderByColumn
{
public:
- typedef QValueListConstIterator<OrderByColumn> ListConstIterator;
+ typedef TQValueListConstIterator<OrderByColumn> ListConstIterator;
OrderByColumn();
OrderByColumn(QueryColumnInfo& column, bool ascending = true, int pos = -1);
@@ -130,13 +130,13 @@ class KEXI_DB_EXPORT OrderByColumn
&& m_ascending==col.m_ascending; }
/*! \return string for debugging purposes. */
- QString debugString() const;
+ TQString debugString() const;
/*! \return a string like "name ASC" usable for building a SQL statement.
If \a includeTableNames is true (the default) field is output in a form
of "tablename.fieldname" (but only if fieldname is not a name of alias).
\a drv and \a identifierEscaping are used for escaping the table and field identifiers. */
- QString toSQLString(bool includeTableName = true,
+ TQString toSQLString(bool includeTableName = true,
Driver *drv = 0, int identifierEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary) const;
protected:
@@ -152,7 +152,7 @@ class KEXI_DB_EXPORT OrderByColumn
};
//! A base for KexiDB::OrderByColumnList
-typedef QValueList<OrderByColumn> OrderByColumnListBase;
+typedef TQValueList<OrderByColumn> OrderByColumnListBase;
//! @short KexiDB::OrderByColumnList provides list of sorted columns for a query schema
class KEXI_DB_EXPORT OrderByColumnList : protected OrderByColumnListBase
@@ -168,11 +168,11 @@ class KEXI_DB_EXPORT OrderByColumnList : protected OrderByColumnListBase
\return false if there is at least one name for which a field or alias name does not exist
(all the newly appended fields are removed in this case) */
bool appendFields(QuerySchema& querySchema,
- const QString& field1, bool ascending1 = true,
- const QString& field2 = QString::null, bool ascending2 = true,
- const QString& field3 = QString::null, bool ascending3 = true,
- const QString& field4 = QString::null, bool ascending4 = true,
- const QString& field5 = QString::null, bool ascending5 = true);
+ const TQString& field1, bool ascending1 = true,
+ const TQString& field2 = TQString(), bool ascending2 = true,
+ const TQString& field3 = TQString(), bool ascending3 = true,
+ const TQString& field4 = TQString(), bool ascending4 = true,
+ const TQString& field5 = TQString(), bool ascending5 = true);
/*! Appends column \a columnInfo. Ascending sorting is set is \a ascending is true. */
void appendColumn(QueryColumnInfo& columnInfo, bool ascending = true);
@@ -185,7 +185,7 @@ class KEXI_DB_EXPORT OrderByColumnList : protected OrderByColumnListBase
/*! Appends field with a name \a field. Ascending sorting is set is \a ascending is true.
\return true on successful appending, and false if there is no such field or alias
name in the \a querySchema. */
- bool appendField(QuerySchema& querySchema, const QString& fieldName,
+ bool appendField(QuerySchema& querySchema, const TQString& fieldName,
bool ascending = true);
/*! Appends a column that is at position \a pos (counted from 0).
@@ -208,13 +208,13 @@ class KEXI_DB_EXPORT OrderByColumnList : protected OrderByColumnListBase
const_iterator constEnd () const { return OrderByColumnListBase::constEnd(); }
/*! \return string for debugging purposes. */
- QString debugString() const;
+ TQString debugString() const;
/*! \return a string like "name ASC, 2 DESC" usable for building a SQL statement.
If \a includeTableNames is true (the default) fields are output in a form
of "tablename.fieldname".
\a drv and \a identifierEscaping are used for escaping the table and field identifiers. */
- QString toSQLString(bool includeTableNames = true,
+ TQString toSQLString(bool includeTableNames = true,
Driver *drv = 0, int identifierEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary) const;
};
@@ -318,7 +318,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
virtual void clear();
/*! \return string for debugging purposes. */
- virtual QString debugString();
+ virtual TQString debugString();
/*! If query was created using a connection,
returns this connection object, otherwise NULL. */
@@ -352,19 +352,19 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
if \a alias is not empty, it will be assigned to this table
using setTableAlias(position, alias)
*/
- void addTable(TableSchema *table, const QCString& alias = QCString());
+ void addTable(TableSchema *table, const TQCString& alias = TQCString());
/*! Removes \a table schema from this query.
This does not destroy \a table object but only takes it out of the list.
If this table was master for the query, master table information is also
- invalidated. */
+ tqinvalidated. */
void removeTable(TableSchema *table);
/*! \return table with name \a tableName or 0 if this query has no such table. */
- TableSchema* table(const QString& tableName) const;
+ TableSchema* table(const TQString& tableName) const;
/*! \return true if the query uses \a table. */
- bool contains(TableSchema *table) const;
+ bool tqcontains(TableSchema *table) const;
/*! Convenience function.
\return table field by searching through all tables in this query.
@@ -384,7 +384,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
@see KexiDB::splitToTableAndFieldParts()
*/
- Field* findTableField(const QString &tableOrTableAndFieldName) const;
+ Field* findTableField(const TQString &tableOrTableAndFieldName) const;
/*! \return alias of a column at \a position or null string
If there is no alias for this column
@@ -392,7 +392,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
If the column is an expression and has no alias defined,
a new unique alias will be generated automatically on this call.
*/
- QCString columnAlias(uint position) const;
+ TQCString columnAlias(uint position) const;
/*! Provided for convenience.
\return true if a column at \a position has non empty alias defined
@@ -403,7 +403,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
/*! Sets \a alias for a column at \a position, within the query.
Passing empty string to \a alias clears alias for a given column. */
- void setColumnAlias(uint position, const QCString& alias);
+ void setColumnAlias(uint position, const TQCString& alias);
/*! \return a table position (within FROM section),
that is bound to column at \a columnPosition (within SELECT section).
@@ -431,7 +431,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
/*! \return alias of a table at \a position (within FROM section)
or null string if there is no alias for this table
or if there is no such table within the query defined. */
- QCString tableAlias(uint position) const;
+ TQCString tableAlias(uint position) const;
/*! \return table position (within FROM section) that has attached
alias \a name.
@@ -444,13 +444,13 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
e.g. "SELECT 1 from table1 t, table2 t" is ok
but "SELECT t.id from table1 t, table2 t" is not.
*/
- int tablePositionForAlias(const QCString& name) const;
+ int tablePositionForAlias(const TQCString& name) const;
/*! \return table position (within FROM section) for \a tableName.
-1 is returend if there's no such table declared in the FROM section.
\sa tablePositions()
*/
- int tablePosition(const QString& tableName) const;
+ int tablePosition(const TQString& tableName) const;
/*! \return a list of all \a tableName table occurrences (within FROM section).
E.g. for "SELECT * FROM table t, table t2" [0, 1] list is returned.
@@ -458,7 +458,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
in the FROM section at all.
\sa tablePosition()
*/
- QValueList<int> tablePositions(const QString& tableName) const;
+ TQValueList<int> tablePositions(const TQString& tableName) const;
/*! Provided for convenience.
\return true if a table at \a position (within FROM section of the the query)
@@ -469,13 +469,13 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
/*! \return column position that has defined alias \a name.
If there is no such alias, -1 is returned. */
- int columnPositionForAlias(const QCString& name) const;
+ int columnPositionForAlias(const TQCString& name) const;
/*! Sets \a alias for a table at \a position (within FROM section
of the the query).
Passing empty sting to \a alias clears alias for a given table
(only for specified \a position). */
- void setTableAlias(uint position, const QCString& alias);
+ void setTableAlias(uint position, const TQCString& alias);
/*! \return a list of relationships defined for this query */
Relationship::List* relationships() const;
@@ -516,12 +516,12 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
will return the same pointer.
- Calling field("T.A") will return the same pointer as field("A").
*/
- virtual Field* field(const QString& name, bool expanded = true);
+ virtual Field* field(const TQString& name, bool expanded = true);
/*! \return field id or NULL if there is no such a field. */
inline Field* field(uint id) { return FieldList::field(id); }
- /*! Like QuerySchema::field(const QString& name) but returns not only Field
+ /*! Like QuerySchema::field(const TQString& name) but returns not only Field
object for \a identifier but entire QueryColumnInfo object.
\a identifier can be:
- a fieldname
@@ -533,7 +533,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
calling columnInfo("name") for "SELECT t1.name, t2.name FROM t1, t2" statement
will only return the column related to t1.name and not t2.name, so you'll need to
explicitly specify "t2.name" as the identifier to get the second column. */
- QueryColumnInfo* columnInfo(const QString& identifier, bool expanded = true);
+ QueryColumnInfo* columnInfo(const TQString& identifier, bool expanded = true);
/*! Options used in fieldsExpanded(). */
enum FieldsExpandedOptions {
@@ -632,7 +632,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
- columnsOrder(UnexpandedListWithoutAsterisks) will return the following map:
QueryColumnInfo(id)->0,
*/
- QMap<QueryColumnInfo*,int> columnsOrder(ColumnsOrderOptions options = ExpandedList);
+ TQMap<QueryColumnInfo*,int> columnsOrder(ColumnsOrderOptions options = ExpandedList);
/*! \return table describing order of primary key (PKEY) fields within the query.
Indexing is performed against vector returned by fieldsExpanded().
@@ -656,7 +656,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
@see example for pkeyFieldsCount().
@todo js: UPDATE CACHE!
*/
- QValueVector<int> pkeyFieldsOrder();
+ TQValueVector<int> pkeyFieldsOrder();
/*! \return number of master table's primary key fields included in this query.
This method is useful to quickly check whether the vector returned by pkeyFieldsOrder()
@@ -685,26 +685,26 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
QueryColumnInfo::List* autoIncrementFields();
/*! \return a preset statement (if any). */
- QString statement() const;
+ TQString statement() const;
/*! Forces a query statement (i.e. no statement is composed from QuerySchema's content) */
- void setStatement(const QString &s);
+ void setStatement(const TQString &s);
/*! \return a string that is a result of concatenating all column names
for \a infolist, with "," between each one.
This is usable e.g. as argument like "field1,field2"
for "INSERT INTO (xxx) ..". The result of this method is effectively cached,
- and it is invalidated when set of fields changes (e.g. using clear()
+ and it is tqinvalidated when set of fields changes (e.g. using clear()
or addField()).
This method is similar to FieldList::sqlFieldsList() it just uses
QueryColumnInfo::List instead of Field::List.
*/
- static QString sqlColumnsList(QueryColumnInfo::List* infolist, Driver *driver);
+ static TQString sqlColumnsList(QueryColumnInfo::List* infolist, Driver *driver);
/*! \return cached sql list created using sqlColumnsList() on a list returned
by autoIncrementFields(). */
- QString autoIncrementSQLFieldsList(Driver *driver);
+ TQString autoIncrementSQLFieldsList(Driver *driver);
/*! Sets a WHERE expression \a exp. It will be owned by this query,
so you can forget about it. Previously set WHERE expression will be deleted.
@@ -717,7 +717,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData
/*! Adds a part to WHERE expression.
Simplifies creating of WHERE expression, if used instead
of setWhereExpression(BaseExpr *expr). */
- void addToWhereExpression(KexiDB::Field *field, const QVariant& value, int relation = '=');
+ void addToWhereExpression(KexiDB::Field *field, const TQVariant& value, int relation = '=');
/*! Sets a list of columns for ORDER BY section of the query.
Each name on the list must be a field or alias present within the query
@@ -815,7 +815,7 @@ class KEXI_DB_EXPORT QueryAsterisk : public Field
bool isAllTableAsterisk() const { return m_table==NULL; }
/*! \return String for debugging purposes. */
- virtual QString debugString() const;
+ virtual TQString debugString() const;
protected:
//! \return a deep copy of this object. Used in FieldList(const FieldList& fl).