00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _NDMANAGER_H_
00022 #define _NDMANAGER_H_
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027
00028
00029 #include <qdom.h>
00030
00031
00032 #include <kapp.h>
00033 #include <klocale.h>
00034 #include <kdockwidget.h>
00035 #include <kaction.h>
00036 #include <kstdaction.h>
00037 #include <kurl.h>
00038 #include <kprocess.h>
00039 #include <kate/view.h>
00040
00041
00042 #include "parameterview.h"
00043 #include "pref.h"
00044 #include "ndmanagerdoc.h"
00045 #include "generalinformation.h"
00046 #include "fileinformation.h"
00047 #include "programinformation.h"
00048 #include "neuroscopevideoinfo.h"
00049 #include "managerview.h"
00050
00051 class KToggleAction;
00052
00053
00062 class ndManager : public KDockMainWindow
00063 {
00064 Q_OBJECT
00065 public:
00069 ndManager();
00070
00074 ~ndManager();
00075
00079 void openDocumentFile(const KURL& url=0);
00080
00101 void createParameterView(QMap<int, QValueList<int> >& anatomicalGroups,QMap<QString, QMap<int,QString> >& attributes,
00102 QMap<int, QValueList<int> >& spikeGroups,QMap<int, QMap<QString,QString> >& spikeGroupsInformation,QMap<int, QValueList<QString> >& units,
00103 GeneralInformation& generalInformation,QMap<QString,int>& acquisitionSystemInfo,QMap<QString,float>& videoInformation,
00104 QValueList<FileInformation>& files,QValueList<ChannelColors>& channelColors,QMap<int,int>& channelOffsets,
00105 NeuroscopeVideoInfo& neuroscopeVideoInfo,QValueList<ProgramInformation>& programs,
00106 int lfpRate,float screenGain,int nbSamples,int peakSampleIndex);
00107
00111 inline ParameterView* getParameterView(){return parameterView;};
00112
00113 protected:
00118 void saveProperties(KConfig *);
00119
00125 void readProperties(KConfig *);
00126
00127 public slots:
00128
00130 void updateGUI(Kate::View* view);
00131
00133 void updateGUI();
00134 void konsoleDockBeingClosed();
00137
00141 void nbSpikeGroupsModified(int nbGroups);
00142
00146 void fileModification(QValueList<QString> extensions);
00147
00151 void checkBeforeLaunchingPrograms();
00152
00156 void checkBeforeLaunchingScripts();
00157
00161 void scriptModification(const QValueList<QString>& scriptNames);
00162
00163 private slots:
00165 void slotFileOpen();
00166
00168 void slotNewFile();
00169
00173 void slotFileOpenRecent(const KURL& url);
00174
00176 void slotImport();
00177
00179 void slotSaveDefault();
00180
00182 void slotFileClose();
00183
00186 virtual bool queryClose();
00187
00189 void slotViewMainToolBar();
00190
00193 void slotViewStatusBar();
00194
00198 void slotStatusMsg(const QString &text);
00199
00201 void slotKeyBindings();
00202
00204 void executePreferencesDlg();
00205
00207 void applyPreferences();
00208
00210 void initializePreferences();
00211
00212
00213 void slotSave();
00214
00215
00216 void slotSaveAs();
00217
00219 void createManagerView();
00220
00222 void slotExpertMode();
00223
00225 void slotQuery();
00227 void slotQueryResult(QString message);
00228 inline void slotQueryResult(KProcess*,char* buffer,int buflen){
00229 slotQueryResult(QString::fromLocal8Bit(buffer,buflen));
00230 };
00231 private:
00233 void setupActions();
00234
00236 void resetState();
00237
00240 void initStatusBar();
00241
00242 private:
00244 KConfig *config;
00245
00249 ndManagerDoc* doc;
00250
00252 ndManagerPreferences* prefDialog;
00253
00257 KDockWidget* mainDock;
00258
00260 QString filePath;
00261
00262
00263 KRecentFilesAction* fileOpenRecent;
00264 KToggleAction* viewMainToolBar;
00265 KToggleAction* viewToolBar;
00266 KToggleAction* viewStatusBar;
00267 KToggleAction* expertMode;
00268
00270 bool importedFile;
00271
00273 bool newFile;
00274
00276 ParameterView* parameterView;
00277
00279 QDomDocument kateXmlDocument;
00280
00282 ManagerView* managerView;
00283
00285 KURL importedFileUrl;
00286
00288 QString queryResult;
00289 QString html;
00290 };
00291
00292 #endif // _NDMANAGER_H_