moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kmplot / kmplot / FktDlg.h
blob81224baa378cf14e77f2670bacfd2998e6ee0075
1 /*
2 * KmPlot - a math. function plotter for the KDE-Desktop
4 * Copyright (C) 1998, 1999 Klaus-Dieter M�ler
5 * 2000, 2002 kd.moeller@t-online.de
6 *
7 * This file is part of the KDE Project.
8 * KmPlot is part of the KDE-EDU Project.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 /** @file FktDlg.h
27 * @brief Contains the FktDlg class. Entering and editing functions equation and attributes.
30 #ifndef FktDlg_included
31 #define FktDlg_included
33 // locale includes
34 #include "FktDlgData.h"
35 #include "View.h"
37 class XParser;
39 /** @short This widget class handles the users function input.
41 * The list of stored plots is shown. The entries can be edited and/or removed.
42 * New plots can be entered calling special dialog windows.
43 * @see KEditFunction, KEditParametric, KEditPolar
45 class FktDlg : public FktDlgData
47 Q_OBJECT
49 public:
50 /**
51 * The constructor gets the current parser instance
52 * @param parent Parent widget.
53 * @param parser points to the current parser instance.
55 FktDlg( QWidget* parent, View* view );
56 /// Empty destructor.
57 virtual ~FktDlg();
58 /// Fill the widgets with plots contained in th parser instance.
59 void getPlots();
60 /// Returns true if a function was changed
61 bool isChanged();
63 public slots:
64 /// Pressed on the "Copy Function.." button
65 void slotCopyFunction();
66 /// Pressed on the "Move Function.." button
67 void slotMoveFunction();
68 protected slots:
69 /// Delete selected plot
70 void slotDelete();
71 /// Edit selected Plot
72 void slotEdit();
73 /// Enables/disables actions if the list has a/no selection.
74 void slotHasSelection();
75 void lb_fktliste_doubleClicked(QListViewItem *, const QPoint &, int);
76 void lb_fktliste_clicked(QListViewItem * item);
77 void lb_fktliste_spacePressed(QListViewItem * item);
79 /// Edit a function plot.
80 /// @param index Function index of the parser instance.
81 /// @param num Listbox index
82 /// @see KEditFunction
83 void slotEditFunction( int id = -1 );
84 /// Edit a parametric plot.
85 /// @param x_index, y_index Function index of the parser instance.
86 /// @param num Listbox index
87 /// @see KEditParametric
88 void slotEditParametric( int x_id = -1, int y_id = -1 );
89 /// Edit a polar plot.
90 /// @param index Function index of the parser instance.
91 /// @param num Listbox index
92 /// @see KEditPolar
93 void slotEditPolar( int id = -1 );
94 /// Edit a new function plot.
95 void slotNewFunction();
96 /// Edit a new parametric plot.
97 void slotNewParametric();
98 /// Edit a new polar plot.
99 void slotNewPolar();
100 /// Invoke Help
101 void slotHelp();
103 private:
104 /// Looks up the id of \a f_str in the parser instance.
105 int getId( const QString &f_str );
106 /// Looks up the indices of the parametric pair of function.
107 int getParamId( const QString &f_str );
108 /// Update the view of the main window.
109 void updateView();
110 /// Called when the dialog is showed
111 void showEvent ( QShowEvent * );
112 // /// Send a function to an other instance of Kmplot. Returns true if it success, otherwise false
113 // bool sendFunction();
115 /// Ponts to the parser instance.
116 View* m_view;
117 /// indicates if a function is changed/added/removed
118 bool changed;
121 #endif // FktDlg_included