Back to index

salome-gui  6.5.0
QtxLogoMgr.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:      QtxLogoMgr.h
00024 // Author:    Sergey TELKOV
00025 //
00026 #ifndef QTXLOGOMGR_H
00027 #define QTXLOGOMGR_H
00028 
00029 #include "Qtx.h"
00030 
00031 #include <QObject>
00032 #include <QList>
00033 #include <QPixmap>
00034 
00035 class QMenuBar;
00036 class QMovie;
00037 
00038 #ifdef WIN32
00039 #pragma warning( disable : 4251 )
00040 #endif
00041 
00042 class QTX_EXPORT QtxLogoMgr : public QObject
00043 {
00044   Q_OBJECT
00045 
00046   class LogoBox;
00047 
00048 public:
00049   QtxLogoMgr( QMenuBar* );
00050   virtual ~QtxLogoMgr();
00051 
00052   int        count() const;
00053 
00054   void       insert( const QString&, QMovie*, const int = -1 );
00055   void       insert( const QString&, const QPixmap&, const int = -1 );
00056   void       remove( const QString& );
00057   void       clear();
00058 
00059   void       startAnimation( const QString& = QString() );
00060   void       stopAnimation( const QString& = QString() );
00061   void       pauseAnimation( const bool, const QString& = QString() );
00062 
00063   QMenuBar*  menuBar() const;
00064 
00065 private:
00066   typedef struct { QString id; QPixmap pix; QMovie* mov; } LogoInfo;
00067   typedef QList<LogoInfo>                                  LogoList;
00068 
00069 private:
00070   void       generate();
00071   int        find( const QString& ) const;
00072   LogoInfo&  insert( const QString&, const int );
00073   void       movies( const QString&, QList<QMovie*>& ) const;
00074 
00075 private:
00076   LogoBox*   myBox;         
00077   LogoList   myLogos;       
00078 };
00079 
00080 #ifdef WIN32
00081 #pragma warning( default : 4251 )
00082 #endif
00083 
00084 #endif // QTXLOGOMGR_H