OpendTect-6_4  6.4
uiioobjselwritetransl.h
Go to the documentation of this file.
1 #ifndef uiioobjselwritetransl_h
2 #define uiioobjselwritetransl_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: April 2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiiomod.h"
16 #include "uigroup.h"
17 #include "factory.h"
18 #include "transl.h"
19 
20 class IOObj;
21 class CtxtIOObj;
22 class IOObjContext;
23 class uiLabel;
24 class uiComboBox;
25 
26 
30 {
31 public:
32 
34 
36  factory, transl_.getDisplayName() )
37 
38  static bool isPresent( const Translator& t )
39  { return factory().hasName(t.getDisplayName()); }
40 
42  { return factory().create(t.getDisplayName(),p); }
43 
44  virtual void use(const IOPar&) = 0;
45  virtual bool fill(IOPar&) const = 0;
46  virtual const char* errMsg() const { return errmsg_; }
47 
48  const Translator& translator() const { return transl_; }
49 
51  virtual const char* suggestedName() const { return ""; }
52 
53 protected:
54 
57 
58 public:
59 
61  { suggestedNameAvailble.trigger(); }
62 
63 };
64 
65 
67 
68 #define mDecluiIOObjTranslatorWriteOptsStdFns(clssnm) \
69  virtual void use(const IOPar&); \
70  virtual bool fill(IOPar&) const; \
71  \
72  static uiIOObjTranslatorWriteOpts* create( uiParent* p ) \
73  { return new clssnm(p); } \
74  static void initClass()
75 
76 
77 
80 mExpClass(uiIo) uiIOObjSelWriteTranslator : public uiGroup
82 public:
84  bool withopts=false);
86 
87  bool isEmpty() const;
88  void setTranslator(const Translator*);
89  const Translator* selectedTranslator() const;
90 
91  IOObj* mkEntry(const char*) const;
92  void updatePars(IOObj&) const;
93  bool hasWriteOpts() const { return !optflds_.isEmpty(); }
94  bool hasSameWriteOpts(const uiIOObjSelWriteTranslator&);
95 
96  void use(const IOObj&);
97  void resetPars();
98 
99  bool hasSelectedTranslator(const IOObj&) const;
100 
102  virtual const char* suggestedName() const;
103 
104 protected:
105 
109 
112 
113  void mkSelFld(const CtxtIOObj&,bool);
114  int translIdx() const;
115  void selChg(CallBacker*);
117  { suggestedNameAvailble.trigger(); }
118  uiIOObjTranslatorWriteOpts* getCurOptFld() const;
119 
120 };
121 
122 
123 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
bool hasWriteOpts() const
Definition: uiioobjselwritetransl.h:93
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: ioobj.h:58
const Translator & translator() const
Definition: uiioobjselwritetransl.h:48
BufferString errmsg_
Definition: uiioobjselwritetransl.h:56
mDefineFactory1ParamInClasswKW(uiIOObjTranslatorWriteOpts, uiParent *, factory, transl_.getDisplayName()) static bool isPresent(const Translator &t)
Definition: uiioobjselwritetransl.h:35
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiComboBox * selfld_
Definition: uiioobjselwritetransl.h:110
bool isPresent(const char *) const
Combo box.
Definition: uicombobox.h:32
Definition: uiparent.h:26
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:142
uiLabel * lbl_
Definition: uiioobjselwritetransl.h:111
const Translator & transl_
Definition: uiioobjselwritetransl.h:55
virtual const char * suggestedName() const
Definition: uiioobjselwritetransl.h:51
Group for editing output translator options.
Definition: uiioobjselwritetransl.h:29
Notifier< uiIOObjSelWriteTranslator > suggestedNameAvailble
Definition: uiioobjselwritetransl.h:101
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
void suggestedNameChanged(CallBacker *)
Definition: uiioobjselwritetransl.h:60
ObjectSet< const Translator > trs_
Definition: uiioobjselwritetransl.h:107
ObjectSet< uiIOObjTranslatorWriteOpts > optflds_
Definition: uiioobjselwritetransl.h:108
void trigger(T &t)
Definition: callback.h:258
IOObjContext & ctxt_
Definition: uiioobjselwritetransl.h:106
I/O Interpreter class for a certain object type.
Definition: transl.h:123
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
void nmAvCB(CallBacker *)
Definition: uiioobjselwritetransl.h:116
Definition: uilabel.h:24
BufferString errmsg_
Definition: horizontracker.h:119
Group for selecting output translator.
Definition: uiioobjselwritetransl.h:80
virtual const char * errMsg() const
Definition: uiioobjselwritetransl.h:46
bool isEmpty(const NLAModel *mdl)
Notifier< uiIOObjTranslatorWriteOpts > suggestedNameAvailble
Definition: uiioobjselwritetransl.h:50
const char * getDisplayName() const
"username [group]"
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62
static uiIOObjTranslatorWriteOpts * create(uiParent *p, const Translator &t)
Definition: uiioobjselwritetransl.h:41

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