Warning, file /multimedia/stopmotion/src/application/modelhandler.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /***************************************************************************
0002  *   Copyright (C) 2005-2014 by Linuxstopmotion contributors;              *
0003  *   see the AUTHORS file for details.                                     *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
0019  ***************************************************************************/
0020 #ifndef MODELHANDLER_H
0021 #define MODELHANDLER_H
0022 
0023 #include <QObject>
0024 
0025 class FrameBar;
0026 class QStatusBar;
0027 class QFileDialog;
0028 class QPushButton;
0029 class QStringList;
0030 class QString;
0031 
0032 /**
0033  * This class handles request related to adding, removing and moving things
0034  * in the model.
0035  *
0036  * @author Bjoern Erik Nilsen & Fredrik Berg Kjoelstad
0037  */
0038 class ModelHandler : public QObject {
0039     Q_OBJECT
0040 public:
0041     /**
0042      * Creates and initializes the ModelHander.
0043      * @param parent the parent of the ModelHander.
0044      * @param sb a statusbar for displaying status information to the user.
0045      * @param frameBar the framebar containing the thumbnails
0046      * @param lastVisitedDir the last visited directory
0047      * @param name the name of the ModelHander
0048      */
0049     ModelHandler( QObject *parent = 0, QStatusBar *sb = 0, FrameBar *frameBar = 0,
0050             QString *lastVisitedDir = 0, const char *name = 0 );
0051 
0052     /**
0053      * Cleans up after the modelhandler.
0054      */
0055     ~ModelHandler();
0056 
0057     /**
0058      * Function for setting the button used for removing frames. This button is
0059      * needed for checking if it is enabled when attempting to remove frames with
0060      * the delete key.
0061      * @param removeFramesButton the button used for removing frames.
0062      */
0063     void setRemoveFramesButton(QPushButton *removeFramesButton);
0064 
0065 
0066 public slots:
0067     /**
0068      * Brings up a dialog so that the user can choose a file to load.
0069      */
0070     void chooseFrame();
0071 
0072     /**
0073      *Adds the file fileName to the animation through the use of
0074      *addFrames(QStringList).
0075      *@param fileName the file to be added to the animation.
0076      */
0077     void addFrame( const QString &fileName );
0078 
0079     /**
0080      * Removes the currently selected frame from the animation.
0081      */
0082     void removeFrames();
0083 
0084     /**
0085      * Adds the files to the animation.
0086      * @param fileNames the files to be added to the animation
0087      */
0088     void addFrames(const QStringList & fileNames);
0089 
0090 
0091     /**
0092      * Creates a new scene. This will be added after the selected frame.
0093      */
0094     void newScene();
0095 
0096     /**
0097      * Removes the active scene.
0098      */
0099     void removeScene();
0100 
0101      /**
0102      * Launch the gimp to edit the current frame.
0103      * @return 0 If successful, 1 on error.
0104      */
0105     int editCurrentFrame();
0106 
0107 private:
0108     FrameBar *frameBar;
0109     QStatusBar *statusBar;
0110     QPushButton *removeFramesButton;
0111     QFileDialog* fileDialog;
0112     QString *lastVisitedDir;
0113 
0114 signals:
0115     /**
0116      * Notified when the model is changed.
0117      */
0118     void modelChanged();
0119 };
0120 
0121 #endif