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

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • editor
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 // Qt
23 #include <QTableView>
24 #include <QMap>
25 
26 // KDE
27 class KActionMenu;
28 class KAction;
29 class KUrl;
30 
31 // KEduVocDocument
32 class KEduVocExpression;
33 class KEduVocDocument;
34 
35 // parley / collection
36 class VocabularyFilter;
37 
38 class Translator;
39 
40 
41 namespace Editor
42 {
43 class EditorWindow;
44 class VocabularyDelegate;
45 
46 class VocabularyView : public QTableView
47 {
48  Q_OBJECT
49 public:
50  VocabularyView(EditorWindow *parent);
51  virtual ~VocabularyView() {}
52 
53  KActionMenu* columnsActionMenu();
54 
55  void setFilter(VocabularyFilter * model);
56 
58  void saveColumnVisibility() const;
59 
60  QModelIndexList getSelectedIndexes() const;
61 
62 public slots:
63  void reset();
64  void appendEntry();
65 
67  void deleteSelectedEntries(bool askConfirmation = true);
68 
70  void slotEditCopy();
71 
73  void slotCutEntry();
74 
76  void slotEditPaste();
77 
82  void appendChar(const QChar & c);
83 
84  void setDocument(KEduVocDocument * doc);
85 
86  void setTranslator(Translator* translator);
87 
88  void checkSpelling(int language);
89 
93  void slotShowVocabularyColumnsDialog();
94 
95 signals:
96  void translationChanged(KEduVocExpression*, int);
97 
98 private slots:
99  void slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
100  void slotSelectionChanged(const QItemSelection&, const QItemSelection&);
101 
102  void continueSpelling();
103  void misspelling(const QString &word, int start);
104  void spellingReplace(const QString& oldWord, int start, const QString &newWord);
105 
106 private:
107  void selectIndex(const QModelIndex &index);
108  // trap enter presses at the end of the document to add a new entry instead of moving to the first cell
109  bool eventFilter(QObject *obj, QEvent *event);
110 
111  // Make this private to avoid inadvertent use. Instead use setFilter() which is public.
112  virtual void setModel(QAbstractItemModel *model) {
113  Q_UNUSED(model)
114  }
115 
116  KAction* m_appendEntryAction;
117  KAction* m_deleteEntriesAction;
118  KAction* m_copyAction;
119  KAction* m_cutAction;
120  KAction* m_pasteAction;
121  KAction* m_selectAllAction;
122  KAction* m_clearSelectionAction;
123 
124  VocabularyFilter* m_model;
125  VocabularyDelegate* m_vocabularyDelegate;
126  KEduVocDocument *m_doc;
127 
128  int m_spellColumn;
129  int m_spellRow;
130  Sonnet::BackgroundChecker *m_spellChecker;
131  Sonnet::Dialog *m_spellDialog;
132 };
133 
134 }
135 
136 #endif
Editor::VocabularyView::slotShowVocabularyColumnsDialog
void slotShowVocabularyColumnsDialog()
Show the vocabulary columns dialog to enable or disable the columns in the view.
Definition: vocabularyview.cpp:348
QModelIndex
QEvent
Editor::VocabularyView::getSelectedIndexes
QModelIndexList getSelectedIndexes() const
Definition: vocabularyview.cpp:446
VocabularyFilter
Definition: vocabularyfilter.h:26
QChar
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
Editor::VocabularyView::columnsActionMenu
KActionMenu * columnsActionMenu()
Editor::VocabularyView::saveColumnVisibility
void saveColumnVisibility() const
Save column visibility settings.
Definition: vocabularyview.cpp:204
QObject
Editor::VocabularyView::deleteSelectedEntries
void deleteSelectedEntries(bool askConfirmation=true)
Delete the currently selected entries.
Definition: vocabularyview.cpp:242
QString
Editor::VocabularyView::slotEditCopy
void slotEditCopy()
put the marked text/object into the clipboard
Definition: vocabularyview.cpp:262
Editor::VocabularyView::checkSpelling
void checkSpelling(int language)
Definition: vocabularyview.cpp:357
QTableView
Editor::VocabularyView::appendEntry
void appendEntry()
Definition: vocabularyview.cpp:226
Editor::VocabularyView::~VocabularyView
virtual ~VocabularyView()
Definition: vocabularyview.h:51
Editor::VocabularyView
Definition: vocabularyview.h:46
Translator
Keeps the translated words.
Definition: translator.h:74
Editor::VocabularyView::translationChanged
void translationChanged(KEduVocExpression *, int)
QItemSelection
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
QAbstractItemView::event
virtual bool event(QEvent *event)
Editor::VocabularyView::reset
void reset()
Definition: vocabularyview.cpp:173
Editor::EditorWindow
Definition: editor.h:50
QAbstractItemModel
QAbstractItemView::model
QAbstractItemModel * model() const
Editor::VocabularyView::setFilter
void setFilter(VocabularyFilter *model)
Definition: vocabularyview.cpp:151
QObject::parent
QObject * parent() const
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 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
  • 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