class SAL_DLLPUBLIC_RTTI DbGridRow final : public SvRefBase
{
css::uno::Any m_aBookmark; // Bookmark of the row, can be set
::std::vector< std::unique_ptr<::svxform::DataColumn> >
m_aVariants;
GridRowStatus m_eStatus; bool m_bIsNew; // row is no longer valid // is removed on the next positioning public:
DbGridRow();
DbGridRow(CursorWrapper* pCur, bool bPaintCursor); void SetState(CursorWrapper* pCur, bool bPaintCursor);
// these options are or'ed and indicate, which of the single // features can be released, default is readonly which means 0 enumclass DbGridControlOptions
{
Readonly = 0x00,
Insert = 0x01,
Update = 0x02, Delete = 0x04
}; namespace o3tl
{ template<> struct typed_flags<DbGridControlOptions> : is_typed_flags<DbGridControlOptions, 0x07> {};
}
// StatusIds for Controls of the Bar // important for invalidation enumclass DbGridControlNavigationBarState
{
NONE,
Text,
Absolute,
Of,
Count,
First,
Next,
Prev,
Last, New,
Undo // related to SID_FM_RECORD_UNDO
};
class FmXGridSourcePropListener; class DisposeListenerGridBridge; class DbGridControl;
// NavigationBar class NavigationBar final : public InterimItemWindow
{ class AbsolutePos final : public RecordItemWindowBase
{ public:
AbsolutePos(std::unique_ptr<weld::Entry> xEntry, NavigationBar* pBar);
std::unique_ptr<weld::Button> m_xFirstBtn; // Button for 'go to the first record'
std::unique_ptr<weld::Button> m_xPrevBtn; // Button for 'go to the previous record'
std::unique_ptr<weld::Button> m_xNextBtn; // Button for 'go to the next record'
std::unique_ptr<weld::Button> m_xLastBtn; // Button for 'go to the last record'
std::unique_ptr<weld::Button> m_xNewBtn; // Button for 'go to a new record'
std::vector< std::unique_ptr<DbGridColumn> > m_aColumns; // Column description
VclPtr<NavigationBar> m_aBar;
DbGridRowRef m_xDataRow; // Row which can be modified // comes from the data cursor
DbGridRowRef m_xSeekRow, // Row to which the iterator can set // comes from the data cursor
m_xEmptyRow; // record set to insert
ImplSVEvent * m_nAsynAdjustEvent;
// if we modify the row for the new record, we automatically insert a "new new row". // But if somebody else inserts a new record into the data source, we have to do the same. // For that reason we have to listen to some properties of our data source.
rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_pDataSourcePropMultiplexer;
FmXGridSourcePropListener* m_pDataSourcePropListener;
rtl::Reference<RowSetEventListener> m_xRowSetListener; // get notification when rows were changed
std::map<sal_uInt16, GridFieldValueListener*> m_aFieldListeners; // property listeners for field values
std::unique_ptr<DisposeListenerGridBridge> m_pCursorDisposeListener; // need to know about the disposing of the seek cursor // construct analogous to the data source proplistener/multiplexer above : // DisposeListenerGridBridge is a bridge from FmXDisposeListener which I don't want to be derived from
FmGridListener* m_pGridListener;
protected:
std::unique_ptr<CursorWrapper> m_pDataCursor; // Cursor for Updates
std::unique_ptr<CursorWrapper> m_pSeekCursor; // Cursor for Seeking
private: // iteration variables
DbGridRowRef m_xCurrentRow;
DbGridRowRef m_xPaintRow; // Row to be displayed
sal_Int32 m_nSeekPos; // Position of the SeekCursor
sal_Int32 m_nTotalCount; // is set when the data cursor finished counting the // records. Initial value is -1
osl::Mutex m_aDestructionSafety;
osl::Mutex m_aAdjustSafety;
Idle m_aRearrangeIdle;
css::util::Date
m_aNullDate; // NullDate of the Numberformatter;
BrowserMode m_nMode;
sal_Int32 m_nCurrentPos; // Current position;
ImplSVEvent * m_nDeleteEvent; // EventId for asynchronous deletion of rows
DbGridControlOptions m_nOptions; // What is the able to do (Insert, Update, Delete) // default readonly
DbGridControlOptions m_nOptionMask; // the mask of options to be enabled in setDataSource // (with respect to the data source capabilities) // defaults to (insert | update | delete)
sal_uInt16 m_nLastColId;
sal_Int32 m_nLastRowId;
/// hide a column virtualvoid HideColumn(sal_uInt16 nId); /// show a column virtualvoid ShowColumn(sal_uInt16 nId);
/** This is called before executing a context menu for a row. rMenu contains the initial entries handledbythisbaseclass'method(whichalwayshastobecalled). Derivedclassesmayalterthemenuinanywayandhandleanyadditionalentriesin PostExecuteColumnContextMenu. Alldisabledentrieswillberemovedbeforeexecutingthemenu,sobecarefulwithseparators nearentriesyouprobablywishtodisable...
*/ virtualvoid PreExecuteRowContextMenu(weld::Menu& rMenu); /** After executing the context menu for a row this method is called.
*/ virtualvoid PostExecuteRowContextMenu(const OUString& rExecutionResult);
// own overridables /// called when the current row changed virtualvoid onRowChange(); /// called when the current column changed virtualvoid onColumnChange();
/** GetCellText returns the text at the given position @param_nRow thenumberoftherow @param_nColId theIDofthecolumn @return thetextoutofthecell
*/ virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const override;
// the data source // the options can restrict but not extend the update abilities void setDataSource(const css::uno::Reference< css::sdbc::XRowSet >& rCursor,
DbGridControlOptions nOpts = DbGridControlOptions::Insert | DbGridControlOptions::Update | DbGridControlOptions::Delete); virtualvoid Dispatch(BrowserDispatchId eId) override;
// which position does the column with the id in the View have, the handle column doesn't count
sal_uInt16 GetViewColumnPos( sal_uInt16 nId ) const { sal_uInt16 nPos = GetColumnPos(nId); return (nPos==BROWSER_INVALIDID) ? GRID_COLUMN_NOT_FOUND : nPos-1; }
// which position does the column with the id in m_aColumns have, that means the css::sdbcx::Container // returned from the GetColumns (may be different from the position returned by GetViewColumnPos // if there are hidden columns)
sal_uInt16 GetModelColumnPos( sal_uInt16 nId ) const;
// the number of columns in the model
sal_uInt16 GetViewColCount() const { return ColCount() - 1; }
sal_uInt16 GetModelColCount() const { returnstatic_cast<sal_uInt16>(m_aColumns.size()); } // reverse to GetViewColumnPos: Id of position, the first non-handle column has position 0
sal_uInt16 GetColumnIdFromViewPos( sal_uInt16 nPos ) const { return GetColumnId(nPos + 1); }
sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos ) const;
DbGridControlOptions GetOptions() const {return m_nOptions;}
NavigationBar& GetNavigationBar() {return *m_aBar;}
DbGridControlOptions SetOptions(DbGridControlOptions nOpt); // The new options are interpreted with respect to the current data source. If it is unable // to update, to insert or to restore, the according options are ignored. If the grid isn't // connected to a data source, all options except OPT_READONLY are ignored.
// adjustment of the cursors in case the data cursor has been // moved from the outside. // the flag indicates if an adjustment of the row count should be // done as well void AdjustDataSource(bool bFull = false); void Undo();
bool getDisplaySynchron() const { return m_bSynchDisplay; } void setDisplaySynchron(bool bSync); // when set to sal_False, the display is no longer in sync with the current cursor position // (means that in AdjustDataSource we are jumping to a row not belonging to CursorPosition) // when using this, you should know what you are doing, because for example entering data // in a row in the display that is not in sync with the position of the cursor can be very critical
void SetStateProvider(const Link<DbGridControlNavigationBarState,int>& rProvider) { m_aMasterStateProvider = rProvider; } // if this link is set the given provider will be asked for the state of my items. // the return values are interpreted as follows : // <0 -> not specified (use default mechanism to determine the state) // ==0 -> the item is disabled // >0 -> the item is enabled void SetSlotExecutor(const Link<DbGridControlNavigationBarState,bool>& rExecutor) { m_aMasterSlotExecutor = rExecutor; } // analogous : if this link is set, all nav-bar slots will be routed through it when executed // if the handler returns nonzero, no further handling of the slot occurs
/// returns <TRUE/> if the text of the given cell can be copied into the clipboard bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId); /// copies the text of the given cell into the clipboard void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
// helper class to grant access to selected methods from within the DbCellControl class struct GrantControlAccess final
{ friendclass DbCellControl; friendclass RowSetEventListener;
};
/// called when a controller needs to be re-initialized void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
/** Creates the accessible object of an additional control. @param_nIndex The0-basedindexofthecontrol. @return TheXAccessibleinterfaceofthespecifiedcontrol.
*/ virtual css::uno::Reference<
css::accessibility::XAccessible >
CreateAccessibleControl( sal_Int32 _nIndex ) override;
// IAccessibleTableProvider /** Creates the accessible object of a data table cell. @paramnRowTherowindexofthecell. @paramnColumnIdThecolumnIDofthecell.
@return The XAccessible interface of the specified cell. */ virtual css::uno::Reference<
css::accessibility::XAccessible >
CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override;
void implAdjustInSolarThread(bool _bRows); // calls AdjustRows or AdjustDataSource, synchron if the caller is running in the solar thread, else asynchron
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet am 2026-06-10)
¤