00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GESTUREBROWSER_H
00026 #define GESTUREBROWSER_H
00027
00028
00029 #include "DigestGuiCore/guicomponentwidgets.h"
00030
00031 #include <QPen>
00032
00033 #include "MvcDigestDb/dgesturerecord.h"
00034
00035 #include "ui_gesturebrowserform.h"
00036
00037 class QAction;
00038 class QActionGroup;
00039 class QItemSelection;
00040 class QItemSelectionModel;
00041 class QMenu;
00042 class QStandardItemModel;
00043
00044 class DigestDbController;
00045 class CategoryItemModel;
00046 class GestureQueryModel;
00047 class SearchWidget;
00048 class SettingsController;
00049
00050
00051 class GestureBrowser : public GuiDbComponentMainWindow {
00052
00053 Q_OBJECT
00054
00055 public:
00056 GestureBrowser( DigestDbController* digestDbController,
00057 SettingsController* settingsController,
00058 QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00059 ~GestureBrowser();
00060
00061 bool eventFilter( QObject* watched, QEvent* event );
00062
00063
00064 protected:
00065 void showEvent( QShowEvent* event );
00066 void hideEvent( QHideEvent* event );
00067
00068 void resetEvent( VEvent* );
00069 void classesEvent( VClassesEvent* );
00070 void collectionsEvent( VCollectionsEvent* );
00071 void gesturesEvent( VGesturesEvent* );
00072
00073
00074 public slots:
00075 void execMessage( const QString& message );
00076
00077
00078 private slots:
00079 void on_actionTestPad_triggered();
00080 void on_actionRecognisers_triggered();
00081 void on_actionExperiments_triggered();
00082 void on_actionDatabase_triggered();
00083 void on_addGestureButton_clicked();
00084 void on_gestureIconZoomMin_clicked();
00085 void on_gestureIconZoomMax_clicked();
00086 void on_gestureIconZoomSlider_valueChanged( int );
00087 void on_playAndStopButton_clicked();
00088 void on_clearButton_clicked();
00089 void on_duplicateButton_clicked();
00090 void on_editAndDoneButton_clicked();
00091
00092 void onGestureModelThumbnailSizeChanged( const QSize& size );
00093
00094 void beginSearch( const QString& text );
00095 void endSearch();
00096
00097 void addNewClass();
00098 void addNewCollection();
00099
00100 void splitCollection();
00101
00102 void removeSelectedCategories();
00103 void removeSelectedGestures();
00104
00105 void onClassActionTriggered( QAction* action );
00106 void onCollectionActionTriggered( QAction* action );
00107
00108 void animationStateChanged();
00109 void onCategorySelectionChanged();
00110 void onGestureSelectionChanged();
00111 void updateNumGesturesLabel();
00112 void updateInfoTextBrowser();
00113
00114 bool setCurrentGesture( int id );
00115 bool setEditCurrentGesture( bool edit );
00116
00117
00118 private:
00119 void initToolBar();
00120
00121 bool updateCurrentGestureFromUi();
00122
00123 void submitEverything();
00124 void submitCurrentGesture();
00125
00126 void refreshAddRemoveClassesMenu();
00127 void refreshAddRemoveCollectionsMenu();
00128
00129 QString gestureFieldsAsHtml( const DGestureRecord& g ) const;
00130 QString gestureDateAsHtml( const QDate& date ) const;
00131
00132 Ui::GestureBrowserForm m_ui;
00133
00134 QString m_gestureQueryStr;
00135
00136 SettingsController* m_settingsController;
00137
00138 CategoryItemModel* m_categoryModel;
00139 QItemSelectionModel* m_categorySelectionModel;
00140
00141 GestureQueryModel* m_gestureModel;
00142 QItemSelectionModel* m_gestureSelectionModel;
00143
00144 QStandardItemModel* m_dummyModel;
00145
00146 QAction* m_splitCollectionAction;
00147
00148 DGestureRecord m_currentGesture;
00149 bool m_currentGestureMiscModified;
00150 bool m_gestureSelected;
00151 bool m_gestureEditing;
00152
00153 QAction* m_addGestureAction;
00154
00155 SearchWidget* m_searchWidget;
00156 QMenu* m_searchMenu;
00157 QActionGroup* m_searchTypeActionGroup;
00158 QAction* m_searchAllAction;
00159 QAction* m_searchIdsAction;
00160 QAction* m_searchLabelsAction;
00161 QAction* m_searchDatesAction;
00162 QAction* m_searchNotesAction;
00163 QAction* m_searchClassesAction;
00164 QAction* m_searchCollectionsAction;
00165 QAction* m_sqlWhereAction;
00166
00167 QPen m_editPen;
00168 QPen m_viewPen;
00169 QBrush m_editBackgroundBrush;
00170 QBrush m_viewBackgroundBrush;
00171
00172 QMenu* m_addRemoveClassesMenu;
00173 QMenu* m_addRemoveCollectionsMenu;
00174 QAction* m_newClassAction;
00175 QAction* m_noClassesPseudoAction;
00176 QAction* m_newCollectionAction;
00177 QAction* m_noCollectionsPseudoAction;
00178 QActionGroup* m_classesActionGroup;
00179 QActionGroup* m_collectionsActionGroup;
00180 };
00181
00182
00183 #endif // ! GESTUREBROWSER_H