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 <kconfig.h>
00031 #include <kxmlguiclient.h>
00032 
00033 class QLabel;
00034 
00035 class KXMLGUIBuilder;
00036 
00037 class KPopupMenu;
00038 class KNoteButton;
00039 class KNoteEdit;
00040 class KNoteConfig;
00041 class KToolBar;
00042 class KListAction;
00043 class KToggleAction;
00044 
00045 namespace KCal {
00046     class Journal;
00047 }
00048 
00049 
00050 class KNote : public QFrame, virtual public KXMLGUIClient
00051 {
00052     Q_OBJECT
00053 public:
00054     KNote( QDomDocument buildDoc, KCal::Journal *journal, QWidget *parent = 0,
00055            const char *name = 0 );
00056     ~KNote();
00057 
00058     void saveData();
00059     void saveConfig() const;
00060 
00061     QString noteId() const;
00062     QString name() const;
00063     QString text() const;
00064 
00065     void setName( const QString& name );
00066     void setText( const QString& text );
00067 
00068     bool isModified() const;
00069 
00070     void sync( const QString& app );
00071     bool isNew( const QString& app ) const;
00072     bool isModified( const QString& app ) const;
00073 
00074 public slots:
00075     void slotKill( bool force = false );
00076 
00077 signals:
00078     void sigRequestNewNote();
00079     void sigShowNextNote();
00080     void sigNameChanged();
00081     void sigDataChanged();
00082     void sigColorChanged();
00083     void sigKillNote( KCal::Journal* );
00084 
00085 protected:
00086     virtual void showEvent( QShowEvent* );
00087     virtual void resizeEvent( QResizeEvent* );
00088     virtual void closeEvent( QCloseEvent* );
00089     virtual void dropEvent( QDropEvent* );
00090     virtual void dragEnterEvent( QDragEnterEvent* );
00091 
00092     virtual bool event( QEvent* );
00093     virtual bool eventFilter( QObject*, QEvent* );
00094 
00095     virtual bool focusNextPrevChild( bool );
00096 
00097 private slots:
00098     void slotRename();
00099     void slotClose();
00100     void slotSend();
00101     void slotMail();
00102     void slotPrint();
00103     void slotSaveAs();
00104     void slotInsDate();
00105     void slotPreferences();
00106     void slotPopupActionToDesktop( int id );
00107 
00108     void slotApplyConfig();
00109     void slotUpdateKeepAboveBelow();
00110     void slotUpdateShowInTaskbar();
00111     void slotUpdateDesktopActions();
00112 
00113 private:
00114     void updateFocus();
00115     void updateLayout();
00116     void updateLabelAlignment();
00117     void setColor( const QColor&, const QColor& );
00118 
00119     void toDesktop( int desktop );
00120 
00121     QString toPlainText( const QString& );
00122 
00123 private:
00124     QLabel        *m_label;
00125     KNoteButton   *m_button;
00126     KToolBar      *m_tool;
00127     KNoteEdit     *m_editor;
00128 
00129     KNoteConfig   *m_config;
00130     KCal::Journal *m_journal;
00131 
00132     KPopupMenu    *m_menu;
00133     KPopupMenu    *m_edit_menu;
00134 
00135     KListAction   *m_toDesktop;
00136     KToggleAction *m_keepAbove;
00137     KToggleAction *m_keepBelow;
00138 
00139     KSharedConfig::Ptr m_kwinConf;
00140 };
00141 
00142 #endif
KDE Logo
This file is part of the documentation for knotes Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 2 09:53:33 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003