korganizer

previewdialog.h
00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2003,2004 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
00008     Author: Sergio Martins, <sergio.martins@kdab.com>
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014 
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018     GNU General Public License for more details.
00019 
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00023 
00024     As a special exception, permission is given to link this program
00025     with any edition of TQt, and distribute the resulting executable,
00026     without including the source code for TQt in the source distribution.
00027 */
00028 
00029 #ifndef PREVIEWDIALOG_H
00030 #define PREVIEWDIALOG_H
00031 
00032 #include <kdialogbase.h>
00033 #include <kurl.h>
00034 
00035 class KOListView;
00036 
00037 namespace KCal {
00038   class CalendarLocal;
00039 }
00040 
00041 class PreviewDialog : public KDialogBase
00042 {
00043     Q_OBJECT
00044   TQ_OBJECT
00045   public:
00046     PreviewDialog( const KURL &url, TQWidget *parent );
00047     ~PreviewDialog();
00048     bool loadCalendar();
00049 
00050   public slots:
00051     void slotAdd();
00052     void slotMerge();
00053 
00054   signals:
00055     void dialogFinished( PreviewDialog * );
00056     void openURL( const KURL &, bool );
00057     void addResource( const KURL & );
00058 
00059   private:
00060     // Checks if mOriginalUrl is a temp file, if it is we ask the user a place to 
00061     // keep the calendar file
00062     bool isTempFile() const;
00063   private:
00064     KURL mOriginalUrl;
00065     KURL *mLocalUrl;
00066     KOListView *mListView;
00067     KCal::CalendarLocal *mCalendar;
00068 };
00069 
00070 #endif