1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef KOVARIABLEDLGS_H
21
#define KOVARIABLEDLGS_H
23
#include "KoVariable.h"
25
#include <kdialogbase.h>
28
#include <klistview.h>
29
#include <koffice_export.h>
36
/******************************************************************
38
* Class: KoVariableNameDia
40
******************************************************************/
42
class KoVariableNameDia : public KDialogBase
47
// For KWMailMergeVariableInsertDia
48
KoVariableNameDia( QWidget *parent );
50
KoVariableNameDia( QWidget *parent, const QPtrList<KoVariable> &vars );
51
QString getName() const;
54
void textChanged ( const QString &_text );
63
* Class: KoCustomVariablesListItem
64
* Used by KoCustomVariablesDia
65
* Represents an item in the listview, holding a lineedit to edit the value of the variable.
67
class KoCustomVariablesListItem : public QListViewItem
70
KoCustomVariablesListItem( QListView *parent );
72
void setVariable( KoCustomVariable *v );
73
KoCustomVariable *getVariable() const;
76
virtual int width ( const QFontMetrics & fm, const QListView * lv, int c ) const;
79
// Gets the value from the lineedit and sets it into the variable
83
KoCustomVariable *var;
84
KLineEdit *editWidget;
88
* Class: KoCustomVariablesList
90
* Used by KoCustomVariablesDia
92
class KoCustomVariablesList : public KListView
97
KoCustomVariablesList( QWidget *parent );
103
void columnSizeChange( int c, int os, int ns );
104
void sectionClicked( int c );
108
Private* d; // currently unused
112
* Class: KoCustomVariablesDia
113
* This dialog allows to set the value of the custom variables.
115
class KOTEXT_EXPORT KoCustomVariablesDia : public KDialogBase
120
KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVariable> &variables );
126
KoCustomVariablesList *list;
131
* Class: KoCustomVarDialog
132
* This dialog allows to add a new custom variable or
133
* to edit an existing one.
135
class KOTEXT_EXPORT KoCustomVarDialog : public KDialogBase
143
KoCustomVarDialog( QWidget *parent );
145
* Edit existing variable @p var
147
KoCustomVarDialog( QWidget *parent, KoCustomVariable *var );
149
virtual QString name();
150
virtual QString value();
155
void slotTextChanged(const QString&);
164
KoCustomVariable *m_var;