knotes
knote.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KNOTE_H
00022 #define KNOTE_H
00023
00024 #include <QColor>
00025 #include <QDomDocument>
00026 #include <QEvent>
00027 #include <QFrame>
00028 #include <QString>
00029
00030 #include <kconfig.h>
00031 #include <kxmlguiclient.h>
00032
00033 class QLabel;
00034 class QLayout;
00035 class QSizeGrip;
00036
00037 class KFind;
00038 class KMenu;
00039 class KNoteButton;
00040 class KNoteConfig;
00041 class KNoteEdit;
00042 class KSelectAction;
00043 class KToggleAction;
00044 class KToolBar;
00045
00046 namespace KCal {
00047 class Journal;
00048 }
00049
00050
00051 class KNote
00052 : public QFrame, virtual public KXMLGUIClient
00053 {
00054 Q_OBJECT
00055 public:
00056 KNote( QDomDocument buildDoc, KCal::Journal *journal, QWidget *parent = 0 );
00057 ~KNote();
00058
00059 void saveData();
00060 void saveConfig() const;
00061
00062 QString noteId() const;
00063 QString name() const;
00064 QString text() const;
00065
00066 void setName( const QString &name );
00067 void setText( const QString &text );
00068
00069 void find( const QString &pattern, long options );
00070
00071 bool isModified() const;
00072
00073 public slots:
00074 void slotKill( bool force = false );
00075
00076 signals:
00077 void sigRequestNewNote();
00078 void sigShowNextNote();
00079 void sigNameChanged();
00080 void sigDataChanged();
00081 void sigColorChanged();
00082 void sigKillNote( KCal::Journal * );
00083
00084 void sigFindFinished();
00085
00086 protected:
00087 virtual void contextMenuEvent( QContextMenuEvent * );
00088 virtual void showEvent( QShowEvent * );
00089 virtual void resizeEvent( QResizeEvent * );
00090 virtual void closeEvent( QCloseEvent * );
00091 virtual void dropEvent( QDropEvent * );
00092 virtual void dragEnterEvent( QDragEnterEvent * );
00093
00094 virtual bool event( QEvent * );
00095 virtual bool eventFilter( QObject *, QEvent * );
00096
00097 private slots:
00098 void slotRename();
00099 void slotUpdateReadOnly();
00100 void slotClose();
00101
00102 void slotSend();
00103 void slotMail();
00104 void slotPrint();
00105 void slotSaveAs();
00106
00107 void slotInsDate();
00108 void slotSetAlarm();
00109
00110 void slotPreferences();
00111 void slotPopupActionToDesktop( int id );
00112
00113 void slotFindNext();
00114 void slotHighlight( const QString &txt, int idx, int len );
00115
00116 void slotApplyConfig();
00117 void slotUpdateKeepAboveBelow();
00118 void slotUpdateShowInTaskbar();
00119 void slotUpdateDesktopActions();
00120
00121 private:
00122 void buildGui();
00123 void createActions();
00124 void createNoteEditor();
00125 void createNoteFooter();
00126 void createNoteHeader();
00127 void prepare();
00128
00129 void updateFocus();
00130 void updateLayout();
00131 void updateLabelAlignment();
00132
00133 void setColor( const QColor &, const QColor & );
00134
00135 void toDesktop( int desktop );
00136
00137 private:
00138 QLayout *m_noteLayout;
00139 QLabel *m_label;
00140 QSizeGrip *m_grip;
00141 KNoteButton *m_button;
00142 KToolBar *m_tool;
00143 KNoteEdit *m_editor;
00144
00145 KNoteConfig *m_config;
00146 KCal::Journal *m_journal;
00147
00148 KFind *m_find;
00149 KMenu *m_menu;
00150
00151 KToggleAction *m_readOnly;
00152
00153 #ifdef Q_WS_X11
00154 KSelectAction *m_toDesktop;
00155 #endif
00156 KToggleAction *m_keepAbove;
00157 KToggleAction *m_keepBelow;
00158
00159 KSharedConfig::Ptr m_kwinConf;
00160 };
00161
00162 #endif