• 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
knoteedit.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 KNOTEEDIT_H
22 #define KNOTEEDIT_H
23 
24 #include "knotes_export.h"
25 #include <QTextCharFormat>
26 #include <QWidget>
27 
28 #include "pimcommon/widgets/customtextedit.h"
29 
30 class QFont;
31 
32 class KAction;
33 class KActionCollection;
34 class KFontAction;
35 class KFontSizeAction;
36 class KToggleAction;
37 class KNote;
38 
39 class KNOTES_EXPORT KNoteEdit : public PimCommon::CustomTextEdit
40 {
41  Q_OBJECT
42 public:
43  explicit KNoteEdit(const QString &configFile, KActionCollection *actions, QWidget *parent = 0 );
44  ~KNoteEdit();
45 
46  void setNote( KNote *_note );
47 
48  void setText( const QString &text );
49  QString text() const;
50 
51  void setTextFont( const QFont &font );
52  void setTabStop( int tabs );
53  void setAutoIndentMode( bool newmode );
54 
55  void setColor(const QColor &fg, const QColor &bg);
56  void setCursorPositionFromStart(int pos);
57  int cursorPositionFromStart() const;
58 
59 public slots:
60  void setRichText( bool );
61 
62  void textBold( bool );
63  void textStrikeOut( bool );
64 
65  void slotTextColor();
66 
67  void textAlignLeft();
68  void textAlignCenter();
69  void textAlignRight();
70  void textAlignBlock();
71 
72  void textList();
73 
74  void textSuperScript();
75  void textSubScript();
76 
77  void textIncreaseIndent();
78  void textDecreaseIndent();
79  void setTextFontSize( int );
80 
81  void slotTextBackgroundColor();
82  void slotInsertDate();
83 
84 protected:
85  void keyPressEvent( QKeyEvent * );
86  void focusInEvent( QFocusEvent * );
87  void focusOutEvent( QFocusEvent * );
88 
89 protected slots:
90  void mousePopupMenuImplementation(const QPoint& pos);
91 
92 private slots:
93  void slotCurrentCharFormatChanged( const QTextCharFormat & );
94  void slotCursorPositionChanged();
95  void slotUpperCase();
96  void slotLowerCase();
97  void slotSentenceCase();
98  void slotInsertCheckMark();
99 private:
100  void autoIndent();
101 
102  void enableRichTextActions(bool enabled);
103 
104 private:
105  QColor mDefaultBackgroundColor;
106  QColor mDefaultForegroundColor;
107 
108  KToggleAction *m_textBold;
109  KToggleAction *m_textItalic;
110  KToggleAction *m_textUnderline;
111  KToggleAction *m_textStrikeOut;
112 
113  KToggleAction *m_textAlignLeft;
114  KToggleAction *m_textAlignCenter;
115  KToggleAction *m_textAlignRight;
116  KToggleAction *m_textAlignBlock;
117 
118  KToggleAction *m_textList;
119  KToggleAction *m_textSuper;
120  KToggleAction *m_textSub;
121 
122  KAction *m_textIncreaseIndent;
123  KAction *m_textDecreaseIndent;
124 
125  KAction *m_textColor;
126  KFontAction *m_textFont;
127  KFontSizeAction *m_textSize;
128  KNote *m_note;
129  KActionCollection *m_actions;
130  bool m_autoIndentMode;
131 };
132 
133 #endif
QWidget
KNoteEdit
Definition: knoteedit.h:39
QFont
KNote
Definition: knote.h:48
QPoint
KNOTES_EXPORT
#define KNOTES_EXPORT
Definition: knotes_export.h:35
QString
QColor
QTextCharFormat
QKeyEvent
knotes_export.h
QFocusEvent
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