File indexing completed on 2024-05-12 16:39:40

0001 /* This file is part of the KDE project
0002  Copyright (C) 2011 Adam Pigg <adam@piggz.co.uk>
0003 
0004  This program is free software; you can redistribute it and/or
0005  modify it under the terms of the GNU Library General Public
0006  License as published by the Free Software Foundation; either
0007  version 2 of the License, or (at your option) any later version.
0008 
0009  This program is distributed in the hope that it will be useful,
0010  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  Library General Public License for more details.
0013 
0014  You should have received a copy of the GNU Library General Public License
0015  along with this program; see the file COPYING.  If not, write to
0016  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef KEXIRECORDNAVIGATORIFACE_H
0021 #define KEXIRECORDNAVIGATORIFACE_H
0022 
0023 #include <QtGlobal>
0024 #include "kexicore_export.h"
0025 
0026 class KexiRecordNavigatorHandler;
0027 class QScrollBar;
0028 
0029 class KEXICORE_EXPORT KexiRecordNavigatorIface
0030 {
0031 public:
0032     KexiRecordNavigatorIface();
0033 
0034     virtual ~KexiRecordNavigatorIface();
0035 
0036     /*! Sets current record number for this navigator,
0037      *  i.e. a value that will be displayed in the 'record number' text box.
0038      *  This can also affect button's enabling and disabling.
0039      *  @p r is counted from 1; if it is 0 'record number' text box's content is cleared. */
0040     virtual void setCurrentRecordNumber(int r) = 0;
0041 
0042     /*! Sets record count for this navigator.
0043      *  This can also affect button's enabling and disabling.
0044      *  By default count is 0. */
0045     virtual void setRecordCount(int count) = 0;
0046 
0047     /*! Sets insertingEnabled flag. If true, "+" button will be enabled. */
0048     virtual void setInsertingEnabled(bool set) = 0;
0049 
0050     /*! Sets visibility of "inserting" button. */
0051     virtual void setInsertingButtonVisible(bool set) = 0;
0052 
0053     /*! Sets record navigator handler. This allows to react
0054      *   on actions performed within navigator and vice versa. */
0055     virtual void setRecordHandler(KexiRecordNavigatorHandler *handler) = 0;
0056 
0057     /*! Shows or hides "editing" indicator. */
0058     virtual void showEditingIndicator(bool show) = 0;
0059 
0060     /*! Sets horizontal bar's \a hbar (at the bottom) geometry so this record navigator
0061      *  is properly positioned together with horizontal scroll bar. This method is used
0062      *  in QScrollView::setHBarGeometry() implementations:
0063      *  see KexiTableView::setHBarGeometry() and KexiFormScrollView::setHBarGeometry()
0064      *  for usage examples. */
0065     virtual void setHBarGeometry(QScrollBar & hbar, int x, int y, int w, int h) = 0;
0066 
0067     /*! Sets label text at the left of the for record navigator's button.
0068      *  By default this label contains translated "Row:" text. */
0069     virtual void setLabelText(const QString& text) = 0;
0070 };
0071 
0072 #endif