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

knotes

  • sources
  • kde-4.14
  • kdepim
  • knotes
  • apps
knotesapp.h
Go to the documentation of this file.
1 /*******************************************************************
2  KNotes -- Notes for the KDE project
3 
4  Copyright (c) 1997-2013, The KNotes Developers
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *******************************************************************/
20 
21 #ifndef KNOTESAPP_H
22 #define KNOTESAPP_H
23 
24 #include <QDomDocument>
25 #include <QList>
26 #include <QWidget>
27 
28 #include <kapplication.h>
29 #include <ksessionmanager.h>
30 #include <kxmlguiclient.h>
31 
32 #include <Akonadi/Item>
33 #include <QPointer>
34 
35 class KNoteFindDialog;
36 class KNotesAkonadiTray;
37 class KMenu;
38 class KNote;
39 class KXMLGUIBuilder;
40 class KXMLGUIFactory;
41 namespace NoteShared {
42 class NotesChangeRecorder;
43 class NotesAkonadiTreeModel;
44 }
45 
46 namespace DNSSD {
47 class PublicService;
48 }
49 class KJob;
50 class QModelIndex;
51 class KNotesApp
52  : public QWidget, public KSessionManager, virtual public KXMLGUIClient
53 {
54  Q_OBJECT
55 public:
56  KNotesApp();
57  ~KNotesApp();
58 
59  bool commitData( QSessionManager & );
60 
61 public slots:
62  void newNote( const QString &name = QString(),
63  const QString &text = QString() );
64  void newNoteFromClipboard( const QString &name = QString() );
65  void hideAllNotes() const;
66  void showAllNotes() const;
67  void showNote( const Akonadi::Item::Id &id ) const;
68  void hideNote(const Akonadi::Item::Id &id ) const;
69  QString name( const Akonadi::Item::Id &id ) const;
70  QString text( const Akonadi::Item::Id &id ) const;
71  void setName(const Akonadi::Item::Id &id, const QString &newName );
72  void setText( const Akonadi::Item::Id &id, const QString &newText );
73 
74 private:
75  void showNote( KNote *note ) const;
76 
77 
78 private Q_SLOTS:
79  void slotPreferences();
80  void slotConfigUpdated();
81  void slotNoteDeleteFinished(KJob*);
82  void slotRowInserted(const QModelIndex &, int, int end);
83  void slotItemRemoved(const Akonadi::Item &item);
84  void slotItemChanged(const Akonadi::Item &item, const QSet<QByteArray> &);
85  void updateNoteActions();
86  void slotActivateRequested( bool, const QPoint& pos);
87  void slotSecondaryActivateRequested( const QPoint& );
88  void slotPrintSelectedNotes();
89  void slotQuit();
90  void slotConfigureAccels();
91  void slotShowNote();
92  void slotWalkThroughNotes();
93  void slotNoteKilled( Akonadi::Item::Id );
94  void slotOpenFindDialog();
95 
96  void slotSelectNote(Akonadi::Item::Id);
97  void slotCollectionChanged(const Akonadi::Collection &, const QSet<QByteArray> &);
98  void slotItemFetchFinished(KJob *job);
99  void slotDeleteSelectedNotes();
100 
101  void newNoteFromTextFile();
102 private:
103  void saveNotes(bool force = false, bool sync = false);
104  void updateNetworkListener();
105  void updateSystray();
106  void createNote(const Akonadi::Item &item);
107  void fetchNotesFromCollection(const Akonadi::Collection &col);
108  KXMLGUIFactory *m_guiFactory;
109  KXMLGUIBuilder *m_guiBuilder;
110  QDomDocument m_noteGUI;
111  KNotesAkonadiTray *mTray;
112  KMenu *m_noteMenu;
113  QList<QAction *> m_noteActions;
114  DNSSD::PublicService *m_publisher;
115  QHash<Akonadi::Item::Id, KNote*> mNotes;
116  NoteShared::NotesChangeRecorder *mNoteRecorder;
117  NoteShared::NotesAkonadiTreeModel *mNoteTreeModel;
118  QPointer<KNoteFindDialog> mFindDialog;
119  bool mDebugBaloo;
120 };
121 
122 #endif
KNotesApp::~KNotesApp
~KNotesApp()
Definition: knotesapp.cpp:223
QModelIndex
KNotesApp::showAllNotes
void showAllNotes() const
Definition: knotesapp.cpp:380
KNoteFindDialog
Definition: knotefinddialog.h:57
QWidget
KXMLGUIClient
QSessionManager
KNotesApp::setText
void setText(const Akonadi::Item::Id &id, const QString &newText)
Definition: knotesapp.cpp:455
KNote
Definition: knote.h:48
QPointer< KNoteFindDialog >
QPoint
KNotesApp::text
QString text(const Akonadi::Item::Id &id) const
Definition: knotesapp.cpp:438
KNotesApp::hideAllNotes
void hideAllNotes() const
Definition: knotesapp.cpp:371
QObject::name
const char * name() const
KSessionManager
QHash< Akonadi::Item::Id, KNote * >
QWidget::pos
QPoint pos() const
QSet
KNotesApp::newNoteFromClipboard
void newNoteFromClipboard(const QString &name=QString())
Definition: knotesapp.cpp:393
QString
QList< QAction * >
KNotesApp::showNote
void showNote(const Akonadi::Item::Id &id) const
QDomDocument
KNotesApp::commitData
bool commitData(QSessionManager &)
Definition: knotesapp.cpp:672
KNotesApp::hideNote
void hideNote(const Akonadi::Item::Id &id) const
Definition: knotesapp.cpp:360
KNotesApp
Definition: knotesapp.h:51
KNotesApp::newNote
void newNote(const QString &name=QString(), const QString &text=QString())
Definition: knotesapp.cpp:326
KNotesApp::setName
void setName(const Akonadi::Item::Id &id, const QString &newName)
Definition: knotesapp.cpp:446
KNotesApp::KNotesApp
KNotesApp()
Definition: knotesapp.cpp:102
KNotesAkonadiTray
Definition: knotesakonaditray.h:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knotes

Skip menu "knotes"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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