summaryrefslogtreecommitdiff
path: root/noncore/applets/notesapplet
Unidiff
Diffstat (limited to 'noncore/applets/notesapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp10
-rw-r--r--noncore/applets/notesapplet/notes.h1
-rw-r--r--noncore/applets/notesapplet/notesapplet.pro8
-rw-r--r--noncore/applets/notesapplet/notesappletimpl.cpp53
-rw-r--r--noncore/applets/notesapplet/notesappletimpl.h35
5 files changed, 13 insertions, 94 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 7b8bdd9..1142028 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -10,24 +10,25 @@
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "notes.h" 16#include "notes.h"
17 17
18#include <qapplication.h> 18#include <qapplication.h>
19#include <stdlib.h> 19#include <stdlib.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21 21
22#include <opie2/otaskbarapplet.h>
22#include <qpe/filemanager.h> 23#include <qpe/filemanager.h>
23#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
24#include <qpe/timestring.h> 25#include <qpe/timestring.h>
25#include <qpe/applnk.h> 26#include <qpe/applnk.h>
26#include <qpe/ir.h> 27#include <qpe/ir.h>
27#include <qpe/config.h> 28#include <qpe/config.h>
28 29
29// #include <qsocket.h> 30// #include <qsocket.h>
30// #include <qclipboard.h> 31// #include <qclipboard.h>
31#include <qmultilineedit.h> 32#include <qmultilineedit.h>
32#include <qlistbox.h> 33#include <qlistbox.h>
33#include <qpopupmenu.h> 34#include <qpopupmenu.h>
@@ -457,24 +458,29 @@ void NotesControl::slotSearch() {
457 458
458NotesApplet::NotesApplet( QWidget *parent, const char *name ) 459NotesApplet::NotesApplet( QWidget *parent, const char *name )
459 : QWidget( parent, name ) { 460 : QWidget( parent, name ) {
460 setFixedHeight( 18 ); 461 setFixedHeight( 18 );
461 setFixedWidth( 14 ); 462 setFixedWidth( 14 );
462 vc = new NotesControl; 463 vc = new NotesControl;
463} 464}
464 465
465NotesApplet::~NotesApplet() { 466NotesApplet::~NotesApplet() {
466 delete vc; 467 delete vc;
467} 468}
468 469
470int NotesApplet::position()
471{
472 return 6;
473}
474
469void NotesApplet::mousePressEvent( QMouseEvent *) { 475void NotesApplet::mousePressEvent( QMouseEvent *) {
470 if( !vc->isHidden()) { 476 if( !vc->isHidden()) {
471 vc->doPopulate=false; 477 vc->doPopulate=false;
472 vc->save(); 478 vc->save();
473 vc->close(); 479 vc->close();
474 } else { 480 } else {
475// vc = new NotesControl; 481// vc = new NotesControl;
476// QPoint curPos = mapToGlobal( rect().topLeft() ); 482// QPoint curPos = mapToGlobal( rect().topLeft() );
477 if(vc->showMax) { 483 if(vc->showMax) {
478 qDebug("show max"); 484 qDebug("show max");
479 vc->showMaximized(); 485 vc->showMaximized();
480 } else { 486 } else {
@@ -493,12 +499,16 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
493 499
494 vc->load(); 500 vc->load();
495// this->setFocus(); 501// this->setFocus();
496 vc->view->setFocus(); 502 vc->view->setFocus();
497 } 503 }
498} 504}
499 505
500void NotesApplet::paintEvent( QPaintEvent* ) { 506void NotesApplet::paintEvent( QPaintEvent* ) {
501 QPainter p(this); 507 QPainter p(this);
502 p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); 508 p.drawPixmap( 0, 1, ( const char** ) notes_xpm );
503} 509}
504 510
511Q_EXPORT_INTERFACE()
512{
513 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NotesApplet> );
514}
diff --git a/noncore/applets/notesapplet/notes.h b/noncore/applets/notesapplet/notes.h
index 08253cb..ed1f98c 100644
--- a/noncore/applets/notesapplet/notes.h
+++ b/noncore/applets/notesapplet/notes.h
@@ -67,24 +67,25 @@ private slots:
67 void loadDoc( const DocLnk &); 67 void loadDoc( const DocLnk &);
68 void slotViewEdited(); 68 void slotViewEdited();
69 void slotBoxSelected(const QString &); 69 void slotBoxSelected(const QString &);
70// void keyReleaseEvent( QKeyEvent *); 70// void keyReleaseEvent( QKeyEvent *);
71 71
72}; 72};
73 73
74class NotesApplet : public QWidget { 74class NotesApplet : public QWidget {
75 Q_OBJECT 75 Q_OBJECT
76public: 76public:
77 NotesApplet( QWidget *parent = 0, const char *name=0 ); 77 NotesApplet( QWidget *parent = 0, const char *name=0 );
78 ~NotesApplet(); 78 ~NotesApplet();
79 static int position();
79 NotesControl *vc; 80 NotesControl *vc;
80public slots: 81public slots:
81private: 82private:
82 void mousePressEvent( QMouseEvent * ); 83 void mousePressEvent( QMouseEvent * );
83 void paintEvent( QPaintEvent* ); 84 void paintEvent( QPaintEvent* );
84 85
85private: 86private:
86 QPixmap notesPixmap; 87 QPixmap notesPixmap;
87private slots: 88private slots:
88 89
89 90
90}; 91};
diff --git a/noncore/applets/notesapplet/notesapplet.pro b/noncore/applets/notesapplet/notesapplet.pro
index 3075948..38ba184 100644
--- a/noncore/applets/notesapplet/notesapplet.pro
+++ b/noncore/applets/notesapplet/notesapplet.pro
@@ -1,16 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = notes.h notesappletimpl.h 3HEADERS = notes.h
4SOURCES = notes.cpp notesappletimpl.cpp 4SOURCES = notes.cpp
5TARGET = notesapplet 5TARGET = notesapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10VERSION = 1.0.0 10VERSION = 1.0.0
11MOC_DIR=opieobj
12OBJECTS_DIR=opieobj
13
14
15 11
16include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/notesapplet/notesappletimpl.cpp b/noncore/applets/notesapplet/notesappletimpl.cpp
deleted file mode 100644
index 8a9da7f..0000000
--- a/noncore/applets/notesapplet/notesappletimpl.cpp
+++ b/dev/null
@@ -1,53 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3**
4**
5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file.
9**
10**
11**********************************************************************/
12#include "notes.h"
13#include "notesappletimpl.h"
14
15
16NotesAppletImpl::NotesAppletImpl()
17 : notes(0){
18}
19
20NotesAppletImpl::~NotesAppletImpl() {
21 // not needed though cause we should have a valid parent
22 delete notes;
23}
24
25QWidget *NotesAppletImpl::applet( QWidget *parent ) {
26 if ( !notes )
27 notes = new NotesApplet( parent );
28 return notes;
29}
30
31int NotesAppletImpl::position() const {
32 return 6;
33}
34
35QRESULT NotesAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
36 *iface = 0;
37 if ( uuid == IID_QUnknown )
38 *iface = this;
39 else if ( uuid == IID_TaskbarApplet )
40 *iface = this;
41 else
42 return QS_FALSE;
43
44 if ( *iface )
45 (*iface)->addRef();
46 return QS_OK;
47}
48
49Q_EXPORT_INTERFACE() {
50 Q_CREATE_INSTANCE( NotesAppletImpl )
51}
52
53
diff --git a/noncore/applets/notesapplet/notesappletimpl.h b/noncore/applets/notesapplet/notesappletimpl.h
deleted file mode 100644
index a87118c..0000000
--- a/noncore/applets/notesapplet/notesappletimpl.h
+++ b/dev/null
@@ -1,35 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3**
4**
5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file.
9**
10**
11**********************************************************************/
12#ifndef NOTESAPPLETIMPL_H
13#define NOTESAPPLETIMPL_H
14
15#include <qpe/taskbarappletinterface.h>
16
17class NotesApplet;
18
19class NotesAppletImpl : public TaskbarAppletInterface
20{
21public:
22 NotesAppletImpl();
23 virtual ~NotesAppletImpl();
24
25 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
26 Q_REFCOUNT
27
28 virtual QWidget *applet( QWidget *parent );
29 virtual int position() const;
30
31private:
32 NotesApplet *notes;
33};
34
35#endif