summaryrefslogtreecommitdiff
path: root/core/pim/today/today.h
blob: 54f31cca171fe609ea8b4d518e56dfb8f8135de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * today.h
 *
 * ---------------------
 *
 * begin       : Sun 10 17:20:00 CEST 2002
 * copyright   : (c) 2002 by Maximilian Reiß
 * email       : max.reiss@gmx.de
 *
 */
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef TODAY_H
#define TODAY_H

#include <qpe/datebookdb.h>
#include <qpe/event.h>

#include <opie/tododb.h>
#include <opie/oclickablelabel.h>

#include <qdatetime.h>
#include <qlist.h>

#include "todayconfig.h"
#include "todaybase.h"

class QVBoxLayout;

class Today : public TodayBase {
    Q_OBJECT

  public:
    Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~Today();

  private slots:
    void startConfig();
    void startTodo();
    void startDatebook();
    void startMail();
    void editCard();
    void draw();
    void editEvent(const Event &e);
 private:
    void init();
    void getDates();
    void getTodo();
    void getMail();
    void autoStart();
    bool checkIfModified();
    void setOwnerField();
    void setOwnerField(QString &string);
  private slots:
    void channelReceived(const QCString &msg, const QByteArray & data);

 private:
    DateBookDB *db;
    ToDoDB *todo;
    todayconfig *conf;
    QWidget* AllDateBookEvents;
    //Config cfg;
    int MAX_LINES_TASK;
    int MAX_CHAR_CLIP;
    int MAX_LINES_MEET;
    int SHOW_LOCATION;
    int SHOW_NOTES;
};

class DateBookEvent: public OClickableLabel {
  Q_OBJECT
public:
  DateBookEvent(const EffectiveEvent &ev,
                QWidget* parent = 0,
                int SHOW_LOCATION = 0,
                int SHOW_NOTES = 0,
                const char* name = 0,
                WFlags fl = 0);
signals:
    void editEvent(const Event &e);
private slots:
    void editMe();
private:
    QString ampmTime(QTime);
    const EffectiveEvent event;
    bool ampm;
};

class DateBookEventLater: public OClickableLabel {
  Q_OBJECT
public:
    DateBookEventLater(const EffectiveEvent &ev,
		       QWidget* parent = 0,
		       int SHOW_LOCATION = 0,
		       int SHOW_NOTES = 0,
		       const char* name = 0,
		       WFlags fl = 0);
signals:
    void editEvent(const Event &e);
private slots:
    void editMe();
private:
    QString ampmTime(QTime);
    const EffectiveEvent event;
    bool ampm;
};

#endif // TODAY_H