00001 /********************************************************************** 00002 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 00021 #ifndef CALC_H 00022 #define CALC_H 00023 00024 #ifdef QT_NO_COMPONENT 00025 #define NO_PLUGINS 00026 #endif 00027 00028 #include <qlayout.h> 00029 #include <qwidgetstack.h> 00030 00031 #ifndef NO_PLUGINS 00032 #include <qvaluelist.h> 00033 #include <qpe/qlibrary.h> 00034 #endif 00035 00036 #include "engine.h" 00037 #include "plugininterface.h" 00038 00039 struct Plugin { 00040 #ifndef NO_PLUGINS 00041 QLibrary *library; 00042 #endif 00043 QWidget *pluginWidget; 00044 CalcInterface *interface; 00045 QString name; 00046 }; 00047 00048 class calc:public QWidget { 00049 00050 Q_OBJECT 00051 public: 00052 calc (QWidget * p = 0, const char *n = 0); 00053 ~calc (); 00054 00055 private: 00056 #ifndef NO_PLUGINS 00057 void loadPlugins (); 00058 QValueList < Plugin > pluginList; 00059 #endif 00060 QVBoxLayout *calculatorLayout; 00061 QWidgetStack *pluginWidgetStack; 00062 QLCDNumber *LCD; 00063 Engine engine; 00064 00065 public slots: 00066 void setMode(int m){pluginWidgetStack->raiseWidget(m);}; 00067 }; 00068 00069 #endif
1.4.2