umbrello API Documentation

cmdlineexportallviewsevent.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2006-2007                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 // own header
00013 #include "cmdlineexportallviewsevent.h"
00014 
00015 // qt includes
00016 #include <qstringlist.h>
00017 
00018 // kde includes
00019 #include <kapplication.h>
00020 #include <kdebug.h>
00021 
00022 // app includes
00023 #include "uml.h"
00024 #include "umlviewimageexportermodel.h"
00025 
00026 
00027 int CmdLineExportAllViewsEvent::getType() {
00028     return QEvent::User + 1;
00029 }
00030 
00031 CmdLineExportAllViewsEvent::CmdLineExportAllViewsEvent(const QString &imageType, const KURL &directory, const bool useFolders)
00032   : QCustomEvent(CmdLineExportAllViewsEvent::getType()) {
00033     m_imageType = imageType;
00034     m_directory = directory;
00035     m_useFolders = useFolders;
00036 }
00037 
00038 void CmdLineExportAllViewsEvent::exportAllViews() {
00039     QStringList errors = UMLViewImageExporterModel().exportAllViews(m_imageType, m_directory, m_useFolders);
00040     if (!errors.isEmpty()) {
00041         kError() << "Errors while exporting:" << endl;
00042         for (QStringList::Iterator it = errors.begin(); it != errors.end(); ++it) {
00043             kError() << *it << endl;
00044         }
00045     }
00046 
00047     kapp->sendEvent(UMLApp::app(), new QCloseEvent());
00048 }
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:55 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003