Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

framebar.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Bjoern Erik Nilsen & Fredrik Berg Kjoelstad     *
00003  *   bjoern_erik_nilsen@hotmail.com & fredrikbk@hotmail.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef FRAMEBAR_H
00021 #define FRAMEBAR_H
00022 
00023 #include "src/config.h"
00024 #include "src/presentation/observer.h"
00025 #include "src/domain/animation/animationmodel.h"
00026 #include "src/domain/animation/frame.h"
00027 #include "thumbview.h"
00028 #include "framepreferencesmenu.h"
00029 
00030 #include <vector>
00031 #include <qscrollview.h>
00032 #include <qhbox.h>
00033 
00034 class ThumbView;
00035 
00041 class FrameBar : public QScrollView, public Observer
00042 {
00043         Q_OBJECT
00044 public:
00049         FrameBar(QWidget *parent = 0);
00050         
00054         ~FrameBar();
00055         
00059         void updateAdd(const vector<char*>& frames, unsigned int index, Frontend *frontend);
00060         
00066         void updateRemove(unsigned int fromFrame, unsigned int toFrame);
00067         
00071         void updateMove(unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition);
00072         
00076         void updateNewActiveFrame(int frameNumber);
00077         
00081         void updateClear();
00082         
00087         void updatePlayFrame(int frameNumber);
00088         
00094         void updateNewScene(int index);
00095         
00101         void updateRemoveScene(int sceneNumber);
00102         
00109         void updateMoveScene(int sceneNumber, int movePosition);
00110         
00120         void updateNewActiveScene(int sceneNumber, vector<char*> framePaths,
00121                         Frontend *frontend);
00122         
00127         void updateAnimationChanged(int frameNumber);
00128         
00134         void setSelecting(bool selecting);
00135         
00140         bool isSelecting();
00141         
00147         void setSelection(int selectionFrame);
00148         
00153         int getSelectionFrame();
00154         
00159         void setPreferencesMenu(FramePreferencesMenu *preferencesMenu);
00160         
00164         void showPreferencesMenu();
00165         
00171         int getMovingScene();
00172         
00178         void setMovingScene(int movingScene);
00179         
00187         void setOpeningScene(bool openingScene);
00188         
00193         bool isOpeningScene();
00194 protected:
00195         
00200         void contentsDragEnterEvent(QDragEnterEvent * event);
00201         
00206         void contentsDropEvent(QDropEvent * event);
00207         
00213         void resizeEvent (QResizeEvent *event);
00214         
00215 public slots:
00219         void frameSoundsChanged();
00220         
00221 signals:
00222         //The signals in the framebar is used for signaling small widget,
00223         //who are deemed to unsignificant to be observers, of changes in
00224         //the framebar/model. A bit hacky and should be in it's own widget.
00225         void newActiveFrame( const QString & );
00226         void newActiveFrame( int value );
00227         void modelSizeChanged( int modelSize );
00228         
00229 private:
00231         int FRAMEBAR_HEIGHT;
00232         
00234         vector<ThumbView*>thumbViews;
00235         
00237         int activeFrame;
00238         
00240         int activeScene;
00241         
00243         int movingScene;
00244         
00247         int selectionFrame;
00248         
00250         bool selecting;
00251         
00252         bool openingScene;
00253         
00255         FramePreferencesMenu *preferencesMenu;
00256         
00263         void addFrame(Frame* frame, unsigned int index);
00264          
00272         void addFrames(const vector<char*>& frames, unsigned int index, 
00273                         Frontend *frontend);
00274         
00280         void removeFrames(unsigned int fromFrame, unsigned int toFrame);
00281         
00288         void moveFrames(unsigned int fromFrame, unsigned int toFrame, 
00289                         unsigned int movePosition);
00290         
00295         void setActiveFrame(int frameNumber);
00296         
00301         void newScene(int index);
00302         
00307         void removeScene(int sceneNumber);
00308         
00314         void moveScene(int sceneNumber, int movePosition);
00315         
00323         void setActiveScene(int sceneNumber, vector<char*> framePaths,
00324                         Frontend *frontend);
00325         
00331         void moveThumbView(unsigned int fromPosition, unsigned int toPosition);
00332 };
00333 
00334 #endif

Generated on Thu May 19 01:51:20 2005 for stopmotion.kdevelop by  doxygen 1.4.2