Libkdepim

multiplyingline.h
1 /*
2  Copyright (C) 2010 Casey Link <[email protected]>
3  Copyright (C) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <[email protected]>
4 
5  Refactored from earlier code by:
6  Copyright (c) 2010 Volker Krause <[email protected]>
7  Copyright (c) 2004 Cornelius Schumacher <[email protected]>
8 
9  This library is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or (at your
12  option) any later version.
13 
14  This library is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
17  License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to the
21  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  02110-1301, USA.
23 */
24 
25 #ifndef MULTIPLYINGLINE_H
26 #define MULTIPLYINGLINE_H
27 
28 #include "kdepim_export.h"
29 
30 #include <KCompletion>
31 #include <QWidget>
32 #include <QSharedPointer>
33 
34 namespace KPIM {
39 class KDEPIM_EXPORT MultiplyingLineData
40 {
41 public:
43  virtual ~MultiplyingLineData()
44  {
45  }
46 
50  virtual void clear() = 0;
54  virtual bool isEmpty() const = 0;
55 };
56 
64 class KDEPIM_EXPORT MultiplyingLine : public QWidget
65 {
66  Q_OBJECT
67 public:
68  explicit MultiplyingLine(QWidget *parent);
69  ~MultiplyingLine() override
70  {
71  }
72 
77  virtual void activate() = 0;
83  virtual bool isActive() const = 0;
84 
90  virtual bool isModified() const = 0;
91 
95  virtual void clearModified() = 0;
96 
101  virtual MultiplyingLineData::Ptr data() const = 0;
107  virtual void setData(const MultiplyingLineData::Ptr &data) = 0;
108 
114  virtual bool isEmpty() const = 0;
115 
116  virtual bool canDeleteLineEdit() const = 0;
117 
125  virtual int setColumnWidth(int w) = 0;
126 
140  virtual void fixTabOrder(QWidget *previous) = 0;
141 
148  virtual QWidget *tabOut() const = 0;
149 
153  virtual void clear() = 0;
154 
159  virtual void setCompletionMode(KCompletion::CompletionMode mode) = 0;
160 
167  virtual void aboutToBeDeleted();
168 
169 Q_SIGNALS:
173  void returnPressed(KPIM::MultiplyingLine *);
177  void downPressed(KPIM::MultiplyingLine *);
181  void upPressed(KPIM::MultiplyingLine *);
185  void rightPressed();
189  void deleteLine(KPIM::MultiplyingLine *);
193  void completionModeChanged(KCompletion::CompletionMode);
194 public Q_SLOTS:
195  void slotPropagateDeletion();
196 
197 protected Q_SLOTS:
198  void slotReturnPressed();
199  void slotFocusUp();
200  void slotFocusDown();
201 
202 protected:
207  void keyPressEvent(QKeyEvent *) override;
208 };
209 }
210 
211 #endif // MULTIPLYINGLINE_H
ABC representing line data.
Abstract Base Class representing a line in the Multiplying line widget.
Class KCheckComboBox::Private.
Definition: kcursorsaver.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 23:17:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.