summaryrefslogtreecommitdiffstats
path: root/kugar/lib/mlabelobject.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kugar/lib/mlabelobject.h
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kugar/lib/mlabelobject.h')
-rw-r--r--kugar/lib/mlabelobject.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/kugar/lib/mlabelobject.h b/kugar/lib/mlabelobject.h
new file mode 100644
index 00000000..7f4a5164
--- /dev/null
+++ b/kugar/lib/mlabelobject.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+ mlabelobject.h - Kugar report label object
+ -------------------
+ begin : Wed Aug 11 1999
+ copyright : (C) 1999 by Mutiny Bay Software
+***************************************************************************/
+
+#ifndef MLABELOBJECT_H
+#define MLABELOBJECT_H
+
+#include <qstring.h>
+#include <qfontmetrics.h>
+
+#include "mreportobject.h"
+
+/**Kugar report label object
+ *@author Mutiny Bay Software
+ */
+
+namespace Kugar
+{
+
+class MLabelObject : public MReportObject
+{
+
+public:
+ /** Font weight constants */
+ enum FontWeight { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 };
+ /** Horizontal alignment constants */
+ enum HAlignment { Left = 0, Center, Right };
+ /** Vertial alignment constants */
+ enum VAlignment { Top = 0, Middle, Bottom };
+
+ /** Constructor */
+ MLabelObject();
+ /** Copy constructor */
+ MLabelObject( const MLabelObject& mLabelObject );
+ /** Assignment operator */
+ MLabelObject operator=( const MLabelObject& mLabelObject );
+ /** Destructor */
+ virtual ~MLabelObject();
+
+protected:
+ /** Label text */
+ QString text;
+ /** Label text font family */
+ QString fontFamily;
+ /** Label text font size in points */
+ int fontSize;
+ /** Label text font weight */
+ int fontWeight;
+ /** Label text font italic flag */
+ bool fontItalic;
+ /** Lable text horizontal alignment */
+ int hAlignment;
+ /** Label text vertical alignment */
+ int vAlignment;
+ /** Label text word wrap flag */
+ bool wordWrap;
+
+private:
+ /** Label text horizontal margin spacing */
+ const int xMargin;
+ /** Label text vertical margin spacing */
+ const int yMargin;
+
+public:
+ /** Sets the label's text string - default is an empty string*/
+ virtual void setText( const QString txt );
+ /** Sets the label's text font - default is Times,10,Normal,false */
+ void setFont( const QString family, int size, int weight, bool italic );
+ /** Sets the label's horizontal alignment -default is Left */
+ void setHorizontalAlignment( int a );
+ /** Sets the label's vertical alignment - default is Top */
+ void setVerticalAlignment( int a );
+ /** Sets the label's word wrap flag - default is false */
+ void setWordWrap( bool state );
+ /** Draws the label using the specificed painter & x/y-offsets */
+ void draw( QPainter* p, int xoffset, int yoffset );
+
+private:
+ /** Copies member data from one object to another.
+ * Used by the copy constructor and assignment operator
+ */
+ void copy( const MLabelObject* mLabelObject );
+
+};
+
+}
+
+#endif