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 <qstring.h>
00025
#include <qevent.h>
00026
#include <qframe.h>
00027
#include <qpoint.h>
00028
#include <qcolor.h>
00029
00030
#include <kxmlguiclient.h>
00031
00032
class QLabel;
00033
00034
class KXMLGUIBuilder;
00035
00036
class KPopupMenu;
00037
class KNoteButton;
00038
class KNoteEdit;
00039
class KNoteConfig;
00040
class KToolBar;
00041
class KListAction;
00042
class KToggleAction;
00043
00044
namespace KCal {
00045
class Journal;
00046 }
00047
00048
00049
class KNote :
public QFrame,
virtual public KXMLGUIClient
00050 {
00051 Q_OBJECT
00052
public:
00053 KNote( KXMLGUIBuilder *builder,
QDomDocument buildDoc, KCal::Journal *journal,
00054
QWidget *parent=0,
const char *name=0 );
00055 ~KNote();
00056
00057
void saveData();
00058
void saveConfig() const;
00059
00060
QString noteId() const;
00061
QString name() const;
00062
QString text() const;
00063
00064
void setName( const
QString& name );
00065
void setText( const
QString& text );
00066
00067
void sync( const
QString& app );
00068
bool isNew( const
QString& app ) const;
00069
bool isModified( const
QString& app ) const;
00070
void toDesktop(
int desktop );
00071
00072 public slots:
00073
void slotKill(
bool force = false );
00074
00075 signals:
00076
void sigRequestNewNote();
00077
void sigNameChanged();
00078
void sigDataChanged();
00079
void sigColorChanged();
00080
void sigKillNote( KCal::Journal* );
00081
00082 protected:
00083 virtual
void showEvent(
QShowEvent* );
00084 virtual
void resizeEvent(
QResizeEvent* );
00085 virtual
void closeEvent(
QCloseEvent* );
00086 virtual
void keyPressEvent(
QKeyEvent* );
00087 virtual
void dropEvent(
QDropEvent* );
00088 virtual
void dragEnterEvent(
QDragEnterEvent* );
00089
00090 virtual
bool event(
QEvent* );
00091 virtual
bool eventFilter(
QObject*, QEvent* );
00092
00093 virtual
bool focusNextPrevChild(
bool );
00094
00095 private slots:
00096
void slotRename();
00097
void slotClose();
00098
void slotSend();
00099
void slotMail();
00100
void slotPrint();
00101
void slotInsDate();
00102
void slotPreferences();
00103
void slotPopupActionToDesktop(
int id );
00104
00105
void slotApplyConfig();
00106
void slotUpdateKeepAboveBelow();
00107
void slotUpdateShowInTaskbar();
00108
void slotUpdateDesktopActions();
00109
00110 private:
00111
void updateFocus();
00112
void updateLayout();
00113
void updateLabelAlignment();
00114
void setColor( const
QColor&, const QColor& );
00115
00116 private:
00117
QPoint m_pointerOffset;
00118
bool m_dragging;
00119
00120
QLabel *m_label;
00121 KNoteButton *m_button;
00122 KToolBar *m_tool;
00123 KNoteEdit *m_editor;
00124
00125 KNoteConfig *m_config;
00126 KCal::Journal *m_journal;
00127
00128 KPopupMenu *m_menu;
00129 KPopupMenu *m_edit_menu;
00130
00131 KListAction *m_toDesktop;
00132 KToggleAction *m_keepAbove;
00133 KToggleAction *m_keepBelow;
00134 };
00135
00136 #endif