knotes Library API Documentation

knote.h

00001 /*******************************************************************
00002  KNotes -- Notes for the KDE project
00003 
00004  Copyright (c) 1997-2004, The KNotes Developers
00005 
00006  This program is free software; you can redistribute it and/or
00007  modify it under the terms of the GNU General Public License
00008  as published by the Free Software Foundation; either version 2
00009  of the License, or (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with this program; if not, write to the Free Software
00018  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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
KDE Logo
This file is part of the documentation for knotes Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:55 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003