kspread Library API Documentation

functions.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003,2004 Ariya Hidayat <ariya@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
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   // no copy or assign
00071   FunctionRepository( const FunctionRepository& );
00072   FunctionRepository& operator=( const FunctionRepository& );
00073 };
00074 
00075 
00076 } // namespace KSpread
00077 
00078 
00079 #endif // KSPREAD_FUNCTIONS
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:42:44 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003