summaryrefslogtreecommitdiffstats
path: root/src/field.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/field.h
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/field.h')
-rw-r--r--src/field.h90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/field.h b/src/field.h
index c9f00da..653b466 100644
--- a/src/field.h
+++ b/src/field.h
@@ -16,9 +16,9 @@
#include "datavectors.h"
-#include <qstringlist.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstringlist.h>
+#include <tqstring.h>
+#include <tqregexp.h>
namespace Tellico {
namespace Data {
@@ -35,21 +35,21 @@ class Field : public KShared {
public:
/**
* The possible field types. A Line is represented by a KLineEdit,
- * a Para is a QMultiLineEdit encompassing multiple lines, a Choice is
+ * a Para is a TQMultiLineEdit encompassing multiple lines, a Choice is
* limited to set values shown in a KComboBox, and a Bool is either true
- * or not and is thus a QCheckBox. A Number type is an integer, though it used
+ * or not and is thus a TQCheckBox. A Number type is an integer, though it used
* to be a Year. A ReadOnly is a hidden value. A URL is obvious, too.
* A Table looks like a small spreadsheet with one column, and a Table2
- * type has two columns. An Image points to a QImage. A Dependent field
+ * type has two columns. An Image points to a TQImage. A Dependent field
* depends on the values of other attributes. A Date contains a date.
*
* Don't forget to change Field::typeMap().
*
* @see KLineEdit
- * @see QTextEdit
+ * @see TQTextEdit
* @see KComboBox
- * @see QCheckBox
- * @see QTable
+ * @see TQCheckBox
+ * @see TQTable
**/
enum Type {
Undef = 0,
@@ -70,7 +70,7 @@ public:
// if you add your own field type, best to start at a high number
// say 100, to ensure uniqueness
};
- typedef QMap<Field::Type, QString> FieldMap;
+ typedef TQMap<Field::Type, TQString> FieldMap;
/**
* The field flags. The properties should be bit-wise OR'd together.
@@ -114,7 +114,7 @@ public:
* @param title The field title
* @param type The field type
*/
- Field(const QString& name, const QString& title, Type type = Line);
+ Field(const TQString& name, const TQString& title, Type type = Line);
/**
* The constructor for Choice types attributes.
* By default, the field category is set to "General", and should be modified
@@ -124,7 +124,7 @@ public:
* @param title The field title
* @param allowed The allowed values of the field
*/
- Field(const QString& name, const QString& title, const QStringList& allowed);
+ Field(const TQString& name, const TQString& title, const TQStringList& allowed);
/**
* The copy constructor
*/
@@ -149,56 +149,56 @@ public:
*
* @return The field name
*/
- const QString& name() const { return m_name; }
+ const TQString& name() const { return m_name; }
/**
* Sets the name of the field. This should only be changed before the field is added
* to a collection, i.e. before any entries use it, etc.
*
* @param name The field name
*/
- void setName(const QString& name) { m_name = name; }
+ void setName(const TQString& name) { m_name = name; }
/**
* Returns the title of the field.
*
* @return The field title
*/
- const QString& title() const { return m_title; }
+ const TQString& title() const { return m_title; }
/**
* Sets the title of the field.
*
* @param title The field title
*/
- void setTitle(const QString& title);
+ void setTitle(const TQString& title);
/**
* Returns the category of the field.
*
* @return The field category
*/
- const QString& category() const { return m_category; }
+ const TQString& category() const { return m_category; }
/**
* Sets the category of the field.
*
* @param category The field category
*/
- void setCategory(const QString& category);
+ void setCategory(const TQString& category);
/**
* Returns the name of the field.
*
* @return The field name
*/
- const QStringList& allowed() const { return m_allowed; }
+ const TQStringList& allowed() const { return m_allowed; }
/**
* Sets the allowed values of the field.
*
* @param allowed The allowed values
*/
- void setAllowed(const QStringList& allowed) { m_allowed = allowed; }
+ void setAllowed(const TQStringList& allowed) { m_allowed = allowed; }
/**
* Add a value to the allowed list
*
* @param value The value to allow
*/
- void addAllowed(const QString& value);
+ void addAllowed(const TQString& value);
/**
* Returns the type of the field.
*
@@ -241,25 +241,25 @@ public:
*
* @return The field description
*/
- const QString& description() const { return m_desc; }
+ const TQString& description() const { return m_desc; }
/**
* Sets the description of the field.
*
* @param desc The field description
*/
- void setDescription(const QString& desc) { m_desc = desc; }
+ void setDescription(const TQString& desc) { m_desc = desc; }
/**
* Returns the default value for the field.
*
* @return The field default value
*/
- const QString& defaultValue() const;
+ const TQString& defaultValue() const;
/**
* Sets the default value of the field.
*
* @param value The field default value
*/
- void setDefaultValue(const QString& value);
+ void setDefaultValue(const TQString& value);
/**
* Some attributes are always a category by themselves.
*
@@ -272,7 +272,7 @@ public:
* @param key The property key
* @param value The property value
*/
- void setProperty(const QString& key, const QString& value);
+ void setProperty(const TQString& key, const TQString& value);
/**
* Sets all the extended properties. Any existing ones get erased.
*
@@ -285,7 +285,7 @@ public:
* @param key The property key
* @returnThe property value
*/
- const QString& property(const QString& key) const { return m_properties[key]; }
+ const TQString& property(const TQString& key) const { return m_properties[key]; }
/**
* Return the list of properties.
*
@@ -297,7 +297,7 @@ public:
* Returns an empty vector for non-Dpendent fields
*/
FieldVec dependsOn(CollPtr coll) const;
- QStringList dependsOn() const;
+ TQStringList dependsOn() const;
/*************************** STATIC **********************************/
@@ -305,7 +305,7 @@ public:
* A wrapper method around all the format functions. The flags
* determine which is called on the string.
*/
- static QString format(const QString& value, FormatFlag flag);
+ static TQString format(const TQString& value, FormatFlag flag);
/**
* A convenience function to format a string as a title.
* At the moment, this means that some articles such as "the" are placed
@@ -313,7 +313,7 @@ public:
*
* @param title The string to be formatted
*/
- static QString formatTitle(const QString& title);
+ static TQString formatTitle(const TQString& title);
/**
* A convenience function to format a string as a personal name.
* At the moment, this means that the name is split at the last white space,
@@ -324,23 +324,23 @@ public:
* @param name The string to be formatted
* @param multiple A boolean indicating if the string can contain multiple values
*/
- static QString formatName(const QString& name, bool multiple=true);
+ static TQString formatName(const TQString& name, bool multiple=true);
/**
* A convenience function to format a string as a date.
*
* @param date The string to be formatted
*/
- static QString formatDate(const QString& date);
+ static TQString formatDate(const TQString& date);
/**
* Helper method to fix capitalization.
*
* @param str String to fix
*/
- static QString capitalize(QString str);
+ static TQString capitalize(TQString str);
/**
* Return the key to be used for sorting titles
*/
- static QString sortKeyTitle(const QString& title);
+ static TQString sortKeyTitle(const TQString& title);
/**
* Returns a mapping of the FieldType enum to translated titles for the types.
*/
@@ -348,23 +348,23 @@ public:
/**
* Returns a list of the titles of the field types.
*/
- static QStringList typeTitles();
+ static TQStringList typeTitles();
/**
* Splits a string into multiple values;
*
* @param string The string to be split
*/
- static QStringList split(const QString& string, bool allowEmpty);
+ static TQStringList split(const TQString& string, bool allowEmpty);
/**
* Returns the delimiter used to split field values
*
* @return The delimeter regexp
*/
- static const QRegExp& delimiter() { return s_delimiter; }
+ static const TQRegExp& delimiter() { return s_delimiter; }
/**
* reset if the field is a rating field used for syntax version 7 and earlier */
static void convertOldRating(Data::FieldPtr field);
- static void stripArticles(QString& value);
+ static void stripArticles(TQString& value);
static void articlesUpdated();
private:
@@ -375,19 +375,19 @@ private:
static long getID();
long m_id;
- QString m_name;
- QString m_title;
- QString m_category;
- QString m_desc;
+ TQString m_name;
+ TQString m_title;
+ TQString m_category;
+ TQString m_desc;
Type m_type;
- QStringList m_allowed;
+ TQStringList m_allowed;
int m_flags;
FormatFlag m_formatFlag;
StringMap m_properties;
// need to remember articles with apostrophes for capitalization
- static QStringList s_articlesApos;
- static QRegExp s_delimiter;
+ static TQStringList s_articlesApos;
+ static TQRegExp s_delimiter;
};
} // end namespace