summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.h
Unidiff
Diffstat (limited to 'korganizer/koeventviewer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 64eb4ff..3df667f 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -1,132 +1,135 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOEVENTVIEWER_H 19#ifndef KOEVENTVIEWER_H
20#define KOEVENTVIEWER_H 20#define KOEVENTVIEWER_H
21// 21//
22// Viewer widget for events. 22// Viewer widget for events.
23// 23//
24 24
25#include <qtextbrowser.h> 25#include <q3textbrowser.h>
26//Added by qt3to4:
27#include <Q3VBoxLayout>
28#include <QKeyEvent>
26 29
27#include <libkcal/event.h> 30#include <libkcal/event.h>
28#include <libkcal/journal.h> 31#include <libkcal/journal.h>
29 32
30 33
31using namespace KCal; 34using namespace KCal;
32 35
33#ifdef DESKTOP_VERSION 36#ifdef DESKTOP_VERSION
34 37
35#include <qradiobutton.h> 38#include <qradiobutton.h>
36#include <qpushbutton.h> 39#include <qpushbutton.h>
37#include <qlayout.h> 40#include <qlayout.h>
38#include <qdialog.h> 41#include <qdialog.h>
39#include <qlabel.h> 42#include <qlabel.h>
40#include <qbuttongroup.h> 43#include <q3buttongroup.h>
41#include <kglobal.h> 44#include <kglobal.h>
42 45
43class KOPrintPrefs : public QDialog 46class KOPrintPrefs : public QDialog
44{ 47{
45 public: 48 public:
46 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : 49 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) :
47 QDialog( parent, name, true ) 50 QDialog( parent, name, true )
48 { 51 {
49 setCaption( i18n("KO/Pi Printout") ); 52 setCaption( i18n("KO/Pi Printout") );
50 QVBoxLayout* lay = new QVBoxLayout( this ); 53 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
51 lay->setSpacing( 9 ); 54 lay->setSpacing( 9 );
52 lay->setMargin( 9 ); 55 lay->setMargin( 9 );
53 QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); 56 QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this );
54 lay->addWidget( lab ); 57 lay->addWidget( lab );
55 lab->setAlignment( AlignCenter ); 58 lab->setAlignment( Qt::AlignCenter );
56 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); 59 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this );
57 lay->addWidget( format ); 60 lay->addWidget( format );
58 format->setExclusive ( true ) ; 61 format->setExclusive ( true ) ;
59 pmNo = new QRadioButton(i18n("Print unscaled"), format ); 62 pmNo = new QRadioButton(i18n("Print unscaled"), format );
60 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); 63 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format );
61 new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); 64 new QRadioButton(i18n("Print scaled up/down to fit one page"), format );
62 pmScaledDown->setChecked( true ); 65 pmScaledDown->setChecked( true );
63 QPushButton * ok = new QPushButton( i18n("OK"), this ); 66 QPushButton * ok = new QPushButton( i18n("OK"), this );
64 lay->addWidget( ok ); 67 lay->addWidget( ok );
65 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 68 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
66 lay->addWidget( cancel ); 69 lay->addWidget( cancel );
67 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 70 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
68 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 71 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
69 } 72 }
70 73
71 int printMode() 74 int printMode()
72 { 75 {
73 if ( pmNo->isChecked() ) 76 if ( pmNo->isChecked() )
74 return 0; 77 return 0;
75 if ( pmScaledDown->isChecked() ) 78 if ( pmScaledDown->isChecked() )
76 return 1; 79 return 1;
77 return 2; 80 return 2;
78 } 81 }
79private: 82private:
80 QRadioButton* pmNo; 83 QRadioButton* pmNo;
81 QRadioButton* pmScaledDown; 84 QRadioButton* pmScaledDown;
82}; 85};
83 86
84#endif 87#endif
85 88
86class KOEventViewer : public QTextBrowser { 89class KOEventViewer : public Q3TextBrowser {
87 Q_OBJECT 90 Q_OBJECT
88 public: 91 public:
89 KOEventViewer(QWidget *parent=0,const char *name=0); 92 KOEventViewer(QWidget *parent=0,const char *name=0);
90 virtual ~KOEventViewer(); 93 virtual ~KOEventViewer();
91 94
92 void setSource(const QString &); 95 void setSource(const QString &);
93 void setEvent(Event *event); 96 void setEvent(Event *event);
94 void addEvent(Event *event); 97 void addEvent(Event *event);
95 void setTodo(Todo *event, bool clearV = true ); 98 void setTodo(Todo *event, bool clearV = true );
96 void setJournal(Journal *jour, bool clearV = true ); 99 void setJournal(Journal *jour, bool clearV = true );
97 100
98 void appendEvent(Event *event, int mode = 0 ); 101 void appendEvent(Event *event, int mode = 0 );
99 void appendTodo(Todo *event, int mode = 0 ); 102 void appendTodo(Todo *event, int mode = 0 );
100 void appendJournal(Journal *jour, int mode = 0 ); 103 void appendJournal(Journal *jour, int mode = 0 );
101 104
102 void clearEvents(bool now=false); 105 void clearEvents(bool now=false);
103 106
104 void addText(QString text); 107 void addText(QString text);
105 void setSyncMode( bool ); 108 void setSyncMode( bool );
106 void setColorMode( int ); 109 void setColorMode( int );
107 void mailToAttendees( bool all ); 110 void mailToAttendees( bool all );
108 void printMe(); 111 void printMe();
109 112
110 protected: 113 protected:
111 int mColorMode; 114 int mColorMode;
112 void addTag(const QString & tag,const QString & text); 115 void addTag(const QString & tag,const QString & text);
113 116
114 void formatCategories(Incidence *event); 117 void formatCategories(Incidence *event);
115 void formatAttendees(Incidence *event); 118 void formatAttendees(Incidence *event);
116 void formatReadOnly(Incidence *event); 119 void formatReadOnly(Incidence *event);
117 void keyPressEvent ( QKeyEvent * e ); 120 void keyPressEvent ( QKeyEvent * e );
118 121
119 private: 122 private:
120 QTextBrowser *mEventTextView; 123 Q3TextBrowser *mEventTextView;
121 bool mSyncMode; 124 bool mSyncMode;
122 QString deTag(QString text); 125 QString deTag(QString text);
123 126
124 QString mText; 127 QString mText;
125 QString mMailSubject; 128 QString mMailSubject;
126 Incidence* mCurrentIncidence; 129 Incidence* mCurrentIncidence;
127 signals: 130 signals:
128 void launchaddressbook(QString uid); 131 void launchaddressbook(QString uid);
129 void showIncidence(QString uid); 132 void showIncidence(QString uid);
130}; 133};
131 134
132#endif 135#endif