~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/widget/properties/KexiPropertyPaneViewBase.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this program; see the file COPYING.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 * Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef KEXIPROPERTYEDITORVIEWBASE_H
 
21
#define KEXIPROPERTYEDITORVIEWBASE_H
 
22
 
 
23
#include "kexiextwidgets_export.h"
 
24
 
 
25
#include <QWidget>
 
26
 
 
27
class QVBoxLayout;
 
28
 
 
29
class KPropertySet;
 
30
 
 
31
class KexiObjectInfoLabel;
 
32
 
 
33
//! @short A base class for propety pane's tabs.
 
34
/*! Defines vertical layout and offers info label on the top.
 
35
 Use mainLayout() to access the QVBoxLayout object.
 
36
*/
 
37
class KEXIEXTWIDGETS_EXPORT KexiPropertyPaneViewBase : public QWidget
 
38
{
 
39
    Q_OBJECT
 
40
public:
 
41
    explicit KexiPropertyPaneViewBase(QWidget* parent = 0);
 
42
    virtual ~KexiPropertyPaneViewBase();
 
43
 
 
44
    KexiObjectInfoLabel *infoLabel() const;
 
45
 
 
46
    /*! Helper function. Updates \a infoLabel widget by reusing properties provided
 
47
     by property set \a set.
 
48
     Read documentation of KexiPropertyEditorView class for information about accepted properties.
 
49
     If \a set is 0 and \a textToDisplayForNullSet string is not empty, this string is displayed
 
50
     (without icon or any other additional part).
 
51
     If \a set is 0 and \a textToDisplayForNullSet string is empty, the \a infoLabel widget becomes
 
52
     hidden. */
 
53
    void updateInfoLabelForPropertySet(
 
54
        KPropertySet* set, const QString& textToDisplayForNullSet = QString());
 
55
protected:
 
56
    //! @return main vertical layout of the pane
 
57
    QVBoxLayout* mainLayout() const;
 
58
 
 
59
    //! @return default spacing for the pane, 2/3 of the font height
 
60
    int spacing() const;
 
61
 
 
62
    //! Adds spacing to the main layout. The size of spacing is taken from spacing().
 
63
    void addSpacing();
 
64
 
 
65
    //! Adds widget-based spacing to the main layout. The size of spacing is taken from spacing().
 
66
    QWidget* addWidgetSpacer();
 
67
 
 
68
    class Private;
 
69
    Private * const d;
 
70
};
 
71
 
 
72
#endif