20#ifndef KSPREAD_VALUE_H
21#define KSPREAD_VALUE_H
23#include <tqdatetime.h>
25#include <tqtextstream.h>
27#include <koffice_export.h>
124 Value( const TQString& s );
126 Value ( const char *s);
133 Value( const TQDateTime& dt );
139 Value( const TQTime& time );
145 Value( const TQDate& date );
204 void setValue( const Value& v );
209 void setValue( bool b );
214 void setValue( long i );
219 void setValue( int i );
224 void setValue( double f );
229 void setValue( const TQString& s );
234 void setError( const TQString& msg );
239 void setValue( const TQDateTime& dt );
244 void setValue( const TQTime& dt );
249 void setValue( const TQDate& dt );
252 void setFormat (Format fmt);
259 bool asBoolean() const;
266 long asInteger() const;
273 double asFloat() const;
280 TQString asString() const;
285 TQDateTime asDateTime() const;
290 TQDate asDate() const;
295 TQTime asTime() const;
300 Value element( unsigned column, unsigned row ) const;
305 void setElement( unsigned column, unsigned row, const Value& value );
311 unsigned columns() const;
317 unsigned rows() const;
324 TQString errorMessage() const;
336 static const Value& empty();
343 static const Value& errorDIV0();
350 static const Value& errorNA();
359 static const Value& errorNAME();
366 static const Value& errorNUM();
373 static const Value& errorNULL();
380 static const Value& errorREF();
388 static const Value& errorVALUE();
394 bool allowComparison( const Value& v ) const;
400 int compare( const Value& v ) const;
405 bool equal( const Value& v ) const;
410 bool less( const Value& v ) const;
415 bool greater( const Value& v ) const;
418 bool operator==( const Value& v ) const;
419 inline bool operator!=( const Value& other ) const { return !operator==( other ); }
421 static int compare( double v1, double v2 );
425 static bool isZero( double v );
434TQTextStream& operator<<( TQTextStream& ts, KSpread::Value::Type type );
435TQTextStream& operator<<( TQTextStream& ts, KSpread::Value value );
Provides a wrapper for cell value.
unsigned columns() const If this value is an array, return the number of columns.
Format format() const Returns the format of the value (i.e.
unsigned rows() const If this value is an array, return the number of rows.
Value & assign(const Value &_value) Assigns from another value.
bool isBoolean() const Returns true if the type of this value is Boolean.
bool isEmpty() const Returns true if empty.
bool isNumber() const Returns true if the type of this value is either integer or floating-point.
bool isArray() const Returns true if the type of this value is array.
Type type() const Returns the type of the value.
bool isFloat() const Returns true if the type of this value is floating-point.
Value() Creates an empty value, i.e holds nothing.
bool isError() const Returns true if this value holds error information.
bool isString() const Returns true if the type of this value is string.
bool isInteger() const Returns true if the type of this value is integer.
|