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

kjots

  • sources
  • kde-4.14
  • kdepim
  • kjots
kjotswidget.h
Go to the documentation of this file.
1 /*
2  This file is part of KJots.
3 
4  Copyright (C) 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de>
5  Copyright (C) 2002, 2003 Aaron J. Seigo <aseigo@kde.org>
6  Copyright (C) 2003 Stanislav Kljuhhin <crz@hot.ee>
7  Copyright (C) 2005-2006 Jaison Lee <lee.jaison@gmail.com>
8  Copyright (C) 2007-2009 Stephen Kelly <steveire@gmail.com>
9 
10  This library is free software; you can redistribute it and/or modify it
11  under the terms of the GNU Library General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or (at your
13  option) any later version.
14 
15  This library is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
18  License for more details.
19 
20  You should have received a copy of the GNU Library General Public License
21  along with this library; see the file COPYING.LIB. If not, write to the
22  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23  02110-1301, USA.
24 */
25 
26 #ifndef KJOTSWIDGET_H
27 #define KJOTSWIDGET_H
28 
29 #include <QWidget>
30 #include <QItemSelection>
31 #include <QAbstractItemDelegate>
32 #include <akonadi/item.h>
33 
34 #include <grantlee/templateloader.h>
35 
36 class QCheckBox;
37 class QTextEdit;
38 class QTextCharFormat;
39 class QSplitter;
40 class QStackedWidget;
41 class QModelIndex;
42 
43 class KActionMenu;
44 class KFindDialog;
45 class KJob;
46 class KReplaceDialog;
47 class KSelectionProxyModel;
48 class KJotsBrowser;
49 class KXMLGUIClient;
50 
51 namespace Akonadi
52 {
53 class EntityTreeModel;
54 class EntityOrderProxyModel;
55 }
56 
57 namespace Grantlee
58 {
59 class Engine;
60 }
61 
62 class KJotsEdit;
63 class KJotsTreeView;
64 class KJotsSortProxyModel;
65 
66 class KJotsWidget : public QWidget
67 {
68  Q_OBJECT
69  Q_CLASSINFO("D-Bus Interface", "org.kde.KJotsWidget")
70 
71 public:
72  KJotsWidget( QWidget *parent, KXMLGUIClient *xmlGuiclient, Qt::WindowFlags f = 0 );
73  ~KJotsWidget();
74 
75  QTextEdit* activeEditor();
76 
77 public slots:
78  void prevPage();
79  void nextPage();
80  void prevBook();
81  void nextBook();
82  bool canGoNextPage() const;
83  bool canGoPreviousPage() const;
84  bool canGoNextBook() const;
85  bool canGoPreviousBook() const;
86 
87  void updateCaption();
88  void updateMenu();
89  void doCreateNewPage( const Akonadi::Collection &collection );
90 
91  Q_SCRIPTABLE void newPage();
92  Q_SCRIPTABLE void newBook();
93 
94  Q_SCRIPTABLE bool queryClose();
95 
96 signals:
97  void canGoNextPageChanged( bool );
98  void canGoPreviousPageChanged( bool );
99  void canGoNextBookChanged( bool );
100  void canGoPreviousBookChanged( bool );
101 
102  void captionChanged( const QString &newCaption );
103 
110  void activeAnchorChanged(const QString &anchorTarget, const QString &anchorText);
111 
112 protected:
113  QString renderSelectionToHtml();
114  QString renderSelectionToXml();
115  QString renderSelectionToPlainText();
116  QString getThemeFromUser();
117 
118  void selectNext( int role, int step );
119  int search( bool );
120  void migrateNoteData( const QString &migrator, const QString &type = QString() );
121 
122 protected slots:
123  void renderSelection();
124  void changeTheme();
125  void exportSelectionToHtml();
126  void exportSelectionToPlainText();
127  void exportSelectionToXml();
128  void printSelection();
129  void printPreviewSelection();
130 
131  void deletePage();
132  void deleteBook();
133  void deleteMultiple();
134 
135 private slots:
136  void delayedInitialization();
137  void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
138  void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight );
139  void bookshelfEditItemFinished( QWidget *, QAbstractItemDelegate::EndEditHint );
140  bool canGo( int role, int step ) const;
141 
142  void newPageResult( KJob *job );
143  void newBookResult( KJob *job );
144 
145  void copySelectionToTitle();
146  void copy();
147  void configure();
148 
149  void onShowSearch();
150  void onUpdateSearch();
151  void onStartSearch();
152  void onRepeatSearch();
153  void onEndSearch();
154 
155  void onShowReplace();
156  void onUpdateReplace();
157  void onStartReplace();
158  void onRepeatReplace();
159  void onEndReplace();
160 
161  void actionLock();
162  void actionUnlock();
163  void actionSortChildrenAlpha();
164  void actionSortChildrenByDate();
165 
166  void saveState();
167  void restoreState();
168 
169  void currentCharFormatChanged(const QTextCharFormat &);
170 
171  void updateConfiguration();
172 
173 private:
174  void print(QPrinter &printer);
175  KXMLGUIClient *m_xmlGuiClient;
176  KJotsEdit *editor;
177  KJotsBrowser *browser;
178  QStackedWidget *stackedWidget;
179  KActionMenu *bookmarkMenu;
180  Akonadi::EntityTreeModel *m_kjotsModel;
181  KSelectionProxyModel *selProxy;
182  KJotsSortProxyModel *m_sortProxyModel;
183  Akonadi::EntityOrderProxyModel *m_orderProxy;
184  KJotsTreeView *treeview;
185  QSplitter *m_splitter;
186  QTimer *m_autosaveTimer;
187 
188  QString activeAnchor;
189 
190  Grantlee::Engine *m_templateEngine;
191  Grantlee::FileSystemTemplateLoader::Ptr m_loader;
192 
193  KFindDialog *searchDialog;
194  QStringList searchHistory;
195  int searchBeginPos, searchEndPos, searchPos;
196  QCheckBox *searchAllPages;
197 
198  KReplaceDialog *replaceDialog;
199  QStringList replaceHistory;
200  int replaceBeginPos, replaceEndPos, replacePos;
201  QCheckBox *replaceAllPages;
202  QModelIndex replaceStartPage;
203 
204  QSet<QAction*> entryActions, pageActions, bookActions, multiselectionActions;
205 };
206 
207 #endif
QModelIndex
KJotsWidget::changeTheme
void changeTheme()
Definition: kjotswidget.cpp:1019
QWidget
KJotsWidget::canGoPreviousBook
bool canGoPreviousBook() const
Definition: kjotswidget.cpp:1306
KJotsWidget::canGoPreviousPage
bool canGoPreviousPage() const
Definition: kjotswidget.cpp:1296
KJotsWidget::canGoNextBookChanged
void canGoNextBookChanged(bool)
KJotsWidget::KJotsWidget
KJotsWidget(QWidget *parent, KXMLGUIClient *xmlGuiclient, Qt::WindowFlags f=0)
Definition: kjotswidget.cpp:113
KJotsWidget::canGoNextBook
bool canGoNextBook() const
Definition: kjotswidget.cpp:1301
KJotsTreeView
Definition: kjotstreeview.h:29
QPrinter
KJotsWidget::exportSelectionToHtml
void exportSelectionToHtml()
Definition: kjotswidget.cpp:1027
KJotsWidget::deletePage
void deletePage()
Definition: kjotswidget.cpp:735
EntityTreeModel
KJotsWidget::queryClose
Q_SCRIPTABLE bool queryClose()
Definition: kjotswidget.cpp:1764
KJotsWidget::exportSelectionToPlainText
void exportSelectionToPlainText()
Definition: kjotswidget.cpp:1053
KJotsWidget
Definition: kjotswidget.h:66
KJotsWidget::exportSelectionToXml
void exportSelectionToXml()
Definition: kjotswidget.cpp:1075
KJotsWidget::updateCaption
void updateCaption()
Definition: kjotswidget.cpp:1745
KJotsEdit
Definition: kjotsedit.h:35
KJotsWidget::renderSelection
void renderSelection()
Definition: kjotswidget.cpp:969
KJotsWidget::getThemeFromUser
QString getThemeFromUser()
Definition: kjotswidget.cpp:1001
KJotsWidget::selectNext
void selectNext(int role, int step)
Definition: kjotswidget.cpp:1222
KJotsWidget::canGoNextPage
bool canGoNextPage() const
Definition: kjotswidget.cpp:1291
KJotsWidget::newBook
Q_SCRIPTABLE void newBook()
Definition: kjotswidget.cpp:797
KJotsWidget::doCreateNewPage
void doCreateNewPage(const Akonadi::Collection &collection)
Definition: kjotswidget.cpp:847
KJotsWidget::activeAnchorChanged
void activeAnchorChanged(const QString &anchorTarget, const QString &anchorText)
Signals that the text cursor in the editor is now on a different anchor, or not on an anchor anymore...
KJotsSortProxyModel
Definition: kjotssortproxymodel.h:29
QTimer
KJotsWidget::captionChanged
void captionChanged(const QString &newCaption)
QCheckBox
KJotsWidget::renderSelectionToHtml
QString renderSelectionToHtml()
Definition: kjotswidget.cpp:875
KJotsWidget::newPage
Q_SCRIPTABLE void newPage()
Definition: kjotswidget.cpp:825
QSet< QAction * >
QStackedWidget
KJotsWidget::canGoPreviousPageChanged
void canGoPreviousPageChanged(bool)
KJotsBrowser
Definition: kjotsbrowser.h:30
QString
KJotsWidget::prevPage
void prevPage()
Definition: kjotswidget.cpp:1259
QStringList
QTextCharFormat
KJotsWidget::updateMenu
void updateMenu()
Definition: kjotswidget.cpp:603
KJotsWidget::canGoPreviousBookChanged
void canGoPreviousBookChanged(bool)
KJotsWidget::printSelection
void printSelection()
Definition: kjotswidget.cpp:1108
KJotsWidget::activeEditor
QTextEdit * activeEditor()
Definition: kjotswidget.cpp:595
QItemSelection
QSplitter
KJotsWidget::canGoNextPageChanged
void canGoNextPageChanged(bool)
KJotsWidget::nextBook
void nextBook()
Definition: kjotswidget.cpp:1244
KJotsWidget::deleteBook
void deleteBook()
Definition: kjotswidget.cpp:765
KJotsWidget::~KJotsWidget
~KJotsWidget()
Definition: kjotswidget.cpp:413
KJotsWidget::deleteMultiple
void deleteMultiple()
Definition: kjotswidget.cpp:708
KJotsWidget::nextPage
void nextPage()
Definition: kjotswidget.cpp:1249
KJotsWidget::prevBook
void prevBook()
Definition: kjotswidget.cpp:1254
KJotsWidget::printPreviewSelection
void printPreviewSelection()
Definition: kjotswidget.cpp:1097
Qt::WindowFlags
typedef WindowFlags
KJotsWidget::renderSelectionToPlainText
QString renderSelectionToPlainText()
Definition: kjotswidget.cpp:906
QObject::parent
QObject * parent() const
KJotsWidget::migrateNoteData
void migrateNoteData(const QString &migrator, const QString &type=QString())
Definition: kjotswidget.cpp:556
QTextEdit
KJotsWidget::search
int search(bool)
Definition: kjotswidget.cpp:1634
KJotsWidget::renderSelectionToXml
QString renderSelectionToXml()
Definition: kjotswidget.cpp:938
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjots

Skip menu "kjots"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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