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

kjots

  • sources
  • kde-4.12
  • 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 <QModelIndexList>
31 #include <QItemSelection>
32 #include <QAbstractItemDelegate>
33 #include <akonadi/item.h>
34 
35 #include <grantlee/templateloader.h>
36 
37 class QCheckBox;
38 class QTextEdit;
39 class QTextCharFormat;
40 class QSplitter;
41 class QStackedWidget;
42 class QModelIndex;
43 
44 class KActionMenu;
45 class KFindDialog;
46 class KJob;
47 class KReplaceDialog;
48 class KSelectionProxyModel;
49 class KJotsBrowser;
50 class KXMLGUIClient;
51 
52 namespace Akonadi
53 {
54 class EntityTreeModel;
55 class EntityOrderProxyModel;
56 }
57 
58 namespace Grantlee
59 {
60 class Engine;
61 }
62 
63 class KJotsEdit;
64 class KJotsTreeView;
65 class KJotsSortProxyModel;
66 
67 class KJotsWidget : public QWidget
68 {
69  Q_OBJECT
70  Q_CLASSINFO("D-Bus Interface", "org.kde.KJotsWidget")
71 
72 public:
73  KJotsWidget( QWidget *parent, KXMLGUIClient *xmlGuiclient, Qt::WindowFlags f = 0 );
74  ~KJotsWidget();
75 
76  QTextEdit* activeEditor();
77 
78 public slots:
79  void prevPage();
80  void nextPage();
81  void prevBook();
82  void nextBook();
83  bool canGoNextPage() const;
84  bool canGoPreviousPage() const;
85  bool canGoNextBook() const;
86  bool canGoPreviousBook() const;
87 
88  void updateCaption();
89  void updateMenu();
90  void doCreateNewPage( const Akonadi::Collection &collection );
91 
92  Q_SCRIPTABLE void newPage();
93  Q_SCRIPTABLE void newBook();
94 
95  Q_SCRIPTABLE bool queryClose();
96 
97 signals:
98  void canGoNextPageChanged( bool );
99  void canGoPreviousPageChanged( bool );
100  void canGoNextBookChanged( bool );
101  void canGoPreviousBookChanged( bool );
102 
103  void captionChanged( const QString &newCaption );
104 
111  void activeAnchorChanged(const QString &anchorTarget, const QString &anchorText);
112 
113 protected:
114  QString renderSelectionToHtml();
115  QString renderSelectionToXml();
116  QString renderSelectionToPlainText();
117  QString getThemeFromUser();
118 
119  void selectNext( int role, int step );
120  int search( bool );
121  void migrateNoteData( const QString &migrator, const QString &type = QString() );
122 
123 protected slots:
124  void renderSelection();
125  void changeTheme();
126  void exportSelectionToHtml();
127  void exportSelectionToPlainText();
128  void exportSelectionToXml();
129  void printSelection();
130  void printPreviewSelection();
131 
132  void deletePage();
133  void deleteBook();
134  void deleteMultiple();
135 
136 private slots:
137  void delayedInitialization();
138  void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
139  void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight );
140  void bookshelfEditItemFinished( QWidget *, QAbstractItemDelegate::EndEditHint );
141  bool canGo( int role, int step ) const;
142 
143  void newPageResult( KJob *job );
144  void newBookResult( KJob *job );
145 
146  void copySelectionToTitle();
147  void copy();
148  void configure();
149 
150  void onShowSearch();
151  void onUpdateSearch();
152  void onStartSearch();
153  void onRepeatSearch();
154  void onEndSearch();
155 
156  void onShowReplace();
157  void onUpdateReplace();
158  void onStartReplace();
159  void onRepeatReplace();
160  void onEndReplace();
161 
162  void actionLock();
163  void actionUnlock();
164  void actionSortChildrenAlpha();
165  void actionSortChildrenByDate();
166 
167  void saveState();
168  void restoreState();
169 
170  void currentCharFormatChanged(const QTextCharFormat &);
171 
172  void updateConfiguration();
173 
174 private:
175  void print(QPrinter &printer);
176  KXMLGUIClient *m_xmlGuiClient;
177  KJotsEdit *editor;
178  KJotsBrowser *browser;
179  QStackedWidget *stackedWidget;
180  KActionMenu *bookmarkMenu;
181  Akonadi::EntityTreeModel *m_kjotsModel;
182  KSelectionProxyModel *selProxy;
183  KJotsSortProxyModel *m_sortProxyModel;
184  Akonadi::EntityOrderProxyModel *m_orderProxy;
185  KJotsTreeView *treeview;
186  QSplitter *m_splitter;
187  QTimer *m_autosaveTimer;
188 
189  QString activeAnchor;
190 
191  Grantlee::Engine *m_templateEngine;
192  Grantlee::FileSystemTemplateLoader::Ptr m_loader;
193 
194  KFindDialog *searchDialog;
195  QStringList searchHistory;
196  int searchBeginPos, searchEndPos, searchPos;
197  QCheckBox *searchAllPages;
198 
199  KReplaceDialog *replaceDialog;
200  QStringList replaceHistory;
201  int replaceBeginPos, replaceEndPos, replacePos;
202  QCheckBox *replaceAllPages;
203  QModelIndex replaceStartPage;
204 
205  QSet<QAction*> entryActions, pageActions, bookActions, multiselectionActions;
206 };
207 
208 #endif
KJotsWidget::changeTheme
void changeTheme()
Definition: kjotswidget.cpp:1020
KJotsWidget::canGoPreviousBook
bool canGoPreviousBook() const
Definition: kjotswidget.cpp:1307
KJotsWidget::canGoPreviousPage
bool canGoPreviousPage() const
Definition: kjotswidget.cpp:1297
KJotsWidget::canGoNextBookChanged
void canGoNextBookChanged(bool)
KJotsWidget::KJotsWidget
KJotsWidget(QWidget *parent, KXMLGUIClient *xmlGuiclient, Qt::WindowFlags f=0)
Definition: kjotswidget.cpp:114
KJotsWidget::canGoNextBook
bool canGoNextBook() const
Definition: kjotswidget.cpp:1302
KJotsTreeView
Definition: kjotstreeview.h:29
KJotsWidget::exportSelectionToHtml
void exportSelectionToHtml()
Definition: kjotswidget.cpp:1028
QWidget
KJotsWidget::deletePage
void deletePage()
Definition: kjotswidget.cpp:736
EntityTreeModel
KJotsWidget::queryClose
Q_SCRIPTABLE bool queryClose()
Definition: kjotswidget.cpp:1765
KJotsWidget::exportSelectionToPlainText
void exportSelectionToPlainText()
Definition: kjotswidget.cpp:1054
KJotsWidget
Definition: kjotswidget.h:67
KJotsWidget::exportSelectionToXml
void exportSelectionToXml()
Definition: kjotswidget.cpp:1076
KJotsWidget::updateCaption
void updateCaption()
Definition: kjotswidget.cpp:1746
KJotsEdit
Definition: kjotsedit.h:35
KJotsWidget::renderSelection
void renderSelection()
Definition: kjotswidget.cpp:970
KJotsWidget::getThemeFromUser
QString getThemeFromUser()
Definition: kjotswidget.cpp:1002
KJotsWidget::selectNext
void selectNext(int role, int step)
Definition: kjotswidget.cpp:1223
KJotsWidget::canGoNextPage
bool canGoNextPage() const
Definition: kjotswidget.cpp:1292
KJotsWidget::newBook
Q_SCRIPTABLE void newBook()
Definition: kjotswidget.cpp:798
KJotsWidget::doCreateNewPage
void doCreateNewPage(const Akonadi::Collection &collection)
Definition: kjotswidget.cpp:848
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
KJotsWidget::captionChanged
void captionChanged(const QString &newCaption)
KJotsWidget::renderSelectionToHtml
QString renderSelectionToHtml()
Definition: kjotswidget.cpp:876
KJotsWidget::newPage
Q_SCRIPTABLE void newPage()
Definition: kjotswidget.cpp:826
KJotsWidget::canGoPreviousPageChanged
void canGoPreviousPageChanged(bool)
KJotsBrowser
Definition: kjotsbrowser.h:31
KJotsWidget::prevPage
void prevPage()
Definition: kjotswidget.cpp:1260
KJotsWidget::updateMenu
void updateMenu()
Definition: kjotswidget.cpp:604
KJotsWidget::canGoPreviousBookChanged
void canGoPreviousBookChanged(bool)
KJotsWidget::printSelection
void printSelection()
Definition: kjotswidget.cpp:1109
KJotsWidget::activeEditor
QTextEdit * activeEditor()
Definition: kjotswidget.cpp:596
KJotsWidget::canGoNextPageChanged
void canGoNextPageChanged(bool)
KJotsWidget::nextBook
void nextBook()
Definition: kjotswidget.cpp:1245
KJotsWidget::deleteBook
void deleteBook()
Definition: kjotswidget.cpp:766
KJotsWidget::~KJotsWidget
~KJotsWidget()
Definition: kjotswidget.cpp:414
KJotsWidget::deleteMultiple
void deleteMultiple()
Definition: kjotswidget.cpp:709
KJotsWidget::nextPage
void nextPage()
Definition: kjotswidget.cpp:1250
KJotsWidget::prevBook
void prevBook()
Definition: kjotswidget.cpp:1255
KJotsWidget::printPreviewSelection
void printPreviewSelection()
Definition: kjotswidget.cpp:1098
KJotsWidget::renderSelectionToPlainText
QString renderSelectionToPlainText()
Definition: kjotswidget.cpp:907
KJotsWidget::migrateNoteData
void migrateNoteData(const QString &migrator, const QString &type=QString())
Definition: kjotswidget.cpp:557
KJotsWidget::search
int search(bool)
Definition: kjotswidget.cpp:1635
KJotsWidget::renderSelectionToXml
QString renderSelectionToXml()
Definition: kjotswidget.cpp:939
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:39 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

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