diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kformula/basicelement.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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 'lib/kformula/basicelement.h')
-rw-r--r-- | lib/kformula/basicelement.h | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/lib/kformula/basicelement.h b/lib/kformula/basicelement.h index ee9cffe0..d373fc6c 100644 --- a/lib/kformula/basicelement.h +++ b/lib/kformula/basicelement.h @@ -21,10 +21,10 @@ #ifndef BASICELEMENT_H #define BASICELEMENT_H -// Qt Include -#include <qdom.h> -#include <qptrlist.h> -#include <qstring.h> +// TQt Include +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqstring.h> // KDE Include @@ -32,7 +32,7 @@ #include "contextstyle.h" #include "kformuladefs.h" -class QKeyEvent; +class TQKeyEvent; class KCommand; @@ -53,7 +53,7 @@ class StyleElement; * Basis of every formula element. An element is used basically by * other elements and by the @ref FormulaCursor . * - * Each element knows its size (a rect that includes all children) + * Each element knows its size (a rect that includes all tqchildren) * and how to draw itself. See @ref calcSizes and @ref draw . * * An element might contain valid cursor position. If the cursor @@ -63,11 +63,11 @@ class StyleElement; * cursor that tell how it wants to move. See @ref moveLeft , * @ref moveRight , @ref moveUp , @ref moveDown . * - * To build a tree an element must own children. If there are children + * To build a tree an element must own tqchildren. If there are tqchildren * there must be a main child. This is the child that might be used to * replace the element. See @ref getMainChild(). * - * If there can be children you might want to @ref insert and @ref remove + * If there can be tqchildren you might want to @ref insert and @ref remove * them. After a removal the element might be senseless. * (See @ref isSenseless ) * If it is it must be removed. @@ -81,13 +81,13 @@ class BasicElement public: /* - * Each element might contain children. Each child needs + * Each element might contain tqchildren. Each child needs * its own unique number. It is not guaranteed, however, * that the number stays the same all the time. - * (The SequenceElement's children are simply counted.) + * (The SequenceElement's tqchildren are simply counted.) */ - BasicElement(BasicElement* parent = 0); + BasicElement(BasicElement* tqparent = 0); virtual ~BasicElement(); // deep copy @@ -102,7 +102,7 @@ public: /** * @returns whether the child should be read-only. The idea is - * that a read-only parent has read-only children. + * that a read-only tqparent has read-only tqchildren. */ virtual bool readOnly( const BasicElement* child ) const; @@ -114,14 +114,14 @@ public: /** * Provide fast access to the rootElement for each child. */ - virtual const FormulaElement* formula() const { return parent->formula(); } + virtual const FormulaElement* formula() const { return tqparent->formula(); } /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const { return QChar::null; } + virtual TQChar getCharacter() const { return TQChar::null; } /** * @returns the type of this element. Used for @@ -141,7 +141,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Returns our position inside the widget. @@ -158,7 +158,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -166,20 +166,20 @@ public: StyleAttributes& style ) = 0; /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) = 0; + const LuPixelPoint& tqparentOrigin ) = 0; /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* /*cmd*/ ) {} @@ -243,7 +243,7 @@ public: */ virtual void entered( SequenceElement* /*child*/ ); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -257,7 +257,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return 0; } //virtual void setMainChild(SequenceElement*) {} @@ -265,21 +265,21 @@ public: // editing // - // Insert and remove children. + // Insert and remove tqchildren. /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction) {} + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction) {} /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction) {} + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction) {} /** * Moves the cursor to a normal place where new elements @@ -290,7 +290,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless() { return false; } @@ -316,7 +316,7 @@ public: /** - * Callback for the tabs among our children. Needed for alignment. + * Callback for the tabs among our tqchildren. Needed for tqalignment. */ virtual void registerTab( BasicElement* /*tab*/ ) {} @@ -336,13 +336,13 @@ public: * new elements because it owns the undo stack. But only the * sequence knows what chars are allowed. */ - virtual KCommand* input( Container*, QKeyEvent* ) { return 0; } + virtual KCommand* input( Container*, TQKeyEvent* ) { return 0; } // basic support - const BasicElement* getParent() const { return parent; } - BasicElement* getParent() { return parent; } - void setParent(BasicElement* p) { parent = p; } + const BasicElement* getParent() const { return tqparent; } + BasicElement* getParent() { return tqparent; } + void setParent(BasicElement* p) { tqparent = p; } luPixel getX() const { return m_x; } luPixel getY() const { return m_y; } @@ -350,7 +350,7 @@ public: void setX( luPixel x ) { m_x = x; } void setY( luPixel y ) { m_y = y; } - //QSize getSize() { return size; } + //TQSize getSize() { return size; } luPixel getWidth() const { return m_width; } luPixel getHeight() const { return m_height; } @@ -367,36 +367,36 @@ public: return getBaseline() - style.axisHeight( tstyle, factor ); } /** - * @return a QDomElement that contain as DomChildren the - * children, and as attribute the attribute of this + * @return a TQDomElement that contain as DomChildren the + * tqchildren, and as attribute the attribute of this * element. */ - QDomElement getElementDom( QDomDocument& doc); + TQDomElement getElementDom( TQDomDocument& doc); /** * Same as above, just MathML. * It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead */ - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; /** - * Set this element attribute, build children and + * Set this element attribute, build tqchildren and * call their buildFromDom. */ - bool buildFromDom(QDomElement element); + bool buildFromDom(TQDomElement element); /** - * Set this element attribute, build children and call + * Set this element attribute, build tqchildren and call * their builFromMathMLDom. * Returns the number of nodes processed or -1 if it failed. */ - int buildFromMathMLDom( QDomElement element ); + int buildFromMathMLDom( TQDomElement element ); // debug static int getEvilDestructionCount() { return evilDestructionCount; } /** - * @returns our type. This is an object from our parent's syntax tree + * @returns our type. This is an object from our tqparent's syntax tree * or 0 if there was a very bad parsing error. */ ElementType* getElementType() const { return elementType; } @@ -408,7 +408,7 @@ public: virtual void setStyle(StyleElement*) {} - virtual QString getElementName() const { return ""; }; + virtual TQString getElementName() const { return ""; }; protected: //Save/load support @@ -416,45 +416,45 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "BASIC"; } + virtual TQString getTagName() const { return "BASIC"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual void writeMathMLAttributes( QDomElement& /*element*/ ) const {}; - virtual void writeMathMLContent( QDomDocument& /*doc*/, - QDomElement& /*element*/, + virtual void writeMathMLAttributes( TQDomElement& /*element*/ ) const {}; + virtual void writeMathMLContent( TQDomDocument& /*doc*/, + TQDomElement& /*element*/, bool /*oasisFormat*/ ) const {}; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Returns if the SequenceElement could be constructed from the nodes first child. * The node name must match the given name. * - * This is a service for all subclasses that contain children. + * This is a service for all subclasses that contain tqchildren. */ - bool buildChild( SequenceElement* child, QDomNode node, QString name ); + bool buildChild( SequenceElement* child, TQDomNode node, TQString name ); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node @@ -462,16 +462,16 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString() { return ""; } + virtual TQString formulaString() { return ""; } /** * Utility function that sets the size type and returns the size value from @@ -483,33 +483,33 @@ protected: * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ - double getSize( const QString& str, SizeType* st ); + double getSize( const TQString& str, SizeType* st ); - SizeType getSpace( const QString& str ); + SizeType getSpace( const TQString& str ); private: /** * Used internally by getSize() */ - double str2size( const QString& str, SizeType* st, uint index, SizeType type ); + double str2size( const TQString& str, SizeType* st, uint index, SizeType type ); /** - * Our parent. - * The parent might not be null except for the FormulaElement + * Our tqparent. + * The tqparent might not be null except for the FormulaElement * that is the top of the element tree. */ - BasicElement* parent; + BasicElement* tqparent; /** * This elements size. */ - //QSize size; + //TQSize size; luPixel m_width; luPixel m_height; /** - * Our position relative to our parent. + * Our position relative to our tqparent. */ //KoPoint position; luPixel m_x; @@ -521,7 +521,7 @@ private: * along this line. * * There are elements (like matrix) that don't have a base line. It is - * -1 in this case. The alignment is done using the middle line. + * -1 in this case. The tqalignment is done using the middle line. */ luPixel m_baseline; |