Salome HOME
initial commit from paravisaddons
[tools/paravisaddons_common.git] / src / ExtractComponentsPlugin / plugin / pqLinkedLineEdit.h
1 // Copyright (C) 2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 /*=========================================================================
21
22    Program: ParaView
23    Module:    $RCSfile$
24
25    Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
26    All rights reserved.
27
28    ParaView is a free software; you can redistribute it and/or modify it
29    under the terms of the ParaView license version 1.2.
30
31    See License_v1.2.txt for the full ParaView license.
32    A copy of this license can be obtained by contacting
33    Kitware Inc.
34    28 Corporate Drive
35    Clifton Park, NY 12065
36    USA
37
38 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
42 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
50 ========================================================================*/
51 #ifndef pqLinkedLineEdit_h
52 #define pqLinkedLineEdit_h
53
54 #include <pqPropertyWidget.h>
55
56 class QLineEdit;
57 class vtkEventQtSlotConnect;
58
59 class pqLinkedLineEdit : public pqPropertyWidget
60 {
61   Q_OBJECT
62   typedef pqPropertyWidget Superclass;
63
64 public:
65   pqLinkedLineEdit(
66     vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject = nullptr);
67   virtual ~pqLinkedLineEdit();
68
69   void updateWidget(bool showing_advanced_properties = false);
70
71 public slots:
72   void onInputArrayModified();
73
74 signals:
75   void textChanged(const QString&);
76   void inputArrayModified();
77
78 protected:
79   QLineEdit* LineEdit;
80   QString PreviousArrayName;
81   vtkEventQtSlotConnect* Connect;
82
83 private:
84   Q_DISABLE_COPY(pqLinkedLineEdit)
85 };
86
87 #endif