functions.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSPREAD_FUNCTIONS
00022 #define KSPREAD_FUNCTIONS
00023
00024 #include <qvaluevector.h>
00025 #include "kspread_value.h"
00026
00027 namespace KSpread
00028 {
00029
00030 class Formula;
00031
00032 typedef KSpreadValue (*FunctionPtr)( const Formula*, QValueVector<KSpreadValue> );
00033
00034 class Function
00035 {
00036 public:
00037 Function( const QString& name, FunctionPtr ptr );
00038 ~Function();
00039 QString name() const;
00040 QString localizedName() const;
00041 QString helpText() const;
00042 void setHelpText( const QString& text );
00043 KSpreadValue exec( const Formula* formula, QValueVector<KSpreadValue> args );
00044
00045 private:
00046 class Private;
00047 Private* d;
00048 };
00049
00050 class FunctionRepository
00051 {
00052 public:
00053
00054 FunctionRepository();
00055 ~FunctionRepository();
00056
00057 static FunctionRepository* self();
00058
00059 void add( Function* function );
00060
00061 Function* function( const QString& name );
00062
00063 private:
00064
00065 class Private;
00066 Private* d;
00067
00068 static FunctionRepository* s_self;
00069
00070
00071 FunctionRepository( const FunctionRepository& );
00072 FunctionRepository& operator=( const FunctionRepository& );
00073 };
00074
00075
00076 }
00077
00078
00079 #endif // KSPREAD_FUNCTIONS
This file is part of the documentation for kspread Library Version 1.4.2.