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

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