OpendTect-6_4  6.4
uibaseobject.h
Go to the documentation of this file.
1 #ifndef uibaseobject_h
2 #define uibaseobject_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Lammertink
9  Date: 16/05/2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 #include "namedobj.h"
17 
18 class uiBody;
19 mFDQtclass(QWidget)
20 
21 mExpClass(uiBase) uiBaseObject : public NamedObject
22 {
23 public:
24  uiBaseObject(const char* nm, uiBody* = 0);
25  virtual ~uiBaseObject();
26 
27  // implementation: uiobj.cc
28  void finalise();
29  bool finalised() const;
30  void clear();
31 
32  virtual void translateText() {}
36  inline const uiBody* body() const { return body_; }
37  inline uiBody* body() { return body_; }
38 
39  static void addCmdRecorder(const CallBack&);
40  static void removeCmdRecorder(const CallBack&);
41 
42  int /* refnr */ beginCmdRecEvent(const char* msg=0);
43  void endCmdRecEvent(int refnr,const char* msg=0);
44 
45  int /* refnr */ beginCmdRecEvent(od_uint64 id,
46  const char* msg=0);
47  void endCmdRecEvent(od_uint64 id,int refnr,
48  const char* msg=0);
49 
50  Notifier<uiBaseObject> tobeDeleted;
52 
53  virtual Notifier<uiBaseObject>& preFinalise()
54  { return finaliseStart; }
55  virtual Notifier<uiBaseObject>& postFinalise()
56  { return finaliseDone; }
57 
58 
59  virtual mQtclass(QWidget*) getWidget() { return 0; }
60  const mQtclass(QWidget*) getWidget() const;
61 
62 protected:
63 
64  void setBody( uiBody* b ) { body_ = b; }
65 
66  Notifier<uiBaseObject> finaliseStart;
68  Notifier<uiBaseObject> finaliseDone;
70 
71 private:
72  int cmdrecrefnr_;
73  uiBody* body_;
74 };
75 
76 
77 /*
78 CmdRecorder annotation to distinguish real user actions from actions
79 performed by program code. Should be used at start of each (non-const)
80 uiObject function that calls any uiBody/Qt function that may trigger a
81 signal received by the corresponding Messenger class (see i_q****.h).
82 Apart from a few notify handler functions, it will do no harm when
83 using this annotation unnecessarily.
84 */
85 
86 #define mBlockCmdRec CmdRecStopper cmdrecstopper(this);
87 
89 {
90 public:
91  CmdRecStopper(const uiBaseObject*);
92  ~CmdRecStopper();
93 
94  static void clearStopperList(const CallBacker* cmdrec);
96 
97  static bool isInStopperList(const uiBaseObject* obj);
98 };
99 
100 
101 #endif
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
#define mQtclass(cls)
Definition: commondefs.h:229
void clear(std::ios &)
Definition: uibaseobject.h:88
Definition: callback.h:254
#define mFDQtclass(cls)
Definition: commondefs.h:228
#define od_uint64
Definition: plftypes.h:37
Object with a name.
Definition: namedobj.h:35
CallBacks object-oriented (object + method).
Definition: callback.h:57

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019