knotes Library API Documentation

knote.h

00001 /*******************************************************************
00002  KNotes -- Notes for the KDE project
00003 
00004  Copyright (c) 1997-2002, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 *******************************************************************/
00020 
00021 #ifndef KNOTE_H
00022 #define KNOTE_H
00023 
00024 #include <qstring.h>
00025 #include <qframe.h>
00026 #include <qpoint.h>
00027 #include <qdir.h>
00028 #include <qcolor.h>
00029 
00030 #include <kxmlguiclient.h>
00031 
00032 class QLabel;
00033 
00034 class KXMLGUIBuilder;
00035 class KXMLGUIFactory;
00036 
00037 class KPopupMenu;
00038 class KToggleAction;
00039 class KListAction;
00040 class KNoteButton;
00041 class KNoteEdit;
00042 
00043 
00044 class KNote : public QFrame, virtual public KXMLGUIClient
00045 {
00046     Q_OBJECT
00047 public:
00048     KNote( KXMLGUIBuilder* builder, QDomDocument buildDoc, const QString& config,
00049            bool load=false, QWidget* parent=0, const char* name=0 );
00050     ~KNote();
00051 
00052     void saveData() const;
00053     void saveConfig() const;
00054     void saveDisplayConfig() const;
00055 
00056     int noteId() const;
00057     QString name() const;
00058     QString text() const;
00059 
00060     void setName( const QString& name );
00061     void setText( const QString& text );
00062 
00063     void sync( const QString& app );
00064     bool isNew( const QString& app ) const;
00065     bool isModified( const QString& app ) const;
00066 
00067 public slots:
00068     void slotNewNote();
00069     void slotRename();
00070     void slotClose();
00071     void slotKill();
00072     void slotMail() /*const*/;
00073     void slotPrint() const;
00074     void slotInsDate();
00075     void slotPreferences();
00076 
00077     void slotToggleAlwaysOnTop();
00078     void slotToDesktop( int id );
00079     void slotUpdateDesktopActions();
00080 
00081 signals:
00082     void sigKilled( const QString& );
00083     void sigRenamed( const QString&, const QString& );
00084     void sigNewNote();
00085     void sigConfigChanged();
00086 
00087 protected:
00088     virtual void resizeEvent( QResizeEvent* );
00089     virtual void closeEvent( QCloseEvent* );
00090     virtual void keyPressEvent( QKeyEvent* );
00091 
00092     virtual bool event( QEvent* );
00093     virtual bool eventFilter( QObject*, QEvent* );
00094 
00095 private slots:
00096     void slotApplyConfig();
00097 
00098 private:
00099     void convertOldConfig();
00100     void updateFocus();
00101     void updateLayout();
00102     void setColor( const QColor&, const QColor& );
00103 
00104     QDir    m_noteDir;
00105     QString m_configFile;
00106     QPoint  m_pointerOffset;
00107     bool    m_dragging;
00108 
00109     QLabel      *m_label;
00110     KNoteButton *m_button;
00111     KNoteEdit   *m_editor;
00112 
00113     KToggleAction *m_alwaysOnTop;
00114     KListAction   *m_toDesktop;
00115 
00116     KPopupMenu *m_menu;
00117     KPopupMenu *m_edit_menu;
00118     
00119     KXMLGUIFactory *factory;
00120 };
00121 
00122 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:19 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001