lib Library API Documentation

koVariableDlgs.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@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, or (at your option) any later version.
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 #ifndef KOVARIABLEDLGS_H
00021 #define KOVARIABLEDLGS_H
00022 
00023 #include "kovariable.h"
00024 
00025 #include <kdialogbase.h>
00026 #include <qptrlist.h>
00027 #include <qstring.h>
00028 #include <klistview.h>
00029 
00030 class QComboBox;
00031 class QVBox;
00032 class QResizeEvent;
00033 class KLineEdit;
00034 class QCloseEvent;
00035 
00036 /******************************************************************
00037  *
00038  * Class: KoVariableNameDia
00039  *
00040  ******************************************************************/
00041 
00042 class KoVariableNameDia : public KDialogBase
00043 {
00044     Q_OBJECT
00045 
00046 public:
00047     // For KWMailMergeVariableInsertDia
00048     KoVariableNameDia( QWidget *parent );
00049     // For kwview
00050     KoVariableNameDia( QWidget *parent, const QPtrList<KoVariable> &vars );
00051     QString getName() const;
00052 
00053 protected slots:
00054     void textChanged ( const QString &_text );
00055 protected:
00056     void init();
00057 
00058     QComboBox *names;
00059     QVBox *back;
00060 };
00061 
00067 class KoCustomVariablesListItem : public QListViewItem
00068 {
00069 public:
00070     KoCustomVariablesListItem( QListView *parent );
00071 
00072     void setVariable( KoCustomVariable *v );
00073     KoCustomVariable *getVariable() const;
00074 
00075     virtual void setup();
00076     virtual int width ( const QFontMetrics & fm, const QListView * lv, int c ) const;
00077     void update();
00078 
00079     // Gets the value from the lineedit and sets it into the variable
00080     void applyValue();
00081 
00082 protected:
00083     KoCustomVariable *var;
00084     KLineEdit *editWidget;
00085 };
00086 
00092 class KoCustomVariablesList : public KListView
00093 {
00094     Q_OBJECT
00095 
00096 public:
00097     KoCustomVariablesList( QWidget *parent );
00098 
00099     void setValues();
00100     void updateItems();
00101 
00102 protected slots:
00103     void columnSizeChange( int c, int os, int ns );
00104     void sectionClicked( int c );
00105 
00106 private:
00107     class Private;
00108     Private* d; // currently unused
00109 };
00110 
00115 class KoCustomVariablesDia : public KDialogBase
00116 {
00117     Q_OBJECT
00118 
00119 public:
00120     KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVariable> &variables );
00121 protected slots:
00122     void slotOk();
00123 
00124 protected:
00125     QVBox *back;
00126     KoCustomVariablesList *list;
00127 
00128 };
00129 
00135 class KoCustomVarDialog : public KDialogBase
00136 {
00137     Q_OBJECT
00138 
00139 public:
00143     KoCustomVarDialog( QWidget *parent );
00147     KoCustomVarDialog( QWidget *parent, KoCustomVariable *var );
00148 
00149     virtual QString name();
00150     virtual QString value();
00151 
00152 protected slots:
00153     void slotAddOk();
00154     void slotEditOk();
00155     void slotTextChanged(const QString&);
00156 
00157 protected:
00158     QVBox *back;
00159     KLineEdit *m_name;
00160     KLineEdit *m_value;
00161 
00162 private:
00163     void init();
00164     KoCustomVariable *m_var;
00165 };
00166 
00167 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Mar 20 14:25:28 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003