00001 /* 00002 This file is part of the Opie Project 00003 00004 Copyright (C) Opie Team <opie-devel@handhelds.org> 00005 =. 00006 .=l. 00007 .>+-= 00008 _;:, .> :=|. This program is free software; you can 00009 .> <`_, > . <= redistribute it and/or modify it under 00010 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00011 .="- .-=="i, .._ License as published by the Free Software 00012 - . .-<_> .<> Foundation; either version 2 of the License, 00013 ._= =} : or (at your option) any later version. 00014 .%`+i> _;_. 00015 .i_,=:_. -<s. This program is distributed in the hope that 00016 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00017 : .. .:, . . . without even the implied warranty of 00018 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00019 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00020 ..}^=.= = ; Library General Public License for more 00021 ++= -. .` .: details. 00022 : = ...= . :.=- 00023 -. .:....=;==+<; You should have received a copy of the GNU 00024 -_. . . )=. = Library General Public License along with 00025 -- :-=` this library; see the file COPYING.LIB. 00026 If not, write to the Free Software Foundation, 00027 Inc., 59 Temple Place - Suite 330, 00028 Boston, MA 02111-1307, USA. 00029 */ 00030 00031 #ifndef OPIE_QUICK_EDIT_H 00032 #define OPIE_QUICK_EDIT_H 00033 00034 #include <qsignal.h> 00035 #include <qwidget.h> 00036 00037 #include <opie2/opimtodo.h> 00038 00039 using Opie::OPimTodo; 00040 00041 namespace Todo{ 00042 class MainWindow; 00043 struct QuickEditBase { 00044 virtual OPimTodo todo()const = 0l; 00045 virtual QSignal* signal() = 0l; 00046 virtual QWidget* widget() = 0l; 00047 }; 00048 /* 00049 * this is my second try 00050 * of signal and slots with namespaces 00051 * and templates 00052 * I use a different approach now 00053 * I give a QSignal away 00054 * and have a protected method called emit 00055 */ 00060 class QuickEdit : public QuickEditBase{ 00061 public: 00062 QuickEdit(MainWindow* main ); 00063 virtual ~QuickEdit(); 00064 //OPimTodo todo()const; 00065 QSignal* signal(); 00066 //QWidget* widget(); 00067 protected: 00068 MainWindow* mainWindow(); 00069 void commit(); 00070 private: 00071 MainWindow* m_main; 00072 QSignal* m_sig; 00073 }; 00074 }; 00075 00076 00077 #endif
1.4.2