File: taskjugglerview.h

package info (click to toggle)
taskjuggler 2.3.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,764 kB
  • ctags: 3,700
  • sloc: cpp: 36,852; sh: 12,761; xml: 5,541; perl: 5,207; makefile: 269; python: 258; lisp: 67
file content (169 lines) | stat: -rw-r--r-- 4,235 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
 * The TaskJuggler Project Management Software
 *
 * Copyright (c) 2001, 2002, 2003, 2004, 2005 by Chris Schlaeger <cs@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * $Id: taskjugglerview.h 1287 2006-03-20 14:27:45Z cs $
 */


#ifndef _TaskJugglerView_h_
#define _TaskJugglerView_h_

#include <qwidget.h>
#include <qvaluelist.h>

#include <kparts/part.h>
#include <ktexteditor/view.h>
#include <kurl.h>

#include <taskjuggleriface.h>

class QTimer;
class QPainter;
class QListViewItem;
class QSplitter;
class QProgressBar;
class QPoint;
class KURL;
class KListView;
class KConfig;
class MainWidget;
class Project;
class CoreAttributes;
class Report;
class FileManager;
class ReportManager;

/**
 * This is the main view class for TaskJuggler.  Most of the non-menu,
 * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
 * here.
 *
 * This taskjuggler uses an HTML component as an example.
 *
 * @short Main view
 * @author Chris Schlaeger <cs@kde.org>
 */
class TaskJugglerView : public QWidget, public TaskJugglerIface
{
    Q_OBJECT
public:
    TaskJugglerView(QWidget *parent);

    virtual ~TaskJugglerView();

    QString currentURL();

    virtual void newProject(KURL fileURL = KURL());

    virtual void newInclude();

    virtual void openURL(QString url);

    virtual void openURL(KURL url);

    virtual void close();

    void print();

    void readProperties(KConfig* config);
    void saveProperties(KConfig* config);

    bool quit(bool force);

public slots:
    void schedule();
    void stop();
    void nextProblem();
    void previousProblem();
    void setFocusToTaskList();
    void setFocusToResourceList();
    void setFocusToAccountList();
    void setFocusToReportList();
    void setFocusToFileList();
    void setFocusToEditor();
    void setFocusToReport();
    void zoomIn();
    void zoomOut();
    void changeStatusBar(const QString& text);

    void showInEditor(CoreAttributes* ca);
    void showInEditor(const Report* report);
    void showInEditor(const KURL& url);
    void configureEditor();

signals:
    /**
     * Use this signal to change the content of the statusbar
     */
    void signalChangeStatusbar(const QString& text);

    /**
     * Use this signal to change the content of the caption
     */
    void signalChangeCaption(const QString& text);
    void announceRecentURL(const KURL& url);

private slots:
    void slotOnURL(const QString& url);
    void loadAfterTimerTimeout();
    void slotSetTitle(const QString& title);
    void addWarningMessage(const QString& msg, const QString& file, int line);
    void addErrorMessage(const QString& msg, const QString& file, int line);
    void focusListViews(int idx);
    void focusBigTab(QWidget* page);
    void taskListClicked(QListViewItem* lvi);
    void resourceListClicked(QListViewItem* lvi);
    void accountListClicked(QListViewItem* lvi);
    void reportListClicked(QListViewItem* lvi);
    void reportListClicked(int button, QListViewItem* lvi, const QPoint& p,
                           int col);
    void fileListClicked(QListViewItem* lvi);
    void messageListClicked(QListViewItem* lvi);
    void showProgressInfo(const QString& fn);
    void keywordHelp();
    void tutorial();

private:
    QString pickTemplateFile(const QString& extention);
    bool loadProject(const KURL& url);

    void updateTaskList();
    void updateResourceList();
    void updateAccountList();

    void closeProject();

    void setLoadingProject(bool lp);

    void addMessage(const QString& msg, const QString& file, int line,
                    bool error);

    void showEditor();
    void hideEditor();
    void showReport();

    Project* project;
    MainWidget* mw;
    QProgressBar* progressBar;
    //KListView* messageListView;
    //QSplitter* editorSplitter;
    QValueList<int> editorSplitterSizes;

    FileManager* fileManager;
    ReportManager* reportManager;

    int lastBrowserUsedWithEditor;
    int messageCounter;
    QTimer* loadDelayTimer;
    KURL urlToLoad;
    bool showReportAfterLoad;
    bool loadingProject;
};

#endif