knote.h
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
00088 virtual bool event( QEvent* );
00089 virtual bool eventFilter( QObject*, QEvent* );
00090
00091 virtual bool focusNextPrevChild( bool );
00092
00093 private slots:
00094 void slotRename();
00095 void slotClose();
00096 void slotMail();
00097 void slotPrint();
00098 void slotInsDate();
00099 void slotPreferences();
00100 void slotPopupActionToDesktop( int id );
00101
00102 void slotApplyConfig();
00103 void slotUpdateKeepAboveBelow();
00104 void slotUpdateShowInTaskbar();
00105 void slotUpdateDesktopActions();
00106
00107 private:
00108 void updateFocus();
00109 void updateLayout();
00110 void updateLabelAlignment();
00111 void setColor( const QColor&, const QColor& );
00112
00113 private:
00114 QPoint m_pointerOffset;
00115 bool m_dragging;
00116
00117 QLabel *m_label;
00118 KNoteButton *m_button;
00119 KToolBar *m_tool;
00120 KNoteEdit *m_editor;
00121
00122 KNoteConfig *m_config;
00123 KCal::Journal *m_journal;
00124
00125 KPopupMenu *m_menu;
00126 KPopupMenu *m_edit_menu;
00127
00128 KListAction *m_toDesktop;
00129 KToggleAction *m_keepAbove;
00130 KToggleAction *m_keepBelow;
00131 };
00132
00133 #endif
This file is part of the documentation for knotes Library Version 3.2.2.