Fix url
[kdepim.git] / korganizer / src / kowindowlist.h
blobc711432a58e30cfd7780e699635d0d40f1adc3a2
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2000,2003 Cornelius Schumacher <schumacher@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
25 #ifndef KORG_KOWINDOWLIST_H
26 #define KORG_KOWINDOWLIST_H
28 #include <QObject>
30 namespace KOrg
32 class MainWindow;
35 class QUrl;
37 /**
38 This class manages a list of KOrganizer instances, each associated with a
39 window displaying a calendar. It acts as relay for signals between this
40 windows and manages information, which requires interaction of all instances.
42 @short manages a list of all KOrganizer instances
43 @author Cornelius Schumacher
45 class KOWindowList : public QObject
47 Q_OBJECT
48 public:
49 /**
50 Constructs a new list of KOrganizer windows. There should only be one
51 instance of this class. The ActionManager class takes care of this.
53 KOWindowList();
54 virtual ~KOWindowList();
56 /**
57 Is there only one instance left?
59 bool lastInstance();
61 /**
62 Is there a instance with this URL?
64 KOrg::MainWindow *findInstance(const QUrl &url);
66 /**
67 Return default instance. This is the main window for the resource based
68 calendar.
70 KOrg::MainWindow *defaultInstance();
72 public Q_SLOTS:
73 /**
74 Register a main window.
76 void addWindow(KOrg::MainWindow *);
77 /**
78 Unregister a main window.
80 void removeWindow(KOrg::MainWindow *);
82 private:
83 QList<KOrg::MainWindow *> mWindowList; // list of all existing KOrganizer instances
85 KOrg::MainWindow *mDefaultWindow;
88 #endif