• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • vocabulary
vocabularyview.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2006, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4  Copyright 2007-2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
5 
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
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. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef VOCABULARYVIEW_H
18 #define VOCABULARYVIEW_H
19 
20 #include <sonnet/dialog.h>
21 
22 #include <QTableView>
23 #include <QMap>
24 
25 class KEduVocExpression;
26 class KEduVocDocument;
27 
28 class KActionMenu;
29 class KAction;
30 class KUrl;
31 
32 class Translator;
33 
34 namespace Editor {
35  class EditorWindow;
36  class VocabularyFilter;
37  class VocabularyDelegate;
38 
39 class VocabularyView : public QTableView
40 {
41  Q_OBJECT
42 public:
43  VocabularyView(EditorWindow *parent);
44  virtual ~VocabularyView() {}
45 
46  KActionMenu* columnsActionMenu();
47 
48  void setModel(VocabularyFilter * model);
49 
51  void saveColumnVisibility() const;
52 
53  QModelIndexList getSelectedIndexes() const;
54 
55 public slots:
56  void reset();
57  void appendEntry();
58 
60  void deleteSelectedEntries(bool askConfirmation = true);
61 
63  void slotEditCopy();
64 
66  void slotCutEntry();
67 
69  void slotEditPaste();
70 
75  void appendChar(const QChar & c);
76 
77  void setDocument(KEduVocDocument * doc);
78 
79  void setTranslator(Translator* translator);
80 
81  void checkSpelling(int language);
82 
86  void slotShowVocabularyColumnsDialog();
87 
88 signals:
89  void translationChanged(KEduVocExpression*, int);
90 
91 private slots:
92  void slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
93  void slotSelectionChanged(const QItemSelection&, const QItemSelection&);
94 
95  void continueSpelling();
96  void misspelling(const QString &word, int start);
97  void spellingReplace(const QString& oldWord, int start, const QString &newWord);
98 
99 private:
100  void selectIndex(const QModelIndex &index);
101  // trap enter presses at the end of the document to add a new entry instead of moving to the first cell
102  bool eventFilter(QObject *obj, QEvent *event);
103  virtual void setModel(QAbstractItemModel *model) { Q_UNUSED(model) }
104 
105  KAction* m_appendEntryAction;
106  KAction* m_deleteEntriesAction;
107  KAction* m_copyAction;
108  KAction* m_cutAction;
109  KAction* m_pasteAction;
110  KAction* m_selectAllAction;
111  KAction* m_clearSelectionAction;
112 
113  VocabularyFilter* m_model;
114  VocabularyDelegate* m_vocabularyDelegate;
115  KEduVocDocument *m_doc;
116 
117  int m_spellColumn;
118  int m_spellRow;
119  Sonnet::BackgroundChecker *m_spellChecker;
120  Sonnet::Dialog *m_spellDialog;
121 };
122 
123 }
124 
125 #endif
Editor::VocabularyView::slotShowVocabularyColumnsDialog
void slotShowVocabularyColumnsDialog()
Show the vocabulary columns dialog to enable or disable the columns in the view.
Definition: vocabularyview.cpp:348
Editor::VocabularyView::getSelectedIndexes
QModelIndexList getSelectedIndexes() const
Definition: vocabularyview.cpp:445
Editor::VocabularyView::slotCutEntry
void slotCutEntry()
Cut an entry.
Definition: vocabularyview.cpp:317
Editor::VocabularyView::VocabularyView
VocabularyView(EditorWindow *parent)
Definition: vocabularyview.cpp:54
Editor::VocabularyView::slotEditPaste
void slotEditPaste()
paste the clipboard into the document
Definition: vocabularyview.cpp:272
QObject
Editor::VocabularyView::columnsActionMenu
KActionMenu * columnsActionMenu()
Editor::VocabularyFilter
Definition: vocabularyfilter.h:27
Editor::VocabularyView::saveColumnVisibility
void saveColumnVisibility() const
Save column visibility settings.
Definition: vocabularyview.cpp:203
Editor::VocabularyView::deleteSelectedEntries
void deleteSelectedEntries(bool askConfirmation=true)
Delete the currently selected entries.
Definition: vocabularyview.cpp:242
QTableView
Editor::VocabularyView::slotEditCopy
void slotEditCopy()
put the marked text/object into the clipboard
Definition: vocabularyview.cpp:262
QAbstractItemModel
Editor::VocabularyView::checkSpelling
void checkSpelling(int language)
Definition: vocabularyview.cpp:357
Editor::VocabularyView::appendEntry
void appendEntry()
Definition: vocabularyview.cpp:226
Editor::VocabularyView::~VocabularyView
virtual ~VocabularyView()
Definition: vocabularyview.h:44
Editor::VocabularyView
Definition: vocabularyview.h:39
Translator
Keeps the translated words.
Definition: translator.h:74
Editor::VocabularyView::translationChanged
void translationChanged(KEduVocExpression *, int)
Editor::VocabularyView::setTranslator
void setTranslator(Translator *translator)
Set the translator to be used by the delegate.
Definition: vocabularyview.cpp:343
Editor::VocabularyView::setDocument
void setDocument(KEduVocDocument *doc)
Definition: vocabularyview.cpp:332
Editor::VocabularyView::reset
void reset()
Definition: vocabularyview.cpp:172
Editor::EditorWindow
Definition: editor.h:46
Editor::VocabularyView::setModel
void setModel(VocabularyFilter *model)
Definition: vocabularyview.cpp:151
Editor::VocabularyView::appendChar
void appendChar(const QChar &c)
Append a char to the last edited entry (used to add the phonetic stuff).
Definition: vocabularyview.cpp:236
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal