00001 /********************************************************************** 00002 ** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com 00003 ** All rights reserved. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 as published by the Free Software 00007 ** Foundation and appearing in the file LICENSE.GPL included in the 00008 ** packaging of this file. 00009 ** 00010 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00011 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00012 ** 00013 **********************************************************************/ 00014 00015 #ifndef __NOTES_APPLET_H__ 00016 #define __NOTES_APPLET_H__ 00017 00018 #include <qwidget.h> 00019 #include <qvbox.h> 00020 #include <qpixmap.h> 00021 #include <qguardedptr.h> 00022 #include <qtimer.h> 00023 #include <qpe/filemanager.h> 00024 #include <qpe/ir.h> 00025 #include <qstring.h> 00026 00027 class QComboBox; 00028 class QCheckBox; 00029 class QSpinBox; 00030 class QPushButton; 00031 class QMultiLineEdit; 00032 class QListBox; 00033 class QListBoxItem; 00034 class NotesControl : public QVBox { 00035 Q_OBJECT 00036 public: 00037 NotesControl( QWidget *parent=0, const char *name=0 ); 00038 00039 QPixmap notes; 00040 QMultiLineEdit *view; 00041 QListBox *box; 00042 QPushButton *saveButton, *deleteButton, *newButton; 00043 QString FileNamePath; 00044 bool loaded, edited, doPopulate, isNew; 00045 bool showMax; 00046 void save(); 00047 void populateBox(); 00048 void load(); 00049 00050 private: 00051 QTimer menuTimer; 00052 DocLnk *doc; 00053 QString oldDocName; 00054 void focusOutEvent( QFocusEvent * ); 00055 void load(const QString&); 00056 private slots: 00057 void slotSearch(); 00058 void slotShowMax(); 00059 void slotBeamButton(); 00060 void slotBeamFinished( Ir*); 00061 void slotDeleteButton(); 00062 void slotSaveButton(); 00063 void slotDeleteButtonClicked(); 00064 void slotNewButton(); 00065 void boxPressed(int, QListBoxItem *, const QPoint&); 00066 void showMenu(); 00067 void loadDoc( const DocLnk &); 00068 void slotViewEdited(); 00069 void slotBoxSelected(const QString &); 00070 // void keyReleaseEvent( QKeyEvent *); 00071 00072 }; 00073 00074 class NotesApplet : public QWidget { 00075 Q_OBJECT 00076 public: 00077 NotesApplet( QWidget *parent = 0, const char *name=0 ); 00078 ~NotesApplet(); 00079 static int position(); 00080 NotesControl *vc; 00081 public slots: 00082 private: 00083 void mousePressEvent( QMouseEvent * ); 00084 void paintEvent( QPaintEvent* ); 00085 00086 private: 00087 QPixmap notesPixmap; 00088 private slots: 00089 00090 00091 }; 00092 00093 #endif // __NOTES_APPLET_H__ 00094
1.4.2