1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : InquireServersQThread.h
6 // Author : Vasily RUSYAEV
12 #include <qguardedptr.h>
15 #include <SALOME_WNT.hxx>
17 #define SALOME_WNT_EXPORT
22 Contains QCustomEvents for posting to InquireServersQThread
24 class SALOME_WNT_EXPORT InquireEvent : public QCustomEvent
28 enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
30 InquireEvent( QEvent::Type type , void* data = 0 )
31 : QCustomEvent( type, data ) {}
34 type() == (QEvent::Type)ProgressEvent ?
35 delete ( int* )data() : delete ( QString* )data();
39 class InquireServersGUI;
41 class SALOME_WNT_EXPORT InquireServersQThread : public QThread
44 InquireServersQThread( InquireServersGUI* r );
45 virtual ~InquireServersQThread();
47 //the main loop of this thread
51 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
52 int getExitStatus() { return myExitStatus;}
53 //return count of inquired servers
54 int getInquiredServers() { return myServersCount; }
60 bool AskServer(int iteration, QString ** message);
61 bool pingServer(int iteration, QString& errMessage);
65 QGuardedPtr<InquireServersGUI> receiver;
68 //this variable is true if we are checking servers
70 //count of inquired servers
72 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
74 //define delay time between two attempts in microseconds
76 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
77 QString myMessages[8];
78 //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
86 class SALOME_WNT_EXPORT InquireServersGUI : public QVBox
94 //returns arguments of QApplication
95 //they are needed for CORBA servers initialization
96 void getArgs( int& _argc, char *** _argv);
97 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
100 // bool withGUI() { return myGUI; }
101 // void withGUI(bool gui) { myGUI = gui; }
103 void setPixmap( QPixmap );
106 virtual void customEvent( QCustomEvent* );
109 InquireServersQThread* myThread;
110 QProgressBar* myPrgBar;
111 //this string contains description of currently asked server
114 QFrame* mySplashFrame;
119 void ClickOnCancel();