summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.h
blob: b5603e0ec643e9ed6d5061ecff134a2f00c770a9 (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
#ifndef KINCIDENCENFORMATTER_H
#define KINCIDENCENFORMATTER_H

#include <qstring.h>
#include <qobject.h>

#include "incidence.h"
#include "event.h"
#include "todo.h"
#include "journal.h"

using namespace KCal;

class KIncidenceFormatter : public QObject
{
  public:
    static KIncidenceFormatter* instance();
    KIncidenceFormatter();
    ~KIncidenceFormatter();
    QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false );
 
    void setEvent(Event *event);
    void setTodo(Todo *event );
    void setJournal(Journal*  );

  protected:
    int mColorMode;
    void addTag(const QString & tag,const QString & text);

    void formatCategories(Incidence *event);
    void formatAttendees(Incidence *event);
    void formatReadOnly(Incidence *event);

  private:
    QString deTag(QString text);
    bool mSyncMode;
    bool mDetails, mCreated ,mModified;

    QString mText;
    Incidence* mCurrentIncidence; 
    static KIncidenceFormatter* mInstance; 
};

#endif