OOFILE  1.9
oofrepedit.h
Go to the documentation of this file.
1 // COPYRIGHT 1999 A.D. Software, All rights reserved
2 // oofrepedit.h
3 // report-writer layer of OOFILE database - editing classes
4 // see also oofrepeditx.h
5 
6 #ifndef H_OOFREPEDIT
7 #define H_OOFREPEDIT
8 
9 #ifndef H_OOFREPEDITOR
10  #include "oofrepeditor.h"
11 #endif
12 #ifndef H_OOFGUI
13  #include "oofgui.h" // for dbFieldLink, dbHelper
14 #endif
15 
16 
35 public:
37  virtual void singleClick(short inX, short inY, OOF_InteractionArea*, oofRepEditingEnv*)=0;
38 };
39 
40 
63 public:
65  virtual ~oofRepEditLink();
66 
68 
69  virtual oofString getCellText(bool* outIsEditable=0, oofString* outLocationName=0, long row=-1, short col=-1)=0;
70  virtual void setCellText(const oofString&, long row=-1, short col=-1)=0;
72 
74 
75  virtual void enterLink(dbGUIAdapter*);
76  virtual bool leaveLink();
77 
79 
80  virtual oofRepTextStyle* textStyle() const; // should never be NULL - cascades from outer container
81  virtual oofRepTextStyle* localTextStyle() const; // may be NULL
82  virtual bool allowsCellTextStyles() const;
84 
86 
87  virtual bool hasCustomViewDrawers() const;
88  virtual oofRepCustomViewDrawer* customViewDrawer(long col) const; // returns NULL if has none
90 
91  void getCurrentCoords(short& outCol, long& outRow) const;
92  void setCurrentCoords(short inCol, long inRow);
93 
95 
96  virtual bool atFirst() const;
97  virtual bool getLastCoords(short& outCol, long& outRow) const;
98  virtual bool getLeftOfCurrent(short& outCol, long& outRow) const;
99  virtual bool getRightOfCurrent(short& outCol, long& outRow) const;
100  virtual bool getUpFromCurrent(short& outCol, long& outRow) const;
101  virtual bool getDownFromCurrent(short& outCol, long& outRow) const;
103 
104 // GUI interfaces
105  virtual void tellGUIcareAboutLocking() const;
106 
107 protected:
109  long mCurrentRow, mLastRow;
110  short mCurrentCol, mLastCol; // use short as it's big enough and will cause compiler warnings if confuse row/col
111 };
112 
113 
130 protected: // only used by subclasses
133  virtual void FinishCreationByLinkingDataModel(oofRepEditingEnv*, oofRepEditLink*); // final after ctor and FinishCreateSelf
134 
136 
137 // optional behavioural overrides
138  virtual void UpdateMovementButtons();
139  virtual void UnableToMoveWarning(movementT, bool movingByCell);
140 
141 // optional actions to override
142  virtual void GoToAnotherCell(movementT);
143  virtual void GoToAnotherItem(movementT);
144 
145 
146 // optional behavioural overrides but Adapter should take care of things
147  virtual void LoadCellEditField();
148  virtual bool AttemptSaveCellEditField();
149 
150 
151 // Template Method - calls several of the above
152  void LoadAndUpdate();
153  void EnterLink(oofRepEditLink*);
154 
155 // dbHelper overrides
156  virtual void maybeDirty(dbFieldLink*);
157 
158 
159 // data storage
164 };
165 
166 
167 // -------------------------------------------------------
168 // o o f R e p E d i t L i n k
169 // -------------------------------------------------------
170 inline void
171 oofRepEditLink::getCurrentCoords(short& outCol, long& outRow) const
172 {
173  outCol = mCurrentCol;
174  outRow = mCurrentRow;
175 }
176 
177 
178 inline void
179 oofRepEditLink::setCurrentCoords(short inCol, long inRow)
180 {
181  mCurrentCol = inCol;
182  mCurrentRow = inRow;
183 }
184 
185 
186 #endif // H_OOFREPEDIT
187 
188 
oofRepEditLink * mCurrentLink
Definition: oofrepedit.h:162
virtual void UnableToMoveWarning(movementT, bool movingByCell)
default beep
void LoadAndUpdate()
separation of these three steps, which commonly occurs, is example of the Template Method pattern all...
Abstract parent defining how report preview reacts to interaction.
Definition: oofrepedit.h:34
virtual void LoadCellEditField()
Typical reasons to override - want to display location or a different display of the editable state (...
Abstract base for anything drawn on report.
Definition: oofrep.h:860
virtual bool AttemptSaveCellEditField()
Platform-independent GUI Integration layer of OOFILE database.
virtual void FinishCreationByLinkingDataModel(oofRepEditingEnv *, oofRepEditLink *)
Definition: oofrepedit.cpp:968
Mixin for reference counted classes which you want to auto-delete when their count falls to zero...
Definition: oof1.h:82
virtual ~oofRepInteractorStrategy()
Definition: oofrepedit.h:36
Subclass platform preview environment to intercept for editing hooks.
Definition: oofrepeditx.h:368
oofRepEditingEnv * mEnv
Definition: oofrepedit.h:161
Links a dbField to a known control type or I/O mechanism.
Definition: oofgui.h:74
Support typical actions of report editing dialogs.
Definition: oofrepedit.h:129
virtual void maybeDirty(dbFieldLink *)
virtual void GoToAnotherItem(movementT)
Separate out item movement from cell movement because you may wish to implement one but use default f...
Describe single rectangular area within preview.
Definition: oofrepeditx.h:293
void EnterLink(oofRepEditLink *)
Definition: oofrepedit.cpp:977
Abstract base for user column drawer.
Definition: oofrep.h:1239
virtual void GoToAnotherCell(movementT)
Portable highly capable string class.
Definition: oofstr.h:101
virtual void UpdateMovementButtons()
override to control disabling
Definition: oofrepedit.cpp:998
Cross-platform specification of text style.
Definition: oofrep.h:732
virtual void singleClick(short inX, short inY, OOF_InteractionArea *, oofRepEditingEnv *)=0
Abstract base Controller class managing database to GUI mapping.
Definition: oofgui.h:355
#define OOFREP_EXPORT
Prefix for report writer classes to enable optional DLL linking.
Definition: oof0.h:189