X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHELLOGUI%2FHELLOGUI.h;h=8ca7e94626d4fbe20634d47c934da7713d71d6bb;hb=c12880d2db02a365bcc3a3a30e48937e0f6d2bab;hp=2559c9dfc57b5ac37d32a2e117e21d16a1b7928d;hpb=4a98a77b5230943c15a4738eb8545c8005c3a6e1;p=samples%2Fhello.git diff --git a/src/HELLOGUI/HELLOGUI.h b/src/HELLOGUI/HELLOGUI.h index 2559c9d..8ca7e94 100644 --- a/src/HELLOGUI/HELLOGUI.h +++ b/src/HELLOGUI/HELLOGUI.h @@ -1,44 +1,114 @@ -// HELLOGUI : HELLO component GUI implemetation +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// HELLOGUI : HELLO component GUI implemetation + #ifndef _HELLOGUI_H_ #define _HELLOGUI_H_ -#include "SALOMEGUI.h" -#include "QAD_Desktop.h" + +#ifdef WIN32 +# if defined HELLO_EXPORTS || defined Hello_EXPORTS +# define HELLO_EXPORT __declspec( dllexport ) +# else +# define HELLO_EXPORT __declspec( dllimport ) +# endif +#else +# define HELLO_EXPORT +#endif + +#include #include #include CORBA_CLIENT_HEADER(HELLO_Gen) +class SalomeApp_Application; - -class HELLOGUI: public SALOMEGUI +class HELLO_EXPORT HELLOGUI: public SalomeApp_Module { Q_OBJECT + //! operations + enum { + OpTestMe = 190, //!< Test me + OpHello = 901, //!< Hello + OpGoodbye = 902, //!< Goodbye + }; + public: - HELLOGUI( const QString& name = "", QObject* parent = 0 ); + HELLOGUI(); + ~HELLOGUI(); + + static HELLO_ORB::HELLO_Gen_var engine(); + + virtual void initialize( CAM_Application* app ); + virtual QString engineIOR() const; + + virtual QPixmap moduleIcon() const; + virtual QString iconName() const; + + virtual void windows( QMap& theMap ) const; + virtual void viewManagers( QStringList& theList ) const; - virtual bool OnGUIEvent (int theCommandID, QAD_Desktop* parent); + virtual LightApp_Selection* createSelection() const; + virtual LightApp_Displayer* displayer(); - virtual bool SetSettings (QAD_Desktop* parent); + virtual void contextMenuPopup( const QString& type, QMenu* menu, QString& title ); - virtual bool CustomPopup ( QAD_Desktop* parent, - QPopupMenu* popup, - const QString & theContext, - const QString & theParent, - const QString & theObject); + virtual void createPreferences(); + virtual void preferencesChanged( const QString& section, const QString& parameter ); - virtual void DefinePopup(QString & theContext, QString & theParent, QString & theObject); + virtual void storeVisualParameters( int savePoint ); + virtual void restoreVisualParameters( int savePoint ); - virtual bool ActiveStudyChanged ( QAD_Desktop* parent ); + virtual void studyActivated(); - static HELLO_ORB::HELLO_Gen_ptr InitHELLOGen(QAD_Desktop* parent); + virtual bool canCopy() const; + virtual bool canPaste() const; + virtual void copy(); + virtual void paste(); + + virtual bool isDraggable( const SUIT_DataObject* what ) const; + virtual bool isDropAccepted( const SUIT_DataObject* where ) const; + virtual void dropObjects( const DataObjectList& what, SUIT_DataObject* where, + const int row, Qt::DropAction action ); + +public slots: + virtual bool activateModule( SUIT_Study* theStudy ); + virtual bool deactivateModule( SUIT_Study* theStudy ); protected: + virtual LightApp_Operation* createOperation( const int id ) const; + +protected slots: + void testMe(); + void hello(); + void goodbye(); private: + static void init(); +private: + static HELLO_ORB::HELLO_Gen_var myEngine; }; -#endif +#endif // _HELLOGUI_H_