Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkPythonSnippets.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _QmitkPythonSnippets_H
18 #define _QmitkPythonSnippets_H
19 
20 #include <QWidget>
21 #include <QMap>
22 #include <MitkQtPythonExports.h>
23 struct QmitkPythonSnippetsData;
24 
27 class MITKQTPYTHON_EXPORT QmitkPythonSnippets: public QWidget
28 {
29  Q_OBJECT
30 
31  public:
32  static const QString DEFAULT_SNIPPET_FILE;
33  static const QString SNIPPETS_ROOT_XML_ELEMENT_NAME;
34  static const QString SNIPPETS_XML_ELEMENT_NAME;
37  typedef QMap<QString, QString> QStringMap;
42  QmitkPythonSnippets( const QString& _AutoSaveFileName="", QWidget* parent=0 );
45  virtual ~QmitkPythonSnippets();
48  static bool LoadStringMap( const QString& filename, QStringMap& oldMap );
49 
50 signals:
53  void PasteCommandRequested(const QString& command);
54 
55  protected slots:
58  void on_PasteSnippet_triggered( bool checked = false );
61  void on_RenameSnippet_triggered( bool checked = false );
64  void on_AddSnippet_triggered( bool checked = false );
67  void on_RemoveSnippet_triggered( bool checked = false );
70  void on_RestoreDefaultSnippets_triggered( bool checked = false );
73  void on_Name_currentIndexChanged( int i );
76  void on_Content_textChanged();
79  void on_SaveSnippets_triggered( bool checked = false );
82  void on_LoadSnippets_triggered( bool checked = false );
83 
84  protected:
87  void SaveStringMap( const QString& filename, const QStringMap& map ) const;
90  QString CreateUniqueName(const QString &name) const;
94  void Update(const QString &name = "");
95  private:
98  QmitkPythonSnippetsData* d;
99 };
100 
101 
102 
103 
104 #endif // _QmitkPythonSnippets_H_INCLUDED
105 
static const QString DEFAULT_SNIPPET_FILE
QMap< QString, QString > QStringMap
typedef for string map
a widget that holds snippets and serializes the snippets to a certain places
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
static const QString SNIPPETS_ROOT_XML_ELEMENT_NAME
static const std::string filename
static const QString SNIPPETS_XML_ELEMENT_NAME