• 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
  • notes
knote.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 KNOTE_H
22 #define KNOTE_H
23 #include <QDomDocument>
24 #include <QEvent>
25 #include <QFrame>
26 
27 #include <kconfig.h>
28 #include <kxmlguiclient.h>
29 #include <KSharedConfig>
30 #include <Akonadi/Item>
31 #include "knoteinterface.h"
32 
33 class KNoteDisplaySettings;
34 
35 class QLabel;
36 class QLayout;
37 class QSizeGrip;
38 
39 class KMenu;
40 class KNoteButton;
41 class KNoteEdit;
42 class KSelectAction;
43 class KToggleAction;
44 class KToolBar;
45 class KJob;
46 
47 
48 class KNote : public QFrame, virtual public KXMLGUIClient, public KNoteInterface
49 {
50  Q_OBJECT
51 public:
52  explicit KNote( const QDomDocument& buildDoc, const Akonadi::Item &item, bool allowDebugBaloo = false, QWidget *parent = 0 );
53  ~KNote();
54 
55  void setChangeItem(const Akonadi::Item &item, const QSet<QByteArray> &set = QSet<QByteArray>());
56  void saveNote(bool force = false, bool sync = false);
57 
58  QString name() const;
59  QString text() const;
60  Akonadi::Item::Id noteId() const;
61 
62  Akonadi::Item item() const;
63 
64  void setName( const QString &name );
65  void setText( const QString &text );
66 
67  bool isModified() const;
68  bool isDesktopAssigned() const;
69 
70  void toDesktop( int desktop );
71 
72 public slots:
73  void slotRename();
74  void slotKill( bool force = false );
75  void slotClose();
76 
77 signals:
78  void sigRequestNewNote();
79  void sigShowNextNote();
80  void sigNameChanged(const QString &);
81  void sigColorChanged();
82  void sigKillNote( Akonadi::Item::Id );
83 
84 protected:
85  virtual void contextMenuEvent( QContextMenuEvent * );
86  virtual void showEvent( QShowEvent * );
87  virtual void resizeEvent( QResizeEvent * );
88  virtual void closeEvent( QCloseEvent * );
89  virtual void dropEvent( QDropEvent * );
90  virtual void dragEnterEvent( QDragEnterEvent * );
91 
92  virtual bool event( QEvent * );
93  virtual bool eventFilter( QObject *, QEvent * );
94 
95 private slots:
96  void slotUpdateReadOnly();
97 
98  void slotSend();
99  void slotMail();
100  void slotPrint();
101  void slotPrintPreview();
102  void slotSaveAs();
103 
104  void slotSetAlarm();
105 
106  void slotPreferences();
107  void slotPopupActionToDesktop( int id );
108 
109  void slotApplyConfig();
110  void slotUpdateKeepAboveBelow(bool save = true);
111  void slotUpdateShowInTaskbar();
112  void slotUpdateDesktopActions();
113 
114  void slotKeepAbove();
115  void slotKeepBelow();
116 
117  void slotRequestNewNote();
118  void slotNoteSaved(KJob *job);
119  void slotDebugBaloo();
120 
121 private:
122  void buildGui();
123  void createActions();
124  void createNoteEditor(const QString &configFile);
125  void createNoteFooter();
126  void createNoteHeader();
127  void prepare();
128 
129  void updateFocus();
130  void updateLayout();
131  void updateLabelAlignment();
132 
133  void setColor( const QColor &, const QColor & );
134  void print(bool preview);
135  void setDisplayDefaultValue();
136 
137 private:
138  void loadNoteContent(const Akonadi::Item &item);
139  void updateAllAttributes();
140  void saveNoteContent();
141  Akonadi::Item mItem;
142  QLayout *m_noteLayout;
143  QLabel *m_label;
144  QSizeGrip *m_grip;
145  KNoteButton *m_button;
146  KToolBar *m_tool;
147  KNoteEdit *m_editor;
148 
149  KMenu *m_menu;
150 
151  KToggleAction *m_readOnly;
152 
153 #ifdef Q_WS_X11
154  KSelectAction *m_toDesktop;
155 #endif
156  KToggleAction *m_keepAbove;
157  KToggleAction *m_keepBelow;
158 
159  KSharedConfig::Ptr m_kwinConf;
160 
161  KNoteDisplaySettings *mDisplayAttribute;
162  bool mAllowDebugBaloo;
163 };
164 
165 #endif
knoteinterface.h
KNote::slotKill
void slotKill(bool force=false)
Definition: knote.cpp:159
QEvent
QResizeEvent
QWidget
KNote::isModified
bool isModified() const
Definition: knote.cpp:281
KXMLGUIClient
KNote::~KNote
~KNote()
Definition: knote.cpp:124
KNoteEdit
Definition: knoteedit.h:39
QLayout
KNote::showEvent
virtual void showEvent(QShowEvent *)
Definition: knote.cpp:1106
KNote
Definition: knote.h:48
KNoteInterface
Definition: knoteinterface.h:22
KNote::saveNote
void saveNote(bool force=false, bool sync=false)
Definition: knote.cpp:178
KNote::isDesktopAssigned
bool isDesktopAssigned() const
Definition: knote.cpp:276
KNote::slotClose
void slotClose()
Definition: knote.cpp:378
KNote::sigShowNextNote
void sigShowNextNote()
KNoteButton
Definition: knotebutton.h:27
KNoteDisplaySettings
Definition: knotedisplaysettings.h:30
KNote::sigKillNote
void sigKillNote(Akonadi::Item::Id)
QCloseEvent
KNote::dropEvent
virtual void dropEvent(QDropEvent *)
Definition: knote.cpp:1149
KNote::eventFilter
virtual bool eventFilter(QObject *, QEvent *)
Definition: knote.cpp:1180
KNote::slotRename
void slotRename()
Definition: knote.cpp:288
QShowEvent
QContextMenuEvent
QObject
QDropEvent
KNote::sigColorChanged
void sigColorChanged()
KNote::text
QString text() const
Definition: knote.cpp:246
KNote::name
QString name() const
Definition: knote.cpp:241
KNote::resizeEvent
virtual void resizeEvent(QResizeEvent *)
Definition: knote.cpp:1127
QSet
KNote::item
Akonadi::Item item() const
Definition: knote.cpp:1247
QString
QColor
KNote::setChangeItem
void setChangeItem(const Akonadi::Item &item, const QSet< QByteArray > &set=QSet< QByteArray >())
Definition: knote.cpp:139
KNote::event
virtual bool event(QEvent *)
Definition: knote.cpp:1170
QDomDocument
QFrame
KNote::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *)
Definition: knote.cpp:1142
KNote::closeEvent
virtual void closeEvent(QCloseEvent *)
Definition: knote.cpp:1133
QDragEnterEvent
KNote::noteId
Akonadi::Item::Id noteId() const
Definition: knote.cpp:236
KNote::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *)
Definition: knote.cpp:1099
KNote::setName
void setName(const QString &name)
Definition: knote.cpp:251
KNote::sigRequestNewNote
void sigRequestNewNote()
KNote::toDesktop
void toDesktop(int desktop)
Definition: knote.cpp:978
QSizeGrip
KNote::KNote
KNote(const QDomDocument &buildDoc, const Akonadi::Item &item, bool allowDebugBaloo=false, QWidget *parent=0)
Definition: knote.cpp:92
QLabel
QObject::parent
QObject * parent() const
KNote::setText
void setText(const QString &text)
Definition: knote.cpp:269
KNote::sigNameChanged
void sigNameChanged(const QString &)
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