00001 /*************************************************************************** 00002 kmymoneycategory.h 00003 ------------------- 00004 begin : Mon Jul 10 2006 00005 copyright : (C) 2006 by Thomas Baumgart 00006 email : Thomas Baumgart <ipwizard@users.sourceforge.net> 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef KMYMONEYCATEGORY_H 00019 #define KMYMONEYCATEGORY_H 00020 00021 // ---------------------------------------------------------------------------- 00022 // QT Includes 00023 00024 class QWidget; 00025 class QFrame; 00026 00027 // ---------------------------------------------------------------------------- 00028 // KDE Includes 00029 00030 #include "kdecompat.h" 00031 #include <kcombobox.h> 00032 class KPushButton; 00033 00034 // ---------------------------------------------------------------------------- 00035 // Project Includes 00036 00037 #include <kmymoney/mymoneyaccount.h> 00038 #include <kmymoney/kmymoneycombo.h> 00039 00040 class kMyMoneyAccountSelector; 00041 00059 class KMyMoneyCategory : public KMyMoneyCombo 00060 { 00061 Q_OBJECT 00062 public: 00094 KMyMoneyCategory(QWidget* parent = 0, const char* name = 0, bool splitButton = false); 00095 00096 virtual ~KMyMoneyCategory(); 00097 00103 kMyMoneyAccountSelector* selector(void) const; 00104 00109 KPushButton* splitButton(void) const; 00110 00114 virtual void reparent( QWidget *parent, WFlags, const QPoint &, bool showIt = FALSE ); 00115 00119 virtual void setPalette(const QPalette& palette); 00120 00124 void setSplitTransaction(void); 00125 00129 bool isSplitTransaction(void) const; 00130 00134 void setCurrentText(const QString& txt = QString()) { KMyMoneyCombo::setCurrentText(txt); } 00135 00136 protected: 00142 virtual void focusInEvent(QFocusEvent* ev); 00143 00147 virtual void focusOutEvent(QFocusEvent* ev); 00148 00152 virtual void setCurrentTextById(const QString& id); 00153 00154 public slots: 00155 virtual void slotItemSelected(const QString& id); 00156 virtual void setEnabled(bool); 00157 virtual void setDisabled(bool); 00158 00159 signals: 00167 void focusIn(void); 00168 00169 private: 00171 class Private; 00173 Private* const d; 00174 }; 00175 00176 00177 class KMyMoneySecurity : public KMyMoneyCategory 00178 { 00179 Q_OBJECT 00180 public: 00181 KMyMoneySecurity(QWidget* parent = 0, const char* name = 0); 00182 virtual ~KMyMoneySecurity(); 00183 00187 void setCurrentText(const QString& txt = QString()) { KMyMoneyCategory::setCurrentText(txt); } 00188 00189 protected: 00193 virtual void setCurrentTextById(const QString& id); 00194 }; 00195 00196 #endif